Ajout des trigers de fermeture de propal

This commit is contained in:
Laurent Destailleur 2005-12-10 13:56:05 +00:00
parent 22565a5cad
commit 8485b591a4
2 changed files with 35 additions and 6 deletions

View File

@ -127,6 +127,27 @@ class InterfaceDemo
{ {
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id); dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched. id=".$object->id);
} }
// Proposals
elseif ($action == 'PROPAL_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
}
elseif ($action == 'PROPAL_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
}
elseif ($action == 'PROPAL_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
}
elseif ($action == 'PROPAL_CLOSE_SIGNED')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
}
elseif ($action == 'PROPAL_CLOSE_REFUSED')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
}
// Contracts // Contracts
elseif ($action == 'CONTRACT_CREATE') elseif ($action == 'CONTRACT_CREATE')
{ {

View File

@ -823,14 +823,22 @@ class Propal
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('PROPAL_CLOSE_SIGNED',$this,$user,$langs,$conf);
// Fin appel triggers
}
else
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('PROPAL_CLOSE_REFUSED',$this,$user,$langs,$conf);
// Fin appel triggers
} }
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('PROP_CLOSE',$this,$user,$langs,$conf);
// Fin appel triggers
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }