31,029
edits
| Line 152: | Line 152: | ||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); | include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); | ||
$interface=new Interfaces($this->db); | $interface=new Interfaces($this->db); | ||
$result=$interface->run_triggers(' | $result=$interface->run_triggers('XXXXX_YYYYY',$this,$user,$langs,$conf); | ||
if ($result < 0) { $error++; $this->errors=$interface->errors; } | if ($result < 0) { $error++; $this->errors=$interface->errors; } | ||
// End call triggers | // End call triggers | ||
</source> | </source> | ||
Here, $this contains the business class with all information to send to the trigger functions. Replace ' | Here, $this contains the business class with all information to send to the trigger functions. Replace 'XXXXX_YYYYY' by an event code not already used. | ||
Then you will be able to add inside the run_trigger method, a "if" to manage this code. The run_trigger method will contains a part of code like this : | Then you will be able to add inside the run_trigger method, a "if" to manage this code. The run_trigger method will contains a part of code like this : | ||