diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php index fa9fd76f2f2..5ca2067b373 100644 --- a/htdocs/projet/project.class.php +++ b/htdocs/projet/project.class.php @@ -326,7 +326,7 @@ class Project extends CommonObject * \brief Supprime le projet dans la base * \param Utilisateur */ - function delete($user, $notrigger=0) + function delete($user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet"; $sql.= " WHERE rowid=".$this->id; diff --git a/htdocs/projet/tasks/task.class.php b/htdocs/projet/tasks/task.class.php index 92c203bab60..ed8bbb10f3c 100644 --- a/htdocs/projet/tasks/task.class.php +++ b/htdocs/projet/tasks/task.class.php @@ -586,7 +586,7 @@ class Task extends CommonObject * \param time Time spent * \param date date */ - function addTimeSpent($user, $time, $date) + function addTimeSpent($user, $time, $date, $notrigger=0) { $result = 0; @@ -607,6 +607,16 @@ class Task extends CommonObject { $task_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task"); $result = 0; + + if (! $notrigger) + { + // Call triggers + include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('TASK_TIMESPENT_CREATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // End call triggers + } } else { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 5aa665e4ffd..86d7f367b54 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -121,7 +121,7 @@ if ($_GET["id"] > 0) } else { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('NewTimeSpent').''; } print '';