25require_once DOL_DOCUMENT_ROOT.
'/core/triggers/dolibarrtriggers.class.php';
42 $this->
name = preg_replace(
'/^Interface/i',
'', get_class($this));
43 $this->family =
"eventorganization";
44 $this->
description =
"Triggers of this module to manage event organization triggers action";
46 $this->version = self::VERSION_DOLIBARR;
47 $this->picto =
'action';
74 if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) {
81 if ($action ==
'PROJECT_VALIDATE') {
82 if (
getDolGlobalString(
'EVENTORGANIZATION_TASK_LABEL') && !empty($object->usage_organize_event)) {
84 if (is_array($taskToDo) && count($taskToDo)>0) {
86 $langs->loadLangs(array(
"eventorganization"));
89 foreach ($taskToDo as $taskLabel) {
90 $task =
new Task($this->db);
91 $task->label = $taskLabel;
92 $task->fk_project = $object->id;
94 $obj = !
getDolGlobalString(
'PROJECT_TASK_ADDON') ?
'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
96 require_once DOL_DOCUMENT_ROOT .
"/core/modules/project/task/" .
getDolGlobalString(
'PROJECT_TASK_ADDON') .
'.php';
97 $modTask =
new $obj();
98 $defaultref = $modTask->getNextValue($object->thirdparty,
null);
100 if (is_numeric($defaultref) && $defaultref <= 0) {
103 $task->ref = $defaultref;
106 $task->date_start =
null;
107 $task->date_end =
null;
109 $result = $task->create($user);
111 $this->errors=array_merge($this->errors, $task->errors);
120 dol_syslog(
"InterfaceEventOrganization.class.php: ".implode(
',', $this->errors), LOG_ERR);
121 $this->db->rollback();
Class to stock current configuration.
Class that all the triggers must extend.
Class of triggered functions for agenda module.
__construct($db)
Constructor.
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarrr business event is done.
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.