From 2e54c35898eac2d49437fb17f4d90548c56bbffa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 9 Sep 2010 17:57:37 +0000 Subject: [PATCH] Add trigger for propal create from clone --- htdocs/comm/propal/class/propal.class.php | 9 ++++++--- .../includes/triggers/interface_all_Demo.class.php-NORUN | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 3cd01bc79ae..d0423546e61 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -822,9 +822,12 @@ class Propal extends CommonObject if (! $error) { - - - + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('PROPAL_CLONE',$object,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Fin appel triggers } // End diff --git a/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN b/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN index c0af800d346..bc69ddaca4e 100644 --- a/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN +++ b/htdocs/includes/triggers/interface_all_Demo.class.php-NORUN @@ -238,6 +238,10 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'PROPAL_CLONE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } elseif ($action == 'PROPAL_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);