32 #[AllowDynamicProperties]
59 public $delivery_note;
77 public $modules_parts;
90 public $logbuffer = array();
95 public $loghandlers = array();
102 public $dol_hide_topmenu;
103 public $dol_hide_leftmenu;
104 public $dol_optimize_smallscreen;
105 public $dol_no_mouse_hover;
106 public $dol_use_jmobile;
110 public $tzuserinputkey =
'tzserver';
125 public $notification;
126 public $expensereport;
127 public $productbatch;
137 $this->file =
new stdClass();
138 $this->db =
new stdClass();
140 $this->file->character_set_client =
'UTF-8';
143 $this->mycompany =
new stdClass();
144 $this->admin =
new stdClass();
145 $this->medias =
new stdClass();
146 $this->global =
new stdClass();
149 $this->browser =
new stdClass();
152 $this->cache = array();
153 $this->modules = array();
154 $this->modules_parts = array(
158 'triggers' => array(),
160 'substitutions' => array(),
165 'barcode' => array(),
167 'societe' => array(),
176 $this->multicompany =
new stdClass();
177 $this->fournisseur =
new stdClass();
178 $this->product =
new stdClass();
179 $this->service =
new stdClass();
180 $this->contrat =
new stdClass();
181 $this->actions =
new stdClass();
182 $this->agenda =
new stdClass();
183 $this->commande =
new stdClass();
184 $this->propal =
new stdClass();
185 $this->facture =
new stdClass();
186 $this->
user =
new stdClass();
187 $this->adherent =
new stdClass();
188 $this->bank =
new stdClass();
189 $this->notification =
new stdClass();
190 $this->expensereport =
new stdClass();
191 $this->productbatch =
new stdClass();
204 if ($this->entity !=
$entity) {
225 if (!empty($this->modules)) {
226 foreach ($this->modules as $m) {
227 if (isset($this->$m)) unset($this->$m);
232 $this->mycompany =
new stdClass();
233 $this->admin =
new stdClass();
234 $this->medias =
new stdClass();
235 $this->global =
new stdClass();
242 $this->fournisseur =
new stdClass();
243 $this->product =
new stdClass();
244 $this->service =
new stdClass();
245 $this->contrat =
new stdClass();
246 $this->actions =
new stdClass();
247 $this->agenda =
new stdClass();
248 $this->commande =
new stdClass();
249 $this->propal =
new stdClass();
250 $this->facture =
new stdClass();
251 $this->contrat =
new stdClass();
252 $this->
user =
new stdClass();
253 $this->adherent =
new stdClass();
254 $this->bank =
new stdClass();
255 $this->notification =
new stdClass();
256 $this->expensereport =
new stdClass();
257 $this->productbatch =
new stdClass();
260 $this->cache = array();
261 $this->modules = array();
262 $this->modules_parts = array(
266 'triggers' => array(),
268 'substitutions' => array(),
273 'barcode' => array(),
275 'societe' => array(),
282 if (!is_null($db) && is_object($db)) {
283 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
286 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
287 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
288 $sql .=
" FROM ".$db->prefix().
"const";
289 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
290 $sql .=
" ORDER BY entity";
292 $resql = $db->query(
$sql);
295 $numr = $db->num_rows($resql);
297 $objp = $db->fetch_object($resql);
299 $value = $objp->value;
302 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
303 $value = $_SERVER[
'DOLIBARR_'.$key];
304 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
305 $value = $_ENV[
'DOLIBARR_'.$key];
310 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
313 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
315 $params = explode(
':', $value, 2);
316 if (!is_array($this->modules_parts[$partname])) {
317 $this->modules_parts[$partname] = array();
319 $this->modules_parts[$partname][$params[0]][] = $value;
320 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
327 $modulename = strtolower($reg[1]);
328 $partname = strtolower($reg[2]);
329 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
330 $this->modules_parts[$partname] = array();
333 $arrValue = json_decode($value,
true);
335 if (is_array($arrValue)) {
336 $newvalue = $arrValue;
337 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
338 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
339 } elseif (in_array($partname, array(
'models',
'theme'))) {
340 $newvalue =
'/'.$modulename.
'/';
341 } elseif (in_array($partname, array(
'sms'))) {
342 $newvalue =
'/'.$modulename.
'/';
343 } elseif ($value == 1) {
344 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
349 if (!empty($newvalue)) {
350 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
352 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
354 $modulename = strtolower($reg[1]);
355 if ($modulename ==
'propale') {
356 $modulename =
'propal';
358 if ($modulename ==
'supplierproposal') {
359 $modulename =
'supplier_proposal';
361 $this->modules[$modulename] = $modulename;
363 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
364 $this->$modulename =
new stdClass();
366 $this->$modulename->enabled =
true;
377 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
378 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
379 foreach ($filesList as $file) {
391 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
393 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
395 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
400 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
402 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
404 $mc =
new ActionsMulticompany($db);
410 if (empty($this->global->MAIN_MENU_STANDARD)) {
411 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
413 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
414 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
416 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
417 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
419 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
420 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
422 if (!isset($this->global->FACTURE_TVAOPTION)) {
423 $this->global->FACTURE_TVAOPTION = 1;
427 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
428 $this->global->LDAP_FIELD_FULLNAME =
'';
430 if (!isset($this->global->LDAP_KEY_USERS)) {
431 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
433 if (!isset($this->global->LDAP_KEY_GROUPS)) {
434 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
436 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
437 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
439 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
440 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
442 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
443 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
447 if (empty($this->global->MAIN_LANG_DEFAULT)) {
448 $this->global->MAIN_LANG_DEFAULT =
"en_US";
451 $rootfordata = DOL_DATA_ROOT;
452 $rootforuser = DOL_DATA_ROOT;
454 if (
isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
455 $rootfordata .=
'/'.$this->entity;
458 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
461 foreach ($this->modules as $module) {
464 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
465 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
467 $this->$module->dir_output = $rootfordata.
"/".$module;
468 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
472 if (!empty($this->modules_parts[
'dir'])) {
473 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
474 if (!empty($this->$module->enabled)) {
475 foreach ($dirs as $type => $name) {
476 $multidirname =
'multidir_'.$type;
477 $dirname =
'dir_'.$type;
479 if ($type !=
'temp') {
481 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
484 $this->$module->$dirname = $rootfordata.
"/".$name;
487 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
490 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
498 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
499 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
502 $this->admin->dir_output = $rootfordata.
'/admin';
503 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
506 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
507 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
509 $this->
user->dir_output = $rootforuser.
"/users";
510 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
513 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
514 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
516 $this->propal->dir_output = $rootfordata.
"/propale";
517 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
520 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
521 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
526 if (!empty($this->fournisseur)) {
527 $this->fournisseur->commande =
new stdClass();
528 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
529 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
530 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
531 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
533 $this->fournisseur->facture =
new stdClass();
534 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
535 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
536 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
537 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
539 $this->supplierproposal =
new stdClass();
540 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
541 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
542 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
543 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
545 $this->fournisseur->payment =
new stdClass();
546 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
547 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
548 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
549 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
552 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) {
553 $this->supplier_order =
new stdClass();
554 $this->supplier_order->enabled = 1;
555 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
556 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
557 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
558 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
560 $this->supplier_invoice =
new stdClass();
561 $this->supplier_invoice->enabled = 1;
562 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
563 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
564 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
565 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
570 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
571 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
572 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
573 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
575 $this->product->dir_output = $rootfordata.
"/produit";
576 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
577 $this->service->dir_output = $rootfordata.
"/produit";
578 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
581 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
582 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
585 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
586 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
588 $this->contrat->dir_output = $rootfordata.
"/contract";
589 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
592 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
593 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
595 $this->bank->dir_output = $rootfordata.
"/bank";
596 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
600 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
603 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
604 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
606 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
607 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
610 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
611 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
613 if (empty($this->global->TICKET_ADDON)) {
614 $this->global->TICKET_ADDON =
'mod_ticket_simple';
618 if (empty($this->global->USER_PASSWORD_GENERATED)) {
619 $this->global->USER_PASSWORD_GENERATED =
'standard';
621 if (empty($this->global->MAIN_UMASK)) {
622 $this->global->MAIN_UMASK =
'0660';
625 $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666);
626 $tmpumask = decoct($tmpumask);
627 if (!preg_match(
'/^0/', $tmpumask)) {
628 $tmpumask =
'0'.$tmpumask;
630 if (empty($tmpumask) || $tmpumask ===
'0') {
633 $this->global->MAIN_UMASK = $tmpumask;
637 $this->use_javascript_ajax = 1;
638 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
639 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
642 if (empty($this->use_javascript_ajax)) {
643 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
644 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
645 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
646 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
651 $this->global->STOCK_CALCULATE_ON_BILL = 0;
652 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
653 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
654 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
655 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
656 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
658 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
660 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
661 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
665 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
666 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
670 if (empty($this->global->MAIN_MONNAIE)) {
671 $this->global->MAIN_MONNAIE =
'EUR';
673 $this->currency = $this->global->MAIN_MONNAIE;
675 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
676 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
680 if (empty($this->global->ACCOUNTING_MODE)) {
681 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
685 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
686 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
690 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
691 $this->global->PROJECT_BILL_TIME_SPENT = 1;
695 if (!isset($this->global->MAIN_HTML_TITLE)) {
696 $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
700 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
701 $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
703 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
706 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
707 $this->global->PRODUIT_LIMIT_SIZE = 1000;
709 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
712 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
715 if (empty($this->global->MAIN_THEME)) {
716 $this->global->MAIN_THEME =
"eldy";
718 if (!empty($this->global->MAIN_FORCETHEME)) {
719 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
721 $this->theme = $this->global->MAIN_THEME;
722 $this->css =
"/theme/".$this->theme.
"/style.css.php";
725 $this->email_from =
"robot@example.com";
726 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
727 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
732 $this->notification->email_from = $this->email_from;
733 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
734 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
738 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
739 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
742 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
743 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
747 $this->format_date_short =
"%d/%m/%Y";
748 $this->format_date_short_java =
"dd/MM/yyyy";
749 $this->format_hour_short =
"%H:%M";
750 $this->format_hour_short_duration =
"%H:%M";
751 $this->format_date_text_short =
"%d %b %Y";
752 $this->format_date_text =
"%d %B %Y";
753 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
754 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
755 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
756 $this->format_date_hour_text =
"%d %B %Y %H:%M";
759 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
760 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
764 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
765 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
767 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
768 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
770 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
771 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
775 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
776 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
778 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
779 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
786 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
787 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
791 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
792 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
796 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
797 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
801 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
802 $this->global->MAIN_SHOW_STATE_CODE = 1;
806 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
807 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
811 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
812 $this->global->USE_STRICT_CSV_RULES = 2;
816 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
817 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
821 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
822 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog';
824 if (!empty($this->modules_parts[
'moduleforexternal'])) {
825 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
826 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
831 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
832 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
836 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
837 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
839 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
840 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
844 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
845 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
847 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
848 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
850 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
851 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
853 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
854 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
859 if (isset($this->agenda)) {
860 $this->adherent->subscription =
new stdClass();
861 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
863 if (isset($this->agenda)) {
864 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
866 if (isset($this->projet)) {
867 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
868 $this->projet->task =
new StdClass();
869 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
872 if (isset($this->commande)) {
873 $this->commande->client =
new stdClass();
874 $this->commande->fournisseur =
new stdClass();
875 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
876 $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
878 if (isset($this->propal)) {
879 $this->propal->cloture =
new stdClass();
880 $this->propal->facturation =
new stdClass();
881 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
882 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
884 if (isset($this->facture)) {
885 $this->facture->client =
new stdClass();
886 $this->facture->fournisseur =
new stdClass();
887 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
888 $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? (int) $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
890 if (isset($this->contrat)) {
891 $this->contrat->services =
new stdClass();
892 $this->contrat->services->inactifs =
new stdClass();
893 $this->contrat->services->expires =
new stdClass();
894 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
895 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
897 if (isset($this->commande)) {
898 $this->bank->rappro =
new stdClass();
899 $this->bank->cheque =
new stdClass();
900 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
901 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
903 if (isset($this->expensereport)) {
904 $this->expensereport->approve =
new stdClass();
905 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
906 $this->expensereport->payment =
new stdClass();
907 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
909 if (isset($this->holiday)) {
910 $this->holiday->approve =
new stdClass();
911 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
914 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
915 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
919 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
920 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
922 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
923 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
926 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
927 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
931 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
932 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
935 if (!isset($this->global->MAIN_JS_GRAPH)) {
936 $this->global->MAIN_JS_GRAPH =
'chart';
939 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
940 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
942 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
943 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
947 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
951 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
955 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
956 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
959 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
960 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
963 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
964 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
965 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
967 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
968 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
973 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
974 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
975 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
976 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
977 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
981 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
982 $this->global->LDAP_MEMBER_ACTIVE = 2;
985 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
986 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
989 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
990 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
993 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
994 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
996 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1000 if (isset($this->product)) {
1002 $this->produit = $this->product;
1005 if (isset($this->facture)) {
1006 $this->invoice = $this->facture;
1009 if (isset($this->commande)) {
1010 $this->order = $this->commande;
1013 if (isset($this->contrat)) {
1014 $this->contract = $this->contrat;
1017 if (isset($this->categorie)) {
1018 $this->category = $this->categorie;
1021 if (isset($this->projet) && !isset($this->project)) {
1022 $this->project = $this->projet;
1025 if (isset($this->adherent) && !isset($this->member)) {
1026 $this->member = $this->adherent;
1030 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
1031 if (is_object($mc)) {
1032 $mc->setValues($this);
1038 if (!empty($this->global->SYSLOG_HANDLERS)) {
1039 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1041 $handlers = array();
1043 foreach ($handlers as $handler) {
1044 $handler_file_found =
'';
1045 $dirsyslogs = array(
'/core/modules/syslog/');
1046 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1047 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1049 foreach ($dirsyslogs as $reldir) {
1052 if (is_dir($newdir)) {
1053 $file = $newdir.$handler.
'.php';
1054 if (file_exists($file)) {
1055 $handler_file_found = $file;
1061 if (empty($handler_file_found)) {
1067 require_once $handler_file_found;
1068 $loghandlerinstance =
new $handler();
1070 throw new Exception(
'Log handler does not extend LogHandlerInterface');
1073 if (empty($this->loghandlers[$handler])) {
1074 $this->loghandlers[$handler] = $loghandlerinstance;
1081 if (!empty($this->file->mailing_limit_sendbyweb)) {
1082 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1084 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1085 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1087 if (!empty($this->file->mailing_limit_sendbycli)) {
1088 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1090 if (!empty($this->file->mailing_limit_sendbyday)) {
1091 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;