490 if (!empty($this->modules)) {
491 foreach ($this->modules as $m) {
492 if (isset($this->$m)) {
509 $this->fournisseur =
new stdClass();
522 $this->notification =
new stdClass();
523 $this->expensereport =
new stdClass();
524 $this->productbatch =
new stdClass();
528 $this->cache = array();
529 $this->modules = array();
530 $this->modules_parts = array(
534 'triggers' => array(),
536 'substitutions' => array(),
541 'barcode' => array(),
543 'societe' => array(),
548 'websitetemplates' => array(),
551 if (!is_null($db) && is_object($db)) {
552 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
555 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
556 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
557 $sql .=
" FROM ".$db->prefix().
"const";
558 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
559 $sql .=
" ORDER BY entity";
561 $resql = $db->query($sql);
564 $numr = $db->num_rows($resql);
566 $objp = $db->fetch_object($resql);
568 $value = $objp->value;
571 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
572 $value = $_SERVER[
'DOLIBARR_'.$key];
573 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
574 $value = $_ENV[
'DOLIBARR_'.$key];
579 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
582 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
584 $params = explode(
':', $value, 2);
585 if (!is_array($this->modules_parts[$partname])) {
586 $this->modules_parts[$partname] = array();
588 $this->modules_parts[$partname][$params[0]][] = $value;
589 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
596 $modulename = strtolower($reg[1]);
597 $partname = strtolower($reg[2]);
598 if (!array_key_exists($partname, $this->modules_parts) || !is_array($this->modules_parts[$partname])) {
599 $this->modules_parts[$partname] = array();
603 $arrValue = json_decode($value,
true);
606 if (is_array($arrValue)) {
607 $newvalue = $arrValue;
608 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
609 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
610 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
611 $newvalue =
'/'.$modulename.
'/';
612 } elseif (in_array($partname, array(
'captcha'))) {
613 $newvalue =
'/'.$modulename.
'/core/modules/security/'.$partname.
'/';
614 } elseif ($value == 1) {
615 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
620 if (!empty($newvalue)) {
621 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
623 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
625 $modulename = strtolower($reg[1]);
626 if ($modulename ==
'propale') {
627 $modulename =
'propal';
629 if ($modulename ==
'supplierproposal') {
630 $modulename =
'supplier_proposal';
632 $this->modules[$modulename] = $modulename;
636 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
637 $this->$modulename =
new stdClass();
639 $this->$modulename->enabled =
true;
664 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
665 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
666 foreach ($filesList as $file) {
678 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
680 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
682 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
689 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
690 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
691 if ($ret && class_exists(
'ActionsMulticompany')) {
692 $mc =
new ActionsMulticompany($db);
697 if (empty($this->global->MAIN_MENU_STANDARD)) {
698 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
700 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
701 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
703 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
704 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
706 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
707 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
709 if (!isset($this->global->FACTURE_TVAOPTION)) {
710 $this->global->FACTURE_TVAOPTION = 1;
714 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
715 $this->global->LDAP_FIELD_FULLNAME =
'';
717 if (!isset($this->global->LDAP_KEY_USERS)) {
718 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
720 if (!isset($this->global->LDAP_KEY_GROUPS)) {
721 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
723 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
724 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
726 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
727 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
729 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
730 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
734 if (empty($this->global->MAIN_LANG_DEFAULT)) {
735 $this->global->MAIN_LANG_DEFAULT =
"en_US";
738 $rootfordata = DOL_DATA_ROOT;
739 $rootforuser = DOL_DATA_ROOT;
741 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
742 $rootfordata .=
'/'.$this->entity;
745 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
748 foreach ($this->modules as $module) {
751 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
752 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
754 $this->$module->dir_output = $rootfordata.
"/".$module;
755 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
759 if (!empty($this->modules_parts[
'dir'])) {
760 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
761 if (!empty($this->$module->enabled)) {
762 foreach ($dirs as $type => $name) {
763 $multidirname =
'multidir_'.$type;
764 $dirname =
'dir_'.$type;
766 if ($type !=
'temp') {
768 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
771 $this->$module->$dirname = $rootfordata.
"/".$name;
774 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
777 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
785 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
786 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
788 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
789 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
792 $this->admin->dir_output = $rootfordata.
'/admin';
793 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
796 $this->api->dir_output = $rootfordata.
'/api';
797 $this->api->dir_temp = $rootfortemp.
'/api/temp';
800 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
801 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
803 $this->
user->dir_output = $rootforuser.
"/users";
804 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
807 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
808 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
810 $this->propal->dir_output = $rootfordata.
"/propale";
811 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
814 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
815 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
820 if (isModEnabled(
'fournisseur')) {
821 $this->fournisseur->commande =
new stdClass();
822 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
823 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
824 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
825 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
827 $this->fournisseur->facture =
new stdClass();
828 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
829 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
830 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
831 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
833 $this->supplier_proposal =
new stdClass();
834 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
835 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
836 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
837 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
839 $this->fournisseur->payment =
new stdClass();
840 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
841 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
842 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
843 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
847 $this->supplier_order =
new stdClass();
848 $this->supplier_order->enabled = 1;
849 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
850 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
851 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
852 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
854 $this->supplier_invoice =
new stdClass();
855 $this->supplier_invoice->enabled = 1;
856 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
857 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
858 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
859 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
864 $this->compta->payment =
new stdClass();
865 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
866 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
869 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
870 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
871 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
872 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
874 $this->product->dir_output = $rootfordata.
"/produit";
875 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
876 $this->service->dir_output = $rootfordata.
"/produit";
877 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
880 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
881 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
884 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
885 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
887 $this->contrat->dir_output = $rootfordata.
"/contract";
888 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
891 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
892 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
894 $this->bank->dir_output = $rootfordata.
"/bank";
895 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
899 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
902 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
903 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
905 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
906 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
909 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
910 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
912 if (empty($this->global->TICKET_ADDON)) {
913 $this->global->TICKET_ADDON =
'mod_ticket_simple';
917 if (empty($this->global->USER_PASSWORD_GENERATED)) {
918 $this->global->USER_PASSWORD_GENERATED =
'standard';
920 if (empty($this->global->MAIN_UMASK)) {
921 $this->global->MAIN_UMASK =
'0660';
925 $tmpumask = decoct($tmpumask);
926 if (!preg_match(
'/^0/', $tmpumask)) {
927 $tmpumask =
'0'.$tmpumask;
929 if (empty($tmpumask)) {
932 $this->global->MAIN_UMASK = $tmpumask;
936 $this->use_javascript_ajax = 1;
937 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
938 $this->use_javascript_ajax = (int) !$this->global->MAIN_DISABLE_JAVASCRIPT;
941 if (empty($this->use_javascript_ajax)) {
942 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
943 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
944 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
945 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
948 if (isModEnabled(
'productbatch')) {
950 $this->global->STOCK_CALCULATE_ON_BILL = 0;
951 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
952 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
953 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
955 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
956 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
958 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
959 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
960 if (!isModEnabled(
'reception')) {
961 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
963 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
964 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
966 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
967 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
971 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
972 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
976 if (empty($this->global->MAIN_MONNAIE)) {
977 $this->global->MAIN_MONNAIE =
'EUR';
979 $this->currency = $this->global->MAIN_MONNAIE;
981 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
982 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
986 if (empty($this->global->ACCOUNTING_MODE)) {
987 $this->global->ACCOUNTING_MODE =
'CREANCES-DETTES';
990 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
991 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 1;
995 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
996 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
1000 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
1001 $this->global->PROJECT_BILL_TIME_SPENT = 1;
1005 if (!isset($this->global->MAIN_HTML_TITLE)) {
1006 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
1009 if (!isset($this->global->MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME)) {
1010 $this->global->MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME = 1;
1016 if ((
int) $this->liste_limit <= 0) {
1018 $this->liste_limit = 15;
1019 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 700) {
1020 $this->liste_limit = 8;
1021 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
1022 $this->liste_limit = 10;
1023 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
1024 $this->liste_limit = 20;
1029 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
1030 $this->global->PRODUIT_LIMIT_SIZE = 1000;
1034 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
1037 if (empty($this->global->MAIN_THEME)) {
1038 $this->global->MAIN_THEME =
"eldy";
1040 if (!empty($this->global->MAIN_FORCETHEME)) {
1041 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
1043 $this->theme = $this->global->MAIN_THEME;
1044 $this->css =
"/theme/".$this->theme.
"/style.css.php";
1047 $this->email_from =
"robot@example.com";
1048 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
1049 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
1053 if (isModEnabled(
'notification')) {
1054 $this->notification->email_from = $this->email_from;
1055 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
1056 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
1060 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1061 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
1064 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1065 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1069 $this->format_date_short =
"%d/%m/%Y";
1070 $this->format_date_short_java =
"dd/MM/yyyy";
1071 $this->format_hour_short =
"%H:%M";
1072 $this->format_hour_short_duration =
"%H:%M";
1073 $this->format_date_text_short =
"%d %b %Y";
1074 $this->format_date_text =
"%d %B %Y";
1075 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1076 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1077 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1078 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1081 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1082 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1086 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1087 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1089 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1090 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1092 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1093 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1097 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
1098 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1;
1100 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
1101 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1;
1105 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1106 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1108 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1109 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1111 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1112 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1119 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1120 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1124 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1125 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1129 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1130 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1134 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1135 $this->global->MAIN_SHOW_STATE_CODE = 1;
1139 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1140 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1144 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1145 $this->global->USE_STRICT_CSV_RULES = 2;
1149 if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1150 $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1;
1154 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
1155 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1159 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1160 $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';
1162 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1163 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1164 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1170 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1171 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1175 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1176 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1178 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1179 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1183 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1184 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1186 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1187 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1189 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1190 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1192 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1193 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1198 if (isset($this->agenda)) {
1199 $this->adherent->subscription =
new stdClass();
1200 $this->adherent->subscription->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MEMBERS') * 86400;
1202 if (isset($this->agenda)) {
1203 $this->agenda->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO', 7) * 86400;
1205 if (isset($this->projet)) {
1206 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1207 $this->projet->task =
new StdClass();
1208 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1211 if (isset($this->commande)) {
1212 $this->commande->client =
new stdClass();
1213 $this->commande->fournisseur =
new stdClass();
1214 $this->commande->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400;
1215 $this->commande->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400;
1217 if (isset($this->propal)) {
1218 $this->propal->cloture =
new stdClass();
1219 $this->propal->facturation =
new stdClass();
1220 $this->propal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_CLOSE') * 86400;
1221 $this->propal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_BILL') * 86400;
1224 if (isset($this->supplier_proposal)) {
1225 $this->supplier_proposal->cloture =
new stdClass();
1226 $this->supplier_proposal->facturation =
new stdClass();
1227 $this->supplier_proposal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE') * 86400;
1228 $this->supplier_proposal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL') * 86400;
1230 if (isset($this->facture)) {
1231 $this->facture->client =
new stdClass();
1232 $this->facture->fournisseur =
new stdClass();
1233 $this->facture->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400;
1234 $this->facture->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400;
1236 if (isset($this->contrat)) {
1237 $this->contrat->services =
new stdClass();
1238 $this->contrat->services->inactifs =
new stdClass();
1239 $this->contrat->services->expires =
new stdClass();
1240 $this->contrat->services->inactifs->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400;
1241 $this->contrat->services->expires->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_RUNNING_SERVICES') * 86400;
1244 $this->bank->rappro =
new stdClass();
1245 $this->bank->cheque =
new stdClass();
1246 $this->bank->rappro->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400;
1247 $this->bank->cheque->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400;
1249 if (isset($this->expensereport)) {
1250 $this->expensereport->approve =
new stdClass();
1251 $this->expensereport->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_EXPENSEREPORTS') * 86400;
1252 $this->expensereport->payment =
new stdClass();
1253 $this->expensereport->payment->warning_delay =
getDolGlobalInt(
'MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400;
1255 if (isset($this->holiday)) {
1256 $this->holiday->approve =
new stdClass();
1257 $this->holiday->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_HOLIDAYS') * 86400;
1259 if (isset($this->mrp)) {
1260 $this->mrp->progress =
new stdClass();
1261 $this->mrp->progress->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MRP') * 86400;
1265 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1268 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1269 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1273 if (!isset($this->main_checkbox_left_column)) {
1274 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
1278 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1279 $this->dol_hide_topmenu = (int) (
bool)
getDolGlobalInt(
'MAIN_HIDE_TOP_MENU');
1281 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1282 $this->dol_hide_leftmenu = (int) (
bool)
getDolGlobalInt(
'MAIN_HIDE_LEFT_MENU');
1285 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1286 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1290 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1291 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1294 if (!isset($this->global->MAIN_JS_GRAPH)) {
1295 $this->global->MAIN_JS_GRAPH =
'chart';
1298 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1299 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1302 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1303 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com/api/';
1305 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1306 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorepublicapi';
1310 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1314 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1318 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1319 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1322 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1323 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1326 if (!empty($this->use_javascript_ajax) &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') >= 1) {
1327 $this->global->EMAILING_USE_ADVANCED_SELECTOR = 1;
1331 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1332 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1333 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1335 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1336 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1340 if (!isset($this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)) {
1341 $this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1;
1343 if (!isset($this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY) && extension_loaded(
'tidy') && class_exists(
"tidy")) {
1344 $this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1;
1347 if (!isset($this->global->MAIN_DISALLOW_UNSECURED_SELECT_INTO_EXTRAFIELDS_FILTER)) {
1349 $this->global->MAIN_DISALLOW_UNSECURED_SELECT_INTO_EXTRAFIELDS_FILTER = 0;
1353 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1354 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1355 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1356 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1357 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1361 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1362 $this->global->LDAP_MEMBER_ACTIVE = 2;
1365 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1366 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1369 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1370 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1376 if (isset($this->product)) {
1378 $this->produit = $this->product;
1381 if (isset($this->facture)) {
1382 $this->invoice = $this->facture;
1385 if (isset($this->commande)) {
1386 $this->order = $this->commande;
1389 if (isset($this->contrat)) {
1390 $this->contract = $this->contrat;
1393 if (isset($this->categorie)) {
1394 $this->category = $this->categorie;
1397 if (isset($this->projet) && !isset($this->project)) {
1398 $this->project = $this->projet;
1401 if (isset($this->adherent) && !isset($this->member)) {
1402 $this->member = $this->adherent;
1406 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1407 if (is_object($mc)) {
1408 $mc->setValues($this);
1412 if (isModEnabled(
'syslog')) {
1414 if (!empty($this->global->SYSLOG_HANDLERS)) {
1415 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1417 $handlers = array();
1419 foreach ($handlers as $handler) {
1420 $handler_file_found =
'';
1421 $dirsyslogs = array(
'/core/modules/syslog/');
1422 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1423 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1425 foreach ($dirsyslogs as $reldir) {
1428 if (is_dir($newdir)) {
1429 $file = $newdir.$handler.
'.php';
1430 if (file_exists($file)) {
1431 $handler_file_found = $file;
1437 if (empty($handler_file_found)) {
1443 require_once $handler_file_found;
1444 $loghandlerinstance =
new $handler();
1445 if (!$loghandlerinstance instanceof
LogHandler) {
1446 throw new Exception(
'Log handler does not extend LogHandler');
1449 if (empty($this->loghandlers[$handler])) {
1450 $this->loghandlers[$handler] = $loghandlerinstance;
1457 if (!empty($this->file->mailing_limit_sendbyweb)) {
1458 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1460 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1461 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1463 if (!empty($this->file->mailing_limit_sendbycli)) {
1464 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1466 if (!empty($this->file->mailing_limit_sendbyday)) {
1467 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;