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 = $this->context[
'member'];
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 ($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($this->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 if (empty($object->actionmsg2)) {
766 $object->actionmsg2 = $langs->
transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs));
768 $object->actionmsg = $langs->
transnoentities(
"MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs));
769 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
770 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
771 $object->actionmsg .=
"\n".$langs->transnoentities(
"Amount").
': '.$object->last_subscription_amount;
772 $object->actionmsg .=
"\n".$langs->transnoentities(
"Period").
': '.
dol_print_date($object->last_subscription_date_start,
'day').
' - '.
dol_print_date($object->last_subscription_date_end,
'day');
774 $object->sendtoid = 0;
775 if ($object->fk_soc > 0) {
776 $object->socid = $object->fk_soc;
778 } elseif ($action ==
'MEMBER_RESILIATE') {
780 $langs->
loadLangs(array(
"agenda",
"other",
"members"));
782 if (empty($object->actionmsg2)) {
783 $object->actionmsg2 = $langs->
transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
785 $object->actionmsg = $langs->
transnoentities(
"MemberResiliatedInDolibarr", $object->getFullName($langs));
786 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
787 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
789 $object->sendtoid = 0;
790 } elseif ($action ==
'MEMBER_DELETE') {
792 $langs->
loadLangs(array(
"agenda",
"other",
"members"));
794 if (empty($object->actionmsg2)) {
795 $object->actionmsg2 = $langs->
transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
797 $object->actionmsg = $langs->
transnoentities(
"MemberDeletedInDolibarr", $object->getFullName($langs));
798 $object->actionmsg .=
"\n".$langs->transnoentities(
"Member").
': '.$object->getFullName($langs);
799 $object->actionmsg .=
"\n".$langs->transnoentities(
"Type").
': '.$object->type;
801 $object->sendtoid = 0;
802 } elseif ($action ==
'PROJECT_CREATE') {
805 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
807 if (empty($object->actionmsg2)) {
808 $object->actionmsg2 = $langs->
transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
810 $object->actionmsg = $langs->
transnoentities(
"ProjectCreatedInDolibarr", $object->ref);
811 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
813 $object->sendtoid = 0;
814 } elseif ($action ==
'PROJECT_VALIDATE') {
816 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
818 if (empty($object->actionmsg2)) {
819 $object->actionmsg2 = $langs->
transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
821 $object->actionmsg = $langs->
transnoentities(
"ProjectValidatedInDolibarr", $object->ref);
822 $object->actionmsg .=
"\n".$langs->transnoentities(
"Project").
': '.$object->ref;
824 $object->sendtoid = 0;
825 } elseif ($action ==
'PROJECT_MODIFY') {
827 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
829 if (empty($object->actionmsg2)) {
830 $object->actionmsg2 = $langs->
transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
832 $object->actionmsg = $langs->
transnoentities(
"ProjectModifiedInDolibarr", $object->ref);
834 if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) {
835 $object->actionmsg .=
"\n".$langs->transnoentitiesnoconv(
"OpportunityStatus").
': '.$object->oldcopy->opp_status.
' -> '.$object->opp_status;
838 $object->sendtoid = 0;
839 } elseif ($action ==
'TASK_CREATE') {
842 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
844 if (empty($object->actionmsg2)) {
845 $object->actionmsg2 = $langs->
transnoentities(
"TaskCreatedInDolibarr", $object->ref);
847 $object->actionmsg = $langs->
transnoentities(
"TaskCreatedInDolibarr", $object->ref);
848 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
850 $object->sendtoid = 0;
851 } elseif ($action ==
'TASK_MODIFY') {
853 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
855 if (empty($object->actionmsg2)) {
856 $object->actionmsg2 = $langs->
transnoentities(
"TaskModifiedInDolibarr", $object->ref);
858 $object->actionmsg = $langs->
transnoentities(
"TaskModifieddInDolibarr", $object->ref);
859 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
861 $object->sendtoid = 0;
862 } elseif ($action ==
'TASK_DELETE') {
864 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
866 if (empty($object->actionmsg2)) {
867 $object->actionmsg2 = $langs->
transnoentities(
"TaskDeletedInDolibarr", $object->ref);
869 $object->actionmsg = $langs->
transnoentities(
"TaskDeletedInDolibarr", $object->ref);
870 $object->actionmsg .=
"\n".$langs->transnoentities(
"Task").
': '.$object->ref;
872 $object->sendtoid = 0;
873 } elseif ($action ==
'TICKET_ASSIGNED') {
875 $langs->
loadLangs(array(
"agenda",
"other",
"projects"));
877 if (empty($object->actionmsg2)) {
878 $object->actionmsg2 = $langs->
transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
880 $object->actionmsg = $langs->
transnoentities(
"TICKET_ASSIGNEDInDolibarr", $object->ref);
881 if ($object->oldcopy->fk_user_assign > 0) {
882 $tmpuser =
new User($this->
db);
883 $tmpuser->fetch($object->oldcopy->fk_user_assign);
884 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$tmpuser->getFullName($langs);
886 $object->actionmsg .=
"\n".$langs->transnoentities(
"OldUser").
': '.$langs->
trans(
"None");
888 if ($object->fk_user_assign > 0) {
889 $tmpuser =
new User($this->
db);
890 $tmpuser->fetch($object->fk_user_assign);
891 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$tmpuser->getFullName($langs);
893 $object->actionmsg .=
"\n".$langs->transnoentities(
"NewUser").
': '.$langs->
trans(
"None");
895 $object->sendtoid = 0;
903 if (empty($object->actionmsg2)) {
904 $langs->
loadLangs(array(
"agenda",
"other"));
905 if ($langs->
transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
906 $object->actionmsg2 = $langs->
transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
908 $tmp = explode(
'_', $action);
909 $object->actionmsg2 = $langs->
transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
912 if (empty($object->actionmsg)) {
913 $langs->
loadLangs(array(
"agenda",
"other"));
914 if ($langs->
transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref)) != $action.
"InDolibarr") {
915 $object->actionmsg = $langs->
transnoentities($action.
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
917 $tmp = explode(
'_', $action);
918 $object->actionmsg = $langs->
transnoentities($tmp[count($tmp) - 1].
"InDolibarr", (empty($object->newref) ? $object->ref : $object->newref));
922 if (!isset($object->sendtoid) || !is_array($object->sendtoid)) {
923 $object->sendtoid = 0;
929 if (empty($object->trackid)) {
931 if (preg_match(
'/^COMPANY_/', $action)) {
932 $object->trackid =
'thi'.$object->id;
933 } elseif (preg_match(
'/^CONTACT_/', $action)) {
934 $object->trackid =
'ctc'.$object->id;
935 } elseif (preg_match(
'/^CONTRACT_/', $action)) {
936 $object->trackid =
'con'.$object->id;
937 } elseif (preg_match(
'/^PROPAL_/', $action)) {
938 $object->trackid =
'pro'.$object->id;
939 } elseif (preg_match(
'/^ORDER_/', $action)) {
940 $object->trackid =
'ord'.$object->id;
941 } elseif (preg_match(
'/^BILL_/', $action)) {
942 $object->trackid =
'inv'.$object->id;
943 } elseif (preg_match(
'/^FICHINTER_/', $action)) {
944 $object->trackid =
'int'.$object->id;
945 } elseif (preg_match(
'/^SHIPPING_/', $action)) {
946 $object->trackid =
'shi'.$object->id;
947 } elseif (preg_match(
'/^RECEPTION_/', $action)) {
948 $object->trackid =
'rec'.$object->id;
949 } elseif (preg_match(
'/^PROPOSAL_SUPPLIER/', $action)) {
950 $object->trackid =
'spr'.$object->id;
951 } elseif (preg_match(
'/^ORDER_SUPPLIER_/', $action)) {
952 $object->trackid =
'sor'.$object->id;
953 } elseif (preg_match(
'/^BILL_SUPPLIER_/', $action)) {
954 $object->trackid =
'sin'.$object->id;
955 } elseif (preg_match(
'/^MEMBER_SUBSCRIPTION_/', $action)) {
956 $object->trackid =
'sub'.$object->id;
957 } elseif (preg_match(
'/^MEMBER_/', $action)) {
958 $object->trackid =
'mem'.$object->id;
959 } elseif (preg_match(
'/^PROJECT_/', $action)) {
960 $object->trackid =
'proj'.$object->id;
961 } elseif (preg_match(
'/^TASK_/', $action)) {
962 $object->trackid =
'tas'.$object->id;
963 } elseif (preg_match(
'/^TICKET_/', $action)) {
964 $object->trackid =
'tic'.$object->id;
965 } elseif (preg_match(
'/^USER_/', $action)) {
966 $object->trackid =
'use'.$object->id;
968 $object->trackid =
'';
980 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
985 if (isset($_SESSION[
'listofnames-'.$object->trackid])) {
986 $attachs = $_SESSION[
'listofnames-'.$object->trackid];
987 if ($attachs && strpos($action,
'SENTBYMAIL')) {
988 $object->actionmsg =
dol_concatdesc($object->actionmsg,
"\n".$langs->transnoentities(
"AttachedFiles").
': '.$attachs);
991 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
992 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
993 $contactforaction =
new Contact($this->
db);
994 $societeforaction =
new Societe($this->
db);
997 if (is_array($object->sendtoid)) {
998 if (count($object->sendtoid) == 1) {
999 $contactforaction->fetch(reset($object->sendtoid));
1002 if ($object->sendtoid > 0) {
1003 $contactforaction->fetch($object->sendtoid);
1007 if (isset($object->socid) && $object->socid > 0) {
1008 $societeforaction->fetch($object->socid);
1009 } elseif (isset($object->fk_soc) && $object->fk_soc > 0) {
1010 $societeforaction->fetch($object->fk_soc);
1011 } elseif (isset($object->thirdparty) && isset($object->thirdparty->id) && $object->thirdparty->id > 0) {
1012 $societeforaction = $object->thirdparty;
1015 $projectid = isset($object->fk_project) ? $object->fk_project : 0;
1016 if ($object->element ==
'project') {
1017 $projectid = $object->id;
1020 $elementid = $object->id;
1021 $elementtype = $object->element;
1022 $elementmodule = (empty($object->module) ?
'' : $object->module);
1023 if ($object->element ==
'subscription') {
1024 $elementid = $object->fk_adherent;
1025 $elementtype =
'member';
1030 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
1032 $actioncomm->type_code = $object->actiontypecode;
1033 $actioncomm->code =
'AC_'.$action;
1034 $actioncomm->label = $object->actionmsg2;
1035 $actioncomm->note_private = $object->actionmsg;
1036 $actioncomm->fk_project = $projectid;
1037 $actioncomm->datep = $now;
1038 $actioncomm->datef = $now;
1039 $actioncomm->durationp = 0;
1040 $actioncomm->percentage = -1;
1041 $actioncomm->socid = $societeforaction->id;
1042 $actioncomm->contact_id = $contactforaction->id;
1043 $actioncomm->authorid = $user->id;
1044 $actioncomm->userownerid = $user->id;
1046 if (!property_exists($object,
'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
1047 $actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
1048 $actioncomm->email_from = empty($object->email_from) ? null : $object->email_from;
1049 $actioncomm->email_sender = empty($object->email_sender) ? null : $object->email_sender;
1050 $actioncomm->email_to = empty($object->email_to) ? null : $object->email_to;
1051 $actioncomm->email_tocc = empty($object->email_tocc) ? null : $object->email_tocc;
1052 $actioncomm->email_tobcc = empty($object->email_tobcc) ? null : $object->email_tobcc;
1053 $actioncomm->email_subject = empty($object->email_subject) ? null : $object->email_subject;
1054 $actioncomm->errors_to = empty($object->errors_to) ? null : $object->errors_to;
1059 if (!in_array($elementtype, array(
'societe',
'contact',
'project'))) {
1060 $actioncomm->fk_element = $elementid;
1061 $actioncomm->elementtype = $elementtype.($elementmodule ?
'@'.$elementmodule :
'');
1064 if (property_exists($object,
'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
1065 $actioncomm->attachedfiles = $object->attachedfiles;
1067 if (property_exists($object,
'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
1068 $actioncomm->userassigned = $object->sendtouserid;
1070 if (property_exists($object,
'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
1071 foreach ($object->sendtoid as $val) {
1072 $actioncomm->socpeopleassigned[$val] = $val;
1076 $ret = $actioncomm->create($user);
1078 if ($ret > 0 && !empty($conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)) {
1079 if (is_array($object->attachedfiles) && array_key_exists(
'paths', $object->attachedfiles) && count($object->attachedfiles[
'paths']) > 0) {
1080 foreach ($object->attachedfiles[
'paths'] as $key => $filespath) {
1081 $srcfile = $filespath;
1082 $destdir = $conf->agenda->dir_output.
'/'.$ret;
1083 $destfile = $destdir.
'/'.$object->attachedfiles[
'names'][$key];
1085 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1092 unset($object->actionmsg);
1093 unset($object->actionmsg2);
1094 unset($object->actiontypecode);
1097 $_SESSION[
'LAST_ACTION_CREATED'] = $ret;
1100 $this->error =
"Failed to insert event : ".$actioncomm->error.
" ".join(
',', $actioncomm->errors);
1101 $this->errors = $actioncomm->errors;
1103 dol_syslog(
"interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
Class to stock current configuration.
dol_mkdir($dir, $dataroot= '', $newmask= '')
Creation of a directory (this can create recursive subdir)
transnoentities($key, $param1= '', $param2= '', $param3= '', $param4= '', $param5= '')
Return translated value of a text string If there is no match for this text, we look in alternative f...
Class to manage agenda events (actions)
$conf db
API class for accounts.
__construct($db)
Constructor.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
$conf db name
Only used if Module[ID]Name translation string is not found.
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...
Class to manage third parties objects (customers, suppliers, prospects...)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Class to manage members of a foundation.
Class to manage translations.
Class of triggered functions for agenda module.
Class that all the triggers must extend.
runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
Function called when a Dolibarrr business event is done.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
loadLangs($domains)
Load translation files.
load($domain, $alt=0, $stopafterdirection=0, $forcelangdir= '', $loadfromfileonly=0, $forceloadifalreadynotfound=0)
Load translation key-value for a particular file, into a memory array.
trans($key, $param1= '', $param2= '', $param3= '', $param4= '', $maxsize=0)
Return text translated of text received as parameter (and encode it into HTML) If there is no match f...