From 8485b591a4c085f88c727b378f8c64ff5427b944 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Dec 2005 13:56:05 +0000 Subject: [PATCH] Ajout des trigers de fermeture de propal --- .../triggers/interface_demo.class.php | 21 +++++++++++++++++++ htdocs/propal.class.php | 20 ++++++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/htdocs/includes/triggers/interface_demo.class.php b/htdocs/includes/triggers/interface_demo.class.php index 34c347a1a6f..03b4ff56c8b 100644 --- a/htdocs/includes/triggers/interface_demo.class.php +++ b/htdocs/includes/triggers/interface_demo.class.php @@ -127,6 +127,27 @@ class InterfaceDemo { 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 elseif ($action == 'CONTRACT_CREATE') { diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 2d80a4327c6..21ad8bf8c60 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -823,14 +823,22 @@ class Propal $this->db->rollback(); 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(); return 1; }