302 if (!empty($this->modules)) {
303 foreach ($this->modules as $m) {
304 if (isset($this->$m)) {
321 $this->fournisseur =
new stdClass();
334 $this->notification =
new stdClass();
335 $this->expensereport =
new stdClass();
336 $this->productbatch =
new stdClass();
339 $this->cache = array();
340 $this->modules = array();
341 $this->modules_parts = array(
345 'triggers' => array(),
347 'substitutions' => array(),
352 'barcode' => array(),
354 'societe' => array(),
359 'websitetemplates' => array(),
362 if (!is_null($db) && is_object($db)) {
363 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
366 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
367 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
368 $sql .=
" FROM ".$db->prefix().
"const";
369 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
370 $sql .=
" ORDER BY entity";
372 $resql = $db->query($sql);
375 $numr = $db->num_rows($resql);
377 $objp = $db->fetch_object($resql);
379 $value = $objp->value;
382 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
383 $value = $_SERVER[
'DOLIBARR_'.$key];
384 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
385 $value = $_ENV[
'DOLIBARR_'.$key];
390 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
393 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
395 $params = explode(
':', $value, 2);
396 if (!is_array($this->modules_parts[$partname])) {
397 $this->modules_parts[$partname] = array();
399 $this->modules_parts[$partname][$params[0]][] = $value;
400 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
407 $modulename = strtolower($reg[1]);
408 $partname = strtolower($reg[2]);
409 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
410 $this->modules_parts[$partname] = array();
414 $arrValue = json_decode($value,
true);
417 if (is_array($arrValue)) {
418 $newvalue = $arrValue;
419 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
420 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
421 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
422 $newvalue =
'/'.$modulename.
'/';
423 } elseif ($value == 1) {
424 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
429 if (!empty($newvalue)) {
430 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
432 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
434 $modulename = strtolower($reg[1]);
435 if ($modulename ==
'propale') {
436 $modulename =
'propal';
438 if ($modulename ==
'supplierproposal') {
439 $modulename =
'supplier_proposal';
441 $this->modules[$modulename] = $modulename;
445 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
446 $this->$modulename =
new stdClass();
448 $this->$modulename->enabled =
true;
473 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
474 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
475 foreach ($filesList as $file) {
487 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
489 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
491 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
496 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
498 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
499 if ($ret && class_exists(
'ActionsMulticompany')) {
500 $mc =
new ActionsMulticompany($db);
505 if (empty($this->global->MAIN_MENU_STANDARD)) {
506 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
508 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
509 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
511 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
512 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
514 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
515 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
517 if (!isset($this->global->FACTURE_TVAOPTION)) {
518 $this->global->FACTURE_TVAOPTION = 1;
522 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
523 $this->global->LDAP_FIELD_FULLNAME =
'';
525 if (!isset($this->global->LDAP_KEY_USERS)) {
526 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
528 if (!isset($this->global->LDAP_KEY_GROUPS)) {
529 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
531 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
532 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
534 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
535 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
537 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
538 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
542 if (empty($this->global->MAIN_LANG_DEFAULT)) {
543 $this->global->MAIN_LANG_DEFAULT =
"en_US";
546 $rootfordata = DOL_DATA_ROOT;
547 $rootforuser = DOL_DATA_ROOT;
549 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
550 $rootfordata .=
'/'.$this->entity;
553 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
556 foreach ($this->modules as $module) {
559 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
560 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
562 $this->$module->dir_output = $rootfordata.
"/".$module;
563 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
567 if (!empty($this->modules_parts[
'dir'])) {
568 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
569 if (!empty($this->$module->enabled)) {
570 foreach ($dirs as $type => $name) {
571 $multidirname =
'multidir_'.$type;
572 $dirname =
'dir_'.$type;
574 if ($type !=
'temp') {
576 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
579 $this->$module->$dirname = $rootfordata.
"/".$name;
582 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
585 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
593 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
594 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
596 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
597 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
600 $this->admin->dir_output = $rootfordata.
'/admin';
601 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
604 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
605 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
607 $this->
user->dir_output = $rootforuser.
"/users";
608 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
611 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
612 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
614 $this->propal->dir_output = $rootfordata.
"/propale";
615 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
618 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
619 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
624 if (isModEnabled(
'fournisseur')) {
625 $this->fournisseur->commande =
new stdClass();
626 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
627 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
628 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
629 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
631 $this->fournisseur->facture =
new stdClass();
632 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
633 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
634 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
635 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
637 $this->supplier_proposal =
new stdClass();
638 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
639 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
640 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
641 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
643 $this->fournisseur->payment =
new stdClass();
644 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
645 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
646 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
647 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
651 $this->supplier_order =
new stdClass();
652 $this->supplier_order->enabled = 1;
653 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
654 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
655 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
656 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
658 $this->supplier_invoice =
new stdClass();
659 $this->supplier_invoice->enabled = 1;
660 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
661 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
662 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
663 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
668 $this->compta->payment =
new stdClass();
669 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
670 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
673 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
674 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
675 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
676 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
678 $this->product->dir_output = $rootfordata.
"/produit";
679 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
680 $this->service->dir_output = $rootfordata.
"/produit";
681 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
684 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
685 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
688 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
689 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
691 $this->contrat->dir_output = $rootfordata.
"/contract";
692 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
695 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
696 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
698 $this->bank->dir_output = $rootfordata.
"/bank";
699 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
703 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
706 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
707 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
709 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
710 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
713 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
714 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
716 if (empty($this->global->TICKET_ADDON)) {
717 $this->global->TICKET_ADDON =
'mod_ticket_simple';
721 if (empty($this->global->USER_PASSWORD_GENERATED)) {
722 $this->global->USER_PASSWORD_GENERATED =
'standard';
724 if (empty($this->global->MAIN_UMASK)) {
725 $this->global->MAIN_UMASK =
'0660';
729 $tmpumask = decoct($tmpumask);
730 if (!preg_match(
'/^0/', $tmpumask)) {
731 $tmpumask =
'0'.$tmpumask;
733 if (empty($tmpumask)) {
736 $this->global->MAIN_UMASK = $tmpumask;
740 $this->use_javascript_ajax = 1;
741 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
742 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
745 if (empty($this->use_javascript_ajax)) {
746 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
747 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
748 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
749 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
752 if (isModEnabled(
'productbatch')) {
754 $this->global->STOCK_CALCULATE_ON_BILL = 0;
755 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
756 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
757 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
759 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
760 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
762 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
763 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
764 if (!isModEnabled(
'reception')) {
765 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
767 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
768 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
770 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
771 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
776 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
777 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
781 if (empty($this->global->MAIN_MONNAIE)) {
782 $this->global->MAIN_MONNAIE =
'EUR';
784 $this->currency = $this->global->MAIN_MONNAIE;
786 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
787 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
791 if (empty($this->global->ACCOUNTING_MODE)) {
792 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
795 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
796 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
800 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
801 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
805 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
806 $this->global->PROJECT_BILL_TIME_SPENT = 1;
810 if (!isset($this->global->MAIN_HTML_TITLE)) {
811 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
816 if ((
int) $this->liste_limit <= 0) {
818 $this->liste_limit = 15;
819 if (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] < 910) {
820 $this->liste_limit = 10;
821 } elseif (!empty($_SESSION[
'dol_screenheight']) && $_SESSION[
'dol_screenheight'] > 1130) {
822 $this->liste_limit = 20;
827 if (!isset($this->main_checkbox_left_column)) {
828 $this->main_checkbox_left_column =
getDolGlobalInt(
"MAIN_CHECKBOX_LEFT_COLUMN");
832 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
833 $this->global->PRODUIT_LIMIT_SIZE = 1000;
837 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE =
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM');
840 if (empty($this->global->MAIN_THEME)) {
841 $this->global->MAIN_THEME =
"eldy";
843 if (!empty($this->global->MAIN_FORCETHEME)) {
844 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
846 $this->theme = $this->global->MAIN_THEME;
847 $this->css =
"/theme/".$this->theme.
"/style.css.php";
850 $this->email_from =
"robot@example.com";
851 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
852 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
856 if (isModEnabled(
'notification')) {
857 $this->notification->email_from = $this->email_from;
858 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
859 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
863 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
864 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
867 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
868 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
872 $this->format_date_short =
"%d/%m/%Y";
873 $this->format_date_short_java =
"dd/MM/yyyy";
874 $this->format_hour_short =
"%H:%M";
875 $this->format_hour_short_duration =
"%H:%M";
876 $this->format_date_text_short =
"%d %b %Y";
877 $this->format_date_text =
"%d %B %Y";
878 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
879 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
880 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
881 $this->format_date_hour_text =
"%d %B %Y %H:%M";
884 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
885 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
889 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
890 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
892 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
893 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
895 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
896 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
900 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
901 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
903 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
904 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
906 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
907 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
914 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
915 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
919 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
920 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
924 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
925 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
929 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
930 $this->global->MAIN_SHOW_STATE_CODE = 1;
934 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
935 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
939 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
940 $this->global->USE_STRICT_CSV_RULES = 2;
944 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
945 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
949 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
950 $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';
952 if (!empty($this->modules_parts[
'moduleforexternal'])) {
953 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
954 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
959 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
960 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
964 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
965 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
967 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
968 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
972 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
973 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
975 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
976 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
978 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
979 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
981 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
982 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
987 if (isset($this->agenda)) {
988 $this->adherent->subscription =
new stdClass();
989 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
991 if (isset($this->agenda)) {
992 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
994 if (isset($this->projet)) {
995 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
996 $this->projet->task =
new StdClass();
997 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
1000 if (isset($this->commande)) {
1001 $this->commande->client =
new stdClass();
1002 $this->commande->fournisseur =
new stdClass();
1003 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
1004 $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;
1006 if (isset($this->propal)) {
1007 $this->propal->cloture =
new stdClass();
1008 $this->propal->facturation =
new stdClass();
1009 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
1010 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
1012 if (isset($this->facture)) {
1013 $this->facture->client =
new stdClass();
1014 $this->facture->fournisseur =
new stdClass();
1015 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
1016 $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;
1018 if (isset($this->contrat)) {
1019 $this->contrat->services =
new stdClass();
1020 $this->contrat->services->inactifs =
new stdClass();
1021 $this->contrat->services->expires =
new stdClass();
1022 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
1023 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
1025 if (isset($this->commande)) {
1026 $this->bank->rappro =
new stdClass();
1027 $this->bank->cheque =
new stdClass();
1028 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
1029 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
1031 if (isset($this->expensereport)) {
1032 $this->expensereport->approve =
new stdClass();
1033 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
1034 $this->expensereport->payment =
new stdClass();
1035 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
1037 if (isset($this->holiday)) {
1038 $this->holiday->approve =
new stdClass();
1039 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
1042 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
1043 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1046 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1047 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1051 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1052 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
1054 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1055 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
1058 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1059 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1063 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1064 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1067 if (!isset($this->global->MAIN_JS_GRAPH)) {
1068 $this->global->MAIN_JS_GRAPH =
'chart';
1071 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1072 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1074 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1075 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1079 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1083 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1087 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1088 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1091 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1092 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1095 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1096 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1097 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1099 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1100 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1105 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1106 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1107 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1108 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1109 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1113 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1114 $this->global->LDAP_MEMBER_ACTIVE = 2;
1117 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1118 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1121 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1122 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1125 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1126 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1128 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1135 if (isset($this->product)) {
1137 $this->produit = $this->product;
1140 if (isset($this->facture)) {
1144 if (isset($this->commande)) {
1148 if (isset($this->contrat)) {
1152 if (isset($this->categorie)) {
1153 $this->category = $this->categorie;
1156 if (isset($this->projet) && !isset($this->project)) {
1160 if (isset($this->adherent) && !isset($this->member)) {
1165 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1166 if (is_object($mc)) {
1167 $mc->setValues($this);
1171 if (isModEnabled(
'syslog')) {
1173 if (!empty($this->global->SYSLOG_HANDLERS)) {
1174 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1176 $handlers = array();
1178 foreach ($handlers as $handler) {
1179 $handler_file_found =
'';
1180 $dirsyslogs = array(
'/core/modules/syslog/');
1181 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1182 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1184 foreach ($dirsyslogs as $reldir) {
1187 if (is_dir($newdir)) {
1188 $file = $newdir.$handler.
'.php';
1189 if (file_exists($file)) {
1190 $handler_file_found = $file;
1196 if (empty($handler_file_found)) {
1202 require_once $handler_file_found;
1203 $loghandlerinstance =
new $handler();
1204 if (!$loghandlerinstance instanceof
LogHandler) {
1205 throw new Exception(
'Log handler does not extend LogHandler');
1208 if (empty($this->loghandlers[$handler])) {
1209 $this->loghandlers[$handler] = $loghandlerinstance;
1216 if (!empty($this->file->mailing_limit_sendbyweb)) {
1217 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1219 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1220 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1222 if (!empty($this->file->mailing_limit_sendbycli)) {
1223 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1225 if (!empty($this->file->mailing_limit_sendbyday)) {
1226 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;