From b8b7dbbed4a65575351acdf43468c4090022242d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 5 Jan 2014 22:05:56 +0100 Subject: [PATCH] Created triggers OPENSURVEY_CREATE and OPENSURVEY_DELETE --- ChangeLog | 2 +- .../class/opensurveysondage.class.php | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index e85b76eaebc..7f320073bed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,7 @@ For developers: - New: More phpunit tests. - New: Payments and supplier payment pages tabs can now be extended from modules. - New: Opensurvey polls tab cards can now be extended from external modules. - +- New: Triggers OPENSURVEY_CREATE, OPENSURVEY_DELETE ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 45c58688969..7630cb39e8e 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -134,14 +134,11 @@ class Opensurveysondage extends CommonObject { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('OPENSURVEY_CREATE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } //// End call triggers } } @@ -331,14 +328,11 @@ class Opensurveysondage extends CommonObject { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('OPENSURVEY_DELETE',$this,$user,$langs,$conf); + if ($result < 0) { $error++; $this->errors=$interface->errors; } //// End call triggers } }