29 require_once DOL_DOCUMENT_ROOT.
'/core/triggers/dolibarrtriggers.class.php';
46 $this->
name = preg_replace(
'/^Interface/i',
'', get_class($this));
47 $this->family =
"agenda";
48 $this->
description =
"Triggers of this module add actions in agenda according to setup made in agenda setup.";
50 $this->version = self::VERSION_DOLIBARR;
51 $this->picto =
'action';
78 if (empty($conf->agenda) || empty($conf->agenda->enabled)) {
83 if (preg_match(
'/^ACTION_/', $action)) {
87 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$action;
92 if (empty($conf->global->$key)) {
96 $langs->load(
"agenda");
98 if (empty($object->actiontypecode)) {
99 $object->actiontypecode =
'AC_OTH_AUTO';
103 if ($action ==
'COMPANY_CREATE') {
105 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
107 if (empty($object->actionmsg2)) {
108 $object->actionmsg2 = $langs->transnoentities(
"NewCompanyToDolibarr", $object->name);
110 $object->actionmsg = $langs->transnoentities(
"NewCompanyToDolibarr", $object->name);
112 $object->sendtoid = 0;
113 $object->socid = $object->id;
114 } elseif ($action ==
'COMPANY_MODIFY') {
116 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
118 if (empty($object->actionmsg2)) {
119 $object->actionmsg2 = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr", $object->name);
121 $object->actionmsg = $langs->transnoentities(
"COMPANY_MODIFYInDolibarr", $object->name);
123 $object->sendtoid = 0;
124 $object->socid = $object->id;
125 } elseif ($action ==
'COMPANY_SENTBYMAIL') {
127 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
129 if (empty($object->actionmsg2)) {
130 dol_syslog(
'Trigger called with property actionmsg2 on object not defined', LOG_ERR);
135 } elseif ($action ==
'CONTACT_CREATE') {
137 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
139 if (empty($object->actionmsg2)) {
140 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
142 $object->actionmsg = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
144 $object->sendtoid = array($object->id => $object->id);
145 $object->socid = $object->socid;
146 } elseif ($action ==
'CONTACT_MODIFY') {
148 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
150 if (empty($object->actionmsg2)) {
151 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
153 $object->actionmsg = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
155 $object->sendtoid = array($object->id => $object->id);
156 $object->socid = $object->socid;
157 } elseif ($action ==
'CONTRACT_VALIDATE') {
159 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
161 if (empty($object->actionmsg2)) {
162 $object->actionmsg2 = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
164 $object->actionmsg = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
166 $object->sendtoid = 0;
167 } elseif ($action ==
'CONTRACT_SENTBYMAIL') {
169 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
171 if (empty($object->actionmsg2)) {
172 $object->actionmsg2 = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
174 if (empty($object->actionmsg)) {
175 $object->actionmsg = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
180 } elseif ($action ==
'PROPAL_VALIDATE') {
182 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
184 if (empty($object->actionmsg2)) {
185 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
187 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
189 $object->sendtoid = 0;
190 } elseif ($action ==
'PROPAL_MODIFY') {
192 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
194 if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
195 $object->actionmsg = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
197 $object->sendtoid = 0;
198 } elseif ($action ==
'PROPAL_SENTBYMAIL') {
200 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
202 if (empty($object->actionmsg2)) {
203 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
205 if (empty($object->actionmsg)) {
206 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
211 } elseif ($action ==
'PROPAL_CLOSE_SIGNED') {
213 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
215 if (empty($object->actionmsg2)) {
216 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
218 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
220 $object->sendtoid = 0;
221 } elseif ($action ==
'PROPAL_CLASSIFY_BILLED') {
223 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
225 if (empty($object->actionmsg2)) {
226 $object->actionmsg2 = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
228 $object->actionmsg = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
230 $object->sendtoid = 0;
231 } elseif ($action ==
'PROPAL_CLOSE_REFUSED') {
233 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
235 if (empty($object->actionmsg2)) {
236 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
238 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
240 $object->sendtoid = 0;
241 } elseif ($action ==
'ORDER_VALIDATE') {
243 $langs->loadLangs(array(
"agenda",
"orders"));
245 if (empty($object->actionmsg2)) {
246 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
248 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
250 $object->sendtoid = 0;
251 } elseif ($action ==
'ORDER_CLOSE') {
253 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
255 if (empty($object->actionmsg2)) {
256 $object->actionmsg2 = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
258 $object->actionmsg = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
260 $object->sendtoid = 0;
261 } elseif ($action ==
'ORDER_CLASSIFY_BILLED') {
263 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
265 if (empty($object->actionmsg2)) {
266 $object->actionmsg2 = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
268 $object->actionmsg = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
270 $object->sendtoid = 0;
271 } elseif ($action ==
'ORDER_CANCEL') {
273 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
275 if (empty($object->actionmsg2)) {
276 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
278 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
280 $object->sendtoid = 0;
281 } elseif ($action ==
'ORDER_SENTBYMAIL') {
283 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
285 if (empty($object->actionmsg2)) {
286 $object->actionmsg2 = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
288 if (empty($object->actionmsg)) {
289 $object->actionmsg = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
294 } elseif ($action ==
'BILL_VALIDATE') {
296 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
298 if (empty($object->actionmsg2)) {
299 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
301 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
303 $object->sendtoid = 0;
304 } elseif ($action ==
'BILL_UNVALIDATE') {
306 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
308 if (empty($object->actionmsg2)) {
309 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
311 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
313 $object->sendtoid = 0;
314 } elseif ($action ==
'BILL_SENTBYMAIL') {
316 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
318 if (empty($object->actionmsg2)) {
319 $object->actionmsg2 = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
321 if (empty($object->actionmsg)) {
322 $object->actionmsg = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
327 } elseif ($action ==
'BILL_PAYED') {
329 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
332 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
333 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
335 $object->sendtoid = 0;
336 } elseif ($action ==
'BILL_CANCEL') {
338 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
340 if (empty($object->actionmsg2)) {
341 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
343 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
345 $object->sendtoid = 0;
346 } elseif ($action ==
'FICHINTER_CREATE') {
348 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
350 if (empty($object->actionmsg2)) {
351 $object->actionmsg2 = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
353 $object->actionmsg = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
355 $object->sendtoid = 0;
356 $object->fk_element = 0;
357 $object->elementtype =
'';
358 } elseif ($action ==
'FICHINTER_VALIDATE') {
360 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
362 if (empty($object->actionmsg2)) {
363 $object->actionmsg2 = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
365 $object->actionmsg = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
367 $object->sendtoid = 0;
368 $object->fk_element = 0;
369 $object->elementtype =
'';
370 } elseif ($action ==
'FICHINTER_MODIFY') {
372 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
374 if (empty($object->actionmsg2)) {
375 $object->actionmsg2 = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
377 $object->actionmsg = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
379 $object->sendtoid = 0;
380 $object->fk_element = 0;
381 $object->elementtype =
'';
382 } elseif ($action ==
'FICHINTER_SENTBYMAIL') {
384 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
386 if (empty($object->actionmsg2)) {
387 $object->actionmsg2 = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
389 if (empty($object->actionmsg)) {
390 $object->actionmsg = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
395 } elseif ($action ==
'FICHINTER_CLASSIFY_BILLED') {
397 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
399 if (empty($object->actionmsg2)) {
400 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
402 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
404 $object->sendtoid = 0;
405 } elseif ($action ==
'FICHINTER_CLASSIFY_UNBILLED') {
407 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
409 if (empty($object->actionmsg2)) {
410 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
412 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
414 $object->sendtoid = 0;
415 } elseif ($action ==
'FICHINTER_DELETE') {
417 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
419 if (empty($object->actionmsg2)) {
420 $object->actionmsg2 = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
422 $object->actionmsg = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
424 $object->sendtoid = 0;
425 $object->fk_element = 0;
426 $object->elementtype =
'';
427 } elseif ($action ==
'SHIPPING_VALIDATE') {
429 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
431 if (empty($object->actionmsg2)) {
432 $object->actionmsg2 = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
434 if (empty($object->actionmsg)) {
435 $object->actionmsg = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
440 } elseif ($action ==
'SHIPPING_SENTBYMAIL') {
442 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
444 if (empty($object->actionmsg2)) {
445 $object->actionmsg2 = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
447 if (empty($object->actionmsg)) {
448 $object->actionmsg = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
453 } elseif ($action ==
'RECEPTION_VALIDATE') {
454 $langs->load(
"agenda");
455 $langs->load(
"other");
456 $langs->load(
"receptions");
458 if (empty($object->actionmsg2)) {
459 $object->actionmsg2 = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
461 if (empty($object->actionmsg)) {
462 $object->actionmsg = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
467 } elseif ($action ==
'RECEPTION_SENTBYMAIL') {
468 $langs->load(
"agenda");
469 $langs->load(
"other");
470 $langs->load(
"receptions");
472 if (empty($object->actionmsg2)) {
473 $object->actionmsg2 = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
475 if (empty($object->actionmsg)) {
476 $object->actionmsg = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
481 } elseif ($action ==
'PROPOSAL_SUPPLIER_VALIDATE') {
483 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
485 if (empty($object->actionmsg2)) {
486 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
488 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
490 $object->sendtoid = 0;
491 } elseif ($action ==
'PROPOSAL_SUPPLIER_SENTBYMAIL') {
493 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
495 if (empty($object->actionmsg2)) {
496 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
498 if (empty($object->actionmsg)) {
499 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
504 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
506 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
508 if (empty($object->actionmsg2)) {
509 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
511 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
513 $object->sendtoid = 0;
514 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
516 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
518 if (empty($object->actionmsg2)) {
519 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
521 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
523 $object->sendtoid = 0;
524 } elseif ($action ==
'ORDER_SUPPLIER_CREATE') {
526 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
528 if (empty($object->actionmsg2)) {
529 $object->actionmsg2 = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
531 $object->actionmsg = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
533 $object->sendtoid = 0;
534 } elseif ($action ==
'ORDER_SUPPLIER_VALIDATE') {
536 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
538 if (empty($object->actionmsg2)) {
539 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
541 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
543 $object->sendtoid = 0;
544 } elseif ($action ==
'ORDER_SUPPLIER_APPROVE') {
546 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
548 if (empty($object->actionmsg2)) {
549 $object->actionmsg2 = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
551 $object->actionmsg = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
553 $object->sendtoid = 0;
554 } elseif ($action ==
'ORDER_SUPPLIER_REFUSE') {
556 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
558 if (empty($object->actionmsg2)) {
559 $object->actionmsg2 = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
561 $object->actionmsg = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
563 if (!empty($object->refuse_note)) {
564 $object->actionmsg .=
'<br>';
565 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->refuse_note;
568 $object->sendtoid = 0;
569 } elseif ($action ==
'ORDER_SUPPLIER_CANCEL') {
571 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
573 if (empty($object->actionmsg2)) {
574 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
576 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
578 if (!empty($object->cancel_note)) {
579 $object->actionmsg .=
'<br>';
580 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->cancel_note;
583 $object->sendtoid = 0;
584 } elseif ($action ==
'ORDER_SUPPLIER_SUBMIT') {
586 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
588 if (empty($object->actionmsg2)) {
589 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
591 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
593 if (!empty($object->context[
'comments'])) {
594 $object->actionmsg .=
'<br>';
595 $object->actionmsg .= $langs->trans(
"Comment") .
': '.$object->context[
'comments'];
598 $object->sendtoid = 0;
599 } elseif ($action ==
'ORDER_SUPPLIER_RECEIVE') {
601 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
603 if (empty($object->actionmsg2)) {
604 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
606 $object->actionmsg = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
608 $object->sendtoid = 0;
609 } elseif ($action ==
'ORDER_SUPPLIER_SENTBYMAIL') {
611 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
613 if (empty($object->actionmsg2)) {
614 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
616 if (empty($object->actionmsg)) {
617 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
622 } elseif ($action ==
'ORDER_SUPPLIER_CLASSIFY_BILLED') {
624 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
626 if (empty($object->actionmsg2)) {
627 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
629 if (empty($object->actionmsg)) {
630 $object->actionmsg = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
633 $object->sendtoid = 0;
634 } elseif ($action ==
'BILL_SUPPLIER_VALIDATE') {
636 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
638 if (empty($object->actionmsg2)) {
639 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
641 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
643 $object->sendtoid = 0;
644 } elseif ($action ==
'BILL_SUPPLIER_UNVALIDATE') {
646 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
648 if (empty($object->actionmsg2)) {
649 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
651 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
653 $object->sendtoid = 0;
654 } elseif ($action ==
'BILL_SUPPLIER_SENTBYMAIL') {
656 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
658 if (empty($object->actionmsg2)) {
659 $object->actionmsg2 = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
661 if (empty($object->actionmsg)) {
662 $object->actionmsg = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
667 } elseif ($action ==
'BILL_SUPPLIER_PAYED') {
669 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
671 if (empty($object->actionmsg2)) {
672 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
674 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
676 $object->sendtoid = 0;
677 } elseif ($action ==
'BILL_SUPPLIER_CANCELED') {
679 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
681 if (empty($object->actionmsg2)) {
682 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
684 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
686 $object->sendtoid = 0;
687 } elseif ($action ==
'MEMBER_VALIDATE') {
690 $langs->loadLangs(array(
"agenda",
"other",
"members"));
692 if (empty($object->actionmsg2)) {
693 $object->actionmsg2 = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
695 $object->actionmsg = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
696 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
697 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
699 $object->sendtoid = 0;
700 } elseif ($action ==
'MEMBER_MODIFY') {
702 $langs->loadLangs(array(
"agenda",
"other",
"members"));
704 if (empty($object->actionmsg2)) {
705 $object->actionmsg2 = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
707 $object->actionmsg = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
708 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
709 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
711 $object->sendtoid = 0;
712 } elseif ($action ==
'MEMBER_SUBSCRIPTION_CREATE') {
714 $langs->loadLangs(array(
"agenda",
"other",
"members"));
716 $member = (isset($this->context[
'member']) ? $this->context[
'member'] :
null);
717 if (!is_object($member)) {
718 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
719 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
721 $member->fetch($object->fk_adherent);
724 if (empty($object->actionmsg2)) {
725 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
727 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
728 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
729 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
730 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
731 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
733 $object->sendtoid = 0;
734 if (isset($object->fk_soc) && $object->fk_soc > 0) {
735 $object->socid = $object->fk_soc;
737 } elseif ($action ==
'MEMBER_SUBSCRIPTION_MODIFY') {
739 $langs->loadLangs(array(
"agenda",
"other",
"members"));
741 $member = $this->context[
'member'];
742 if (!is_object($member)) {
743 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
745 $member->fetch($object->fk_adherent);
748 if (empty($object->actionmsg2)) {
749 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
751 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
752 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
753 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
754 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
755 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
757 $object->sendtoid = 0;
758 if ($object->fk_soc > 0) {
759 $object->socid = $object->fk_soc;
761 } elseif ($action ==
'MEMBER_SUBSCRIPTION_DELETE') {
763 $langs->loadLangs(array(
"agenda",
"other",
"members"));
765 $member = $this->context[
'member'];
766 if (!is_object($member)) {
767 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
768 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
770 $member->fetch($object->fk_adherent);
773 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs));
774 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
775 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
776 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
777 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
778 if (empty($object->actionmsg2)) {
779 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs));
782 $object->sendtoid = 0;
783 if (isset($object->fk_soc) && $object->fk_soc > 0) {
784 $object->socid = $object->fk_soc;
786 } elseif ($action ==
'MEMBER_RESILIATE') {
788 $langs->loadLangs(array(
"agenda",
"other",
"members"));
790 if (empty($object->actionmsg2)) {
791 $object->actionmsg2 = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
793 $object->actionmsg = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
794 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
795 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
797 $object->sendtoid = 0;
798 } elseif ($action ==
'MEMBER_DELETE') {
800 $langs->loadLangs(array(
"agenda",
"other",
"members"));
802 if (empty($object->actionmsg2)) {
803 $object->actionmsg2 = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
805 $object->actionmsg = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
806 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
807 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
809 $object->sendtoid = 0;
810 } elseif ($action ==
'MEMBER_EXCLUDE') {
812 $langs->loadLangs(array(
"agenda",
"other",
"members"));
814 if (empty($object->actionmsg2)) {
815 $object->actionmsg2 = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
817 $object->actionmsg = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
818 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
819 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
821 $object->sendtoid = 0;
822 } elseif ($action ==
'PROJECT_CREATE') {
825 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
827 if (empty($object->actionmsg2)) {
828 $object->actionmsg2 = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
830 $object->actionmsg = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
831 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
833 $object->sendtoid = 0;
834 } elseif ($action ==
'PROJECT_VALIDATE') {
836 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
838 if (empty($object->actionmsg2)) {
839 $object->actionmsg2 = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
841 $object->actionmsg = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
842 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
844 $object->sendtoid = 0;
845 } elseif ($action ==
'PROJECT_MODIFY') {
847 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
849 if (empty($object->actionmsg2)) {
850 $object->actionmsg2 = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
852 $object->actionmsg = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
854 if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) {
855 $object->actionmsg .=
"\n".$langs->transnoentitiesnoconv(
"OpportunityStatus").
': '.$object->oldcopy->opp_status.
' -> '.$object->opp_status;
858 $object->sendtoid = 0;
859 } elseif ($action ==
'PROJECT_SENTBYMAIL') {
861 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
863 if (empty($object->actionmsg2)) {
864 $object->actionmsg2 = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
866 if (empty($object->actionmsg)) {
867 $object->actionmsg = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
872 } elseif ($action ==
'TASK_CREATE') {
875 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
877 if (empty($object->actionmsg2)) {
878 $object->actionmsg2 = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
880 $object->actionmsg = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
881 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
883 $object->sendtoid = 0;
884 } elseif ($action ==
'TASK_MODIFY') {
886 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
888 if (empty($object->actionmsg2)) {
889 $object->actionmsg2 = $langs->transnoentities(
"TaskModifiedInDolibarr", $object->ref);
891 $object->actionmsg = $langs->transnoentities(
"TaskModifieddInDolibarr", $object->ref);
892 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
894 $object->sendtoid = 0;
895 } elseif ($action ==
'TASK_DELETE') {
897 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
899 if (empty($object->actionmsg2)) {
900 $object->actionmsg2 = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
902 $object->actionmsg = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
903 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
905 $object->sendtoid = 0;
906 } elseif ($action ==
'TICKET_ASSIGNED') {
908 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
910 if (empty($object->actionmsg2)) {
911 $object->actionmsg2 = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
913 $object->actionmsg = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
914 if ($object->oldcopy->fk_user_assign > 0) {
915 $tmpuser =
new User($this->
db);
916 $tmpuser->fetch($object->oldcopy->fk_user_assign);
917 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$tmpuser->getFullName($langs);
919 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$langs->trans(
"None");
921 if ($object->fk_user_assign > 0) {
922 $tmpuser =
new User($this->
db);
923 $tmpuser->fetch($object->fk_user_assign);
924 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$tmpuser->getFullName($langs);
926 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$langs->trans(
"None");
928 $object->sendtoid = 0;
936 if (empty($object->actionmsg2)) {
937 $langs->loadLangs(array(
"agenda",
"other"));
938 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
939 $object->actionmsg2 = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
941 $tmp = explode(
'_', $action);
942 $object->actionmsg2 = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
945 if (empty($object->actionmsg)) {
946 $langs->loadLangs(array(
"agenda",
"other"));
947 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
948 $object->actionmsg = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
950 $tmp = explode(
'_', $action);
951 $object->actionmsg = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
955 if (!isset($object->sendtoid) || !is_array($object->sendtoid)) {
956 $object->sendtoid = 0;
962 if (empty($object->trackid)) {
964 if (preg_match(
'/^COMPANY_/', $action)) {
965 $object->trackid =
'thi'.$object->id;
966 } elseif (preg_match(
'/^CONTACT_/', $action)) {
967 $object->trackid =
'ctc'.$object->id;
968 } elseif (preg_match(
'/^CONTRACT_/', $action)) {
969 $object->trackid =
'con'.$object->id;
970 } elseif (preg_match(
'/^PROPAL_/', $action)) {
971 $object->trackid =
'pro'.$object->id;
972 } elseif (preg_match(
'/^ORDER_/', $action)) {
973 $object->trackid =
'ord'.$object->id;
974 } elseif (preg_match(
'/^BILL_/', $action)) {
975 $object->trackid =
'inv'.$object->id;
976 } elseif (preg_match(
'/^FICHINTER_/', $action)) {
977 $object->trackid =
'int'.$object->id;
978 } elseif (preg_match(
'/^SHIPPING_/', $action)) {
979 $object->trackid =
'shi'.$object->id;
980 } elseif (preg_match(
'/^RECEPTION_/', $action)) {
981 $object->trackid =
'rec'.$object->id;
982 } elseif (preg_match(
'/^PROPOSAL_SUPPLIER/', $action)) {
983 $object->trackid =
'spr'.$object->id;
984 } elseif (preg_match(
'/^ORDER_SUPPLIER_/', $action)) {
985 $object->trackid =
'sor'.$object->id;
986 } elseif (preg_match(
'/^BILL_SUPPLIER_/', $action)) {
987 $object->trackid =
'sin'.$object->id;
988 } elseif (preg_match(
'/^MEMBER_SUBSCRIPTION_/', $action)) {
989 $object->trackid =
'sub'.$object->id;
990 } elseif (preg_match(
'/^MEMBER_/', $action)) {
991 $object->trackid =
'mem'.$object->id;
992 } elseif (preg_match(
'/^PARTNERSHIP_/', $action)) {
993 $object->trackid =
'pship'.$object->id;
994 } elseif (preg_match(
'/^PROJECT_/', $action)) {
995 $object->trackid =
'proj'.$object->id;
996 } elseif (preg_match(
'/^TASK_/', $action)) {
997 $object->trackid =
'tas'.$object->id;
998 } elseif (preg_match(
'/^TICKET_/', $action)) {
999 $object->trackid =
'tic'.$object->id;
1000 } elseif (preg_match(
'/^USER_/', $action)) {
1001 $object->trackid =
'use'.$object->id;
1003 $object->trackid =
'';
1015 dol_syslog(
"Trigger '".$this->
name.
"' for action '".$action.
"' launched by ".__FILE__.
". id=".$object->id);
1020 if (isset($_SESSION[
'listofnames-'.$object->trackid])) {
1021 $attachs = $_SESSION[
'listofnames-'.$object->trackid];
1022 if ($attachs && strpos($action,
'SENTBYMAIL')) {
1023 $object->actionmsg =
dol_concatdesc($object->actionmsg,
"\n".$langs->transnoentities(
"AttachedFiles").
': '.$attachs);
1026 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
1027 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
1028 $contactforaction =
new Contact($this->
db);
1029 $societeforaction =
new Societe($this->
db);
1032 if (is_array($object->sendtoid)) {
1033 if (count($object->sendtoid) == 1) {
1034 $contactforaction->fetch(reset($object->sendtoid));
1037 if ($object->sendtoid > 0) {
1038 $contactforaction->fetch($object->sendtoid);
1042 if (isset($object->socid) && $object->socid > 0) {
1043 $societeforaction->fetch($object->socid);
1044 } elseif (isset($object->fk_soc) && $object->fk_soc > 0) {
1045 $societeforaction->fetch($object->fk_soc);
1046 } elseif (isset($object->thirdparty) && isset($object->thirdparty->id) && $object->thirdparty->id > 0) {
1047 $societeforaction = $object->thirdparty;
1050 $projectid = isset($object->fk_project) ? $object->fk_project : 0;
1051 if ($object->element ==
'project') {
1052 $projectid = $object->id;
1055 $elementid = $object->id;
1056 $elementtype = $object->element;
1057 $elementmodule = (empty($object->module) ?
'' : $object->module);
1058 if ($object->element ==
'subscription') {
1059 $elementid = $object->fk_adherent;
1060 $elementtype =
'member';
1065 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1067 $actioncomm->type_code = $object->actiontypecode;
1068 $actioncomm->code =
'AC_'.$action;
1069 $actioncomm->label = $object->actionmsg2;
1070 $actioncomm->note_private = $object->actionmsg;
1071 $actioncomm->fk_project = $projectid;
1072 $actioncomm->datep = $now;
1073 $actioncomm->datef = $now;
1074 $actioncomm->durationp = 0;
1075 $actioncomm->percentage = -1;
1076 $actioncomm->socid = $societeforaction->id;
1077 $actioncomm->contact_id = $contactforaction->id;
1078 $actioncomm->authorid = $user->id;
1079 $actioncomm->userownerid = $user->id;
1081 if (!property_exists($object,
'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
1082 $actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
1083 $actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
1084 $actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
1085 $actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
1086 $actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
1087 $actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
1088 $actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
1089 $actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
1094 if (!in_array($elementtype, array(
'societe',
'contact',
'project'))) {
1095 $actioncomm->fk_element = $elementid;
1096 $actioncomm->elementtype = $elementtype.($elementmodule ?
'@'.$elementmodule :
'');
1099 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
1100 $actioncomm->attachedfiles = $object->attachedfiles;
1102 if (property_exists($object,
'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
1103 $actioncomm->userassigned = $object->sendtouserid;
1105 if (property_exists($object,
'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
1106 foreach ($object->sendtoid as $val) {
1107 $actioncomm->socpeopleassigned[$val] = $val;
1111 $ret = $actioncomm->create($user);
1113 if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) {
1114 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && array_key_exists(
'paths', $object->attachedfiles) && count($object->attachedfiles[
'paths']) > 0) {
1115 foreach ($object->attachedfiles[
'paths'] as $key => $filespath) {
1116 $srcfile = $filespath;
1117 $destdir = $conf->agenda->dir_output.
'/'.$ret;
1118 $destfile = $destdir.
'/'.$object->attachedfiles[
'names'][$key];
1120 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1127 unset($object->actionmsg);
1128 unset($object->actionmsg2);
1129 unset($object->actiontypecode);
1132 $_SESSION[
'LAST_ACTION_CREATED'] = $ret;
1135 $this->error =
"Failed to insert event : ".$actioncomm->error.
" ".join(
',', $actioncomm->errors);
1136 $this->errors = $actioncomm->errors;
1138 dol_syslog(
"interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
Class to manage agenda events (actions)
Class to manage members of a foundation.
Class to stock current configuration.
Class that all the triggers must extend.
Class of triggered functions for agenda module.
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarrr business event is done.
__construct($db)
Constructor.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
Class to manage Dolibarr users.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.