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';
79 if (empty($conf->agenda) || empty($conf->agenda->enabled)) {
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 $object->sendtoid = 0;
125 $object->socid = $object->id;
126 } elseif ($action ==
'COMPANY_SENTBYMAIL') {
128 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
130 if (empty($object->actionmsg2)) {
131 dol_syslog(
'Trigger called with property actionmsg2 on object not defined', LOG_ERR);
136 } elseif ($action ==
'CONTACT_CREATE') {
138 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
140 if (empty($object->actionmsg2)) {
141 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
143 $object->actionmsg = $langs->transnoentities(
"CONTACT_CREATEInDolibarr", $object->getFullName($langs));
145 $object->sendtoid = array($object->id => $object->id);
146 $object->socid = $object->socid;
147 } elseif ($action ==
'CONTACT_MODIFY') {
149 $langs->loadLangs(array(
"agenda",
"other",
"companies"));
151 if (empty($object->actionmsg2)) {
152 $object->actionmsg2 = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
154 $object->actionmsg = $langs->transnoentities(
"CONTACT_MODIFYInDolibarr", $object->name);
156 $object->sendtoid = array($object->id => $object->id);
157 $object->socid = $object->socid;
158 } elseif ($action ==
'CONTRACT_VALIDATE') {
160 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
162 if (empty($object->actionmsg2)) {
163 $object->actionmsg2 = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
165 $object->actionmsg = $langs->transnoentities(
"ContractValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
167 $object->sendtoid = 0;
168 } elseif ($action ==
'CONTRACT_SENTBYMAIL') {
170 $langs->loadLangs(array(
"agenda",
"other",
"contracts"));
172 if (empty($object->actionmsg2)) {
173 $object->actionmsg2 = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
175 if (empty($object->actionmsg)) {
176 $object->actionmsg = $langs->transnoentities(
"ContractSentByEMail", $object->ref);
181 } elseif ($action ==
'PROPAL_VALIDATE') {
183 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
185 if (empty($object->actionmsg2)) {
186 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
188 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
190 $object->sendtoid = 0;
191 } elseif ($action ==
'PROPAL_MODIFY') {
193 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
195 if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
196 $object->actionmsg = $langs->transnoentities(
"PropalBackToDraftInDolibarr", ($object->newref ? $object->newref : $object->ref));
198 $object->sendtoid = 0;
199 } elseif ($action ==
'PROPAL_SENTBYMAIL') {
201 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
203 if (empty($object->actionmsg2)) {
204 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
206 if (empty($object->actionmsg)) {
207 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
212 } elseif ($action ==
'PROPAL_CLOSE_SIGNED') {
214 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
216 if (empty($object->actionmsg2)) {
217 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
219 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
221 $object->sendtoid = 0;
222 } elseif ($action ==
'PROPAL_CLASSIFY_BILLED') {
224 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
226 if (empty($object->actionmsg2)) {
227 $object->actionmsg2 = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
229 $object->actionmsg = $langs->transnoentities(
"PropalClassifiedBilledInDolibarr", $object->ref);
231 $object->sendtoid = 0;
232 } elseif ($action ==
'PROPAL_CLOSE_REFUSED') {
234 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
236 if (empty($object->actionmsg2)) {
237 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
239 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
241 $object->sendtoid = 0;
242 } elseif ($action ==
'ORDER_VALIDATE') {
244 $langs->loadLangs(array(
"agenda",
"orders"));
246 if (empty($object->actionmsg2)) {
247 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
249 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
251 $object->sendtoid = 0;
252 } elseif ($action ==
'ORDER_CLOSE') {
254 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
256 if (empty($object->actionmsg2)) {
257 $object->actionmsg2 = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
259 $object->actionmsg = $langs->transnoentities(
"OrderDeliveredInDolibarr", $object->ref);
261 $object->sendtoid = 0;
262 } elseif ($action ==
'ORDER_CLASSIFY_BILLED') {
264 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
266 if (empty($object->actionmsg2)) {
267 $object->actionmsg2 = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
269 $object->actionmsg = $langs->transnoentities(
"OrderBilledInDolibarr", $object->ref);
271 $object->sendtoid = 0;
272 } elseif ($action ==
'ORDER_CANCEL') {
274 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
276 if (empty($object->actionmsg2)) {
277 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
279 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
281 $object->sendtoid = 0;
282 } elseif ($action ==
'ORDER_SENTBYMAIL') {
284 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
286 if (empty($object->actionmsg2)) {
287 $object->actionmsg2 = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
289 if (empty($object->actionmsg)) {
290 $object->actionmsg = $langs->transnoentities(
"OrderSentByEMail", $object->ref);
295 } elseif ($action ==
'BILL_VALIDATE') {
297 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
299 if (empty($object->actionmsg2)) {
300 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
302 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
304 $object->sendtoid = 0;
305 } elseif ($action ==
'BILL_UNVALIDATE') {
307 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
309 if (empty($object->actionmsg2)) {
310 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
312 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
314 $object->sendtoid = 0;
315 } elseif ($action ==
'BILL_SENTBYMAIL') {
317 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
319 if (empty($object->actionmsg2)) {
320 $object->actionmsg2 = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
322 if (empty($object->actionmsg)) {
323 $object->actionmsg = $langs->transnoentities(
"InvoiceSentByEMail", $object->ref);
328 } elseif ($action ==
'BILL_PAYED') {
330 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
333 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
334 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
336 $object->sendtoid = 0;
337 } elseif ($action ==
'BILL_CANCEL') {
339 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
341 if (empty($object->actionmsg2)) {
342 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
344 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
346 $object->sendtoid = 0;
347 } elseif ($action ==
'FICHINTER_CREATE') {
349 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
351 if (empty($object->actionmsg2)) {
352 $object->actionmsg2 = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
354 $object->actionmsg = $langs->transnoentities(
"InterventionCreatedInDolibarr", $object->ref);
356 $object->sendtoid = 0;
357 $object->fk_element = 0;
358 $object->elementtype =
'';
359 } elseif ($action ==
'FICHINTER_VALIDATE') {
361 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
363 if (empty($object->actionmsg2)) {
364 $object->actionmsg2 = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
366 $object->actionmsg = $langs->transnoentities(
"InterventionValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
368 $object->sendtoid = 0;
369 $object->fk_element = 0;
370 $object->elementtype =
'';
371 } elseif ($action ==
'FICHINTER_MODIFY') {
373 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
375 if (empty($object->actionmsg2)) {
376 $object->actionmsg2 = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
378 $object->actionmsg = $langs->transnoentities(
"InterventionModifiedInDolibarr", $object->ref);
380 $object->sendtoid = 0;
381 $object->fk_element = 0;
382 $object->elementtype =
'';
383 } elseif ($action ==
'FICHINTER_SENTBYMAIL') {
385 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
387 if (empty($object->actionmsg2)) {
388 $object->actionmsg2 = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
390 if (empty($object->actionmsg)) {
391 $object->actionmsg = $langs->transnoentities(
"InterventionSentByEMail", $object->ref);
396 } elseif ($action ==
'FICHINTER_CLASSIFY_BILLED') {
398 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
400 if (empty($object->actionmsg2)) {
401 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
403 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedBilledInDolibarr", $object->ref);
405 $object->sendtoid = 0;
406 } elseif ($action ==
'FICHINTER_CLASSIFY_UNBILLED') {
408 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
410 if (empty($object->actionmsg2)) {
411 $object->actionmsg2 = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
413 $object->actionmsg = $langs->transnoentities(
"InterventionClassifiedUnbilledInDolibarr", $object->ref);
415 $object->sendtoid = 0;
416 } elseif ($action ==
'FICHINTER_DELETE') {
418 $langs->loadLangs(array(
"agenda",
"other",
"interventions"));
420 if (empty($object->actionmsg2)) {
421 $object->actionmsg2 = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
423 $object->actionmsg = $langs->transnoentities(
"InterventionDeletedInDolibarr", $object->ref);
425 $object->sendtoid = 0;
426 $object->fk_element = 0;
427 $object->elementtype =
'';
428 } elseif ($action ==
'SHIPPING_VALIDATE') {
430 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
432 if (empty($object->actionmsg2)) {
433 $object->actionmsg2 = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
435 if (empty($object->actionmsg)) {
436 $object->actionmsg = $langs->transnoentities(
"ShippingValidated", ($object->newref ? $object->newref : $object->ref));
441 } elseif ($action ==
'SHIPPING_SENTBYMAIL') {
443 $langs->loadLangs(array(
"agenda",
"other",
"sendings"));
445 if (empty($object->actionmsg2)) {
446 $object->actionmsg2 = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
448 if (empty($object->actionmsg)) {
449 $object->actionmsg = $langs->transnoentities(
"ShippingSentByEMail", $object->ref);
454 } elseif ($action ==
'RECEPTION_VALIDATE') {
455 $langs->load(
"agenda");
456 $langs->load(
"other");
457 $langs->load(
"receptions");
459 if (empty($object->actionmsg2)) {
460 $object->actionmsg2 = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
462 if (empty($object->actionmsg)) {
463 $object->actionmsg = $langs->transnoentities(
"ReceptionValidated", ($object->newref ? $object->newref : $object->ref));
468 } elseif ($action ==
'RECEPTION_SENTBYMAIL') {
469 $langs->load(
"agenda");
470 $langs->load(
"other");
471 $langs->load(
"receptions");
473 if (empty($object->actionmsg2)) {
474 $object->actionmsg2 = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
476 if (empty($object->actionmsg)) {
477 $object->actionmsg = $langs->transnoentities(
"ReceptionSentByEMail", $object->ref);
482 } elseif ($action ==
'PROPOSAL_SUPPLIER_VALIDATE') {
484 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
486 if (empty($object->actionmsg2)) {
487 $object->actionmsg2 = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
489 $object->actionmsg = $langs->transnoentities(
"PropalValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
491 $object->sendtoid = 0;
492 } elseif ($action ==
'PROPOSAL_SUPPLIER_SENTBYMAIL') {
494 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
496 if (empty($object->actionmsg2)) {
497 $object->actionmsg2 = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
499 if (empty($object->actionmsg)) {
500 $object->actionmsg = $langs->transnoentities(
"ProposalSentByEMail", $object->ref);
505 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
507 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
509 if (empty($object->actionmsg2)) {
510 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
512 $object->actionmsg = $langs->transnoentities(
"PropalClosedSignedInDolibarr", $object->ref);
514 $object->sendtoid = 0;
515 } elseif ($action ==
'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
517 $langs->loadLangs(array(
"agenda",
"other",
"propal"));
519 if (empty($object->actionmsg2)) {
520 $object->actionmsg2 = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
522 $object->actionmsg = $langs->transnoentities(
"PropalClosedRefusedInDolibarr", $object->ref);
524 $object->sendtoid = 0;
525 } elseif ($action ==
'ORDER_SUPPLIER_CREATE') {
527 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
529 if (empty($object->actionmsg2)) {
530 $object->actionmsg2 = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
532 $object->actionmsg = $langs->transnoentities(
"OrderCreatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
534 $object->sendtoid = 0;
535 } elseif ($action ==
'ORDER_SUPPLIER_VALIDATE') {
537 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
539 if (empty($object->actionmsg2)) {
540 $object->actionmsg2 = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
542 $object->actionmsg = $langs->transnoentities(
"OrderValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
544 $object->sendtoid = 0;
545 } elseif ($action ==
'ORDER_SUPPLIER_APPROVE') {
547 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
549 if (empty($object->actionmsg2)) {
550 $object->actionmsg2 = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
552 $object->actionmsg = $langs->transnoentities(
"OrderApprovedInDolibarr", $object->ref);
554 $object->sendtoid = 0;
555 } elseif ($action ==
'ORDER_SUPPLIER_REFUSE') {
557 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
559 if (empty($object->actionmsg2)) {
560 $object->actionmsg2 = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
562 $object->actionmsg = $langs->transnoentities(
"OrderRefusedInDolibarr", $object->ref);
564 if (!empty($object->refuse_note)) {
565 $object->actionmsg .=
'<br>';
566 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->refuse_note;
569 $object->sendtoid = 0;
570 } elseif ($action ==
'ORDER_SUPPLIER_CANCEL') {
572 $langs->loadLangs(array(
"agenda",
"other",
"orders",
"main"));
574 if (empty($object->actionmsg2)) {
575 $object->actionmsg2 = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
577 $object->actionmsg = $langs->transnoentities(
"OrderCanceledInDolibarr", $object->ref);
579 if (!empty($object->cancel_note)) {
580 $object->actionmsg .=
'<br>';
581 $object->actionmsg .= $langs->trans(
"Reason") .
': '.$object->cancel_note;
584 $object->sendtoid = 0;
585 } elseif ($action ==
'ORDER_SUPPLIER_SUBMIT') {
587 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
589 if (empty($object->actionmsg2)) {
590 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
592 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
594 if (!empty($object->context[
'comments'])) {
595 $object->actionmsg .=
'<br>';
596 $object->actionmsg .= $langs->trans(
"Comment") .
': '.$object->context[
'comments'];
599 $object->sendtoid = 0;
600 } elseif ($action ==
'ORDER_SUPPLIER_RECEIVE') {
602 $langs->loadLangs(array(
"agenda",
"other",
"orders"));
604 if (empty($object->actionmsg2)) {
605 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
607 $object->actionmsg = $langs->transnoentities(
"SupplierOrderReceivedInDolibarr", ($object->newref ? $object->newref : $object->ref));
609 $object->sendtoid = 0;
610 } elseif ($action ==
'ORDER_SUPPLIER_SENTBYMAIL') {
612 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
614 if (empty($object->actionmsg2)) {
615 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
617 if (empty($object->actionmsg)) {
618 $object->actionmsg = $langs->transnoentities(
"SupplierOrderSentByEMail", $object->ref);
623 } elseif ($action ==
'ORDER_SUPPLIER_CLASSIFY_BILLED') {
625 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
627 if (empty($object->actionmsg2)) {
628 $object->actionmsg2 = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
630 if (empty($object->actionmsg)) {
631 $object->actionmsg = $langs->transnoentities(
"SupplierOrderClassifiedBilled", $object->ref);
634 $object->sendtoid = 0;
635 } elseif ($action ==
'BILL_SUPPLIER_VALIDATE') {
637 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
639 if (empty($object->actionmsg2)) {
640 $object->actionmsg2 = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
642 $object->actionmsg = $langs->transnoentities(
"InvoiceValidatedInDolibarr", ($object->newref ? $object->newref : $object->ref));
644 $object->sendtoid = 0;
645 } elseif ($action ==
'BILL_SUPPLIER_UNVALIDATE') {
647 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
649 if (empty($object->actionmsg2)) {
650 $object->actionmsg2 = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
652 $object->actionmsg = $langs->transnoentities(
"InvoiceBackToDraftInDolibarr", $object->ref);
654 $object->sendtoid = 0;
655 } elseif ($action ==
'BILL_SUPPLIER_SENTBYMAIL') {
657 $langs->loadLangs(array(
"agenda",
"other",
"bills",
"orders"));
659 if (empty($object->actionmsg2)) {
660 $object->actionmsg2 = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
662 if (empty($object->actionmsg)) {
663 $object->actionmsg = $langs->transnoentities(
"SupplierInvoiceSentByEMail", $object->ref);
668 } elseif ($action ==
'BILL_SUPPLIER_PAYED') {
670 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
672 if (empty($object->actionmsg2)) {
673 $object->actionmsg2 = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
675 $object->actionmsg = $langs->transnoentities(
"InvoicePaidInDolibarr", $object->ref);
677 $object->sendtoid = 0;
678 } elseif ($action ==
'BILL_SUPPLIER_CANCELED') {
680 $langs->loadLangs(array(
"agenda",
"other",
"bills"));
682 if (empty($object->actionmsg2)) {
683 $object->actionmsg2 = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
685 $object->actionmsg = $langs->transnoentities(
"InvoiceCanceledInDolibarr", $object->ref);
687 $object->sendtoid = 0;
688 } elseif ($action ==
'MEMBER_VALIDATE') {
691 $langs->loadLangs(array(
"agenda",
"other",
"members"));
693 if (empty($object->actionmsg2)) {
694 $object->actionmsg2 = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
696 $object->actionmsg = $langs->transnoentities(
"MemberValidatedInDolibarr", $object->getFullName($langs));
697 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
698 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
700 $object->sendtoid = 0;
701 } elseif ($action ==
'MEMBER_MODIFY') {
703 $langs->loadLangs(array(
"agenda",
"other",
"members"));
705 if (empty($object->actionmsg2)) {
706 $object->actionmsg2 = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
708 $object->actionmsg = $langs->transnoentities(
"MemberModifiedInDolibarr", $object->getFullName($langs));
709 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
710 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
712 $object->sendtoid = 0;
713 } elseif ($action ==
'MEMBER_SUBSCRIPTION_CREATE') {
715 $langs->loadLangs(array(
"agenda",
"other",
"members"));
717 $member = (isset($this->context[
'member']) ? $this->context[
'member'] :
null);
718 if (!is_object($member)) {
719 dol_syslog(
"Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object");
720 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
722 $member->fetch($object->fk_adherent);
725 if (empty($object->actionmsg2)) {
726 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
728 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
729 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
730 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
731 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
732 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
734 $object->sendtoid = 0;
735 if (isset($object->fk_soc) && $object->fk_soc > 0) {
736 $object->socid = $object->fk_soc;
738 } elseif ($action ==
'MEMBER_SUBSCRIPTION_MODIFY') {
740 $langs->loadLangs(array(
"agenda",
"other",
"members"));
742 $member = $this->context[
'member'];
743 if (!is_object($member)) {
744 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
746 $member->fetch($object->fk_adherent);
749 if (empty($object->actionmsg2)) {
750 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
752 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
753 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$member->getFullName($langs);
754 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
755 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
756 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
758 $object->sendtoid = 0;
759 if ($object->fk_soc > 0) {
760 $object->socid = $object->fk_soc;
762 } elseif ($action ==
'MEMBER_SUBSCRIPTION_DELETE') {
764 $langs->loadLangs(array(
"agenda",
"other",
"members"));
766 if (empty($object->actionmsg2)) {
767 $object->actionmsg2 = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs));
769 $object->actionmsg = $langs->transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs));
770 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
771 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->fk_type;
772 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->amount;
773 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->dateh,
'day').
' - '.
dol_print_date($object->datef,
'day');
775 $object->sendtoid = 0;
776 if (isset($object->fk_soc) && $object->fk_soc > 0) {
777 $object->socid = $object->fk_soc;
779 } elseif ($action ==
'MEMBER_RESILIATE') {
781 $langs->loadLangs(array(
"agenda",
"other",
"members"));
783 if (empty($object->actionmsg2)) {
784 $object->actionmsg2 = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
786 $object->actionmsg = $langs->transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
787 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
788 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
790 $object->sendtoid = 0;
791 } elseif ($action ==
'MEMBER_DELETE') {
793 $langs->loadLangs(array(
"agenda",
"other",
"members"));
795 if (empty($object->actionmsg2)) {
796 $object->actionmsg2 = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
798 $object->actionmsg = $langs->transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
799 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
800 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
802 $object->sendtoid = 0;
803 } elseif ($action ==
'MEMBER_EXCLUDE') {
805 $langs->loadLangs(array(
"agenda",
"other",
"members"));
807 if (empty($object->actionmsg2)) {
808 $object->actionmsg2 = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
810 $object->actionmsg = $langs->transnoentities(
"MemberExcludedInDolibarr", $object->getFullName($langs));
811 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
812 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
814 $object->sendtoid = 0;
815 } elseif ($action ==
'PROJECT_CREATE') {
818 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
820 if (empty($object->actionmsg2)) {
821 $object->actionmsg2 = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
823 $object->actionmsg = $langs->transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
824 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
826 $object->sendtoid = 0;
827 } elseif ($action ==
'PROJECT_VALIDATE') {
829 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
831 if (empty($object->actionmsg2)) {
832 $object->actionmsg2 = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
834 $object->actionmsg = $langs->transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
835 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
837 $object->sendtoid = 0;
838 } elseif ($action ==
'PROJECT_MODIFY') {
840 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
842 if (empty($object->actionmsg2)) {
843 $object->actionmsg2 = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
845 $object->actionmsg = $langs->transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
847 if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) {
848 $object->actionmsg .=
"\n".$langs->transnoentitiesnoconv(
"OpportunityStatus").
': '.$object->oldcopy->opp_status.
' -> '.$object->opp_status;
851 $object->sendtoid = 0;
852 } elseif ($action ==
'PROJECT_SENTBYMAIL') {
854 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
856 if (empty($object->actionmsg2)) {
857 $object->actionmsg2 = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
859 if (empty($object->actionmsg)) {
860 $object->actionmsg = $langs->transnoentities(
"ProjectSentByEMail", $object->ref);
865 } elseif ($action ==
'PROJECT_CLOSE') {
867 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
869 if (empty($object->actionmsg2)) {
870 $object->actionmsg2 = $langs->transnoentities(
"ProjectClosedInDolibarr", $object->ref);
872 $object->actionmsg = $langs->transnoentities(
"ProjectClosedInDolibarr", $object->ref);
874 $object->sendtoid = 0;
875 } elseif ($action ==
'TASK_CREATE') {
878 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
880 if (empty($object->actionmsg2)) {
881 $object->actionmsg2 = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
883 $object->actionmsg = $langs->transnoentities(
"TaskCreatedInDolibarr", $object->ref);
884 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
886 $object->sendtoid = 0;
887 } elseif ($action ==
'TASK_MODIFY') {
889 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
891 if (empty($object->actionmsg2)) {
892 $object->actionmsg2 = $langs->transnoentities(
"TaskModifiedInDolibarr", $object->ref);
894 $object->actionmsg = $langs->transnoentities(
"TaskModifieddInDolibarr", $object->ref);
895 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
897 $object->sendtoid = 0;
898 } elseif ($action ==
'TASK_DELETE') {
900 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
902 if (empty($object->actionmsg2)) {
903 $object->actionmsg2 = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
905 $object->actionmsg = $langs->transnoentities(
"TaskDeletedInDolibarr", $object->ref);
906 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
908 $object->sendtoid = 0;
909 } elseif ($action ==
'TICKET_ASSIGNED') {
911 $langs->loadLangs(array(
"agenda",
"other",
"projects"));
913 if (empty($object->actionmsg2)) {
914 $object->actionmsg2 = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
916 $object->actionmsg = $langs->transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
917 if ($object->oldcopy->fk_user_assign > 0) {
918 $tmpuser =
new User($this->
db);
919 $tmpuser->fetch($object->oldcopy->fk_user_assign);
920 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$tmpuser->getFullName($langs);
922 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$langs->trans(
"None");
924 if ($object->fk_user_assign > 0) {
925 $tmpuser =
new User($this->
db);
926 $tmpuser->fetch($object->fk_user_assign);
927 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$tmpuser->getFullName($langs);
929 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$langs->trans(
"None");
931 $object->sendtoid = 0;
939 if (empty($object->actionmsg2)) {
940 $langs->loadLangs(array(
"agenda",
"other"));
941 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
942 $object->actionmsg2 = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
944 $tmp = explode(
'_', $action);
945 $object->actionmsg2 = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
948 if (empty($object->actionmsg)) {
949 $langs->loadLangs(array(
"agenda",
"other"));
950 if ($langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
951 $object->actionmsg = $langs->transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
953 $tmp = explode(
'_', $action);
954 $object->actionmsg = $langs->transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
958 if (!isset($object->sendtoid) || !is_array($object->sendtoid)) {
959 $object->sendtoid = 0;
965 if (empty($object->trackid)) {
967 if (preg_match(
'/^COMPANY_/', $action)) {
968 $object->trackid =
'thi'.$object->id;
969 } elseif (preg_match(
'/^CONTACT_/', $action)) {
970 $object->trackid =
'ctc'.$object->id;
971 } elseif (preg_match(
'/^CONTRACT_/', $action)) {
972 $object->trackid =
'con'.$object->id;
973 } elseif (preg_match(
'/^PROPAL_/', $action)) {
974 $object->trackid =
'pro'.$object->id;
975 } elseif (preg_match(
'/^ORDER_/', $action)) {
976 $object->trackid =
'ord'.$object->id;
977 } elseif (preg_match(
'/^BILL_/', $action)) {
978 $object->trackid =
'inv'.$object->id;
979 } elseif (preg_match(
'/^FICHINTER_/', $action)) {
980 $object->trackid =
'int'.$object->id;
981 } elseif (preg_match(
'/^SHIPPING_/', $action)) {
982 $object->trackid =
'shi'.$object->id;
983 } elseif (preg_match(
'/^RECEPTION_/', $action)) {
984 $object->trackid =
'rec'.$object->id;
985 } elseif (preg_match(
'/^PROPOSAL_SUPPLIER/', $action)) {
986 $object->trackid =
'spr'.$object->id;
987 } elseif (preg_match(
'/^ORDER_SUPPLIER_/', $action)) {
988 $object->trackid =
'sor'.$object->id;
989 } elseif (preg_match(
'/^BILL_SUPPLIER_/', $action)) {
990 $object->trackid =
'sin'.$object->id;
991 } elseif (preg_match(
'/^MEMBER_SUBSCRIPTION_/', $action)) {
992 $object->trackid =
'sub'.$object->id;
993 } elseif (preg_match(
'/^MEMBER_/', $action)) {
994 $object->trackid =
'mem'.$object->id;
995 } elseif (preg_match(
'/^PROJECT_/', $action)) {
996 $object->trackid =
'proj'.$object->id;
997 } elseif (preg_match(
'/^TASK_/', $action)) {
998 $object->trackid =
'tas'.$object->id;
999 } elseif (preg_match(
'/^TICKET_/', $action)) {
1000 $object->trackid =
'tic'.$object->id;
1001 } elseif (preg_match(
'/^USER_/', $action)) {
1002 $object->trackid =
'use'.$object->id;
1004 $object->trackid =
'';
1016 dol_syslog(
"Trigger '".$this->
name.
"' for action '".$action.
"' launched by ".__FILE__.
". id=".$object->id);
1021 if (isset($_SESSION[
'listofnames-'.$object->trackid])) {
1022 $attachs = $_SESSION[
'listofnames-'.$object->trackid];
1023 if ($attachs && strpos($action,
'SENTBYMAIL')) {
1024 $object->actionmsg =
dol_concatdesc($object->actionmsg,
"\n".$langs->transnoentities(
"AttachedFiles").
': '.$attachs);
1027 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
1028 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
1029 $contactforaction =
new Contact($this->
db);
1030 $societeforaction =
new Societe($this->
db);
1033 if (is_array($object->sendtoid)) {
1034 if (count($object->sendtoid) == 1) {
1035 $contactforaction->fetch(reset($object->sendtoid));
1038 if ($object->sendtoid > 0) {
1039 $contactforaction->fetch($object->sendtoid);
1043 if (isset($object->socid) && $object->socid > 0) {
1044 $societeforaction->fetch($object->socid);
1045 } elseif (isset($object->fk_soc) && $object->fk_soc > 0) {
1046 $societeforaction->fetch($object->fk_soc);
1047 } elseif (isset($object->thirdparty) && isset($object->thirdparty->id) && $object->thirdparty->id > 0) {
1048 $societeforaction = $object->thirdparty;
1051 $projectid = isset($object->fk_project) ? $object->fk_project : 0;
1052 if ($object->element ==
'project') {
1053 $projectid = $object->id;
1056 $elementid = $object->id;
1057 $elementtype = $object->element;
1058 $elementmodule = (empty($object->module) ?
'' : $object->module);
1059 if ($object->element ==
'subscription') {
1060 $elementid = $object->fk_adherent;
1061 $elementtype =
'member';
1066 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1068 $actioncomm->type_code = $object->actiontypecode;
1069 $actioncomm->code =
'AC_'.$action;
1070 $actioncomm->label = $object->actionmsg2;
1071 $actioncomm->note_private = $object->actionmsg;
1072 $actioncomm->fk_project = $projectid;
1073 $actioncomm->datep = $now;
1074 $actioncomm->datef = $now;
1075 $actioncomm->durationp = 0;
1076 $actioncomm->percentage = -1;
1077 $actioncomm->socid = $societeforaction->id;
1078 $actioncomm->contact_id = $contactforaction->id;
1079 $actioncomm->authorid = $user->id;
1080 $actioncomm->userownerid = $user->id;
1082 if (!property_exists($object,
'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
1083 $actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
1084 $actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
1085 $actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
1086 $actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
1087 $actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
1088 $actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
1089 $actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
1090 $actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
1095 if (!in_array($elementtype, array(
'societe',
'contact',
'project'))) {
1096 $actioncomm->fk_element = $elementid;
1097 $actioncomm->elementtype = $elementtype.($elementmodule ?
'@'.$elementmodule :
'');
1100 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
1101 $actioncomm->attachedfiles = $object->attachedfiles;
1103 if (property_exists($object,
'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
1104 $actioncomm->userassigned = $object->sendtouserid;
1106 if (property_exists($object,
'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
1107 foreach ($object->sendtoid as $val) {
1108 $actioncomm->socpeopleassigned[$val] = $val;
1112 $ret = $actioncomm->create($user);
1114 if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) {
1115 if (is_array($object->attachedfiles) && array_key_exists(
'paths', $object->attachedfiles) && count($object->attachedfiles[
'paths']) > 0) {
1116 foreach ($object->attachedfiles[
'paths'] as $key => $filespath) {
1117 $srcfile = $filespath;
1118 $destdir = $conf->agenda->dir_output.
'/'.$ret;
1119 $destfile = $destdir.
'/'.$object->attachedfiles[
'names'][$key];
1121 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1128 unset($object->actionmsg);
1129 unset($object->actionmsg2);
1130 unset($object->actiontypecode);
1133 $_SESSION[
'LAST_ACTION_CREATED'] = $ret;
1136 $this->error =
"Failed to insert event : ".$actioncomm->error.
" ".join(
',', $actioncomm->errors);
1137 $this->errors = $actioncomm->errors;
1139 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.