303 if (!empty($this->modules)) {
304 foreach ($this->modules as $m) {
305 if (isset($this->$m)) {
322 $this->fournisseur =
new stdClass();
335 $this->notification =
new stdClass();
336 $this->expensereport =
new stdClass();
337 $this->productbatch =
new stdClass();
340 $this->cache = array();
341 $this->modules = array();
342 $this->modules_parts = array(
346 'triggers' => array(),
348 'substitutions' => array(),
353 'barcode' => array(),
355 'societe' => array(),
360 'websitetemplates' => array(),
363 if (!is_null($db) && is_object($db)) {
364 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
367 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
368 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
369 $sql .=
" FROM ".$db->prefix().
"const";
370 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
371 $sql .=
" ORDER BY entity";
373 $resql = $db->query($sql);
376 $numr = $db->num_rows($resql);
378 $objp = $db->fetch_object($resql);
380 $value = $objp->value;
383 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
384 $value = $_SERVER[
'DOLIBARR_'.$key];
385 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
386 $value = $_ENV[
'DOLIBARR_'.$key];
391 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
394 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
396 $params = explode(
':', $value, 2);
397 if (!is_array($this->modules_parts[$partname])) {
398 $this->modules_parts[$partname] = array();
400 $this->modules_parts[$partname][$params[0]][] = $value;
401 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
408 $modulename = strtolower($reg[1]);
409 $partname = strtolower($reg[2]);
410 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
411 $this->modules_parts[$partname] = array();
415 $arrValue = json_decode($value,
true);
418 if (is_array($arrValue)) {
419 $newvalue = $arrValue;
420 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
421 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
422 } elseif (in_array($partname, array(
'models',
'theme',
'websitetemplates'))) {
423 $newvalue =
'/'.$modulename.
'/';
424 } elseif ($value == 1) {
425 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
430 if (!empty($newvalue)) {
431 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
433 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
435 $modulename = strtolower($reg[1]);
436 if ($modulename ==
'propale') {
437 $modulename =
'propal';
439 if ($modulename ==
'supplierproposal') {
440 $modulename =
'supplier_proposal';
442 $this->modules[$modulename] = $modulename;
446 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
447 $this->$modulename =
new stdClass();
449 $this->$modulename->enabled =
true;
474 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
475 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
476 foreach ($filesList as $file) {
488 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
490 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
492 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
497 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
499 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
500 if ($ret && class_exists(
'ActionsMulticompany')) {
501 $mc =
new ActionsMulticompany($db);
506 if (empty($this->global->MAIN_MENU_STANDARD)) {
507 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
509 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
510 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
512 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
513 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
515 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
516 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
518 if (!isset($this->global->FACTURE_TVAOPTION)) {
519 $this->global->FACTURE_TVAOPTION = 1;
523 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
524 $this->global->LDAP_FIELD_FULLNAME =
'';
526 if (!isset($this->global->LDAP_KEY_USERS)) {
527 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
529 if (!isset($this->global->LDAP_KEY_GROUPS)) {
530 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
532 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
533 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
535 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
536 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
538 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
539 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
543 if (empty($this->global->MAIN_LANG_DEFAULT)) {
544 $this->global->MAIN_LANG_DEFAULT =
"en_US";
547 $rootfordata = DOL_DATA_ROOT;
548 $rootforuser = DOL_DATA_ROOT;
550 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
551 $rootfordata .=
'/'.$this->entity;
554 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
557 foreach ($this->modules as $module) {
560 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
561 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
563 $this->$module->dir_output = $rootfordata.
"/".$module;
564 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
568 if (!empty($this->modules_parts[
'dir'])) {
569 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
570 if (!empty($this->$module->enabled)) {
571 foreach ($dirs as $type => $name) {
572 $multidirname =
'multidir_'.$type;
573 $dirname =
'dir_'.$type;
575 if ($type !=
'temp') {
577 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
580 $this->$module->$dirname = $rootfordata.
"/".$name;
583 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
586 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
594 $this->mycompany->multidir_output = array($this->entity => $rootfordata.
"/mycompany");
595 $this->mycompany->multidir_temp = array($this->entity => $rootfortemp.
"/mycompany/temp");
597 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
598 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
601 $this->admin->dir_output = $rootfordata.
'/admin';
602 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
605 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
606 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
608 $this->
user->dir_output = $rootforuser.
"/users";
609 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
612 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
613 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
615 $this->propal->dir_output = $rootfordata.
"/propale";
616 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
619 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
620 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
625 if (isModEnabled(
'fournisseur')) {
626 $this->fournisseur->commande =
new stdClass();
627 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
628 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
629 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
630 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
632 $this->fournisseur->facture =
new stdClass();
633 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
634 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
635 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
636 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
638 $this->supplier_proposal =
new stdClass();
639 $this->supplier_proposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
640 $this->supplier_proposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
641 $this->supplier_proposal->dir_output = $rootfordata.
"/supplier_proposal";
642 $this->supplier_proposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
644 $this->fournisseur->payment =
new stdClass();
645 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
646 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
647 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
648 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
652 $this->supplier_order =
new stdClass();
653 $this->supplier_order->enabled = 1;
654 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
655 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
656 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
657 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
659 $this->supplier_invoice =
new stdClass();
660 $this->supplier_invoice->enabled = 1;
661 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
662 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
663 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
664 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
669 $this->compta->payment =
new stdClass();
670 $this->compta->payment->dir_output = $rootfordata.
"/compta/payment";
671 $this->compta->payment->dir_temp = $rootfortemp.
"/compta/payment/temp";
674 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
675 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
676 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
677 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
679 $this->product->dir_output = $rootfordata.
"/produit";
680 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
681 $this->service->dir_output = $rootfordata.
"/produit";
682 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
685 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
686 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
689 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
690 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
692 $this->contrat->dir_output = $rootfordata.
"/contract";
693 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
696 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
697 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
699 $this->bank->dir_output = $rootfordata.
"/bank";
700 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
704 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
707 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
708 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
710 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
711 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
714 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
715 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
717 if (empty($this->global->TICKET_ADDON)) {
718 $this->global->TICKET_ADDON =
'mod_ticket_simple';
722 if (empty($this->global->USER_PASSWORD_GENERATED)) {
723 $this->global->USER_PASSWORD_GENERATED =
'standard';
725 if (empty($this->global->MAIN_UMASK)) {
726 $this->global->MAIN_UMASK =
'0660';
729 $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666);
730 $tmpumask = decoct($tmpumask);
731 if (!preg_match(
'/^0/', $tmpumask)) {
732 $tmpumask =
'0'.$tmpumask;
734 if (empty($tmpumask) || $tmpumask ===
'0') {
737 $this->global->MAIN_UMASK = $tmpumask;
741 $this->use_javascript_ajax = 1;
742 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
743 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
746 if (empty($this->use_javascript_ajax)) {
747 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
748 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
749 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
750 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
753 if (isModEnabled(
'productbatch')) {
755 $this->global->STOCK_CALCULATE_ON_BILL = 0;
756 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
757 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) {
758 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
760 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
761 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
763 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
764 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
765 if (!isModEnabled(
'reception')) {
766 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
768 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) {
769 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
771 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) {
772 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
777 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
778 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
782 if (empty($this->global->MAIN_MONNAIE)) {
783 $this->global->MAIN_MONNAIE =
'EUR';
785 $this->currency = $this->global->MAIN_MONNAIE;
787 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
788 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
792 if (empty($this->global->ACCOUNTING_MODE)) {
793 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
796 if (!isset($this->global->MAIN_ENABLE_AJAX_TOOLTIP)) {
797 $this->global->MAIN_ENABLE_AJAX_TOOLTIP = 0;
801 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
802 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
806 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
807 $this->global->PROJECT_BILL_TIME_SPENT = 1;
811 if (!isset($this->global->MAIN_HTML_TITLE)) {
812 $this->global->MAIN_HTML_TITLE =
'thirdpartynameonly,contactnameonly,projectnameonly';
816 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
817 $this->global->MAIN_SIZE_LISTE_LIMIT = 15;
819 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
822 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
823 $this->global->PRODUIT_LIMIT_SIZE = 1000;
825 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
828 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
831 if (empty($this->global->MAIN_THEME)) {
832 $this->global->MAIN_THEME =
"eldy";
834 if (!empty($this->global->MAIN_FORCETHEME)) {
835 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
837 $this->theme = $this->global->MAIN_THEME;
838 $this->css =
"/theme/".$this->theme.
"/style.css.php";
841 $this->email_from =
"robot@example.com";
842 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
843 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
847 if (isModEnabled(
'notification')) {
848 $this->notification->email_from = $this->email_from;
849 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
850 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
854 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
855 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
858 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
859 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
863 $this->format_date_short =
"%d/%m/%Y";
864 $this->format_date_short_java =
"dd/MM/yyyy";
865 $this->format_hour_short =
"%H:%M";
866 $this->format_hour_short_duration =
"%H:%M";
867 $this->format_date_text_short =
"%d %b %Y";
868 $this->format_date_text =
"%d %B %Y";
869 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
870 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
871 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
872 $this->format_date_hour_text =
"%d %B %Y %H:%M";
875 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
876 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
880 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
881 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
883 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
884 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
886 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
887 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
891 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
892 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
894 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
895 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
897 if (!isset($this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
898 $this->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING = 1;
905 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
906 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
910 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
911 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
915 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
916 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
920 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
921 $this->global->MAIN_SHOW_STATE_CODE = 1;
925 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
926 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
930 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
931 $this->global->USE_STRICT_CSV_RULES = 2;
935 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
936 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
940 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
941 $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';
943 if (!empty($this->modules_parts[
'moduleforexternal'])) {
944 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
945 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
950 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
951 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
955 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
956 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
958 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
959 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
963 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
964 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
966 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
967 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
969 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
970 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
972 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
973 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
978 if (isset($this->agenda)) {
979 $this->adherent->subscription =
new stdClass();
980 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
982 if (isset($this->agenda)) {
983 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
985 if (isset($this->projet)) {
986 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
987 $this->projet->task =
new StdClass();
988 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
991 if (isset($this->commande)) {
992 $this->commande->client =
new stdClass();
993 $this->commande->fournisseur =
new stdClass();
994 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
995 $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;
997 if (isset($this->propal)) {
998 $this->propal->cloture =
new stdClass();
999 $this->propal->facturation =
new stdClass();
1000 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
1001 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
1003 if (isset($this->facture)) {
1004 $this->facture->client =
new stdClass();
1005 $this->facture->fournisseur =
new stdClass();
1006 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
1007 $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;
1009 if (isset($this->contrat)) {
1010 $this->contrat->services =
new stdClass();
1011 $this->contrat->services->inactifs =
new stdClass();
1012 $this->contrat->services->expires =
new stdClass();
1013 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
1014 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
1016 if (isset($this->commande)) {
1017 $this->bank->rappro =
new stdClass();
1018 $this->bank->cheque =
new stdClass();
1019 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
1020 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
1022 if (isset($this->expensereport)) {
1023 $this->expensereport->approve =
new stdClass();
1024 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
1025 $this->expensereport->payment =
new stdClass();
1026 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
1028 if (isset($this->holiday)) {
1029 $this->holiday->approve =
new stdClass();
1030 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
1033 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
1034 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
1037 if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1038 $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1;
1042 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
1043 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
1045 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
1046 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
1049 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
1050 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
1054 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
1055 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
1058 if (!isset($this->global->MAIN_JS_GRAPH)) {
1059 $this->global->MAIN_JS_GRAPH =
'chart';
1062 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
1063 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
1065 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
1066 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
1070 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
1074 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
1078 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
1079 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
1082 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
1083 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
1086 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
1087 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
1088 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
1090 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
1091 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
1096 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
1097 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
1098 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
1099 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
1100 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
1104 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
1105 $this->global->LDAP_MEMBER_ACTIVE = 2;
1108 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
1109 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
1112 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
1113 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1116 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1117 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1119 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1126 if (isset($this->product)) {
1128 $this->produit = $this->product;
1131 if (isset($this->facture)) {
1135 if (isset($this->commande)) {
1139 if (isset($this->contrat)) {
1143 if (isset($this->categorie)) {
1144 $this->category = $this->categorie;
1147 if (isset($this->projet) && !isset($this->project)) {
1151 if (isset($this->adherent) && !isset($this->member)) {
1156 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1157 if (is_object($mc)) {
1158 $mc->setValues($this);
1162 if (isModEnabled(
'syslog')) {
1164 if (!empty($this->global->SYSLOG_HANDLERS)) {
1165 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1167 $handlers = array();
1169 foreach ($handlers as $handler) {
1170 $handler_file_found =
'';
1171 $dirsyslogs = array(
'/core/modules/syslog/');
1172 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1173 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1175 foreach ($dirsyslogs as $reldir) {
1178 if (is_dir($newdir)) {
1179 $file = $newdir.$handler.
'.php';
1180 if (file_exists($file)) {
1181 $handler_file_found = $file;
1187 if (empty($handler_file_found)) {
1193 require_once $handler_file_found;
1194 $loghandlerinstance =
new $handler();
1195 if (!$loghandlerinstance instanceof
LogHandler) {
1196 throw new Exception(
'Log handler does not extend LogHandler');
1199 if (empty($this->loghandlers[$handler])) {
1200 $this->loghandlers[$handler] = $loghandlerinstance;
1207 if (!empty($this->file->mailing_limit_sendbyweb)) {
1208 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1210 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1211 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1213 if (!empty($this->file->mailing_limit_sendbycli)) {
1214 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1216 if (!empty($this->file->mailing_limit_sendbyday)) {
1217 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;