34require_once DOL_DOCUMENT_ROOT.
'/core/triggers/dolibarrtriggers.class.php';
49 parent::__construct($db);
50 $this->family =
"demo";
52 $this->version = self::VERSIONS[
'dev'];
53 $this->picto =
'mymodule@mymodule';
70 if (!isModEnabled(
'mymodule')) {
79 $methodName = lcfirst(str_replace(
' ',
'', ucwords(str_replace(
'_',
' ', strtolower($action)))));
80 $callback = array($this, $methodName);
81 if (is_callable($callback)) {
83 "Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".
$object->id
86 return call_user_func($callback, $action,
$object, $user, $langs, $conf);
308 dol_syslog(
"Trigger '".$this->
name.
"' for action '".$action.
"' launched by ".__FILE__.
". id=".
$object->id);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to stock current configuration.
Class that all triggers must inherit.
Class of triggers for MyModule module.
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarr business event is done.
__construct($db)
Constructor.
Class to manage translations.
Class to manage Dolibarr users.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.