82 if (!isModEnabled(
'agenda')) {
87 if (preg_match(
'/^ACTION_/', $action)) {
91 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$action;
100 $langs->load(
"agenda");
102 if (empty(
$object->actiontypecode)) {
103 $object->actiontypecode =
'AC_OTH_AUTO';
107 if ($action ==
'COMPANY_CREATE') {
109 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
111 if (empty(
$object->actionmsg2)) {
112 if (empty(
$object->context[
'actionmsg2'])) {
113 $object->actionmsg2 = $langs->transnoentities(
"NewCompanyToDolibarr",
$object->name);
118 if (empty(
$object->actionmsg)) {
119 $object->actionmsg = $langs->transnoentities(
"NewCompanyToDolibarr",
$object->name);
124 } elseif ($action ==
'COMPANY_MODIFY') {
126 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
128 if (empty(
$object->actionmsg2)) {
129 if (empty(
$object->context[
'actionmsg2'])) {
130 $object->actionmsg2 = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr",
$object->name);
135 if (empty(
$object->actionmsg)) {
136 $object->actionmsg = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr",
$object->name);
140 if (!empty(
$object->context[
'mergefromname'])) {
146 } elseif ($action ==
'COMPANY_SENTBYMAIL') {
148 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
150 if (empty(
$object->actionmsg2)) {
151 if (empty(
$object->context[
'actionmsg2'])) {
152 dol_syslog(
'Trigger called with property actionmsg2 and context[actionmsg2] on object not defined', LOG_ERR);
160 } elseif ($action ==
'CONTACT_CREATE') {
162 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
164 if (empty(
$object->actionmsg2)) {
165 if (empty(
$object->context[
'actionmsg2'])) {
166 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_CREATEInDolibarr",
$object->getFullName($langs));
171 if (empty(
$object->actionmsg)) {
172 $object->actionmsg = $langs->transnoentities(
"CONTACT_CREATEInDolibarr",
$object->getFullName($langs));
177 } elseif ($action ==
'CONTACT_MODIFY') {
179 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
181 if (empty(
$object->actionmsg2)) {
182 if (empty(
$object->context[
'actionmsg2'])) {
183 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr",
$object->name);
188 if (empty(
$object->actionmsg)) {
189 $object->actionmsg = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr",
$object->name);
194 } elseif ($action ==
'CONTRACT_VALIDATE') {
196 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
198 if (empty(
$object->actionmsg2)) {
199 if (empty(
$object->context[
'actionmsg2'])) {
205 if (empty(
$object->actionmsg)) {
210 } elseif ($action ==
'CONTRACT_SENTBYMAIL') {
212 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
214 if (empty(
$object->actionmsg2)) {
215 if (empty(
$object->context[
'actionmsg2'])) {
216 $object->actionmsg2 = $langs->transnoentities(
"ContractSentByEMail",
$object->ref);
221 if (empty(
$object->actionmsg)) {
222 $object->actionmsg = $langs->transnoentities(
"ContractSentByEMail",
$object->ref);
227 } elseif ($action ==
'PROPAL_VALIDATE') {
229 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
231 if (empty(
$object->actionmsg2)) {
232 if (empty(
$object->context[
'actionmsg2'])) {
238 if (empty(
$object->actionmsg)) {
243 } elseif ($action ==
'PROPAL_MODIFY') {
245 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
247 if (empty(
$object->actionmsg2)) {
248 if (empty(
$object->context[
'actionmsg2'])) {
254 if (empty(
$object->actionmsg)) {
259 } elseif ($action ==
'PROPAL_SENTBYMAIL') {
261 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
263 if (empty(
$object->actionmsg2)) {
264 if (empty(
$object->context[
'actionmsg2'])) {
265 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail",
$object->ref);
270 if (empty(
$object->actionmsg)) {
271 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail",
$object->ref);
276 } elseif ($action ==
'PROPAL_CLOSE_SIGNED') {
278 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
280 if (empty(
$object->actionmsg2)) {
281 if (empty(
$object->context[
'actionmsg2'])) {
282 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr",
$object->ref);
287 if (empty(
$object->actionmsg)) {
288 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr",
$object->ref);
292 } elseif ($action ==
'PROPAL_CLASSIFY_BILLED') {
294 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
296 if (empty(
$object->actionmsg2)) {
297 if (empty(
$object->context[
'actionmsg2'])) {
298 $object->actionmsg2 = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr",
$object->ref);
303 if (empty(
$object->actionmsg)) {
304 $object->actionmsg = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr",
$object->ref);
308 } elseif ($action ==
'PROPAL_CLOSE_REFUSED') {
310 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
312 if (empty(
$object->actionmsg2)) {
313 if (empty(
$object->context[
'actionmsg2'])) {
314 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr",
$object->ref);
319 if (empty(
$object->actionmsg)) {
320 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr",
$object->ref);
324 } elseif ($action ==
'ORDER_VALIDATE') {
326 $langs->loadLangs(array(
"agenda",
"orders"));
328 if (empty(
$object->actionmsg2)) {
329 if (empty(
$object->context[
'actionmsg2'])) {
335 if (empty(
$object->actionmsg)) {
340 } elseif ($action ==
'ORDER_CLOSE') {
342 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
344 if (empty(
$object->actionmsg2)) {
345 if (empty(
$object->context[
'actionmsg2'])) {
346 $object->actionmsg2 = $langs->transnoentities(
"OrderDeliveredInDolibarr",
$object->ref);
351 if (empty(
$object->actionmsg)) {
352 $object->actionmsg = $langs->transnoentities(
"OrderDeliveredInDolibarr",
$object->ref);
356 } elseif ($action ==
'ORDER_CLASSIFY_BILLED') {
358 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
360 if (empty(
$object->actionmsg2)) {
361 if (empty(
$object->context[
'actionmsg2'])) {
362 $object->actionmsg2 = $langs->transnoentities(
"OrderBilledInDolibarr",
$object->ref);
367 if (empty(
$object->actionmsg)) {
368 $object->actionmsg = $langs->transnoentities(
"OrderBilledInDolibarr",
$object->ref);
372 } elseif ($action ==
'ORDER_CANCEL') {
374 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
376 if (empty(
$object->actionmsg2)) {
377 if (empty(
$object->context[
'actionmsg2'])) {
378 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr",
$object->ref);
383 if (empty(
$object->actionmsg)) {
384 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr",
$object->ref);
388 } elseif ($action ==
'ORDER_SENTBYMAIL') {
390 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
392 if (empty(
$object->actionmsg2)) {
393 if (empty(
$object->context[
'actionmsg2'])) {
394 $object->actionmsg2 = $langs->transnoentities(
"OrderSentByEMail",
$object->ref);
399 if (empty(
$object->actionmsg)) {
400 $object->actionmsg = $langs->transnoentities(
"OrderSentByEMail",
$object->ref);
405 } elseif ($action ==
'BILL_VALIDATE') {
407 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
409 if (empty(
$object->actionmsg2)) {
410 if (empty(
$object->context[
'actionmsg2'])) {
416 if (empty(
$object->actionmsg)) {
421 } elseif ($action ==
'BILL_UNVALIDATE') {
423 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
425 if (empty(
$object->actionmsg2)) {
426 if (empty(
$object->context[
'actionmsg2'])) {
427 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr",
$object->ref);
432 if (empty(
$object->actionmsg)) {
433 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr",
$object->ref);
437 } elseif ($action ==
'BILL_SENTBYMAIL') {
439 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
441 if (empty(
$object->actionmsg2)) {
442 if (empty(
$object->context[
'actionmsg2'])) {
443 $object->actionmsg2 = $langs->transnoentities(
"InvoiceSentByEMail",
$object->ref);
448 if (empty(
$object->actionmsg)) {
449 $object->actionmsg = $langs->transnoentities(
"InvoiceSentByEMail",
$object->ref);
454 } elseif ($action ==
'BILL_PAYED') {
456 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
459 if (empty(
$object->actionmsg2)) {
460 if (empty(
$object->context[
'actionmsg2'])) {
461 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr",
$object->ref);
466 if (empty(
$object->actionmsg)) {
467 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr",
$object->ref);
471 } elseif ($action ==
'BILL_CANCEL') {
473 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
475 if (empty(
$object->actionmsg2)) {
476 if (empty(
$object->context[
'actionmsg2'])) {
477 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr",
$object->ref);
482 if (empty(
$object->actionmsg)) {
483 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr",
$object->ref);
487 } elseif ($action ==
'FICHINTER_CREATE') {
489 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
491 if (empty(
$object->actionmsg2)) {
492 if (empty(
$object->context[
'actionmsg2'])) {
493 $object->actionmsg2 = $langs->transnoentities(
"InterventionCreatedInDolibarr",
$object->ref);
498 if (empty(
$object->actionmsg)) {
499 $object->actionmsg = $langs->transnoentities(
"InterventionCreatedInDolibarr",
$object->ref);
505 } elseif ($action ==
'FICHINTER_VALIDATE') {
507 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
509 if (empty(
$object->actionmsg2)) {
510 if (empty(
$object->context[
'actionmsg2'])) {
516 if (empty(
$object->actionmsg)) {
523 } elseif ($action ==
'FICHINTER_MODIFY') {
525 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
527 if (empty(
$object->actionmsg2)) {
528 if (empty(
$object->context[
'actionmsg2'])) {
529 $object->actionmsg2 = $langs->transnoentities(
"InterventionModifiedInDolibarr",
$object->ref);
534 if (empty(
$object->actionmsg)) {
535 $object->actionmsg = $langs->transnoentities(
"InterventionModifiedInDolibarr",
$object->ref);
541 } elseif ($action ==
'FICHINTER_SENTBYMAIL') {
543 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
545 if (empty(
$object->actionmsg2)) {
546 if (empty(
$object->context[
'actionmsg2'])) {
547 $object->actionmsg2 = $langs->transnoentities(
"InterventionSentByEMail",
$object->ref);
552 if (empty(
$object->actionmsg)) {
553 $object->actionmsg = $langs->transnoentities(
"InterventionSentByEMail",
$object->ref);
558 } elseif ($action ==
'FICHINTER_CLASSIFY_BILLED') {
560 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
562 if (empty(
$object->actionmsg2)) {
563 if (empty(
$object->context[
'actionmsg2'])) {
564 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr",
$object->ref);
569 if (empty(
$object->actionmsg)) {
570 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr",
$object->ref);
574 } elseif ($action ==
'FICHINTER_CLASSIFY_UNBILLED') {
576 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
578 if (empty(
$object->actionmsg2)) {
579 if (empty(
$object->context[
'actionmsg2'])) {
580 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr",
$object->ref);
585 if (empty(
$object->actionmsg)) {
586 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr",
$object->ref);
590 } elseif ($action ==
'FICHINTER_CLOSE') {
592 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
594 if (empty(
$object->actionmsg2)) {
595 if (empty(
$object->context[
'actionmsg2'])) {
596 $object->actionmsg2 = $langs->transnoentities(
"InterventionClosedInDolibarr",
$object->ref);
601 if (empty(
$object->actionmsg)) {
602 $object->actionmsg = $langs->transnoentities(
"InterventionClosedInDolibarr",
$object->ref);
608 } elseif ($action ==
'FICHINTER_DELETE') {
610 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
612 if (empty(
$object->actionmsg2)) {
613 if (empty(
$object->context[
'actionmsg2'])) {
614 $object->actionmsg2 = $langs->transnoentities(
"InterventionDeletedInDolibarr",
$object->ref);
619 if (empty(
$object->actionmsg)) {
620 $object->actionmsg = $langs->transnoentities(
"InterventionDeletedInDolibarr",
$object->ref);
626 } elseif ($action ==
'SHIPPING_VALIDATE') {
628 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
630 if (empty(
$object->actionmsg2)) {
631 if (empty(
$object->context[
'actionmsg2'])) {
637 if (empty(
$object->actionmsg)) {
643 } elseif ($action ==
'SHIPPING_SENTBYMAIL') {
645 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
647 if (empty(
$object->actionmsg2)) {
648 if (empty(
$object->context[
'actionmsg2'])) {
649 $object->actionmsg2 = $langs->transnoentities(
"ShippingSentByEMail",
$object->ref);
654 if (empty(
$object->actionmsg)) {
655 $object->actionmsg = $langs->transnoentities(
"ShippingSentByEMail",
$object->ref);
660 } elseif ($action ==
'RECEPTION_VALIDATE') {
661 $langs->load(
"agenda");
662 $langs->load(
"other");
663 $langs->load(
"receptions");
665 if (empty(
$object->actionmsg2)) {
666 if (empty(
$object->context[
'actionmsg2'])) {
672 if (empty(
$object->actionmsg)) {
678 } elseif ($action ==
'RECEPTION_SENTBYMAIL') {
679 $langs->load(
"agenda");
680 $langs->load(
"other");
681 $langs->load(
"receptions");
683 if (empty(
$object->actionmsg2)) {
684 if (empty(
$object->context[
'actionmsg2'])) {
685 $object->actionmsg2 = $langs->transnoentities(
"ReceptionSentByEMail",
$object->ref);
690 if (empty(
$object->actionmsg)) {
691 $object->actionmsg = $langs->transnoentities(
"ReceptionSentByEMail",
$object->ref);
696 } elseif ($action ==
'PROPOSAL_SUPPLIER_VALIDATE') {
698 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
700 if (empty(
$object->actionmsg2)) {
701 if (empty(
$object->context[
'actionmsg2'])) {
707 if (empty(
$object->actionmsg)) {
712 } elseif ($action ==
'PROPOSAL_SUPPLIER_SENTBYMAIL') {
714 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
716 if (empty(
$object->actionmsg2)) {
717 if (empty(
$object->context[
'actionmsg2'])) {
718 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail",
$object->ref);
723 if (empty(
$object->actionmsg)) {
724 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail",
$object->ref);
729 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
731 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
733 if (empty(
$object->actionmsg2)) {
734 if (empty(
$object->context[
'actionmsg2'])) {
735 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr",
$object->ref);
740 if (empty(
$object->actionmsg)) {
741 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr",
$object->ref);
745 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
747 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
749 if (empty(
$object->actionmsg2)) {
750 if (empty(
$object->context[
'actionmsg2'])) {
751 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr",
$object->ref);
756 if (empty(
$object->actionmsg)) {
757 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr",
$object->ref);
761 } elseif ($action ==
'ORDER_SUPPLIER_CREATE') {
763 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
765 if (empty(
$object->actionmsg2)) {
766 if (empty(
$object->context[
'actionmsg2'])) {
772 if (empty(
$object->actionmsg)) {
777 } elseif ($action ==
'ORDER_SUPPLIER_VALIDATE') {
779 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
781 if (empty(
$object->actionmsg2)) {
782 if (empty(
$object->context[
'actionmsg2'])) {
788 if (empty(
$object->actionmsg)) {
793 } elseif ($action ==
'ORDER_SUPPLIER_APPROVE') {
795 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
797 if (empty(
$object->actionmsg2)) {
798 if (empty(
$object->context[
'actionmsg2'])) {
799 $object->actionmsg2 = $langs->transnoentities(
"OrderApprovedInDolibarr",
$object->ref);
804 if (empty(
$object->actionmsg)) {
805 $object->actionmsg = $langs->transnoentities(
"OrderApprovedInDolibarr",
$object->ref);
809 } elseif ($action ==
'ORDER_SUPPLIER_REFUSE') {
811 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
813 if (empty(
$object->actionmsg2)) {
814 if (empty(
$object->context[
'actionmsg2'])) {
815 $object->actionmsg2 = $langs->transnoentities(
"OrderRefusedInDolibarr",
$object->ref);
820 if (empty(
$object->actionmsg)) {
821 $object->actionmsg = $langs->transnoentities(
"OrderRefusedInDolibarr",
$object->ref);
824 if (!empty(
$object->refuse_note)) {
826 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->refuse_note;
830 } elseif ($action ==
'ORDER_SUPPLIER_CANCEL') {
832 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
834 if (empty(
$object->actionmsg2)) {
835 if (empty(
$object->context[
'actionmsg2'])) {
836 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr",
$object->ref);
841 if (empty(
$object->actionmsg)) {
842 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr",
$object->ref);
845 if (!empty(
$object->cancel_note)) {
847 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->cancel_note;
851 } elseif ($action ==
'ORDER_SUPPLIER_SUBMIT') {
853 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
855 if (empty(
$object->actionmsg2)) {
856 if (empty(
$object->context[
'actionmsg2'])) {
857 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", (
$object->newref ?:
$object->ref),
$object->getInputMethod());
862 if (empty(
$object->actionmsg)) {
866 if (!empty(
$object->context[
'comments'])) {
868 $object->actionmsg .= $langs->trans(
"Comment") .
': '.$object->context[
'comments'];
872 } elseif ($action ==
'ORDER_SUPPLIER_RECEIVE') {
874 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
876 if (empty(
$object->actionmsg2)) {
877 if (empty(
$object->context[
'actionmsg2'])) {
883 if (empty(
$object->actionmsg)) {
888 } elseif ($action ==
'ORDER_SUPPLIER_SENTBYMAIL') {
890 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
892 if (empty(
$object->actionmsg2)) {
893 if (empty(
$object->context[
'actionmsg2'])) {
894 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSentByEMail",
$object->ref);
899 if (empty(
$object->actionmsg)) {
900 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSentByEMail",
$object->ref);
905 } elseif ($action ==
'ORDER_SUPPLIER_CLASSIFY_BILLED') {
907 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
909 if (empty(
$object->actionmsg2)) {
910 if (empty(
$object->context[
'actionmsg2'])) {
911 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderClassifiedBilled",
$object->ref);
916 if (empty(
$object->actionmsg)) {
917 $object->actionmsg = $langs->transnoentities(
"SupplierOrderClassifiedBilled",
$object->ref);
921 } elseif ($action ==
'BILL_SUPPLIER_VALIDATE') {
923 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
925 if (empty(
$object->actionmsg2)) {
926 if (empty(
$object->context[
'actionmsg2'])) {
932 if (empty(
$object->actionmsg)) {
937 } elseif ($action ==
'BILL_SUPPLIER_UNVALIDATE') {
939 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
941 if (empty(
$object->actionmsg2)) {
942 if (empty(
$object->context[
'actionmsg2'])) {
943 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr",
$object->ref);
948 if (empty(
$object->actionmsg)) {
949 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr",
$object->ref);
953 } elseif ($action ==
'BILL_SUPPLIER_SENTBYMAIL') {
955 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
957 if (empty(
$object->actionmsg2)) {
958 if (empty(
$object->context[
'actionmsg2'])) {
959 $object->actionmsg2 = $langs->transnoentities(
"SupplierInvoiceSentByEMail",
$object->ref);
964 if (empty(
$object->actionmsg)) {
965 $object->actionmsg = $langs->transnoentities(
"SupplierInvoiceSentByEMail",
$object->ref);
970 } elseif ($action ==
'BILL_SUPPLIER_PAYED') {
972 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
974 if (empty(
$object->actionmsg2)) {
975 if (empty(
$object->context[
'actionmsg2'])) {
976 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr",
$object->ref);
981 if (empty(
$object->actionmsg)) {
982 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr",
$object->ref);
986 } elseif ($action ==
'BILL_SUPPLIER_CANCELED') {
988 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
990 if (empty(
$object->actionmsg2)) {
991 if (empty(
$object->context[
'actionmsg2'])) {
992 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr",
$object->ref);
997 if (empty(
$object->actionmsg)) {
998 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr",
$object->ref);
1002 } elseif ($action ==
'MEMBER_VALIDATE') {
1005 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1007 if (empty(
$object->actionmsg2)) {
1008 if (empty(
$object->context[
'actionmsg2'])) {
1009 $object->actionmsg2 = $langs->transnoentities(
"MemberValidatedInDolibarr",
$object->getFullName($langs));
1014 if (empty(
$object->actionmsg)) {
1015 $object->actionmsg = $langs->transnoentities(
"MemberValidatedInDolibarr",
$object->getFullName($langs));
1016 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.
$object->getFullName($langs);
1017 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->type;
1021 } elseif ($action ==
'MEMBER_MODIFY') {
1023 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1025 if (empty(
$object->actionmsg2)) {
1026 if (empty(
$object->context[
'actionmsg2'])) {
1027 $object->actionmsg2 = $langs->transnoentities(
"MemberModifiedInDolibarr",
$object->getFullName($langs));
1032 if (empty(
$object->actionmsg)) {
1033 $object->actionmsg = $langs->transnoentities(
"MemberModifiedInDolibarr",
$object->getFullName($langs));
1034 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.
$object->getFullName($langs);
1035 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->type;
1039 } elseif ($action ==
'MEMBER_SUBSCRIPTION_CREATE') {
1041 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1043 $member = (isset(
$object->context[
'member']) ?
$object->context[
'member'] :
null);
1044 if (!is_object($member)) {
1045 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
1046 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
1048 $member->fetch(
$object->fk_adherent);
1051 if (empty(
$object->actionmsg2)) {
1052 if (empty(
$object->context[
'actionmsg2'])) {
1053 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr",
$object->id, $member->getFullName($langs));
1058 if (empty(
$object->actionmsg)) {
1059 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr",
$object->id, $member->getFullName($langs));
1060 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
1061 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->fk_type;
1062 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.
$object->amount;
1070 } elseif ($action ==
'MEMBER_SUBSCRIPTION_MODIFY') {
1072 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1074 $member =
$object->context[
'member'];
1075 if (!is_object($member)) {
1076 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
1078 $member->fetch(
$object->fk_adherent);
1081 if (empty(
$object->actionmsg2)) {
1082 if (empty(
$object->context[
'actionmsg2'])) {
1083 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr",
$object->id, $member->getFullName($langs));
1088 if (empty(
$object->actionmsg)) {
1089 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr",
$object->id, $member->getFullName($langs));
1090 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
1091 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->fk_type;
1092 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.
$object->amount;
1100 } elseif ($action ==
'MEMBER_SUBSCRIPTION_DELETE') {
1102 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1104 $member =
$object->context[
'member'];
1105 if (!is_object($member)) {
1106 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
1107 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
1109 $member->fetch(
$object->fk_adherent);
1112 if (empty(
$object->actionmsg2)) {
1113 if (empty(
$object->context[
'actionmsg2'])) {
1114 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr",
$object->ref, $member->getFullName($langs));
1119 if (empty(
$object->actionmsg)) {
1120 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr",
$object->ref, $member->getFullName($langs));
1121 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
1122 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->fk_type;
1123 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.
$object->amount;
1131 } elseif ($action ==
'MEMBER_RESILIATE') {
1133 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1135 if (empty(
$object->actionmsg2)) {
1136 if (empty(
$object->context[
'actionmsg2'])) {
1137 $object->actionmsg2 = $langs->transnoentities(
"MemberResiliatedInDolibarr",
$object->getFullName($langs));
1142 if (empty(
$object->actionmsg)) {
1143 $object->actionmsg = $langs->transnoentities(
"MemberResiliatedInDolibarr",
$object->getFullName($langs));
1144 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.
$object->getFullName($langs);
1145 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->type;
1149 } elseif ($action ==
'MEMBER_DELETE') {
1151 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1153 if (empty(
$object->actionmsg2)) {
1154 if (empty(
$object->context[
'actionmsg2'])) {
1155 $object->actionmsg2 = $langs->transnoentities(
"MemberDeletedInDolibarr",
$object->getFullName($langs));
1160 if (empty(
$object->actionmsg)) {
1161 $object->actionmsg = $langs->transnoentities(
"MemberDeletedInDolibarr",
$object->getFullName($langs));
1162 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.
$object->getFullName($langs);
1163 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->type;
1167 } elseif ($action ==
'MEMBER_EXCLUDE') {
1169 $langs->loadLangs(array(
"agenda",
"other",
"members"));
1171 if (empty(
$object->actionmsg2)) {
1172 if (empty(
$object->context[
'actionmsg2'])) {
1173 $object->actionmsg2 = $langs->transnoentities(
"MemberExcludedInDolibarr",
$object->getFullName($langs));
1178 if (empty(
$object->actionmsg)) {
1179 $object->actionmsg = $langs->transnoentities(
"MemberExcludedInDolibarr",
$object->getFullName($langs));
1180 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.
$object->getFullName($langs);
1181 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.
$object->type;
1185 } elseif ($action ==
'PROJECT_CREATE') {
1188 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1190 if (empty(
$object->actionmsg2)) {
1191 if (empty(
$object->context[
'actionmsg2'])) {
1192 $object->actionmsg2 = $langs->transnoentities(
"ProjectCreatedInDolibarr",
$object->ref);
1197 if (empty(
$object->actionmsg)) {
1198 $object->actionmsg = $langs->transnoentities(
"ProjectCreatedInDolibarr",
$object->ref);
1199 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.
$object->ref;
1203 } elseif ($action ==
'PROJECT_VALIDATE') {
1205 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1207 if (empty(
$object->actionmsg2)) {
1208 if (empty(
$object->context[
'actionmsg2'])) {
1209 $object->actionmsg2 = $langs->transnoentities(
"ProjectValidatedInDolibarr",
$object->ref);
1214 if (empty(
$object->actionmsg)) {
1215 $object->actionmsg = $langs->transnoentities(
"ProjectValidatedInDolibarr",
$object->ref);
1216 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.
$object->ref;
1220 } elseif ($action ==
'PROJECT_MODIFY') {
1222 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1224 if (empty(
$object->actionmsg2)) {
1225 if (empty(
$object->context[
'actionmsg2'])) {
1226 $object->actionmsg2 = $langs->transnoentities(
"ProjectModifiedInDolibarr",
$object->ref);
1231 if (empty(
$object->actionmsg)) {
1232 $object->actionmsg = $langs->transnoentities(
"ProjectModifiedInDolibarr",
$object->ref);
1237 $object->actionmsg .=
"\n".$langs->transnoentitiesnoconv(
"OpportunityStatus").
': '.
$object->oldcopy->opp_status.
' -> '.
$object->opp_status;
1241 } elseif ($action ==
'PROJECT_SENTBYMAIL') {
1243 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1245 if (empty(
$object->actionmsg2)) {
1246 if (empty(
$object->context[
'actionmsg2'])) {
1247 $object->actionmsg2 = $langs->transnoentities(
"ProjectSentByEMail",
$object->ref);
1252 if (empty(
$object->actionmsg)) {
1253 $object->actionmsg = $langs->transnoentities(
"ProjectSentByEMail",
$object->ref);
1258 } elseif ($action ==
'PROJECT_DELETE') {
1260 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1262 if (empty(
$object->actionmsg2)) {
1263 $object->actionmsg2 = $langs->transnoentities(
"ProjectDeletedInDolibarr",
$object->ref);
1265 $object->actionmsg = $langs->transnoentities(
"ProjectDeletedInDolibarr",
$object->ref);
1268 } elseif ($action ==
'PROJECT_CLOSE') {
1270 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1272 if (empty(
$object->actionmsg2)) {
1273 if (empty(
$object->context[
'actionmsg2'])) {
1274 $object->actionmsg2 = $langs->transnoentities(
"ProjectClosedInDolibarr",
$object->ref);
1279 if (empty(
$object->actionmsg)) {
1280 $object->actionmsg = $langs->transnoentities(
"ProjectClosedInDolibarr",
$object->ref);
1284 } elseif ($action ==
'TASK_CREATE') {
1287 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1289 if (empty(
$object->actionmsg2)) {
1290 if (empty(
$object->context[
'actionmsg2'])) {
1291 $object->actionmsg2 = $langs->transnoentities(
"TaskCreatedInDolibarr",
$object->ref);
1296 if (empty(
$object->actionmsg)) {
1297 $object->actionmsg = $langs->transnoentities(
"TaskCreatedInDolibarr",
$object->ref);
1298 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.
$object->ref;
1302 } elseif ($action ==
'TASK_MODIFY') {
1304 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1306 if (empty(
$object->actionmsg2)) {
1307 if (empty(
$object->context[
'actionmsg2'])) {
1308 $object->actionmsg2 = $langs->transnoentities(
"TaskModifiedInDolibarr",
$object->ref);
1313 if (empty(
$object->actionmsg)) {
1314 $object->actionmsg = $langs->transnoentities(
"TaskModifieddInDolibarr",
$object->ref);
1315 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.
$object->ref;
1319 } elseif ($action ==
'TASK_DELETE') {
1321 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1323 if (empty(
$object->actionmsg2)) {
1324 if (empty(
$object->context[
'actionmsg2'])) {
1325 $object->actionmsg2 = $langs->transnoentities(
"TaskDeletedInDolibarr",
$object->ref);
1330 if (empty(
$object->actionmsg)) {
1331 $object->actionmsg = $langs->transnoentities(
"TaskDeletedInDolibarr",
$object->ref);
1332 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.
$object->ref;
1336 } elseif ($action ==
'TICKET_ASSIGNED') {
1338 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
1340 if (empty(
$object->actionmsg2)) {
1341 if (empty(
$object->context[
'actionmsg2'])) {
1342 $object->actionmsg2 = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr",
$object->ref);
1347 if (empty(
$object->actionmsg)) {
1348 $object->actionmsg = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr",
$object->ref);
1351 if (
$object->oldcopy->fk_user_assign > 0) {
1352 $tmpuser =
new User($this->db);
1353 $tmpuser->fetch(
$object->oldcopy->fk_user_assign);
1354 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$tmpuser->getFullName($langs);
1356 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$langs->trans(
"None");
1358 if (
$object->fk_user_assign > 0) {
1359 $tmpuser =
new User($this->db);
1360 $tmpuser->fetch(
$object->fk_user_assign);
1361 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$tmpuser->getFullName($langs);
1363 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$langs->trans(
"None");
1373 if (!empty(
$object->context[
'actionmsg']) && empty(
$object->actionmsg)) {
1376 if (!empty(
$object->context[
'actionmsg2']) && empty(
$object->actionmsg2)) {
1380 if (empty(
$object->actionmsg2)) {
1382 $langs->loadLangs(array(
"agenda",
"other"));
1383 if ($langs->transnoentities($action.
"InDolibarr", (empty(
$object->newref) ?
$object->ref :
$object->newref)) != $action.
"InDolibarr") {
1386 $tmp = explode(
'_', $action);
1387 $object->actionmsg2 = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty(
$object->newref) ?
$object->ref :
$object->newref));
1390 if (empty(
$object->actionmsg)) {
1392 $langs->loadLangs(array(
"agenda",
"other"));
1393 if ($langs->transnoentities($action.
"InDolibarr", (empty(
$object->newref) ?
$object->ref :
$object->newref)) != $action.
"InDolibarr") {
1396 $tmp = explode(
'_', $action);
1397 $object->actionmsg = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty(
$object->newref) ?
$object->ref :
$object->newref));
1399 if (isModEnabled(
'multicompany') && property_exists(
$object,
'entity') &&
$object->entity > 1) {
1400 $object->actionmsg .=
' ('.$langs->trans(
"Entity").
' '.
$object->entity.
')';
1411 if (empty(
$object->trackid)) {
1413 if (preg_match(
'/^COMPANY_/', $action)) {
1414 $object->trackid =
'thi'.$object->id;
1415 } elseif (preg_match(
'/^CONTACT_/', $action)) {
1416 $object->trackid =
'ctc'.$object->id;
1417 } elseif (preg_match(
'/^CONTRACT_/', $action)) {
1418 $object->trackid =
'con'.$object->id;
1419 } elseif (preg_match(
'/^PROPAL_/', $action)) {
1420 $object->trackid =
'pro'.$object->id;
1421 } elseif (preg_match(
'/^ORDER_/', $action)) {
1422 $object->trackid =
'ord'.$object->id;
1423 } elseif (preg_match(
'/^BILL_/', $action)) {
1424 $object->trackid =
'inv'.$object->id;
1425 } elseif (preg_match(
'/^FICHINTER_/', $action)) {
1426 $object->trackid =
'int'.$object->id;
1427 } elseif (preg_match(
'/^SHIPPING_/', $action)) {
1428 $object->trackid =
'shi'.$object->id;
1429 } elseif (preg_match(
'/^RECEPTION_/', $action)) {
1430 $object->trackid =
'rec'.$object->id;
1431 } elseif (preg_match(
'/^PROPOSAL_SUPPLIER/', $action)) {
1432 $object->trackid =
'spr'.$object->id;
1433 } elseif (preg_match(
'/^ORDER_SUPPLIER_/', $action)) {
1434 $object->trackid =
'sor'.$object->id;
1435 } elseif (preg_match(
'/^BILL_SUPPLIER_/', $action)) {
1436 $object->trackid =
'sin'.$object->id;
1437 } elseif (preg_match(
'/^MEMBER_SUBSCRIPTION_/', $action)) {
1438 $object->trackid =
'sub'.$object->id;
1439 } elseif (preg_match(
'/^MEMBER_/', $action)) {
1440 $object->trackid =
'mem'.$object->id;
1441 } elseif (preg_match(
'/^PARTNERSHIP_/', $action)) {
1442 $object->trackid =
'pship'.$object->id;
1443 } elseif (preg_match(
'/^PROJECT_/', $action)) {
1444 $object->trackid =
'proj'.$object->id;
1445 } elseif (preg_match(
'/^TASK_/', $action)) {
1446 $object->trackid =
'tas'.$object->id;
1447 } elseif (preg_match(
'/^TICKET_/', $action)) {
1448 $object->trackid =
'tic'.$object->id;
1449 } elseif (preg_match(
'/^USER_/', $action)) {
1450 $object->trackid =
'use'.$object->id;
1456 dol_syslog(
"Trigger '".$this->
name.
"' for action '".$action.
"' launched by ".__FILE__.
". id=".
$object->id);
1461 if (isset($_SESSION[
'listofnames-'.
$object->trackid])) {
1462 $attachments = $_SESSION[
'listofnames-'.$object->trackid];
1463 if ($attachments && strpos($action,
'SENTBYMAIL')) {
1468 $societeforactionid = 0;
1469 $contactforactionid = 0;
1472 if (is_array(
$object->sendtoid)) {
1473 if (count(
$object->sendtoid) == 1) {
1474 $contactforactionid = reset(
$object->sendtoid);
1478 $contactforactionid =
$object->sendtoid;
1483 $societeforactionid =
$object->socid;
1485 $societeforactionid =
$object->fk_soc;
1486 } elseif (isset(
$object->thirdparty) && isset(
$object->thirdparty->id) &&
$object->thirdparty->id > 0) {
1487 $societeforactionid =
$object->thirdparty->id;
1490 $projectid = isset(
$object->fk_project) ?
$object->fk_project : 0;
1491 if (
$object->element ==
'project') {
1496 $elementtype =
$object->element;
1497 $elementmodule = (empty(
$object->module) ?
'' :
$object->module);
1498 if (
$object->element ==
'subscription') {
1499 $elementid =
$object->fk_adherent;
1500 $elementtype =
'member';
1505 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1507 $actioncomm->type_code =
$object->actiontypecode;
1508 $actioncomm->code =
'AC_'.$action;
1509 $actioncomm->label =
$object->actionmsg2;
1510 $actioncomm->note_private =
$object->actionmsg;
1511 $actioncomm->fk_project = $projectid;
1512 $actioncomm->datep = $now;
1513 $actioncomm->datef = $now;
1514 $actioncomm->durationp = 0;
1515 $actioncomm->percentage = -1;
1516 $actioncomm->socid = $societeforactionid;
1517 $actioncomm->contact_id = $contactforactionid;
1518 $actioncomm->authorid = $user->id;
1519 $actioncomm->userownerid = $user->id;
1521 if (!property_exists(
$object,
'email_fields_no_propagate_in_actioncomm') || empty(
$object->email_fields_no_propagate_in_actioncomm)) {
1522 $actioncomm->email_msgid = empty(
$object->email_msgid) ? null :
$object->email_msgid;
1523 $actioncomm->email_from = empty(
$object->email_from) ? null :
$object->email_from;
1524 $actioncomm->email_sender = empty(
$object->email_sender) ? null :
$object->email_sender;
1525 $actioncomm->email_to = empty(
$object->email_to) ? null :
$object->email_to;
1526 $actioncomm->email_tocc = empty(
$object->email_tocc) ? null :
$object->email_tocc;
1527 $actioncomm->email_tobcc = empty(
$object->email_tobcc) ? null :
$object->email_tobcc;
1528 $actioncomm->email_subject = empty(
$object->email_subject) ? null :
$object->email_subject;
1529 $actioncomm->errors_to = empty(
$object->errors_to) ? null :
$object->errors_to;
1534 if (!in_array($elementtype, array(
'societe',
'contact',
'project'))) {
1535 $actioncomm->fk_element = $elementid;
1536 $actioncomm->elementtype = $elementtype.($elementmodule ?
'@'.$elementmodule :
'');
1539 if (property_exists(
$object,
'attachedfiles') && is_array(
$object->attachedfiles) && count(
$object->attachedfiles) > 0) {
1540 $actioncomm->attachedfiles =
$object->attachedfiles;
1542 if (property_exists(
$object,
'sendtouserid') && is_array(
$object->sendtouserid) && count(
$object->sendtouserid) > 0) {
1543 $actioncomm->userassigned =
$object->sendtouserid;
1545 if (property_exists(
$object,
'sendtoid') && is_array(
$object->sendtoid) && count(
$object->sendtoid) > 0) {
1546 foreach (
$object->sendtoid as $val) {
1547 $actioncomm->socpeopleassigned[$val] = $val;
1551 $ret = $actioncomm->create($user);
1554 if (property_exists(
$object,
'attachedfiles') && is_array(
$object->attachedfiles) && array_key_exists(
'paths',
$object->attachedfiles) && count(
$object->attachedfiles[
'paths']) > 0) {
1557 $destdir = $tmpelems[
'dir_output'].
'/'.$ret;
1559 foreach (
$object->attachedfiles[
'paths'] as $key => $filespath) {
1560 $srcfile = $filespath;
1561 $destfile = $destdir.
'/'.
$object->attachedfiles[
'names'][$key];
1563 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1571 unset(
$object->context[
'actionmsg']);
1572 unset(
$object->context[
'actionmsg2']);
1575 unset(
$object->actiontypecode);
1578 $_SESSION[
'LAST_ACTION_CREATED'] = $ret;
1581 $this->error =
"Failed to insert event : ".$actioncomm->error.
" ".implode(
',', $actioncomm->errors);
1582 $this->errors = $actioncomm->errors;
1584 dol_syslog(
"interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);