439 if (!empty($this->modules)) {
440 foreach ($this->modules as $m) {
441 if (isset($this->$m)) {
458 $this->fournisseur =
new stdClass();
471 $this->notification =
new stdClass();
472 $this->expensereport =
new stdClass();
473 $this->productbatch =
new stdClass();
476 $this->cache = array();
477 $this->modules = array();
478 $this->modules_parts = array(
482 'triggers' => array(),
484 'substitutions' => array(),
489 'barcode' => array(),
491 'societe' => array(),
496 'websitetemplates' => array(),
499 if (!is_null($db) && is_object($db)) {
500 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
503 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
504 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
505 $sql .=
" FROM ".$db->prefix().
"const";
506 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
507 $sql .=
" ORDER BY entity";
509 $resql = $db->query($sql);
512 $numr = $db->num_rows($resql);
514 $objp = $db->fetch_object($resql);
516 $value = $objp->value;
519 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
520 $value = $_SERVER[
'DOLIBARR_'.$key];
521 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
522 $value = $_ENV[
'DOLIBARR_'.$key];
527 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
530 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
532 $params = explode(
':', $value, 2);
533 if (!is_array($this->modules_parts[$partname])) {
534 $this->modules_parts[$partname] = array();
536 $this->modules_parts[$partname][$params[0]][] = $value;
537 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
544 $modulename = strtolower($reg[1]);
545 $partname = strtolower($reg[2]);
546 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
547 $this->modules_parts[$partname] = array();
551 $arrValue = json_decode($value,
true);
554 if (is_array($arrValue)) {
555 $newvalue = $arrValue;
556 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
557 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
558 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
559 $newvalue =
'/'.$modulename.
'/';
560 } elseif (in_array($partname, array(
'captcha'))) {
561 $newvalue =
'/'.$modulename.
'/core/modules/security/'.$partname.
'/';
562 } elseif ($value == 1) {
563 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
568 if (!empty($newvalue)) {
569 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
571 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
573 $modulename = strtolower($reg[1]);
574 if ($modulename ==
'propale') {
575 $modulename =
'propal';
577 if ($modulename ==
'supplierproposal') {
578 $modulename =
'supplier_proposal';
580 $this->modules[$modulename] = $modulename;
584 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
585 $this->$modulename =
new stdClass();
587 $this->$modulename->enabled =
true;
612 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
613 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
614 foreach ($filesList as $file) {
626 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
628 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
630 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
635 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
637 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
638 if ($ret && class_exists(
'ActionsMulticompany')) {
639 $mc =
new ActionsMulticompany($db);
644 if (empty($this->global->MAIN_MENU_STANDARD)) {
645 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
647 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
648 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
650 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
651 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
653 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
654 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
656 if (!isset($this->global->FACTURE_TVAOPTION)) {
657 $this->global->FACTURE_TVAOPTION = 1;
661 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
662 $this->global->LDAP_FIELD_FULLNAME =
'';
664 if (!isset($this->global->LDAP_KEY_USERS)) {
665 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
667 if (!isset($this->global->LDAP_KEY_GROUPS)) {
668 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
670 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
671 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
673 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
674 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
676 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
677 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
681 if (empty($this->global->MAIN_LANG_DEFAULT)) {
682 $this->global->MAIN_LANG_DEFAULT =
"en_US";
685 $rootfordata = DOL_DATA_ROOT;
686 $rootforuser = DOL_DATA_ROOT;
688 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
689 $rootfordata .=
'/'.$this->entity;
692 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
695 foreach ($this->modules as $module) {
698 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
699 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
701 $this->$module->dir_output = $rootfordata.
"/".$module;
702 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
706 if (!empty($this->modules_parts[
'dir'])) {
707 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
708 if (!empty($this->$module->enabled)) {
709 foreach ($dirs as $type => $name) {
710 $multidirname =
'multidir_'.$type;
711 $dirname =
'dir_'.$type;
713 if ($type !=
'temp') {
715 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
718 $this->$module->$dirname = $rootfordata.
"/".$name;
721 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
724 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
732 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
733 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
735 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
736 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
739 $this->admin->dir_output = $rootfordata.
'/admin';
740 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
743 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
744 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
746 $this->
user->dir_output = $rootforuser.
"/users";
747 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
750 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
751 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
753 $this->propal->dir_output = $rootfordata.
"/propale";
754 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
757 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
758 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
763 if (isModEnabled(
'fournisseur')) {
764 $this->fournisseur->commande =
new stdClass();
765 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
766 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
767 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
768 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
770 $this->fournisseur->facture =
new stdClass();
771 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
772 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
773 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
774 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
776 $this->supplier_proposal =
new stdClass();
777 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
778 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
779 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
780 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
782 $this->fournisseur->payment =
new stdClass();
783 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
784 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
785 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
786 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
790 $this->supplier_order =
new stdClass();
791 $this->supplier_order->enabled = 1;
792 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
793 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
794 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
795 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
797 $this->supplier_invoice =
new stdClass();
798 $this->supplier_invoice->enabled = 1;
799 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
800 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
801 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
802 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
807 $this->compta->payment =
new stdClass();
808 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
809 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
812 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
813 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
814 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
815 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
817 $this->product->dir_output = $rootfordata.
"/produit";
818 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
819 $this->service->dir_output = $rootfordata.
"/produit";
820 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
823 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
824 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
827 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
828 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
830 $this->contrat->dir_output = $rootfordata.
"/contract";
831 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
834 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
835 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
837 $this->bank->dir_output = $rootfordata.
"/bank";
838 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
842 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
845 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
846 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
848 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
849 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
852 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
853 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
855 if (empty($this->global->TICKET_ADDON)) {
856 $this->global->TICKET_ADDON =
'mod_ticket_simple';
860 if (empty($this->global->USER_PASSWORD_GENERATED)) {
861 $this->global->USER_PASSWORD_GENERATED =
'standard';
863 if (empty($this->global->MAIN_UMASK)) {
864 $this->global->MAIN_UMASK =
'0660';
868 $tmpumask = decoct($tmpumask);
869 if (!preg_match(
'/^0/', $tmpumask)) {
870 $tmpumask =
'0'.$tmpumask;
872 if (empty($tmpumask)) {
875 $this->global->MAIN_UMASK = $tmpumask;
879 $this->use_javascript_ajax = 1;
880 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
881 $this->use_javascript_ajax = (int) !$this->global->MAIN_DISABLE_JAVASCRIPT;
884 if (empty($this->use_javascript_ajax)) {
885 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
886 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
887 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
888 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
891 if (isModEnabled(
'productbatch')) {
893 $this->global->STOCK_CALCULATE_ON_BILL = 0;
894 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
895 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
896 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
898 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
899 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
901 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
902 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
903 if (!isModEnabled(
'reception')) {
904 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
906 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
907 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
909 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
910 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
915 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
916 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
920 if (empty($this->global->MAIN_MONNAIE)) {
921 $this->global->MAIN_MONNAIE =
'EUR';
923 $this->currency = $this->global->MAIN_MONNAIE;
925 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
926 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
930 if (empty($this->global->ACCOUNTING_MODE)) {
931 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
934 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
935 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
939 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
940 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
944 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
945 $this->global->PROJECT_BILL_TIME_SPENT = 1;
949 if (!isset($this->global->MAIN_HTML_TITLE)) {
950 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
956 if ((
int) $this->liste_limit <= 0) {
958 $this->liste_limit = 15;
959 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 700) {
960 $this->liste_limit = 8;
961 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
962 $this->liste_limit = 10;
963 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
964 $this->liste_limit = 20;
969 if (!isset($this->main_checkbox_left_column)) {
970 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
974 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
975 $this->global->PRODUIT_LIMIT_SIZE = 1000;
979 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
982 if (empty($this->global->MAIN_THEME)) {
983 $this->global->MAIN_THEME =
"eldy";
985 if (!empty($this->global->MAIN_FORCETHEME)) {
986 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
988 $this->theme = $this->global->MAIN_THEME;
989 $this->css =
"/theme/".$this->theme.
"/style.css.php";
992 $this->email_from =
"robot@example.com";
993 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
994 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
998 if (isModEnabled(
'notification')) {
999 $this->notification->email_from = $this->email_from;
1000 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
1001 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
1005 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
1006 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
1009 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
1010 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
1014 $this->format_date_short =
"%d/%m/%Y";
1015 $this->format_date_short_java =
"dd/MM/yyyy";
1016 $this->format_hour_short =
"%H:%M";
1017 $this->format_hour_short_duration =
"%H:%M";
1018 $this->format_date_text_short =
"%d %b %Y";
1019 $this->format_date_text =
"%d %B %Y";
1020 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
1021 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
1022 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
1023 $this->format_date_hour_text =
"%d %B %Y %H:%M";
1026 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
1027 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
1031 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
1032 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
1034 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
1035 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
1037 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
1038 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
1042 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
1043 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
1045 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
1046 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
1048 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1049 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
1056 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
1057 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
1061 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
1062 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
1066 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
1067 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
1071 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
1072 $this->global->MAIN_SHOW_STATE_CODE = 1;
1076 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
1077 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
1081 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
1082 $this->global->USE_STRICT_CSV_RULES = 2;
1086 if (!isset($this->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
1087 $this->global->ADHERENT_LOGIN_NOT_REQUIRED = 1;
1091 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
1092 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
1096 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
1097 $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';
1099 if (!empty($this->modules_parts[
'moduleforexternal'])) {
1100 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
1101 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
1107 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
1108 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
1112 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
1113 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
1115 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
1116 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
1120 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
1121 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
1123 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
1124 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
1126 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
1127 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
1129 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
1130 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
1135 if (isset($this->agenda)) {
1136 $this->adherent->subscription =
new stdClass();
1137 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
1139 if (isset($this->agenda)) {
1140 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
1142 if (isset($this->projet)) {
1143 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
1144 $this->projet->task =
new StdClass();
1145 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1148 if (isset($this->commande)) {
1149 $this->commande->client =
new stdClass();
1150 $this->commande->fournisseur =
new stdClass();
1151 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
1152 $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;
1154 if (isset($this->propal)) {
1155 $this->propal->cloture =
new stdClass();
1156 $this->propal->facturation =
new stdClass();
1157 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
1158 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
1160 if (isset($this->facture)) {
1161 $this->facture->client =
new stdClass();
1162 $this->facture->fournisseur =
new stdClass();
1163 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
1164 $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;
1166 if (isset($this->contrat)) {
1167 $this->contrat->services =
new stdClass();
1168 $this->contrat->services->inactifs =
new stdClass();
1169 $this->contrat->services->expires =
new stdClass();
1170 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
1171 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
1173 if (isset($this->commande)) {
1174 $this->bank->rappro =
new stdClass();
1175 $this->bank->cheque =
new stdClass();
1176 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
1177 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
1179 if (isset($this->expensereport)) {
1180 $this->expensereport->approve =
new stdClass();
1181 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
1182 $this->expensereport->payment =
new stdClass();
1183 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
1185 if (isset($this->holiday)) {
1186 $this->holiday->approve =
new stdClass();
1187 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
1190 if ((!empty($this->global->PRODUIT_MULTIPRICES) ||
getDolGlobalString(
'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
1191 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1194 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1195 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1199 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1200 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
1202 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1203 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
1206 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1207 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1211 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1212 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1215 if (!isset($this->global->MAIN_JS_GRAPH)) {
1216 $this->global->MAIN_JS_GRAPH =
'chart';
1219 if (!isset($this->global->THEME_ELDY_USEBORDERONTABLE)) {
1220 $this->global->THEME_ELDY_USEBORDERONTABLE = 1;
1223 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1224 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1226 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1227 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1231 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1235 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1239 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1240 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1243 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1244 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1247 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1248 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1249 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1251 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1252 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1257 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1258 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1259 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1260 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1261 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1265 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1266 $this->global->LDAP_MEMBER_ACTIVE = 2;
1269 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1270 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1273 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1274 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1277 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1278 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1280 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1287 if (isset($this->product)) {
1289 $this->produit = $this->product;
1292 if (isset($this->facture)) {
1293 $this->invoice = $this->facture;
1296 if (isset($this->commande)) {
1297 $this->order = $this->commande;
1300 if (isset($this->contrat)) {
1301 $this->contract = $this->contrat;
1304 if (isset($this->categorie)) {
1305 $this->category = $this->categorie;
1308 if (isset($this->projet) && !isset($this->project)) {
1312 if (isset($this->adherent) && !isset($this->member)) {
1313 $this->member = $this->adherent;
1317 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1318 if (is_object($mc)) {
1319 $mc->setValues($this);
1323 if (isModEnabled(
'syslog')) {
1325 if (!empty($this->global->SYSLOG_HANDLERS)) {
1326 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1328 $handlers = array();
1330 foreach ($handlers as $handler) {
1331 $handler_file_found =
'';
1332 $dirsyslogs = array(
'/core/modules/syslog/');
1333 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1334 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1336 foreach ($dirsyslogs as $reldir) {
1339 if (is_dir($newdir)) {
1340 $file = $newdir.$handler.
'.php';
1341 if (file_exists($file)) {
1342 $handler_file_found = $file;
1348 if (empty($handler_file_found)) {
1354 require_once $handler_file_found;
1355 $loghandlerinstance =
new $handler();
1356 if (!$loghandlerinstance instanceof
LogHandler) {
1357 throw new Exception(
'Log handler does not extend LogHandler');
1360 if (empty($this->loghandlers[$handler])) {
1361 $this->loghandlers[$handler] = $loghandlerinstance;
1368 if (!empty($this->file->mailing_limit_sendbyweb)) {
1369 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1371 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1372 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1374 if (!empty($this->file->mailing_limit_sendbycli)) {
1375 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1377 if (!empty($this->file->mailing_limit_sendbyday)) {
1378 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;