Skip to content

Commit

Permalink
New: getNomUrl can point to different page for tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 29, 2014
1 parent 1669700 commit 3243958
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions htdocs/projet/class/task.class.php
Expand Up @@ -143,7 +143,7 @@ function create($user, $notrigger=0)
}

// Update extrafield
if (! $error)
if (! $error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
Expand Down Expand Up @@ -480,15 +480,16 @@ function hasChildren()
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $option Sur quoi pointe le lien
* @param int $mode Mode 'task', 'time', 'contact', 'note', document' define page to link to.
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='')
function getNomUrl($withpicto=0,$option='',$mode='task')
{
global $langs;

$result='';

$lien = '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$this->id.($option=='withproject'?'&withproject=1':'').'">';
$lien = '<a href="'.DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option=='withproject'?'&withproject=1':'').'">';
$lienfin='</a>';

$picto='projecttask';
Expand Down Expand Up @@ -746,7 +747,7 @@ function addTimeSpent($user, $notrigger=0)
// Clean parameters
if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note);
if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date;

$this->db->begin();

$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time (";
Expand Down Expand Up @@ -832,9 +833,9 @@ function getSummaryOfTimeSpent($id='')
global $langs;

if (empty($id)) $id=$this->id;

$result=array();

$sql = "SELECT";
$sql.= " MIN(t.task_datehour) as min_date,";
$sql.= " MAX(t.task_datehour) as max_date,";
Expand Down Expand Up @@ -925,7 +926,7 @@ function updateTimeSpent($user, $notrigger=0)
// Clean parameters
if (empty($this->timespent_datehour)) $this->timespent_datehour = $this->timespent_date;
if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note);

$this->db->begin();

$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET";
Expand Down

0 comments on commit 3243958

Please sign in to comment.