From 42f8da7496671bab030b153b5246e975214b37ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Feb 2018 12:56:17 +0100 Subject: [PATCH] NEW Add trigger CONTRACT_MODIFY --- htdocs/contrat/class/contrat.class.php | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ad6b16163a5..fd1019390be 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1268,26 +1268,14 @@ class Contrat extends CommonObject { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Call triggers + $result=$this->call_trigger('CONTRACT_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } } - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used + if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used { $result=$this->insertExtraFields(); if ($result < 0)