444 if (!empty($this->modules)) {
445 foreach ($this->modules as $m) {
446 if (isset($this->$m)) {
463 $this->fournisseur =
new stdClass();
476 $this->notification =
new stdClass();
477 $this->expensereport =
new stdClass();
478 $this->productbatch =
new stdClass();
482 $this->cache = array();
483 $this->modules = array();
484 $this->modules_parts = array(
488 'triggers' => array(),
490 'substitutions' => array(),
495 'barcode' => array(),
497 'societe' => array(),
502 'websitetemplates' => array(),
505 if (!is_null($db) && is_object($db)) {
506 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
509 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
510 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
511 $sql .=
" FROM ".$db->prefix().
"const";
512 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
513 $sql .=
" ORDER BY entity";
515 $resql = $db->query($sql);
518 $numr = $db->num_rows($resql);
520 $objp = $db->fetch_object($resql);
522 $value = $objp->value;
525 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
526 $value = $_SERVER[
'DOLIBARR_'.$key];
527 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
528 $value = $_ENV[
'DOLIBARR_'.$key];
533 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
536 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
538 $params = explode(
':', $value, 2);
539 if (!is_array($this->modules_parts[$partname])) {
540 $this->modules_parts[$partname] = array();
542 $this->modules_parts[$partname][$params[0]][] = $value;
543 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
550 $modulename = strtolower($reg[1]);
551 $partname = strtolower($reg[2]);
552 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
553 $this->modules_parts[$partname] = array();
557 $arrValue = json_decode($value,
true);
560 if (is_array($arrValue)) {
561 $newvalue = $arrValue;
562 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
563 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
564 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
565 $newvalue =
'/'.$modulename.
'/';
566 } elseif (in_array($partname, array(
'captcha'))) {
567 $newvalue =
'/'.$modulename.
'/core/modules/security/'.$partname.
'/';
568 } elseif ($value == 1) {
569 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
574 if (!empty($newvalue)) {
575 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
577 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
579 $modulename = strtolower($reg[1]);
580 if ($modulename ==
'propale') {
581 $modulename =
'propal';
583 if ($modulename ==
'supplierproposal') {
584 $modulename =
'supplier_proposal';
586 $this->modules[$modulename] = $modulename;
590 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
591 $this->$modulename =
new stdClass();
593 $this->$modulename->enabled =
true;
618 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
619 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
620 foreach ($filesList as $file) {
632 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
634 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
636 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
641 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
643 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
644 if ($ret && class_exists(
'ActionsMulticompany')) {
645 $mc =
new ActionsMulticompany($db);
650 if (empty($this->global->MAIN_MENU_STANDARD)) {
651 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
653 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
654 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
656 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
657 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
659 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
660 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
662 if (!isset($this->global->FACTURE_TVAOPTION)) {
663 $this->global->FACTURE_TVAOPTION = 1;
667 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
668 $this->global->LDAP_FIELD_FULLNAME =
'';
670 if (!isset($this->global->LDAP_KEY_USERS)) {
671 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
673 if (!isset($this->global->LDAP_KEY_GROUPS)) {
674 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
676 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
677 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
679 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
680 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
682 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
683 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
687 if (empty($this->global->MAIN_LANG_DEFAULT)) {
688 $this->global->MAIN_LANG_DEFAULT =
"en_US";
691 $rootfordata = DOL_DATA_ROOT;
692 $rootforuser = DOL_DATA_ROOT;
694 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
695 $rootfordata .=
'/'.$this->entity;
698 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
701 foreach ($this->modules as $module) {
704 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
705 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
707 $this->$module->dir_output = $rootfordata.
"/".$module;
708 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
712 if (!empty($this->modules_parts[
'dir'])) {
713 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
714 if (!empty($this->$module->enabled)) {
715 foreach ($dirs as $type => $name) {
716 $multidirname =
'multidir_'.$type;
717 $dirname =
'dir_'.$type;
719 if ($type !=
'temp') {
721 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
724 $this->$module->$dirname = $rootfordata.
"/".$name;
727 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
730 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
738 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
739 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
741 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
742 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
745 $this->admin->dir_output = $rootfordata.
'/admin';
746 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
749 $this->api->dir_output = $rootfordata.
'/api';
750 $this->api->dir_temp = $rootfortemp.
'/api/temp';
753 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
754 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
756 $this->
user->dir_output = $rootforuser.
"/users";
757 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
760 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
761 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
763 $this->propal->dir_output = $rootfordata.
"/propale";
764 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
767 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
768 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
773 if (isModEnabled(
'fournisseur')) {
774 $this->fournisseur->commande =
new stdClass();
775 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
776 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
777 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
778 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
780 $this->fournisseur->facture =
new stdClass();
781 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
782 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
783 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
784 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
786 $this->supplier_proposal =
new stdClass();
787 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
788 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
789 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
790 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
792 $this->fournisseur->payment =
new stdClass();
793 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
794 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
795 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
796 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
800 $this->supplier_order =
new stdClass();
801 $this->supplier_order->enabled = 1;
802 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
803 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
804 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
805 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
807 $this->supplier_invoice =
new stdClass();
808 $this->supplier_invoice->enabled = 1;
809 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
810 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
811 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
812 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
817 $this->compta->payment =
new stdClass();
818 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
819 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
822 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
823 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
824 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
825 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
827 $this->product->dir_output = $rootfordata.
"/produit";
828 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
829 $this->service->dir_output = $rootfordata.
"/produit";
830 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
833 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
834 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
837 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
838 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
840 $this->contrat->dir_output = $rootfordata.
"/contract";
841 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
844 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
845 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
847 $this->bank->dir_output = $rootfordata.
"/bank";
848 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
852 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
855 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
856 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
858 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
859 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
862 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
863 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
865 if (empty($this->global->TICKET_ADDON)) {
866 $this->global->TICKET_ADDON =
'mod_ticket_simple';
870 if (empty($this->global->USER_PASSWORD_GENERATED)) {
871 $this->global->USER_PASSWORD_GENERATED =
'standard';
873 if (empty($this->global->MAIN_UMASK)) {
874 $this->global->MAIN_UMASK =
'0660';
878 $tmpumask = decoct($tmpumask);
879 if (!preg_match(
'/^0/', $tmpumask)) {
880 $tmpumask =
'0'.$tmpumask;
882 if (empty($tmpumask)) {
885 $this->global->MAIN_UMASK = $tmpumask;
889 $this->use_javascript_ajax = 1;
890 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
891 $this->use_javascript_ajax = (int) !$this->global->MAIN_DISABLE_JAVASCRIPT;
894 if (empty($this->use_javascript_ajax)) {
895 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
896 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
897 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
898 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
901 if (isModEnabled(
'productbatch')) {
903 $this->global->STOCK_CALCULATE_ON_BILL = 0;
904 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
905 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
906 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
908 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
909 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
911 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
912 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
913 if (!isModEnabled(
'reception')) {
914 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
916 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
917 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
919 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
920 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
925 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
926 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
930 if (empty($this->global->MAIN_MONNAIE)) {
931 $this->global->MAIN_MONNAIE =
'EUR';
933 $this->currency = $this->global->MAIN_MONNAIE;
935 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
936 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
940 if (empty($this->global->ACCOUNTING_MODE)) {
941 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
944 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
945 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
949 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
950 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
954 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
955 $this->global->PROJECT_BILL_TIME_SPENT = 1;
959 if (!isset($this->global->MAIN_HTML_TITLE)) {
960 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
966 if ((
int) $this->liste_limit <= 0) {
968 $this->liste_limit = 15;
969 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 700) {
970 $this->liste_limit = 8;
971 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
972 $this->liste_limit = 10;
973 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
974 $this->liste_limit = 20;
979 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
980 $this->global->PRODUIT_LIMIT_SIZE = 1000;
984 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
987 if (empty($this->global->MAIN_THEME)) {
988 $this->global->MAIN_THEME =
"eldy";
990 if (!empty($this->global->MAIN_FORCETHEME)) {
991 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
993 $this->theme = $this->global->MAIN_THEME;
994 $this->css =
"/theme/".$this->theme.
"/style.css.php";
997 $this->email_from =
"robot@example.com";
998 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
999 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
1003 if (isModEnabled(
'notification')) {
1004 $this->notification->email_from = $this->email_from;
1005 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
1006 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
1010 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1011 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
1014 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1015 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1019 $this->format_date_short =
"%d/%m/%Y";
1020 $this->format_date_short_java =
"dd/MM/yyyy";
1021 $this->format_hour_short =
"%H:%M";
1022 $this->format_hour_short_duration =
"%H:%M";
1023 $this->format_date_text_short =
"%d %b %Y";
1024 $this->format_date_text =
"%d %B %Y";
1025 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1026 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1027 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1028 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1031 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1032 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1036 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1037 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1039 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1040 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1042 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1043 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1047 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
1048 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1;
1050 if (!isset($this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
1051 $this->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1;
1055 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1056 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1058 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1059 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1061 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1062 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1069 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1070 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1074 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1075 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1079 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1080 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1084 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1085 $this->global->MAIN_SHOW_STATE_CODE = 1;
1089 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1090 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1094 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1095 $this->global->USE_STRICT_CSV_RULES = 2;
1099 if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1100 $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1;
1104 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
1105 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1109 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1110 $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';
1112 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1113 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1114 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1120 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1121 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1125 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1126 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1128 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1129 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1133 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1134 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1136 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1137 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1139 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1140 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1142 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1143 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1148 if (isset($this->agenda)) {
1149 $this->adherent->subscription =
new stdClass();
1150 $this->adherent->subscription->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_MEMBERS') * 86400;
1152 if (isset($this->agenda)) {
1153 $this->agenda->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO', 7) * 86400;
1155 if (isset($this->projet)) {
1156 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1157 $this->projet->task =
new StdClass();
1158 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1161 if (isset($this->commande)) {
1162 $this->commande->client =
new stdClass();
1163 $this->commande->fournisseur =
new stdClass();
1164 $this->commande->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_ORDERS_TO_PROCESS', 2) * 86400;
1165 $this->commande->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS', 7) * 86400;
1167 if (isset($this->propal)) {
1168 $this->propal->cloture =
new stdClass();
1169 $this->propal->facturation =
new stdClass();
1170 $this->propal->cloture->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_CLOSE') * 86400;
1171 $this->propal->facturation->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_PROPALS_TO_BILL') * 86400;
1173 if (isset($this->facture)) {
1174 $this->facture->client =
new stdClass();
1175 $this->facture->fournisseur =
new stdClass();
1176 $this->facture->client->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED') * 86400;
1177 $this->facture->fournisseur->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY') * 86400;
1179 if (isset($this->contrat)) {
1180 $this->contrat->services =
new stdClass();
1181 $this->contrat->services->inactifs =
new stdClass();
1182 $this->contrat->services->expires =
new stdClass();
1183 $this->contrat->services->inactifs->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_NOT_ACTIVATED_SERVICES') * 86400;
1184 $this->contrat->services->expires->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_RUNNING_SERVICES') * 86400;
1186 if (isset($this->bank)) {
1187 $this->bank->rappro =
new stdClass();
1188 $this->bank->cheque =
new stdClass();
1189 $this->bank->rappro->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE') * 86400;
1190 $this->bank->cheque->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_CHEQUES_TO_DEPOSIT') * 86400;
1192 if (isset($this->expensereport)) {
1193 $this->expensereport->approve =
new stdClass();
1194 $this->expensereport->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_EXPENSEREPORTS') * 86400;
1195 $this->expensereport->payment =
new stdClass();
1196 $this->expensereport->payment->warning_delay =
getDolGlobalInt(
'MIN_DELAY_EXPENSEREPORTS_TO_PAY') * 86400;
1198 if (isset($this->holiday)) {
1199 $this->holiday->approve =
new stdClass();
1200 $this->holiday->approve->warning_delay =
getDolGlobalInt(
'MAIN_DELAY_HOLIDAYS') * 86400;
1204 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1207 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1208 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1212 if (!isset($this->main_checkbox_left_column)) {
1213 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
1217 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1220 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1224 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1225 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1229 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1230 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1233 if (!isset($this->global->MAIN_JS_GRAPH)) {
1234 $this->global->MAIN_JS_GRAPH =
'chart';
1237 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1238 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1241 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1242 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1244 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1245 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1249 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1253 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1257 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1258 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1261 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1262 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1265 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1266 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1267 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1269 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1270 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1275 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1276 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1277 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1278 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1279 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1283 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1284 $this->global->LDAP_MEMBER_ACTIVE = 2;
1287 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1288 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1291 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1292 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1295 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1296 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1298 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1305 if (isset($this->product)) {
1307 $this->produit = $this->product;
1310 if (isset($this->facture)) {
1311 $this->invoice = $this->facture;
1314 if (isset($this->commande)) {
1315 $this->order = $this->commande;
1318 if (isset($this->contrat)) {
1319 $this->contract = $this->contrat;
1322 if (isset($this->categorie)) {
1323 $this->category = $this->categorie;
1326 if (isset($this->projet) && !isset($this->project)) {
1330 if (isset($this->adherent) && !isset($this->member)) {
1331 $this->member = $this->adherent;
1335 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1336 if (is_object($mc)) {
1337 $mc->setValues($this);
1341 if (isModEnabled(
'syslog')) {
1343 if (!empty($this->global->SYSLOG_HANDLERS)) {
1344 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1346 $handlers = array();
1348 foreach ($handlers as $handler) {
1349 $handler_file_found =
'';
1350 $dirsyslogs = array(
'/core/modules/syslog/');
1351 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1352 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1354 foreach ($dirsyslogs as $reldir) {
1357 if (is_dir($newdir)) {
1358 $file = $newdir.$handler.
'.php';
1359 if (file_exists($file)) {
1360 $handler_file_found = $file;
1366 if (empty($handler_file_found)) {
1372 require_once $handler_file_found;
1373 $loghandlerinstance =
new $handler();
1374 if (!$loghandlerinstance instanceof
LogHandler) {
1375 throw new Exception(
'Log handler does not extend LogHandler');
1378 if (empty($this->loghandlers[$handler])) {
1379 $this->loghandlers[$handler] = $loghandlerinstance;
1386 if (!empty($this->file->mailing_limit_sendbyweb)) {
1387 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1389 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1390 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1392 if (!empty($this->file->mailing_limit_sendbycli)) {
1393 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1395 if (!empty($this->file->mailing_limit_sendbyday)) {
1396 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;