438 if (!empty($this->modules)) {
439 foreach ($this->modules as $m) {
440 if (isset($this->$m)) {
457 $this->fournisseur =
new stdClass();
470 $this->notification =
new stdClass();
471 $this->expensereport =
new stdClass();
472 $this->productbatch =
new stdClass();
475 $this->cache = array();
476 $this->modules = array();
477 $this->modules_parts = array(
481 'triggers' => array(),
483 'substitutions' => array(),
488 'barcode' => array(),
490 'societe' => array(),
495 'websitetemplates' => array(),
498 if (!is_null($db) && is_object($db)) {
499 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
502 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
503 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
504 $sql .=
" FROM ".$db->prefix().
"const";
505 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
506 $sql .=
" ORDER BY entity";
508 $resql = $db->query($sql);
511 $numr = $db->num_rows($resql);
513 $objp = $db->fetch_object($resql);
515 $value = $objp->value;
518 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
519 $value = $_SERVER[
'DOLIBARR_'.$key];
520 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
521 $value = $_ENV[
'DOLIBARR_'.$key];
526 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
529 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
531 $params = explode(
':', $value, 2);
532 if (!is_array($this->modules_parts[$partname])) {
533 $this->modules_parts[$partname] = array();
535 $this->modules_parts[$partname][$params[0]][] = $value;
536 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
543 $modulename = strtolower($reg[1]);
544 $partname = strtolower($reg[2]);
545 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
546 $this->modules_parts[$partname] = array();
550 $arrValue = json_decode($value,
true);
553 if (is_array($arrValue)) {
554 $newvalue = $arrValue;
555 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
556 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
557 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
558 $newvalue =
'/'.$modulename.
'/';
559 } elseif (in_array($partname, array(
'captcha'))) {
560 $newvalue =
'/'.$modulename.
'/core/modules/security/'.$partname.
'/';
561 } elseif ($value == 1) {
562 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
567 if (!empty($newvalue)) {
568 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
570 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
572 $modulename = strtolower($reg[1]);
573 if ($modulename ==
'propale') {
574 $modulename =
'propal';
576 if ($modulename ==
'supplierproposal') {
577 $modulename =
'supplier_proposal';
579 $this->modules[$modulename] = $modulename;
583 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
584 $this->$modulename =
new stdClass();
586 $this->$modulename->enabled =
true;
611 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
612 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
613 foreach ($filesList as $file) {
625 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
627 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
629 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
634 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
636 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
637 if ($ret && class_exists(
'ActionsMulticompany')) {
638 $mc =
new ActionsMulticompany($db);
643 if (empty($this->global->MAIN_MENU_STANDARD)) {
644 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
646 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
647 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
649 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
650 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
652 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
653 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
655 if (!isset($this->global->FACTURE_TVAOPTION)) {
656 $this->global->FACTURE_TVAOPTION = 1;
660 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
661 $this->global->LDAP_FIELD_FULLNAME =
'';
663 if (!isset($this->global->LDAP_KEY_USERS)) {
664 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
666 if (!isset($this->global->LDAP_KEY_GROUPS)) {
667 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
669 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
670 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
672 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
673 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
675 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
676 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
680 if (empty($this->global->MAIN_LANG_DEFAULT)) {
681 $this->global->MAIN_LANG_DEFAULT =
"en_US";
684 $rootfordata = DOL_DATA_ROOT;
685 $rootforuser = DOL_DATA_ROOT;
687 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
688 $rootfordata .=
'/'.$this->entity;
691 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
694 foreach ($this->modules as $module) {
697 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
698 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
700 $this->$module->dir_output = $rootfordata.
"/".$module;
701 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
705 if (!empty($this->modules_parts[
'dir'])) {
706 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
707 if (!empty($this->$module->enabled)) {
708 foreach ($dirs as $type => $name) {
709 $multidirname =
'multidir_'.$type;
710 $dirname =
'dir_'.$type;
712 if ($type !=
'temp') {
714 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
717 $this->$module->$dirname = $rootfordata.
"/".$name;
720 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
723 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
731 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
732 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
734 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
735 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
738 $this->admin->dir_output = $rootfordata.
'/admin';
739 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
742 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
743 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
745 $this->
user->dir_output = $rootforuser.
"/users";
746 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
749 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
750 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
752 $this->propal->dir_output = $rootfordata.
"/propale";
753 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
756 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
757 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
762 if (isModEnabled(
'fournisseur')) {
763 $this->fournisseur->commande =
new stdClass();
764 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
765 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
766 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
767 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
769 $this->fournisseur->facture =
new stdClass();
770 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
771 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
772 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
773 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
775 $this->supplier_proposal =
new stdClass();
776 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
777 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
778 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
779 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
781 $this->fournisseur->payment =
new stdClass();
782 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
783 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
784 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
785 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
789 $this->supplier_order =
new stdClass();
790 $this->supplier_order->enabled = 1;
791 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
792 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
793 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
794 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
796 $this->supplier_invoice =
new stdClass();
797 $this->supplier_invoice->enabled = 1;
798 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
799 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
800 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
801 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
806 $this->compta->payment =
new stdClass();
807 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
808 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
811 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
812 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
813 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
814 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
816 $this->product->dir_output = $rootfordata.
"/produit";
817 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
818 $this->service->dir_output = $rootfordata.
"/produit";
819 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
822 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
823 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
826 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
827 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
829 $this->contrat->dir_output = $rootfordata.
"/contract";
830 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
833 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
834 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
836 $this->bank->dir_output = $rootfordata.
"/bank";
837 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
841 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
844 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
845 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
847 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
848 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
851 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
852 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
854 if (empty($this->global->TICKET_ADDON)) {
855 $this->global->TICKET_ADDON =
'mod_ticket_simple';
859 if (empty($this->global->USER_PASSWORD_GENERATED)) {
860 $this->global->USER_PASSWORD_GENERATED =
'standard';
862 if (empty($this->global->MAIN_UMASK)) {
863 $this->global->MAIN_UMASK =
'0660';
867 $tmpumask = decoct($tmpumask);
868 if (!preg_match(
'/^0/', $tmpumask)) {
869 $tmpumask =
'0'.$tmpumask;
871 if (empty($tmpumask)) {
874 $this->global->MAIN_UMASK = $tmpumask;
878 $this->use_javascript_ajax = 1;
879 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
880 $this->use_javascript_ajax = (int) !$this->global->MAIN_DISABLE_JAVASCRIPT;
883 if (empty($this->use_javascript_ajax)) {
884 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
885 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
886 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
887 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
890 if (isModEnabled(
'productbatch')) {
892 $this->global->STOCK_CALCULATE_ON_BILL = 0;
893 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
894 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
895 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
897 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
898 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
900 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
901 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
902 if (!isModEnabled(
'reception')) {
903 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
905 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
906 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
908 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
909 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
914 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
915 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
919 if (empty($this->global->MAIN_MONNAIE)) {
920 $this->global->MAIN_MONNAIE =
'EUR';
922 $this->currency = $this->global->MAIN_MONNAIE;
924 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
925 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
929 if (empty($this->global->ACCOUNTING_MODE)) {
930 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
933 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
934 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
938 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
939 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
943 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
944 $this->global->PROJECT_BILL_TIME_SPENT = 1;
948 if (!isset($this->global->MAIN_HTML_TITLE)) {
949 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
955 if ((
int) $this->liste_limit <= 0) {
957 $this->liste_limit = 15;
958 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 700) {
959 $this->liste_limit = 8;
960 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
961 $this->liste_limit = 10;
962 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
963 $this->liste_limit = 20;
968 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
969 $this->global->PRODUIT_LIMIT_SIZE = 1000;
973 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
976 if (empty($this->global->MAIN_THEME)) {
977 $this->global->MAIN_THEME =
"eldy";
979 if (!empty($this->global->MAIN_FORCETHEME)) {
980 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
982 $this->theme = $this->global->MAIN_THEME;
983 $this->css =
"/theme/".$this->theme.
"/style.css.php";
986 $this->email_from =
"robot@example.com";
987 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
988 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
992 if (isModEnabled(
'notification')) {
993 $this->notification->email_from = $this->email_from;
994 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
995 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
999 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1000 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
1003 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1004 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1008 $this->format_date_short =
"%d/%m/%Y";
1009 $this->format_date_short_java =
"dd/MM/yyyy";
1010 $this->format_hour_short =
"%H:%M";
1011 $this->format_hour_short_duration =
"%H:%M";
1012 $this->format_date_text_short =
"%d %b %Y";
1013 $this->format_date_text =
"%d %B %Y";
1014 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1015 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1016 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1017 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1020 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1021 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1025 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1026 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1028 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1029 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1031 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1032 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1036 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
1037 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1;
1039 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
1040 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1;
1044 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1045 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1047 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1048 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1050 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1051 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1058 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1059 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1063 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1064 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1068 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1069 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1073 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1074 $this->global->MAIN_SHOW_STATE_CODE = 1;
1078 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1079 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1083 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1084 $this->global->USE_STRICT_CSV_RULES = 2;
1088 if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1089 $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1;
1093 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
1094 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1098 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1099 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog,ticket';
1101 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1102 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1103 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1109 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1110 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1114 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1115 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1117 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1118 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1122 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1123 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1125 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1126 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1128 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1129 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1131 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1132 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1137 if (isset($this->agenda)) {
1138 $this->adherent->subscription =
new stdClass();
1139 $this->adherent->subscription->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MEMBERS') * 86400;
1141 if (isset($this->agenda)) {
1142 $this->agenda->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO', 7) * 86400;
1144 if (isset($this->projet)) {
1145 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1146 $this->projet->task =
new StdClass();
1147 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1150 if (isset($this->commande)) {
1151 $this->commande->client =
new stdClass();
1152 $this->commande->fournisseur =
new stdClass();
1153 $this->commande->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400;
1154 $this->commande->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400;
1156 if (isset($this->propal)) {
1157 $this->propal->cloture =
new stdClass();
1158 $this->propal->facturation =
new stdClass();
1159 $this->propal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_CLOSE') * 86400;
1160 $this->propal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_BILL') * 86400;
1162 if (isset($this->facture)) {
1163 $this->facture->client =
new stdClass();
1164 $this->facture->fournisseur =
new stdClass();
1165 $this->facture->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400;
1166 $this->facture->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400;
1168 if (isset($this->contrat)) {
1169 $this->contrat->services =
new stdClass();
1170 $this->contrat->services->inactifs =
new stdClass();
1171 $this->contrat->services->expires =
new stdClass();
1172 $this->contrat->services->inactifs->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400;
1173 $this->contrat->services->expires->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_RUNNING_SERVICES') * 86400;
1175 if (isset($this->bank)) {
1176 $this->bank->rappro =
new stdClass();
1177 $this->bank->cheque =
new stdClass();
1178 $this->bank->rappro->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400;
1179 $this->bank->cheque->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400;
1181 if (isset($this->expensereport)) {
1182 $this->expensereport->approve =
new stdClass();
1183 $this->expensereport->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_EXPENSEREPORTS') * 86400;
1184 $this->expensereport->payment =
new stdClass();
1185 $this->expensereport->payment->warning_delay =
getDolGlobalInt(
'MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400;
1187 if (isset($this->holiday)) {
1188 $this->holiday->approve =
new stdClass();
1189 $this->holiday->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_HOLIDAYS') * 86400;
1193 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1196 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1197 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1201 if (!isset($this->main_checkbox_left_column)) {
1202 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
1206 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1209 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1213 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1214 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1218 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1219 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1222 if (!isset($this->global->MAIN_JS_GRAPH)) {
1223 $this->global->MAIN_JS_GRAPH =
'chart';
1226 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1227 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1230 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1231 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1233 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1234 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1238 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1242 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1246 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1247 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1250 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1251 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1254 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1255 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1256 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1258 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1259 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1264 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1265 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1266 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1267 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1268 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1272 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1273 $this->global->LDAP_MEMBER_ACTIVE = 2;
1276 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1277 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1280 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1281 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1284 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1285 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1287 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1294 if (isset($this->product)) {
1296 $this->produit = $this->product;
1299 if (isset($this->facture)) {
1300 $this->invoice = $this->facture;
1303 if (isset($this->commande)) {
1304 $this->order = $this->commande;
1307 if (isset($this->contrat)) {
1308 $this->contract = $this->contrat;
1311 if (isset($this->categorie)) {
1312 $this->category = $this->categorie;
1315 if (isset($this->projet) && !isset($this->project)) {
1319 if (isset($this->adherent) && !isset($this->member)) {
1320 $this->member = $this->adherent;
1324 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1325 if (is_object($mc)) {
1326 $mc->setValues($this);
1330 if (isModEnabled(
'syslog')) {
1332 if (!empty($this->global->SYSLOG_HANDLERS)) {
1333 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1335 $handlers = array();
1337 foreach ($handlers as $handler) {
1338 $handler_file_found =
'';
1339 $dirsyslogs = array(
'/core/modules/syslog/');
1340 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1341 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1343 foreach ($dirsyslogs as $reldir) {
1346 if (is_dir($newdir)) {
1347 $file = $newdir.$handler.
'.php';
1348 if (file_exists($file)) {
1349 $handler_file_found = $file;
1355 if (empty($handler_file_found)) {
1361 require_once $handler_file_found;
1362 $loghandlerinstance =
new $handler();
1363 if (!$loghandlerinstance instanceof
LogHandler) {
1364 throw new Exception(
'Log handler does not extend LogHandler');
1367 if (empty($this->loghandlers[$handler])) {
1368 $this->loghandlers[$handler] = $loghandlerinstance;
1375 if (!empty($this->file->mailing_limit_sendbyweb)) {
1376 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1378 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1379 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1381 if (!empty($this->file->mailing_limit_sendbycli)) {
1382 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1384 if (!empty($this->file->mailing_limit_sendbyday)) {
1385 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;