434 if (!empty($this->modules)) {
435 foreach ($this->modules as $m) {
436 if (isset($this->$m)) {
453 $this->fournisseur =
new stdClass();
466 $this->notification =
new stdClass();
467 $this->expensereport =
new stdClass();
468 $this->productbatch =
new stdClass();
471 $this->cache = array();
472 $this->modules = array();
473 $this->modules_parts = array(
477 'triggers' => array(),
479 'substitutions' => array(),
484 'barcode' => array(),
486 'societe' => array(),
491 'websitetemplates' => array(),
494 if (!is_null($db) && is_object($db)) {
495 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
498 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
499 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
500 $sql .=
" FROM ".$db->prefix().
"const";
501 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
502 $sql .=
" ORDER BY entity";
504 $resql = $db->query($sql);
507 $numr = $db->num_rows($resql);
509 $objp = $db->fetch_object($resql);
511 $value = $objp->value;
514 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
515 $value = $_SERVER[
'DOLIBARR_'.$key];
516 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
517 $value = $_ENV[
'DOLIBARR_'.$key];
522 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
525 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
527 $params = explode(
':', $value, 2);
528 if (!is_array($this->modules_parts[$partname])) {
529 $this->modules_parts[$partname] = array();
531 $this->modules_parts[$partname][$params[0]][] = $value;
532 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
539 $modulename = strtolower($reg[1]);
540 $partname = strtolower($reg[2]);
541 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
542 $this->modules_parts[$partname] = array();
546 $arrValue = json_decode($value,
true);
549 if (is_array($arrValue)) {
550 $newvalue = $arrValue;
551 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
552 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
553 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
554 $newvalue =
'/'.$modulename.
'/';
555 } elseif ($value == 1) {
556 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
561 if (!empty($newvalue)) {
562 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
564 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
566 $modulename = strtolower($reg[1]);
567 if ($modulename ==
'propale') {
568 $modulename =
'propal';
570 if ($modulename ==
'supplierproposal') {
571 $modulename =
'supplier_proposal';
573 $this->modules[$modulename] = $modulename;
577 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
578 $this->$modulename =
new stdClass();
580 $this->$modulename->enabled =
true;
605 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
606 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
607 foreach ($filesList as $file) {
619 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
621 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
623 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
628 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
630 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
631 if ($ret && class_exists(
'ActionsMulticompany')) {
632 $mc =
new ActionsMulticompany($db);
637 if (empty($this->global->MAIN_MENU_STANDARD)) {
638 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
640 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
641 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
643 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
644 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
646 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
647 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
649 if (!isset($this->global->FACTURE_TVAOPTION)) {
650 $this->global->FACTURE_TVAOPTION = 1;
654 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
655 $this->global->LDAP_FIELD_FULLNAME =
'';
657 if (!isset($this->global->LDAP_KEY_USERS)) {
658 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
660 if (!isset($this->global->LDAP_KEY_GROUPS)) {
661 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
663 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
664 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
666 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
667 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
669 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
670 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
674 if (empty($this->global->MAIN_LANG_DEFAULT)) {
675 $this->global->MAIN_LANG_DEFAULT =
"en_US";
678 $rootfordata = DOL_DATA_ROOT;
679 $rootforuser = DOL_DATA_ROOT;
681 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
682 $rootfordata .=
'/'.$this->entity;
685 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
688 foreach ($this->modules as $module) {
691 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
692 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
694 $this->$module->dir_output = $rootfordata.
"/".$module;
695 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
699 if (!empty($this->modules_parts[
'dir'])) {
700 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
701 if (!empty($this->$module->enabled)) {
702 foreach ($dirs as $type => $name) {
703 $multidirname =
'multidir_'.$type;
704 $dirname =
'dir_'.$type;
706 if ($type !=
'temp') {
708 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
711 $this->$module->$dirname = $rootfordata.
"/".$name;
714 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
717 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
725 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
726 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
728 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
729 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
732 $this->admin->dir_output = $rootfordata.
'/admin';
733 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
736 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
737 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
739 $this->
user->dir_output = $rootforuser.
"/users";
740 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
743 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
744 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
746 $this->propal->dir_output = $rootfordata.
"/propale";
747 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
750 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
751 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
756 if (isModEnabled(
'fournisseur')) {
757 $this->fournisseur->commande =
new stdClass();
758 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
759 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
760 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
761 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
763 $this->fournisseur->facture =
new stdClass();
764 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
765 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
766 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
767 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
769 $this->supplier_proposal =
new stdClass();
770 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
771 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
772 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
773 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
775 $this->fournisseur->payment =
new stdClass();
776 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
777 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
778 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
779 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
783 $this->supplier_order =
new stdClass();
784 $this->supplier_order->enabled = 1;
785 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
786 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
787 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
788 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
790 $this->supplier_invoice =
new stdClass();
791 $this->supplier_invoice->enabled = 1;
792 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
793 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
794 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
795 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
800 $this->compta->payment =
new stdClass();
801 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
802 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
805 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
806 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
807 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
808 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
810 $this->product->dir_output = $rootfordata.
"/produit";
811 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
812 $this->service->dir_output = $rootfordata.
"/produit";
813 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
816 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
817 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
820 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
821 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
823 $this->contrat->dir_output = $rootfordata.
"/contract";
824 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
827 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
828 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
830 $this->bank->dir_output = $rootfordata.
"/bank";
831 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
835 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
838 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
839 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
841 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
842 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
845 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
846 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
848 if (empty($this->global->TICKET_ADDON)) {
849 $this->global->TICKET_ADDON =
'mod_ticket_simple';
853 if (empty($this->global->USER_PASSWORD_GENERATED)) {
854 $this->global->USER_PASSWORD_GENERATED =
'standard';
856 if (empty($this->global->MAIN_UMASK)) {
857 $this->global->MAIN_UMASK =
'0660';
861 $tmpumask = decoct($tmpumask);
862 if (!preg_match(
'/^0/', $tmpumask)) {
863 $tmpumask =
'0'.$tmpumask;
865 if (empty($tmpumask)) {
868 $this->global->MAIN_UMASK = $tmpumask;
872 $this->use_javascript_ajax = 1;
873 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
874 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
877 if (empty($this->use_javascript_ajax)) {
878 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
879 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
880 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
881 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
884 if (isModEnabled(
'productbatch')) {
886 $this->global->STOCK_CALCULATE_ON_BILL = 0;
887 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
888 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
889 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
891 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
892 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
894 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
895 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
896 if (!isModEnabled(
'reception')) {
897 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
899 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
900 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
902 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
903 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
908 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
909 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
913 if (empty($this->global->MAIN_MONNAIE)) {
914 $this->global->MAIN_MONNAIE =
'EUR';
916 $this->currency = $this->global->MAIN_MONNAIE;
918 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
919 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
923 if (empty($this->global->ACCOUNTING_MODE)) {
924 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
927 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
928 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
932 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
933 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
937 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
938 $this->global->PROJECT_BILL_TIME_SPENT = 1;
942 if (!isset($this->global->MAIN_HTML_TITLE)) {
943 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
948 if ((
int) $this->liste_limit <= 0) {
950 $this->liste_limit = 15;
951 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
952 $this->liste_limit = 10;
953 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
954 $this->liste_limit = 20;
959 if (!isset($this->main_checkbox_left_column)) {
960 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
964 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
965 $this->global->PRODUIT_LIMIT_SIZE = 1000;
969 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
972 if (empty($this->global->MAIN_THEME)) {
973 $this->global->MAIN_THEME =
"eldy";
975 if (!empty($this->global->MAIN_FORCETHEME)) {
976 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
978 $this->theme = $this->global->MAIN_THEME;
979 $this->css =
"/theme/".$this->theme.
"/style.css.php";
982 $this->email_from =
"robot@example.com";
983 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
984 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
988 if (isModEnabled(
'notification')) {
989 $this->notification->email_from = $this->email_from;
990 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
991 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
995 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
996 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
999 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1000 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1004 $this->format_date_short =
"%d/%m/%Y";
1005 $this->format_date_short_java =
"dd/MM/yyyy";
1006 $this->format_hour_short =
"%H:%M";
1007 $this->format_hour_short_duration =
"%H:%M";
1008 $this->format_date_text_short =
"%d %b %Y";
1009 $this->format_date_text =
"%d %B %Y";
1010 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1011 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1012 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1013 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1016 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1017 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1021 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1022 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1024 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1025 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1027 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1028 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1032 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1033 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1035 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1036 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1038 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1039 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1046 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1047 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1051 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1052 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1056 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1057 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1061 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1062 $this->global->MAIN_SHOW_STATE_CODE = 1;
1066 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1067 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1071 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1072 $this->global->USE_STRICT_CSV_RULES = 2;
1076 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
1077 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1081 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1082 $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';
1084 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1085 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1086 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1092 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1093 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1097 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1098 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1100 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1101 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1105 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1106 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1108 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1109 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1111 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1112 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1114 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1115 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1120 if (isset($this->agenda)) {
1121 $this->adherent->subscription =
new stdClass();
1122 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
1124 if (isset($this->agenda)) {
1125 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
1127 if (isset($this->projet)) {
1128 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1129 $this->projet->task =
new StdClass();
1130 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1133 if (isset($this->commande)) {
1134 $this->commande->client =
new stdClass();
1135 $this->commande->fournisseur =
new stdClass();
1136 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
1137 $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
1139 if (isset($this->propal)) {
1140 $this->propal->cloture =
new stdClass();
1141 $this->propal->facturation =
new stdClass();
1142 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
1143 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
1145 if (isset($this->facture)) {
1146 $this->facture->client =
new stdClass();
1147 $this->facture->fournisseur =
new stdClass();
1148 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
1149 $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? (int) $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
1151 if (isset($this->contrat)) {
1152 $this->contrat->services =
new stdClass();
1153 $this->contrat->services->inactifs =
new stdClass();
1154 $this->contrat->services->expires =
new stdClass();
1155 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
1156 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
1158 if (isset($this->commande)) {
1159 $this->bank->rappro =
new stdClass();
1160 $this->bank->cheque =
new stdClass();
1161 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
1162 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
1164 if (isset($this->expensereport)) {
1165 $this->expensereport->approve =
new stdClass();
1166 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
1167 $this->expensereport->payment =
new stdClass();
1168 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
1170 if (isset($this->holiday)) {
1171 $this->holiday->approve =
new stdClass();
1172 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
1175 if ((!empty($this->global->PRODUIT_MULTIPRICES) ||
getDolGlobalString(
'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
1176 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1179 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1180 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1184 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1185 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
1187 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1188 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
1191 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1192 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1196 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1197 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1200 if (!isset($this->global->MAIN_JS_GRAPH)) {
1201 $this->global->MAIN_JS_GRAPH =
'chart';
1204 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1205 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1208 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1209 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1211 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1212 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1216 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1220 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1224 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1225 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1228 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1229 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1232 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1233 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1234 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1236 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1237 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1242 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1243 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1244 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1245 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1246 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1250 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1251 $this->global->LDAP_MEMBER_ACTIVE = 2;
1254 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1255 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1258 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1259 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1262 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1263 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1265 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1272 if (isset($this->product)) {
1274 $this->produit = $this->product;
1277 if (isset($this->facture)) {
1278 $this->invoice = $this->facture;
1281 if (isset($this->commande)) {
1282 $this->order = $this->commande;
1285 if (isset($this->contrat)) {
1286 $this->contract = $this->contrat;
1289 if (isset($this->categorie)) {
1290 $this->category = $this->categorie;
1293 if (isset($this->projet) && !isset($this->project)) {
1297 if (isset($this->adherent) && !isset($this->member)) {
1298 $this->member = $this->adherent;
1302 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1303 if (is_object($mc)) {
1304 $mc->setValues($this);
1308 if (isModEnabled(
'syslog')) {
1310 if (!empty($this->global->SYSLOG_HANDLERS)) {
1311 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1313 $handlers = array();
1315 foreach ($handlers as $handler) {
1316 $handler_file_found =
'';
1317 $dirsyslogs = array(
'/core/modules/syslog/');
1318 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1319 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1321 foreach ($dirsyslogs as $reldir) {
1324 if (is_dir($newdir)) {
1325 $file = $newdir.$handler.
'.php';
1326 if (file_exists($file)) {
1327 $handler_file_found = $file;
1333 if (empty($handler_file_found)) {
1339 require_once $handler_file_found;
1340 $loghandlerinstance =
new $handler();
1341 if (!$loghandlerinstance instanceof
LogHandler) {
1342 throw new Exception(
'Log handler does not extend LogHandler');
1345 if (empty($this->loghandlers[$handler])) {
1346 $this->loghandlers[$handler] = $loghandlerinstance;
1353 if (!empty($this->file->mailing_limit_sendbyweb)) {
1354 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1356 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1357 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1359 if (!empty($this->file->mailing_limit_sendbycli)) {
1360 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1362 if (!empty($this->file->mailing_limit_sendbyday)) {
1363 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;