74 if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) {
81 if ($action ==
'PROJECT_VALIDATE') {
82 if (!empty($conf->global->EVENTORGANIZATION_TASK_LABEL) && !empty($object->usage_organize_event)) {
83 $taskToDo = explode(
"\n", $conf->global->EVENTORGANIZATION_TASK_LABEL);
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 = empty($conf->global->PROJECT_TASK_ADDON) ?
'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
95 if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT .
"/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON .
".php")) {
96 require_once DOL_DOCUMENT_ROOT .
"/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON .
'.php';
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();