30 require_once DOL_DOCUMENT_ROOT.
'/core/triggers/dolibarrtriggers.class.php';
47 $this->
name = preg_replace(
'/^Interface/i',
'', get_class($this));
48 $this->family =
"agenda";
49 $this->
description =
"Triggers of this module add actions in agenda according to setup made in agenda setup.";
51 $this->version = self::VERSION_DOLIBARR;
52 $this->picto =
'action';
84 if (preg_match(
'/^ACTION_/', $action)) {
88 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$action;
93 if (empty($conf->global->$key)) {
97 $langs->load(
"agenda");
99 if (empty($object->actiontypecode)) {
100 $object->actiontypecode =
'AC_OTH_AUTO';
104 if ($action ==
'COMPANY_CREATE') {
106 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
108 if (empty($object->actionmsg2)) {
109 $object->actionmsg2 = $langs->transnoentities(
"NewCompanyToDolibarr", $object->name);
111 $object->actionmsg = $langs->transnoentities(
"NewCompanyToDolibarr", $object->name);
113 $object->sendtoid = 0;
114 $object->socid = $object->id;
115 } elseif ($action ==
'COMPANY_MODIFY') {
117 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
119 if (empty($object->actionmsg2)) {
120 $object->actionmsg2 = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr", $object->name);
122 $object->actionmsg = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr", $object->name);
124 if (!empty($object->context[
'mergefromname'])) {
125 $object->actionmsg =
dol_concatdesc($object->actionmsg, $langs->trans(
"DataFromWasMerged", $object->context[
'mergefromname']));
128 $object->sendtoid = 0;
129 $object->socid = $object->id;
130 } elseif ($action ==
'COMPANY_SENTBYMAIL') {
132 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
134 if (empty($object->actionmsg2)) {
135 dol_syslog(
'Trigger called with property actionmsg2 on object not defined', LOG_ERR);
140 } elseif ($action ==
'CONTACT_CREATE') {
142 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
144 if (empty($object->actionmsg2)) {
145 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
147 $object->actionmsg = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
149 $object->sendtoid = array($object->id => $object->id);
150 $object->socid = $object->socid;
151 } elseif ($action ==
'CONTACT_MODIFY') {
153 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
155 if (empty($object->actionmsg2)) {
156 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
158 $object->actionmsg = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
160 $object->sendtoid = array($object->id => $object->id);
161 $object->socid = $object->socid;
162 } elseif ($action ==
'CONTRACT_VALIDATE') {
164 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
166 if (empty($object->actionmsg2)) {
167 $object->actionmsg2 = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
169 $object->actionmsg = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
171 $object->sendtoid = 0;
172 } elseif ($action ==
'CONTRACT_SENTBYMAIL') {
174 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
176 if (empty($object->actionmsg2)) {
177 $object->actionmsg2 = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
179 if (empty($object->actionmsg)) {
180 $object->actionmsg = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
185 } elseif ($action ==
'PROPAL_VALIDATE') {
187 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
189 if (empty($object->actionmsg2)) {
190 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
192 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
194 $object->sendtoid = 0;
195 } elseif ($action ==
'PROPAL_MODIFY') {
197 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
199 if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
200 $object->actionmsg = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
202 $object->sendtoid = 0;
203 } elseif ($action ==
'PROPAL_SENTBYMAIL') {
205 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
207 if (empty($object->actionmsg2)) {
208 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
210 if (empty($object->actionmsg)) {
211 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
216 } elseif ($action ==
'PROPAL_CLOSE_SIGNED') {
218 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
220 if (empty($object->actionmsg2)) {
221 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
223 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
225 $object->sendtoid = 0;
226 } elseif ($action ==
'PROPAL_CLASSIFY_BILLED') {
228 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
230 if (empty($object->actionmsg2)) {
231 $object->actionmsg2 = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
233 $object->actionmsg = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
235 $object->sendtoid = 0;
236 } elseif ($action ==
'PROPAL_CLOSE_REFUSED') {
238 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
240 if (empty($object->actionmsg2)) {
241 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
243 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
245 $object->sendtoid = 0;
246 } elseif ($action ==
'ORDER_VALIDATE') {
248 $langs->loadLangs(array(
"agenda",
"orders"));
250 if (empty($object->actionmsg2)) {
251 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
253 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
255 $object->sendtoid = 0;
256 } elseif ($action ==
'ORDER_CLOSE') {
258 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
260 if (empty($object->actionmsg2)) {
261 $object->actionmsg2 = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
263 $object->actionmsg = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
265 $object->sendtoid = 0;
266 } elseif ($action ==
'ORDER_CLASSIFY_BILLED') {
268 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
270 if (empty($object->actionmsg2)) {
271 $object->actionmsg2 = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
273 $object->actionmsg = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
275 $object->sendtoid = 0;
276 } elseif ($action ==
'ORDER_CANCEL') {
278 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
280 if (empty($object->actionmsg2)) {
281 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
283 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
285 $object->sendtoid = 0;
286 } elseif ($action ==
'ORDER_SENTBYMAIL') {
288 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
290 if (empty($object->actionmsg2)) {
291 $object->actionmsg2 = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
293 if (empty($object->actionmsg)) {
294 $object->actionmsg = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
299 } elseif ($action ==
'BILL_VALIDATE') {
301 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
303 if (empty($object->actionmsg2)) {
304 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
306 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
308 $object->sendtoid = 0;
309 } elseif ($action ==
'BILL_UNVALIDATE') {
311 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
313 if (empty($object->actionmsg2)) {
314 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
316 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
318 $object->sendtoid = 0;
319 } elseif ($action ==
'BILL_SENTBYMAIL') {
321 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
323 if (empty($object->actionmsg2)) {
324 $object->actionmsg2 = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
326 if (empty($object->actionmsg)) {
327 $object->actionmsg = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
332 } elseif ($action ==
'BILL_PAYED') {
334 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
337 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
338 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
340 $object->sendtoid = 0;
341 } elseif ($action ==
'BILL_CANCEL') {
343 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
345 if (empty($object->actionmsg2)) {
346 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
348 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
350 $object->sendtoid = 0;
351 } elseif ($action ==
'FICHINTER_CREATE') {
353 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
355 if (empty($object->actionmsg2)) {
356 $object->actionmsg2 = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
358 $object->actionmsg = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
360 $object->sendtoid = 0;
361 $object->fk_element = 0;
362 $object->elementtype =
'';
363 } elseif ($action ==
'FICHINTER_VALIDATE') {
365 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
367 if (empty($object->actionmsg2)) {
368 $object->actionmsg2 = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
370 $object->actionmsg = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
372 $object->sendtoid = 0;
373 $object->fk_element = 0;
374 $object->elementtype =
'';
375 } elseif ($action ==
'FICHINTER_MODIFY') {
377 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
379 if (empty($object->actionmsg2)) {
380 $object->actionmsg2 = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
382 $object->actionmsg = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
384 $object->sendtoid = 0;
385 $object->fk_element = 0;
386 $object->elementtype =
'';
387 } elseif ($action ==
'FICHINTER_SENTBYMAIL') {
389 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
391 if (empty($object->actionmsg2)) {
392 $object->actionmsg2 = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
394 if (empty($object->actionmsg)) {
395 $object->actionmsg = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
400 } elseif ($action ==
'FICHINTER_CLASSIFY_BILLED') {
402 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
404 if (empty($object->actionmsg2)) {
405 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
407 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
409 $object->sendtoid = 0;
410 } elseif ($action ==
'FICHINTER_CLASSIFY_UNBILLED') {
412 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
414 if (empty($object->actionmsg2)) {
415 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
417 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
419 $object->sendtoid = 0;
420 } elseif ($action ==
'FICHINTER_DELETE') {
422 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
424 if (empty($object->actionmsg2)) {
425 $object->actionmsg2 = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
427 $object->actionmsg = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
429 $object->sendtoid = 0;
430 $object->fk_element = 0;
431 $object->elementtype =
'';
432 } elseif ($action ==
'SHIPPING_VALIDATE') {
434 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
436 if (empty($object->actionmsg2)) {
437 $object->actionmsg2 = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
439 if (empty($object->actionmsg)) {
440 $object->actionmsg = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
445 } elseif ($action ==
'SHIPPING_SENTBYMAIL') {
447 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
449 if (empty($object->actionmsg2)) {
450 $object->actionmsg2 = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
452 if (empty($object->actionmsg)) {
453 $object->actionmsg = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
458 } elseif ($action ==
'RECEPTION_VALIDATE') {
459 $langs->load(
"agenda");
460 $langs->load(
"other");
461 $langs->load(
"receptions");
463 if (empty($object->actionmsg2)) {
464 $object->actionmsg2 = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
466 if (empty($object->actionmsg)) {
467 $object->actionmsg = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
472 } elseif ($action ==
'RECEPTION_SENTBYMAIL') {
473 $langs->load(
"agenda");
474 $langs->load(
"other");
475 $langs->load(
"receptions");
477 if (empty($object->actionmsg2)) {
478 $object->actionmsg2 = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
480 if (empty($object->actionmsg)) {
481 $object->actionmsg = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
486 } elseif ($action ==
'PROPOSAL_SUPPLIER_VALIDATE') {
488 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
490 if (empty($object->actionmsg2)) {
491 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
493 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
495 $object->sendtoid = 0;
496 } elseif ($action ==
'PROPOSAL_SUPPLIER_SENTBYMAIL') {
498 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
500 if (empty($object->actionmsg2)) {
501 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
503 if (empty($object->actionmsg)) {
504 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
509 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
511 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
513 if (empty($object->actionmsg2)) {
514 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
516 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
518 $object->sendtoid = 0;
519 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
521 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
523 if (empty($object->actionmsg2)) {
524 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
526 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
528 $object->sendtoid = 0;
529 } elseif ($action ==
'ORDER_SUPPLIER_CREATE') {
531 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
533 if (empty($object->actionmsg2)) {
534 $object->actionmsg2 = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
536 $object->actionmsg = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
538 $object->sendtoid = 0;
539 } elseif ($action ==
'ORDER_SUPPLIER_VALIDATE') {
541 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
543 if (empty($object->actionmsg2)) {
544 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
546 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
548 $object->sendtoid = 0;
549 } elseif ($action ==
'ORDER_SUPPLIER_APPROVE') {
551 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
553 if (empty($object->actionmsg2)) {
554 $object->actionmsg2 = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
556 $object->actionmsg = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
558 $object->sendtoid = 0;
559 } elseif ($action ==
'ORDER_SUPPLIER_REFUSE') {
561 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
563 if (empty($object->actionmsg2)) {
564 $object->actionmsg2 = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
566 $object->actionmsg = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
568 if (!empty($object->refuse_note)) {
569 $object->actionmsg .=
'<br>';
570 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->refuse_note;
573 $object->sendtoid = 0;
574 } elseif ($action ==
'ORDER_SUPPLIER_CANCEL') {
576 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
578 if (empty($object->actionmsg2)) {
579 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
581 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
583 if (!empty($object->cancel_note)) {
584 $object->actionmsg .=
'<br>';
585 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->cancel_note;
588 $object->sendtoid = 0;
589 } elseif ($action ==
'ORDER_SUPPLIER_SUBMIT') {
591 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
593 if (empty($object->actionmsg2)) {
594 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
596 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
598 if (!empty($object->context[
'comments'])) {
599 $object->actionmsg .=
'<br>';
600 $object->actionmsg .= $langs->trans(
"Comment") .
': '.$object->context[
'comments'];
603 $object->sendtoid = 0;
604 } elseif ($action ==
'ORDER_SUPPLIER_RECEIVE') {
606 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
608 if (empty($object->context[
'actionmsg2'])) {
609 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
611 $object->actionmsg2 = $object->context[
'actionmsg2'];
613 $object->actionmsg = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
615 $object->sendtoid = 0;
616 } elseif ($action ==
'ORDER_SUPPLIER_SENTBYMAIL') {
618 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
620 if (empty($object->actionmsg2)) {
621 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
623 if (empty($object->actionmsg)) {
624 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
629 } elseif ($action ==
'ORDER_SUPPLIER_CLASSIFY_BILLED') {
631 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
633 if (empty($object->actionmsg2)) {
634 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
636 if (empty($object->actionmsg)) {
637 $object->actionmsg = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
640 $object->sendtoid = 0;
641 } elseif ($action ==
'BILL_SUPPLIER_VALIDATE') {
643 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
645 if (empty($object->actionmsg2)) {
646 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
648 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
650 $object->sendtoid = 0;
651 } elseif ($action ==
'BILL_SUPPLIER_UNVALIDATE') {
653 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
655 if (empty($object->actionmsg2)) {
656 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
658 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
660 $object->sendtoid = 0;
661 } elseif ($action ==
'BILL_SUPPLIER_SENTBYMAIL') {
663 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
665 if (empty($object->actionmsg2)) {
666 $object->actionmsg2 = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
668 if (empty($object->actionmsg)) {
669 $object->actionmsg = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
674 } elseif ($action ==
'BILL_SUPPLIER_PAYED') {
676 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
678 if (empty($object->actionmsg2)) {
679 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
681 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
683 $object->sendtoid = 0;
684 } elseif ($action ==
'BILL_SUPPLIER_CANCELED') {
686 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
688 if (empty($object->actionmsg2)) {
689 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
691 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
693 $object->sendtoid = 0;
694 } elseif ($action ==
'MEMBER_VALIDATE') {
697 $langs->loadLangs(array(
"agenda",
"other",
"members"));
699 if (empty($object->actionmsg2)) {
700 $object->actionmsg2 = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
702 $object->actionmsg = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
703 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
704 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
706 $object->sendtoid = 0;
707 } elseif ($action ==
'MEMBER_MODIFY') {
709 $langs->loadLangs(array(
"agenda",
"other",
"members"));
711 if (empty($object->actionmsg2)) {
712 $object->actionmsg2 = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
714 $object->actionmsg = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
715 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
716 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
718 $object->sendtoid = 0;
719 } elseif ($action ==
'MEMBER_SUBSCRIPTION_CREATE') {
721 $langs->loadLangs(array(
"agenda",
"other",
"members"));
723 $member = (isset($this->context[
'member']) ? $this->context[
'member'] :
null);
724 if (!is_object($member)) {
725 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
726 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
728 $member->fetch($object->fk_adherent);
731 if (empty($object->actionmsg2)) {
732 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
734 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
735 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
736 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
737 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
738 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
740 $object->sendtoid = 0;
741 if (isset($object->fk_soc) && $object->fk_soc > 0) {
742 $object->socid = $object->fk_soc;
744 } elseif ($action ==
'MEMBER_SUBSCRIPTION_MODIFY') {
746 $langs->loadLangs(array(
"agenda",
"other",
"members"));
748 $member = $this->context[
'member'];
749 if (!is_object($member)) {
750 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
752 $member->fetch($object->fk_adherent);
755 if (empty($object->actionmsg2)) {
756 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
758 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
759 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
760 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
761 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
762 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
764 $object->sendtoid = 0;
765 if ($object->fk_soc > 0) {
766 $object->socid = $object->fk_soc;
768 } elseif ($action ==
'MEMBER_SUBSCRIPTION_DELETE') {
770 $langs->loadLangs(array(
"agenda",
"other",
"members"));
772 $member = $this->context[
'member'];
773 if (!is_object($member)) {
774 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
775 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
777 $member->fetch($object->fk_adherent);
780 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs));
781 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
782 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
783 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
784 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
785 if (empty($object->actionmsg2)) {
786 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs));
789 $object->sendtoid = 0;
790 if (isset($object->fk_soc) && $object->fk_soc > 0) {
791 $object->socid = $object->fk_soc;
793 } elseif ($action ==
'MEMBER_RESILIATE') {
795 $langs->loadLangs(array(
"agenda",
"other",
"members"));
797 if (empty($object->actionmsg2)) {
798 $object->actionmsg2 = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
800 $object->actionmsg = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
801 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
802 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
804 $object->sendtoid = 0;
805 } elseif ($action ==
'MEMBER_DELETE') {
807 $langs->loadLangs(array(
"agenda",
"other",
"members"));
809 if (empty($object->actionmsg2)) {
810 $object->actionmsg2 = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
812 $object->actionmsg = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
813 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
814 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
816 $object->sendtoid = 0;
817 } elseif ($action ==
'MEMBER_EXCLUDE') {
819 $langs->loadLangs(array(
"agenda",
"other",
"members"));
821 if (empty($object->actionmsg2)) {
822 $object->actionmsg2 = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
824 $object->actionmsg = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
825 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
826 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
828 $object->sendtoid = 0;
829 } elseif ($action ==
'PROJECT_CREATE') {
832 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
834 if (empty($object->actionmsg2)) {
835 $object->actionmsg2 = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
837 $object->actionmsg = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
838 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
840 $object->sendtoid = 0;
841 } elseif ($action ==
'PROJECT_VALIDATE') {
843 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
845 if (empty($object->actionmsg2)) {
846 $object->actionmsg2 = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
848 $object->actionmsg = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
849 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
851 $object->sendtoid = 0;
852 } elseif ($action ==
'PROJECT_MODIFY') {
854 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
856 if (empty($object->actionmsg2)) {
857 $object->actionmsg2 = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
859 $object->actionmsg = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
861 if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) {
862 $object->actionmsg .=
"\n".$langs->transnoentitiesnoconv(
"OpportunityStatus").
': '.$object->oldcopy->opp_status.
' -> '.$object->opp_status;
865 $object->sendtoid = 0;
866 } elseif ($action ==
'PROJECT_SENTBYMAIL') {
868 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
870 if (empty($object->actionmsg2)) {
871 $object->actionmsg2 = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
873 if (empty($object->actionmsg)) {
874 $object->actionmsg = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
879 } elseif ($action ==
'PROJECT_CLOSE') {
881 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
883 if (empty($object->actionmsg2)) {
884 $object->actionmsg2 = $langs->transnoentities(
"ProjectClosedInDolibarr", $object->ref);
886 $object->actionmsg = $langs->transnoentities(
"ProjectClosedInDolibarr", $object->ref);
888 $object->sendtoid = 0;
889 } elseif ($action ==
'TASK_CREATE') {
892 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
894 if (empty($object->actionmsg2)) {
895 $object->actionmsg2 = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
897 $object->actionmsg = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
898 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
900 $object->sendtoid = 0;
901 } elseif ($action ==
'TASK_MODIFY') {
903 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
905 if (empty($object->actionmsg2)) {
906 $object->actionmsg2 = $langs->transnoentities(
"TaskModifiedInDolibarr", $object->ref);
908 $object->actionmsg = $langs->transnoentities(
"TaskModifieddInDolibarr", $object->ref);
909 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
911 $object->sendtoid = 0;
912 } elseif ($action ==
'TASK_DELETE') {
914 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
916 if (empty($object->actionmsg2)) {
917 $object->actionmsg2 = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
919 $object->actionmsg = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
920 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
922 $object->sendtoid = 0;
923 } elseif ($action ==
'TICKET_ASSIGNED') {
925 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
927 if (empty($object->actionmsg2)) {
928 $object->actionmsg2 = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
930 $object->actionmsg = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
931 if ($object->oldcopy->fk_user_assign > 0) {
932 $tmpuser =
new User($this->db);
933 $tmpuser->fetch($object->oldcopy->fk_user_assign);
934 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$tmpuser->getFullName($langs);
936 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$langs->trans(
"None");
938 if ($object->fk_user_assign > 0) {
939 $tmpuser =
new User($this->db);
940 $tmpuser->fetch($object->fk_user_assign);
941 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$tmpuser->getFullName($langs);
943 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$langs->trans(
"None");
945 $object->sendtoid = 0;
952 if (!empty($object->context[
'actionmsg']) && empty($object->actionmsg)) {
953 $object->actionmsg = $object->context[
'actionmsg'];
955 if (!empty($object->context[
'actionmsg2']) && empty($object->actionmsg2)) {
956 $object->actionmsg2 = $object->context[
'actionmsg2'];
959 if (empty($object->actionmsg2)) {
961 $langs->loadLangs(array(
"agenda",
"other"));
962 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
963 $object->actionmsg2 = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
965 $tmp = explode(
'_', $action);
966 $object->actionmsg2 = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
969 if (empty($object->actionmsg)) {
971 $langs->loadLangs(array(
"agenda",
"other"));
972 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
973 $object->actionmsg = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
975 $tmp = explode(
'_', $action);
976 $object->actionmsg = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
980 if (!isset($object->sendtoid) || !is_array($object->sendtoid)) {
981 $object->sendtoid = 0;
987 if (empty($object->trackid)) {
989 if (preg_match(
'/^COMPANY_/', $action)) {
990 $object->trackid =
'thi'.$object->id;
991 } elseif (preg_match(
'/^CONTACT_/', $action)) {
992 $object->trackid =
'ctc'.$object->id;
993 } elseif (preg_match(
'/^CONTRACT_/', $action)) {
994 $object->trackid =
'con'.$object->id;
995 } elseif (preg_match(
'/^PROPAL_/', $action)) {
996 $object->trackid =
'pro'.$object->id;
997 } elseif (preg_match(
'/^ORDER_/', $action)) {
998 $object->trackid =
'ord'.$object->id;
999 } elseif (preg_match(
'/^BILL_/', $action)) {
1000 $object->trackid =
'inv'.$object->id;
1001 } elseif (preg_match(
'/^FICHINTER_/', $action)) {
1002 $object->trackid =
'int'.$object->id;
1003 } elseif (preg_match(
'/^SHIPPING_/', $action)) {
1004 $object->trackid =
'shi'.$object->id;
1005 } elseif (preg_match(
'/^RECEPTION_/', $action)) {
1006 $object->trackid =
'rec'.$object->id;
1007 } elseif (preg_match(
'/^PROPOSAL_SUPPLIER/', $action)) {
1008 $object->trackid =
'spr'.$object->id;
1009 } elseif (preg_match(
'/^ORDER_SUPPLIER_/', $action)) {
1010 $object->trackid =
'sor'.$object->id;
1011 } elseif (preg_match(
'/^BILL_SUPPLIER_/', $action)) {
1012 $object->trackid =
'sin'.$object->id;
1013 } elseif (preg_match(
'/^MEMBER_SUBSCRIPTION_/', $action)) {
1014 $object->trackid =
'sub'.$object->id;
1015 } elseif (preg_match(
'/^MEMBER_/', $action)) {
1016 $object->trackid =
'mem'.$object->id;
1017 } elseif (preg_match(
'/^PARTNERSHIP_/', $action)) {
1018 $object->trackid =
'pship'.$object->id;
1019 } elseif (preg_match(
'/^PROJECT_/', $action)) {
1020 $object->trackid =
'proj'.$object->id;
1021 } elseif (preg_match(
'/^TASK_/', $action)) {
1022 $object->trackid =
'tas'.$object->id;
1023 } elseif (preg_match(
'/^TICKET_/', $action)) {
1024 $object->trackid =
'tic'.$object->id;
1025 } elseif (preg_match(
'/^USER_/', $action)) {
1026 $object->trackid =
'use'.$object->id;
1028 $object->trackid =
'';
1040 dol_syslog(
"Trigger '".$this->
name.
"' for action '".$action.
"' launched by ".__FILE__.
". id=".$object->id);
1045 if (isset($_SESSION[
'listofnames-'.$object->trackid])) {
1046 $attachs = $_SESSION[
'listofnames-'.$object->trackid];
1047 if ($attachs && strpos($action,
'SENTBYMAIL')) {
1048 $object->actionmsg =
dol_concatdesc($object->actionmsg,
"\n".$langs->transnoentities(
"AttachedFiles").
': '.$attachs);
1051 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
1052 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
1053 $contactforaction =
new Contact($this->db);
1054 $societeforaction =
new Societe($this->db);
1057 if (is_array($object->sendtoid)) {
1058 if (count($object->sendtoid) == 1) {
1059 $contactforaction->fetch(reset($object->sendtoid));
1062 if ($object->sendtoid > 0) {
1063 $contactforaction->fetch($object->sendtoid);
1067 if (isset($object->socid) && $object->socid > 0) {
1068 $societeforaction->fetch($object->socid);
1069 } elseif (isset($object->fk_soc) && $object->fk_soc > 0) {
1070 $societeforaction->fetch($object->fk_soc);
1071 } elseif (isset($object->thirdparty) && isset($object->thirdparty->id) && $object->thirdparty->id > 0) {
1072 $societeforaction = $object->thirdparty;
1075 $projectid = isset($object->fk_project) ? $object->fk_project : 0;
1076 if ($object->element ==
'project') {
1077 $projectid = $object->id;
1080 $elementid = $object->id;
1081 $elementtype = $object->element;
1082 $elementmodule = (empty($object->module) ?
'' : $object->module);
1083 if ($object->element ==
'subscription') {
1084 $elementid = $object->fk_adherent;
1085 $elementtype =
'member';
1090 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1092 $actioncomm->type_code = $object->actiontypecode;
1093 $actioncomm->code =
'AC_'.$action;
1094 $actioncomm->label = $object->actionmsg2;
1095 $actioncomm->note_private = $object->actionmsg;
1096 $actioncomm->fk_project = $projectid;
1097 $actioncomm->datep = $now;
1098 $actioncomm->datef = $now;
1099 $actioncomm->durationp = 0;
1100 $actioncomm->percentage = -1;
1101 $actioncomm->socid = $societeforaction->id;
1102 $actioncomm->contact_id = $contactforaction->id;
1103 $actioncomm->authorid = $user->id;
1104 $actioncomm->userownerid = $user->id;
1106 if (!property_exists($object,
'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
1107 $actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
1108 $actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
1109 $actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
1110 $actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
1111 $actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
1112 $actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
1113 $actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
1114 $actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
1119 if (!in_array($elementtype, array(
'societe',
'contact',
'project'))) {
1120 $actioncomm->fk_element = $elementid;
1121 $actioncomm->elementtype = $elementtype.($elementmodule ?
'@'.$elementmodule :
'');
1124 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
1125 $actioncomm->attachedfiles = $object->attachedfiles;
1127 if (property_exists($object,
'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
1128 $actioncomm->userassigned = $object->sendtouserid;
1130 if (property_exists($object,
'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
1131 foreach ($object->sendtoid as $val) {
1132 $actioncomm->socpeopleassigned[$val] = $val;
1136 $ret = $actioncomm->create($user);
1138 if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) {
1139 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && array_key_exists(
'paths', $object->attachedfiles) && count($object->attachedfiles[
'paths']) > 0) {
1140 foreach ($object->attachedfiles[
'paths'] as $key => $filespath) {
1141 $srcfile = $filespath;
1142 $destdir = $conf->agenda->dir_output.
'/'.$ret;
1143 $destfile = $destdir.
'/'.$object->attachedfiles[
'names'][$key];
1145 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1152 unset($object->actionmsg);
1153 unset($object->actionmsg2);
1154 unset($object->actiontypecode);
1157 $_SESSION[
'LAST_ACTION_CREATED'] = $ret;
1160 $this->error =
"Failed to insert event : ".$actioncomm->error.
" ".join(
',', $actioncomm->errors);
1161 $this->errors = $actioncomm->errors;
1163 dol_syslog(
"interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);