forked from Wavyzz/dolibarr
Fix: management of time spent in task card
This commit is contained in:
@@ -248,7 +248,7 @@ class Categorie
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('CATEGORY_UPDATE',$this,$user,$langs,$conf);
|
||||
$result=$interface->run_triggers('CATEGORY_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'CATEGORY_UPDATE')
|
||||
elseif ($action == 'CATEGORY_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
@@ -361,7 +361,7 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'PROJECT_UPDATE')
|
||||
elseif ($action == 'PROJECT_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
@@ -375,7 +375,7 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'TASK_UPDATE')
|
||||
elseif ($action == 'TASK_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
@@ -389,7 +389,7 @@ class InterfaceDemo
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
elseif ($action == 'TASK_TIMESPENT_UPDATE')
|
||||
elseif ($action == 'TASK_TIMESPENT_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
}
|
||||
|
||||
@@ -113,6 +113,16 @@ class Project extends CommonObject
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet");
|
||||
$result = $this->id;
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PROJECT_CREATE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -154,6 +164,16 @@ class Project extends CommonObject
|
||||
dol_syslog("Project::Update sql=".$sql,LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PROJECT_MODIFY',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$result = 0;
|
||||
}
|
||||
else
|
||||
@@ -326,7 +346,7 @@ class Project extends CommonObject
|
||||
* \brief Supprime le projet dans la base
|
||||
* \param Utilisateur
|
||||
*/
|
||||
function delete($user)
|
||||
function delete($user, $notrigger=0)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
@@ -335,6 +355,16 @@ class Project extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('PROJECT_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user