Fix: management of time spent in task card
This commit is contained in:
parent
f2423b654a
commit
ca30725757
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -121,7 +121,7 @@ if ($_GET["id"] > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Modify').'</a>';
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('NewTimeSpent').'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user