diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 8405120ddef..7e77154fb32 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -219,15 +219,11 @@ class Productcustomerprice extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_customer_price"); if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_CREATE', $user); - // // 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; } - // // End call triggers + if ($result < 0) { + $error++; + } } } @@ -714,12 +710,11 @@ class Productcustomerprice extends CommonObject if (! $error) { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PRODUCT_CUSTOMER_PRICE_UPDATE', $this, $user, $langs, $conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End call triggers + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_UPDATE', $user); + + if ($result < 0) { + $error++; + } } } @@ -854,15 +849,11 @@ class Productcustomerprice extends CommonObject if (! $error) { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_DELETE', $user); - // // 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; } - // // End call triggers + if ($result < 0) { + $error++; + } } }