494 if (!empty($this->modules)) {
495 foreach ($this->modules as $m) {
496 if (isset($this->$m)) {
513 $this->fournisseur =
new stdClass();
526 $this->notification =
new stdClass();
527 $this->expensereport =
new stdClass();
528 $this->productbatch =
new stdClass();
532 $this->supplier_order =
null;
533 $this->supplier_invoice =
null;
536 $this->cache = array();
537 $this->modules = array();
538 $this->modules_parts = array(
542 'triggers' => array(),
544 'substitutions' => array(),
549 'barcode' => array(),
551 'societe' => array(),
556 'websitetemplates' => array(),
559 if (!is_null($db) && is_object($db)) {
560 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
563 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
564 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
565 $sql .=
" FROM ".$db->prefix().
"const";
566 $sql .=
" WHERE entity IN (0,".((int) $this->entity).
")";
567 $sql .=
" ORDER BY entity";
569 $resql = $db->query($sql);
572 $numr = $db->num_rows($resql);
574 $objp = $db->fetch_object($resql);
576 $value = $objp->value;
579 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
580 $value = $_SERVER[
'DOLIBARR_'.$key];
581 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
582 $value = $_ENV[
'DOLIBARR_'.$key];
587 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
590 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
592 $params = explode(
':', $value, 2);
593 if (!is_array($this->modules_parts[$partname])) {
594 $this->modules_parts[$partname] = array();
596 $this->modules_parts[$partname][$params[0]][] = $value;
597 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
604 $modulename = strtolower($reg[1]);
605 $partname = strtolower($reg[2]);
606 if (!array_key_exists($partname, $this->modules_parts) || !is_array($this->modules_parts[$partname])) {
607 $this->modules_parts[$partname] = array();
611 $arrValue = json_decode($value,
true);
614 if (is_array($arrValue)) {
615 $newvalue = $arrValue;
616 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
617 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
618 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
619 $newvalue =
'/'.$modulename.
'/';
620 } elseif (in_array($partname, array(
'captcha'))) {
621 $newvalue =
'/'.$modulename.
'/core/modules/security/'.$partname.
'/';
622 } elseif ($value == 1) {
623 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
628 if (!empty($newvalue)) {
630 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
632 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
634 $modulename = strtolower($reg[1]);
635 if ($modulename ==
'propale') {
636 $modulename =
'propal';
638 if ($modulename ==
'supplierproposal') {
639 $modulename =
'supplier_proposal';
641 if ($modulename ==
'supplierorder') {
642 $modulename =
'supplier_order';
644 if ($modulename ==
'supplierinvoice') {
645 $modulename =
'supplier_invoice';
647 $this->modules[$modulename] = $modulename;
651 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
652 $this->$modulename =
new stdClass();
655 $this->$modulename->enabled =
true;
666 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
667 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
668 foreach ($filesList as $file) {
680 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
682 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
684 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
691 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
692 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
693 if ($ret && class_exists(
'ActionsMulticompany')) {
694 $mc =
new ActionsMulticompany($db);
699 if (empty($this->global->MAIN_MENU_STANDARD)) {
700 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
702 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
703 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
705 if (!isset($this->global->FACTURE_TVAOPTION)) {
706 $this->global->FACTURE_TVAOPTION = 1;
713 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
714 $this->global->LDAP_FIELD_FULLNAME =
'';
716 if (!isset($this->global->LDAP_KEY_USERS)) {
717 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
719 if (!isset($this->global->LDAP_KEY_GROUPS)) {
720 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
722 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
723 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
725 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
726 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
728 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
729 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
733 if (empty($this->global->MAIN_LANG_DEFAULT)) {
734 $this->global->MAIN_LANG_DEFAULT =
"en_US";
737 $rootfordata = DOL_DATA_ROOT;
738 $rootforuser = DOL_DATA_ROOT;
740 if (
isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
741 $rootfordata .=
'/'.$this->entity;
744 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
747 foreach ($this->modules as
$module) {
751 if ($dirformodule ==
'banque') {
752 $dirformodule =
'bank';
757 $this->$dirformodule->multidir_output = array($this->entity => $rootfordata.
"/".$dirformodule);
758 $this->$dirformodule->multidir_temp = array($this->entity => $rootfortemp.
"/".$dirformodule.
"/temp");
760 $this->$dirformodule->dir_output = $rootfordata.
"/".$dirformodule;
761 $this->$dirformodule->dir_temp = $rootfortemp.
"/".$dirformodule.
"/temp";
765 if (!empty($this->modules_parts[
'dir'])) {
766 foreach ($this->modules_parts[
'dir'] as
$module => $dirs) {
767 if (!empty($this->$module->enabled)) {
768 foreach ($dirs as $type => $name) {
769 $multidirname =
'multidir_'.$type;
770 $dirname =
'dir_'.$type;
772 if ($type !=
'temp') {
774 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
777 $this->$module->$dirname = $rootfordata.
"/".$name;
780 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
783 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
791 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
792 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
794 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
795 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
798 $this->admin->dir_output = $rootfordata.
'/admin';
799 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
802 $this->api->dir_output = $rootfordata.
'/api';
803 $this->api->dir_temp = $rootfortemp.
'/api/temp';
806 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
807 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
809 $this->
user->dir_output = $rootfordata.
"/users";
810 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
813 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
814 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
816 $this->propal->dir_output = $rootfordata.
"/propale";
817 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
820 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
821 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
827 $this->fournisseur->commande =
new stdClass();
828 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
829 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
830 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
831 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
833 $this->fournisseur->facture =
new stdClass();
834 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
835 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
836 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
837 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
839 $this->supplier_proposal =
new stdClass();
840 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
841 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
842 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
843 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
845 $this->fournisseur->payment =
new stdClass();
846 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
847 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
848 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
849 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
853 $this->supplier_order =
new stdClass();
854 $this->supplier_order->enabled = 1;
855 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
856 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
857 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
858 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
860 $this->supplier_invoice =
new stdClass();
861 $this->supplier_invoice->enabled = 1;
862 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
863 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
864 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
865 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
870 $this->compta->payment =
new stdClass();
871 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
872 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
875 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
876 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
877 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
878 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
880 $this->product->dir_output = $rootfordata.
"/produit";
881 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
882 $this->service->dir_output = $rootfordata.
"/produit";
883 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
886 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
887 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
890 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
891 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
893 $this->contrat->dir_output = $rootfordata.
"/contract";
894 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
898 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
901 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
902 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
904 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
905 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
908 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
909 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
911 if (empty($this->global->TICKET_ADDON)) {
912 $this->global->TICKET_ADDON =
'mod_ticket_simple';
916 if (empty($this->global->USER_PASSWORD_GENERATED)) {
917 $this->global->USER_PASSWORD_GENERATED =
'standard';
919 if (empty($this->global->MAIN_UMASK)) {
920 $this->global->MAIN_UMASK =
'0660';
924 $tmpumask = decoct($tmpumask);
925 if (!preg_match(
'/^0/', $tmpumask)) {
926 $tmpumask =
'0'.$tmpumask;
928 if (empty($tmpumask)) {
931 $this->global->MAIN_UMASK = $tmpumask;
935 $this->use_javascript_ajax = 1;
936 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
937 $this->use_javascript_ajax = (int) !
getDolGlobalInt(
'MAIN_DISABLE_JAVASCRIPT');
940 if (empty($this->use_javascript_ajax)) {
941 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
942 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
943 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
944 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
949 $this->global->STOCK_CALCULATE_ON_BILL = 0;
950 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
951 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
952 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
954 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
955 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
957 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
958 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
960 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
962 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
963 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
965 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
966 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
970 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
971 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
975 if (empty($this->global->MAIN_MONNAIE)) {
976 $this->global->MAIN_MONNAIE =
'EUR';
978 $this->currency = $this->global->MAIN_MONNAIE;
981 $this->global->AI_USED_FOR_FILE_TO_TEXT_CONVERTION = 1;
983 if (!isset($this->global->MAIN_USE_TOP_MENU_IMPORT_FILE)) {
984 $this->global->MAIN_USE_TOP_MENU_IMPORT_FILE = 1;
988 if (empty($this->global->ACCOUNTING_MODE)) {
989 $this->global->ACCOUNTING_MODE =
'CREANCES-DETTES';
992 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
993 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 1;
995 if (!isset($this->global->THEME_SHOW_BORDER_ON_INPUT)) {
996 $this->global->THEME_SHOW_BORDER_ON_INPUT = 1;
998 if (!isset($this->global->THEME_ELDY_BORDER_RADIUS)) {
999 $this->global->THEME_ELDY_BORDER_RADIUS = 10;
1003 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
1004 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
1008 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
1009 $this->global->PROJECT_BILL_TIME_SPENT = 1;
1013 if (!isset($this->global->MAIN_EMAIL_USE_LAYOUT)) {
1014 $this->global->MAIN_EMAIL_USE_LAYOUT = 1;
1018 if (!isset($this->global->MAIN_HTML_TITLE)) {
1019 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
1022 if (!isset($this->global->MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME)) {
1023 $this->global->MAIN_FEATURE_TO_SHOW_TOP_MENU_URL_IN_FRAME = 1;
1029 if ((
int) $this->liste_limit <= 0) {
1035 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
1036 $this->global->PRODUIT_LIMIT_SIZE = 1000;
1040 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
1043 if (empty($this->global->MAIN_THEME)) {
1044 $this->global->MAIN_THEME =
"eldy";
1046 if (!empty($this->global->MAIN_FORCETHEME)) {
1047 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
1049 $this->theme = $this->global->MAIN_THEME;
1050 $this->css =
"/theme/".$this->theme.
"/style.css.php";
1053 $this->email_from =
"robot@example.com";
1054 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
1055 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
1060 $this->notification->email_from = $this->email_from;
1061 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
1062 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
1066 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1067 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
1070 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1071 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1075 $this->format_date_short =
"%d/%m/%Y";
1076 $this->format_date_short_java =
"dd/MM/yyyy";
1077 $this->format_hour_short =
"%H:%M";
1078 $this->format_hour_sec_short =
"%H:%M:%S";
1079 $this->format_hour_short_duration =
"%H:%M";
1080 $this->format_date_text_short =
"%d %b %Y";
1081 $this->format_date_text =
"%d %B %Y";
1082 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1083 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1084 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1085 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1088 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1089 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1093 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1094 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1096 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1097 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1099 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1100 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1104 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
1105 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1;
1107 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
1108 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1;
1112 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1113 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1115 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1116 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1118 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1119 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1126 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1127 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1131 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1132 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1136 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1137 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1141 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1142 $this->global->MAIN_SHOW_STATE_CODE = 1;
1146 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1147 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1151 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1152 $this->global->USE_STRICT_CSV_RULES = 2;
1156 if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1157 $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1;
1161 if (! isset($this->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) {
1162 $this->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION = 1;
1166 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && !
getDolGlobalString(
'STRIPE_USE_NEW_CHECKOUT')) {
1167 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1171 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1172 $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';
1174 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1175 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1176 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1182 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1183 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1187 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1188 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1190 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1191 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1195 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1196 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1198 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1199 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1201 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1202 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1204 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1205 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1210 if (isset($this->adherent)) {
1211 $this->warning_delays[
'subscription'] =
getDolGlobalInt(
'MAIN_DELAY_MEMBERS') * 86400;
1212 $this->adherent->subscription =
new stdClass();
1213 $this->adherent->subscription->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MEMBERS') * 86400;
1215 if (isset($this->agenda)) {
1216 $this->warning_delays[
'agenda'] =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO', 7) * 86400;
1217 $this->agenda->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO', 7) * 86400;
1219 if (isset($this->projet)) {
1220 $this->warning_delays[
'project'] = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1221 $this->warning_delays[
'task'] = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1222 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1223 $this->projet->task =
new stdClass();
1224 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1226 if (isset($this->commande)) {
1227 $this->warning_delays[
'order'] =
getDolGlobalInt(
'MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400;
1228 $this->warning_delays[
'purchase_order'] =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400;
1229 $this->commande->client =
new stdClass();
1230 $this->commande->fournisseur =
new stdClass();
1231 $this->commande->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400;
1232 $this->commande->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400;
1234 if (isset($this->propal)) {
1235 $this->warning_delays[
'proposal_close'] =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_CLOSE') * 86400;
1236 $this->warning_delays[
'proposal_invoice'] =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_BILL') * 86400;
1237 $this->propal->cloture =
new stdClass();
1238 $this->propal->facturation =
new stdClass();
1239 $this->propal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_CLOSE') * 86400;
1240 $this->propal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_BILL') * 86400;
1243 if (isset($this->supplier_proposal)) {
1244 $this->warning_delays[
'supplier_proposal_close'] =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE') * 86400;
1245 $this->warning_delays[
'supplier_proposal_invoice'] =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL') * 86400;
1246 $this->supplier_proposal->cloture =
new stdClass();
1247 $this->supplier_proposal->facturation =
new stdClass();
1248 $this->supplier_proposal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_CLOSE') * 86400;
1249 $this->supplier_proposal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_PROPALS_TO_BILL') * 86400;
1251 if (isset($this->facture)) {
1252 $this->warning_delays[
'invoice'] =
getDolGlobalInt(
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400;
1253 $this->warning_delays[
'supplier_invoice'] =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400;
1254 $this->facture->client =
new stdClass();
1255 $this->facture->fournisseur =
new stdClass();
1256 $this->facture->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400;
1257 $this->facture->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400;
1259 if (isset($this->contrat)) {
1260 $this->warning_delays[
'contract_inactive'] =
getDolGlobalInt(
'MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400;
1261 $this->warning_delays[
'contract_expired'] =
getDolGlobalInt(
'MAIN_DELAY_RUNNING_SERVICES') * 86400;
1262 $this->contrat->services =
new stdClass();
1263 $this->contrat->services->inactifs =
new stdClass();
1264 $this->contrat->services->expires =
new stdClass();
1265 $this->contrat->services->inactifs->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400;
1266 $this->contrat->services->expires->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_RUNNING_SERVICES') * 86400;
1269 $this->warning_delays[
'bank_cheque_to_conciliate'] =
getDolGlobalInt(
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400;
1270 $this->warning_delays[
'bank_cheque_to_be_deposited'] =
getDolGlobalInt(
'MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400;
1271 $this->warning_delays[
'bank_direct_debit'] =
getDolGlobalInt(
'MAIN_DELAY_BANK_DIRECT_DEBIT', 15) * 86400;
1272 $this->warning_delays[
'bank_credit_transfer'] =
getDolGlobalInt(
'MAIN_DELAY_BANK_CREDIT_TRANSFER', 15) * 86400;
1273 $this->bank->rappro =
new stdClass();
1274 $this->bank->cheque =
new stdClass();
1275 $this->bank->rappro->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400;
1276 $this->bank->cheque->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400;
1278 if (isset($this->expensereport)) {
1279 $this->warning_delays[
'expensereport_approve'] =
getDolGlobalInt(
'MAIN_DELAY_EXPENSEREPORTS') * 86400;
1280 $this->warning_delays[
'expense_report_payment'] =
getDolGlobalInt(
'MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400;
1281 $this->expensereport->approve =
new stdClass();
1282 $this->expensereport->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_EXPENSEREPORTS') * 86400;
1283 $this->expensereport->payment =
new stdClass();
1284 $this->expensereport->payment->warning_delay =
getDolGlobalInt(
'MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400;
1286 if (isset($this->holiday)) {
1287 $this->warning_delays[
'holiday_approve'] =
getDolGlobalInt(
'MAIN_DELAY_HOLIDAYS') * 86400;
1288 $this->holiday->approve =
new stdClass();
1289 $this->holiday->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_HOLIDAYS') * 86400;
1291 if (isset($this->mrp)) {
1292 $this->warning_delays[
'mrp'] =
getDolGlobalInt(
'MAIN_DELAY_MRP') * 86400;
1293 $this->mrp->progress =
new stdClass();
1294 $this->mrp->progress->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MRP') * 86400;
1298 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1301 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1302 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1307 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
1310 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1311 $this->dol_hide_topmenu = (int) (
bool)
getDolGlobalInt(
'MAIN_HIDE_TOP_MENU');
1313 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1314 $this->dol_hide_leftmenu = (int) (
bool)
getDolGlobalInt(
'MAIN_HIDE_LEFT_MENU');
1317 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1318 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1322 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1323 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1326 if (!isset($this->global->MAIN_JS_GRAPH)) {
1327 $this->global->MAIN_JS_GRAPH =
'chart';
1330 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1331 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1334 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1335 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com/api/';
1337 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1338 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorepublicapi';
1342 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1346 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = (defined(
'MAIN_SECURITY_CSRF_WITH_TOKEN') ? constant(
'MAIN_SECURITY_CSRF_WITH_TOKEN') : 3);
1350 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1351 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1354 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1355 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1358 if (!empty($this->use_javascript_ajax) &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') >= 1) {
1359 $this->global->EMAILING_USE_ADVANCED_SELECTOR = 1;
1363 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1364 if (defined(
'MAIN_ANTIVIRUS_UPLOAD_ON')) {
1365 $this->global->MAIN_ANTIVIRUS_UPLOAD_ON = constant(
'MAIN_ANTIVIRUS_UPLOAD_ON');
1367 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1368 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1370 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1371 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1375 if (!isset($this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)) {
1376 $this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1;
1378 if (!isset($this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY) && extension_loaded(
'tidy') && class_exists(
"tidy")) {
1379 $this->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1;
1381 if (!isset($this->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)) {
1382 $this->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
1387 $this->global->PRODUCT_USE_CUSTOMER_PACKAGING = 0;
1391 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1392 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1393 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1394 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1395 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1400 $this->global->LDAP_MEMBER_ACTIVE = 2;
1404 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1407 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1408 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1414 if (isset($this->product)) {
1416 $this->produit = $this->product;
1419 if (isset($this->facture)) {
1420 $this->invoice = $this->facture;
1423 if (isset($this->commande)) {
1424 $this->order = $this->commande;
1427 if (isset($this->contrat)) {
1428 $this->contract = $this->contrat;
1431 if (isset($this->categorie)) {
1432 $this->category = $this->categorie;
1436 $this->project = (isset($this->projet) ? $this->projet :
null);
1438 $this->member = (isset($this->adherent) ? $this->adherent :
null);
1441 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
1442 if (is_object($mc)) {
1443 $mc->setValues($this);
1449 if (!empty($this->global->SYSLOG_HANDLERS)) {
1450 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1452 if (empty($handlers) || !is_array($handlers)) {
1453 $handlers = array();
1455 foreach ($handlers as $handler) {
1457 if (!is_string($handler) || !preg_match(
'/^[a-zA-Z0-9_]+$/', $handler)) {
1460 $handler_file_found =
'';
1461 $dirsyslogs = array(
'/core/modules/syslog/');
1462 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1463 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1465 foreach ($dirsyslogs as $reldir) {
1468 if (is_dir($newdir)) {
1469 $file = $newdir.$handler.
'.php';
1470 if (file_exists($file)) {
1471 $handler_file_found = $file;
1477 if (empty($handler_file_found)) {
1483 require_once $handler_file_found;
1484 $loghandlerinstance =
new $handler();
1485 if (!$loghandlerinstance instanceof
LogHandler) {
1486 throw new Exception(
'Log handler does not extend LogHandler');
1489 if (empty($this->loghandlers[$handler])) {
1490 $this->loghandlers[$handler] = $loghandlerinstance;
1497 if (!empty($this->file->mailing_limit_sendbyweb)) {
1498 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1500 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1501 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1503 if (!empty($this->file->mailing_limit_sendbycli)) {
1504 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1506 if (!empty($this->file->mailing_limit_sendbyday)) {
1507 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;