65 public $modules_parts;
74 public $logbuffer = array();
79 public $loghandlers = array();
88 public $dol_hide_topmenu;
89 public $dol_hide_leftmenu;
90 public $dol_optimize_smallscreen;
91 public $dol_no_mouse_hover;
92 public $dol_use_jmobile;
96 public $tzuserinputkey =
'tzserver';
105 $this->file =
new stdClass();
106 $this->
db =
new stdClass();
108 $this->file->character_set_client =
'UTF-8';
111 $this->mycompany =
new stdClass();
112 $this->admin =
new stdClass();
113 $this->medias =
new stdClass();
114 $this->global =
new stdClass();
117 $this->browser =
new stdClass();
120 $this->cache = array();
121 $this->modules = array();
122 $this->modules_parts = array(
126 'triggers' => array(),
128 'substitutions' => array(),
133 'barcode' => array(),
135 'societe' => array(),
143 $this->syslog =
new stdClass();
144 $this->multicompany =
new stdClass();
145 $this->expedition_bon =
new stdClass();
146 $this->delivery_note =
new stdClass();
147 $this->fournisseur =
new stdClass();
148 $this->product =
new stdClass();
149 $this->service =
new stdClass();
150 $this->contrat =
new stdClass();
151 $this->actions =
new stdClass();
152 $this->agenda =
new stdClass();
153 $this->commande =
new stdClass();
154 $this->propal =
new stdClass();
155 $this->facture =
new stdClass();
156 $this->contrat =
new stdClass();
157 $this->
user =
new stdClass();
158 $this->adherent =
new stdClass();
159 $this->bank =
new stdClass();
160 $this->notification =
new stdClass();
161 $this->mailing =
new stdClass();
162 $this->expensereport =
new stdClass();
163 $this->productbatch =
new stdClass();
176 if ($this->entity !=
$entity) {
197 if (!empty($this->modules)) {
198 foreach ($this->modules as $m) {
199 if (isset($this->$m)) unset($this->$m);
204 $this->mycompany =
new stdClass();
205 $this->admin =
new stdClass();
206 $this->medias =
new stdClass();
207 $this->global =
new stdClass();
214 $this->syslog =
new stdClass();
215 $this->expedition_bon =
new stdClass();
216 $this->delivery_note =
new stdClass();
217 $this->fournisseur =
new stdClass();
218 $this->product =
new stdClass();
219 $this->service =
new stdClass();
220 $this->contrat =
new stdClass();
221 $this->actions =
new stdClass();
222 $this->agenda =
new stdClass();
223 $this->commande =
new stdClass();
224 $this->propal =
new stdClass();
225 $this->facture =
new stdClass();
226 $this->contrat =
new stdClass();
227 $this->
user =
new stdClass();
228 $this->adherent =
new stdClass();
229 $this->bank =
new stdClass();
230 $this->notification =
new stdClass();
231 $this->mailing =
new stdClass();
232 $this->expensereport =
new stdClass();
233 $this->productbatch =
new stdClass();
236 $this->cache = array();
237 $this->modules = array();;
238 $this->modules_parts = array(
242 'triggers' => array(),
244 'substitutions' => array(),
249 'barcode' => array(),
251 'societe' => array(),
257 if (!is_null($db) && is_object($db)) {
258 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
261 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
262 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
263 $sql .=
" FROM ".$db->prefix().
"const";
264 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
265 $sql .=
" ORDER BY entity";
267 $resql = $db->query($sql);
270 $numr = $db->num_rows(
$resql);
272 $objp = $db->fetch_object(
$resql);
274 $value = $objp->value;
277 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
278 $value = $_SERVER[
'DOLIBARR_'.$key];
279 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
280 $value = $_ENV[
'DOLIBARR_'.$key];
285 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
288 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
290 $params = explode(
':', $value, 2);
291 if (!is_array($this->modules_parts[$partname])) {
292 $this->modules_parts[$partname] = array();
294 $this->modules_parts[$partname][$params[0]][] = $value;
295 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
302 $modulename = strtolower($reg[1]);
303 $partname = strtolower($reg[2]);
304 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
305 $this->modules_parts[$partname] = array();
308 $arrValue = json_decode($value,
true);
310 if (is_array($arrValue)) {
311 $newvalue = $arrValue;
312 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
313 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
314 } elseif (in_array($partname, array(
'models',
'theme'))) {
315 $newvalue =
'/'.$modulename.
'/';
316 } elseif (in_array($partname, array(
'sms'))) {
317 $newvalue =
'/'.$modulename.
'/';
318 } elseif ($value == 1) {
319 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
324 if (!empty($newvalue)) {
325 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
327 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
329 $modulename = strtolower($reg[1]);
330 if ($modulename ==
'propale') {
331 $modulename =
'propal';
333 if ($modulename ==
'supplierproposal') {
334 $modulename =
'supplier_proposal';
336 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
337 $this->$modulename =
new stdClass();
339 $this->$modulename->enabled =
true;
340 $this->modules[] = $modulename;
351 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
352 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
353 foreach ($filesList as $file) {
365 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
367 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
369 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
374 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
376 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
378 $mc =
new ActionsMulticompany($db);
384 if (empty($this->global->MAIN_MENU_STANDARD)) {
385 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
387 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
388 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
390 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
391 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
393 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
394 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
396 if (!isset($this->global->FACTURE_TVAOPTION)) {
397 $this->global->FACTURE_TVAOPTION = 1;
401 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
402 $this->global->LDAP_FIELD_FULLNAME =
'';
404 if (!isset($this->global->LDAP_KEY_USERS)) {
405 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
407 if (!isset($this->global->LDAP_KEY_GROUPS)) {
408 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
410 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
411 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
413 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
414 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
416 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
417 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
421 if (empty($this->global->MAIN_LANG_DEFAULT)) {
422 $this->global->MAIN_LANG_DEFAULT =
"en_US";
425 $rootfordata = DOL_DATA_ROOT;
426 $rootforuser = DOL_DATA_ROOT;
428 if (
isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
429 $rootfordata .=
'/'.$this->entity;
432 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
435 foreach ($this->modules as $module) {
438 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
439 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
441 $this->$module->dir_output = $rootfordata.
"/".$module;
442 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
446 if (!empty($this->modules_parts[
'dir'])) {
447 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
448 if (!empty($this->$module->enabled)) {
449 foreach ($dirs as $type => $name) {
450 $multidirname =
'multidir_'.$type;
451 $dirname =
'dir_'.$type;
453 if ($type !=
'temp') {
455 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
458 $this->$module->$dirname = $rootfordata.
"/".$name;
461 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
464 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
472 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
473 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
476 $this->admin->dir_output = $rootfordata.
'/admin';
477 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
480 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
481 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
483 $this->
user->dir_output = $rootforuser.
"/users";
484 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
487 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
488 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
490 $this->propal->dir_output = $rootfordata.
"/propale";
491 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
494 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
495 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
500 $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0);
502 $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0);
505 if (!empty($this->fournisseur)) {
506 $this->fournisseur->commande =
new stdClass();
507 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
508 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
509 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
510 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
512 $this->fournisseur->facture =
new stdClass();
513 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
514 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
515 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
516 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
518 $this->supplierproposal =
new stdClass();
519 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
520 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
521 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
522 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
524 $this->fournisseur->payment =
new stdClass();
525 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
526 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
527 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
528 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
531 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) {
532 $this->supplier_order =
new stdClass();
533 $this->supplier_order->enabled = 1;
534 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
535 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
536 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
537 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
539 $this->supplier_invoice =
new stdClass();
540 $this->supplier_invoice->enabled = 1;
541 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
542 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
543 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
544 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
549 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
550 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
551 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
552 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
554 $this->product->dir_output = $rootfordata.
"/produit";
555 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
556 $this->service->dir_output = $rootfordata.
"/produit";
557 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
560 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
561 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
564 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
565 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
567 $this->contrat->dir_output = $rootfordata.
"/contract";
568 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
571 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
572 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
574 $this->bank->dir_output = $rootfordata.
"/bank";
575 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
579 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
582 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
583 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
585 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
586 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
589 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
590 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
592 if (empty($this->global->TICKET_ADDON)) {
593 $this->global->TICKET_ADDON =
'mod_ticket_simple';
597 if (empty($this->global->USER_PASSWORD_GENERATED)) {
598 $this->global->USER_PASSWORD_GENERATED =
'standard';
600 if (empty($this->global->MAIN_UMASK)) {
601 $this->global->MAIN_UMASK =
'0664';
605 $this->use_javascript_ajax = 1;
606 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
607 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
610 if (empty($this->use_javascript_ajax)) {
611 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
612 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
613 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
614 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
617 if (!empty($this->productbatch->enabled)) {
618 $this->global->STOCK_CALCULATE_ON_BILL = 0;
619 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
620 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
621 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
622 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
623 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
624 if (empty($this->reception->enabled)) {
625 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
627 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
628 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
632 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
633 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
637 if (empty($this->global->MAIN_MONNAIE)) {
638 $this->global->MAIN_MONNAIE =
'EUR';
640 $this->currency = $this->global->MAIN_MONNAIE;
642 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
643 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
647 if (empty($this->global->ACCOUNTING_MODE)) {
648 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
652 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
653 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
657 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
658 $this->global->PROJECT_BILL_TIME_SPENT = 1;
662 if (!isset($this->global->MAIN_HTML_TITLE)) {
663 $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
667 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
668 $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
670 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
673 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
674 $this->global->PRODUIT_LIMIT_SIZE = 1000;
676 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
679 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
682 if (empty($this->global->MAIN_THEME)) {
683 $this->global->MAIN_THEME =
"eldy";
685 if (!empty($this->global->MAIN_FORCETHEME)) {
686 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
688 $this->theme = $this->global->MAIN_THEME;
689 $this->css =
"/theme/".$this->theme.
"/style.css.php";
692 $this->email_from =
"robot@example.com";
693 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
694 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
698 $this->notification->email_from = $this->email_from;
699 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
700 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
704 $this->mailing->email_from = $this->email_from;
705 if (!empty($this->global->MAILING_EMAIL_FROM)) {
706 $this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
709 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
710 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
713 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
714 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
718 $this->format_date_short =
"%d/%m/%Y";
719 $this->format_date_short_java =
"dd/MM/yyyy";
720 $this->format_hour_short =
"%H:%M";
721 $this->format_hour_short_duration =
"%H:%M";
722 $this->format_date_text_short =
"%d %b %Y";
723 $this->format_date_text =
"%d %B %Y";
724 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
725 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
726 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
727 $this->format_date_hour_text =
"%d %B %Y %H:%M";
730 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
731 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
735 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
736 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
738 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
739 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
741 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
742 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
746 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
747 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
749 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
750 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
757 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
758 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
762 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
763 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
767 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
768 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
772 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
773 $this->global->MAIN_SHOW_STATE_CODE = 1;
777 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
778 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
782 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
783 $this->global->USE_STRICT_CSV_RULES = 2;
787 if (!isset($this->global->ACCOUNTING_REEXPORT)) {
788 $this->global->ACCOUNTING_REEXPORT = 1;
792 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
793 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
797 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
798 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog';
800 if (!empty($this->modules_parts[
'moduleforexternal'])) {
801 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
802 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
807 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
808 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
812 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
813 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
815 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
816 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
820 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
821 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
823 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
824 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
826 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
827 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
829 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
830 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
835 if (isset($this->agenda)) {
836 $this->adherent->subscription =
new stdClass();
837 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
839 if (isset($this->agenda)) {
840 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
842 if (isset($this->projet)) {
843 $this->projet->warning_delay = (isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE) ? $this->global->MAIN_DELAY_PROJECT_TO_CLOSE : 7) * 86400;
844 $this->projet->task =
new StdClass();
845 $this->projet->task->warning_delay = (isset($this->global->MAIN_DELAY_TASKS_TODO) ? $this->global->MAIN_DELAY_TASKS_TODO : 7) * 86400;
848 if (isset($this->commande)) {
849 $this->commande->client =
new stdClass();
850 $this->commande->fournisseur =
new stdClass();
851 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
852 $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
854 if (isset($this->propal)) {
855 $this->propal->cloture =
new stdClass();
856 $this->propal->facturation =
new stdClass();
857 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
858 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
860 if (isset($this->facture)) {
861 $this->facture->client =
new stdClass();
862 $this->facture->fournisseur =
new stdClass();
863 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
864 $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
866 if (isset($this->contrat)) {
867 $this->contrat->services =
new stdClass();
868 $this->contrat->services->inactifs =
new stdClass();
869 $this->contrat->services->expires =
new stdClass();
870 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
871 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
873 if (isset($this->commande)) {
874 $this->bank->rappro =
new stdClass();
875 $this->bank->cheque =
new stdClass();
876 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
877 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
879 if (isset($this->expensereport)) {
880 $this->expensereport->approve =
new stdClass();
881 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
882 $this->expensereport->payment =
new stdClass();
883 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
885 if (isset($this->holiday)) {
886 $this->holiday->approve =
new stdClass();
887 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
890 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
891 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
895 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
896 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
898 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
899 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
902 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
903 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
907 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
908 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
911 if (!isset($this->global->MAIN_JS_GRAPH)) {
912 $this->global->MAIN_JS_GRAPH =
'chart';
915 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
916 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
918 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
919 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
923 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
927 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
931 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
932 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
935 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
936 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
937 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
939 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
940 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
945 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
946 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
947 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
948 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
949 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
953 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
954 $this->global->LDAP_MEMBER_ACTIVE = 2;
957 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
958 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
961 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
962 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
965 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
966 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
968 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
972 if (isset($this->product)) {
974 $this->produit = $this->product;
977 if (isset($this->facture)) {
978 $this->invoice = $this->facture;
981 if (isset($this->commande)) {
982 $this->order = $this->commande;
985 if (isset($this->contrat)) {
986 $this->contract = $this->contrat;
989 if (isset($this->categorie)) {
990 $this->category = $this->categorie;
993 if (isset($this->projet) && !isset($this->project)) {
994 $this->project = $this->projet;
997 if (isset($this->adherent) && !isset($this->member)) {
998 $this->member = $this->adherent;
1002 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
1003 if (is_object($mc)) {
1004 $mc->setValues($this);
1008 if (!empty($this->syslog->enabled)) {
1010 if (!empty($this->global->SYSLOG_HANDLERS)) {
1011 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1013 $handlers = array();
1015 foreach ($handlers as $handler) {
1016 $handler_file_found =
'';
1017 $dirsyslogs = array(
'/core/modules/syslog/');
1018 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1019 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1021 foreach ($dirsyslogs as $reldir) {
1024 if (is_dir($newdir)) {
1025 $file = $newdir.$handler.
'.php';
1026 if (file_exists($file)) {
1027 $handler_file_found = $file;
1033 if (empty($handler_file_found)) {
1039 require_once $handler_file_found;
1040 $loghandlerinstance =
new $handler();
1042 throw new Exception(
'Log handler does not extend LogHandlerInterface');
1045 if (empty($this->loghandlers[$handler])) {
1046 $this->loghandlers[$handler] = $loghandlerinstance;
1053 if (!empty($this->file->mailing_limit_sendbyweb)) {
1054 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1056 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1057 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1059 if (!empty($this->file->mailing_limit_sendbycli)) {
1060 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1062 if (!empty($this->file->mailing_limit_sendbyday)) {
1063 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;