228 if (!empty($this->modules)) {
229 foreach ($this->modules as $m) {
230 if (isset($this->$m)) unset($this->$m);
235 $this->mycompany =
new stdClass();
236 $this->admin =
new stdClass();
237 $this->medias =
new stdClass();
238 $this->global =
new stdClass();
245 $this->fournisseur =
new stdClass();
246 $this->product =
new stdClass();
247 $this->service =
new stdClass();
248 $this->contrat =
new stdClass();
249 $this->actions =
new stdClass();
250 $this->agenda =
new stdClass();
251 $this->commande =
new stdClass();
252 $this->propal =
new stdClass();
253 $this->facture =
new stdClass();
254 $this->contrat =
new stdClass();
255 $this->
user =
new stdClass();
256 $this->adherent =
new stdClass();
257 $this->bank =
new stdClass();
258 $this->notification =
new stdClass();
259 $this->expensereport =
new stdClass();
260 $this->productbatch =
new stdClass();
261 $this->api =
new stdClass();
264 $this->cache = array();
265 $this->modules = array();
266 $this->modules_parts = array(
270 'triggers' => array(),
272 'substitutions' => array(),
277 'barcode' => array(),
279 'societe' => array(),
286 if (!is_null($db) && is_object($db)) {
287 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
290 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
291 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
292 $sql .=
" FROM ".$db->prefix().
"const";
293 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
294 $sql .=
" ORDER BY entity";
296 $resql = $db->query($sql);
299 $numr = $db->num_rows($resql);
301 $objp = $db->fetch_object($resql);
303 $value = $objp->value;
306 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
307 $value = $_SERVER[
'DOLIBARR_'.$key];
308 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
309 $value = $_ENV[
'DOLIBARR_'.$key];
314 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
317 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
319 $params = explode(
':', $value, 2);
320 if (!is_array($this->modules_parts[$partname])) {
321 $this->modules_parts[$partname] = array();
323 $this->modules_parts[$partname][$params[0]][] = $value;
324 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
331 $modulename = strtolower($reg[1]);
332 $partname = strtolower($reg[2]);
333 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
334 $this->modules_parts[$partname] = array();
337 $arrValue = json_decode($value,
true);
339 if (is_array($arrValue)) {
340 $newvalue = $arrValue;
341 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
342 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
343 } elseif (in_array($partname, array(
'models',
'theme'))) {
344 $newvalue =
'/'.$modulename.
'/';
345 } elseif (in_array($partname, array(
'sms'))) {
346 $newvalue =
'/'.$modulename.
'/';
347 } elseif ($value == 1) {
348 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
353 if (!empty($newvalue)) {
354 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
356 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
358 $modulename = strtolower($reg[1]);
359 if ($modulename ==
'propale') {
360 $modulename =
'propal';
362 if ($modulename ==
'supplierproposal') {
363 $modulename =
'supplier_proposal';
365 $this->modules[$modulename] = $modulename;
367 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
368 $this->$modulename =
new stdClass();
370 $this->$modulename->enabled =
true;
381 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
382 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
383 foreach ($filesList as $file) {
395 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
397 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
399 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
404 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
406 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
408 $mc =
new ActionsMulticompany($db);
414 if (empty($this->global->MAIN_MENU_STANDARD)) {
415 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
417 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
418 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
420 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
421 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
423 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
424 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
426 if (!isset($this->global->FACTURE_TVAOPTION)) {
427 $this->global->FACTURE_TVAOPTION = 1;
431 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
432 $this->global->LDAP_FIELD_FULLNAME =
'';
434 if (!isset($this->global->LDAP_KEY_USERS)) {
435 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
437 if (!isset($this->global->LDAP_KEY_GROUPS)) {
438 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
440 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
441 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
443 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
444 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
446 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
447 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
451 if (empty($this->global->MAIN_LANG_DEFAULT)) {
452 $this->global->MAIN_LANG_DEFAULT =
"en_US";
455 $rootfordata = DOL_DATA_ROOT;
456 $rootforuser = DOL_DATA_ROOT;
458 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
459 $rootfordata .=
'/'.$this->entity;
462 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
465 foreach ($this->modules as $module) {
468 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
469 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
471 $this->$module->dir_output = $rootfordata.
"/".$module;
472 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
476 if (!empty($this->modules_parts[
'dir'])) {
477 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
478 if (!empty($this->$module->enabled)) {
479 foreach ($dirs as $type => $name) {
480 $multidirname =
'multidir_'.$type;
481 $dirname =
'dir_'.$type;
483 if ($type !=
'temp') {
485 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
488 $this->$module->$dirname = $rootfordata.
"/".$name;
491 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
494 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
502 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
503 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
506 $this->admin->dir_output = $rootfordata.
'/admin';
507 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
510 $this->api->dir_output = $rootfordata.
'/api';
511 $this->api->dir_temp = $rootfortemp.
'/api/temp';
514 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
515 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
517 $this->
user->dir_output = $rootforuser.
"/users";
518 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
521 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
522 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
524 $this->propal->dir_output = $rootfordata.
"/propale";
525 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
528 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
529 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
534 if (!empty($this->fournisseur)) {
535 $this->fournisseur->commande =
new stdClass();
536 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
537 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
538 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
539 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
541 $this->fournisseur->facture =
new stdClass();
542 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
543 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
544 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
545 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
547 $this->supplierproposal =
new stdClass();
548 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
549 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
550 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
551 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
553 $this->fournisseur->payment =
new stdClass();
554 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
555 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
556 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
557 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
560 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) {
561 $this->supplier_order =
new stdClass();
562 $this->supplier_order->enabled = 1;
563 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
564 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
565 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
566 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
568 $this->supplier_invoice =
new stdClass();
569 $this->supplier_invoice->enabled = 1;
570 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
571 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
572 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
573 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
578 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
579 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
580 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
581 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
583 $this->product->dir_output = $rootfordata.
"/produit";
584 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
585 $this->service->dir_output = $rootfordata.
"/produit";
586 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
589 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
590 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
593 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
594 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
596 $this->contrat->dir_output = $rootfordata.
"/contract";
597 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
600 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
601 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
603 $this->bank->dir_output = $rootfordata.
"/bank";
604 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
608 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
611 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
612 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
614 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
615 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
618 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
619 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
621 if (empty($this->global->TICKET_ADDON)) {
622 $this->global->TICKET_ADDON =
'mod_ticket_simple';
626 if (empty($this->global->USER_PASSWORD_GENERATED)) {
627 $this->global->USER_PASSWORD_GENERATED =
'standard';
629 if (empty($this->global->MAIN_UMASK)) {
630 $this->global->MAIN_UMASK =
'0660';
633 $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666);
634 $tmpumask = decoct($tmpumask);
635 if (!preg_match(
'/^0/', $tmpumask)) {
636 $tmpumask =
'0'.$tmpumask;
638 if (empty($tmpumask) || $tmpumask ===
'0') {
641 $this->global->MAIN_UMASK = $tmpumask;
645 $this->use_javascript_ajax = 1;
646 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
647 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
650 if (empty($this->use_javascript_ajax)) {
651 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
652 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
653 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
654 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
657 if (isModEnabled(
'productbatch')) {
659 $this->global->STOCK_CALCULATE_ON_BILL = 0;
660 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
661 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
662 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
663 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
664 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
665 if (!isModEnabled(
'reception')) {
666 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
668 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
669 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
673 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
674 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
678 if (empty($this->global->MAIN_MONNAIE)) {
679 $this->global->MAIN_MONNAIE =
'EUR';
681 $this->currency = $this->global->MAIN_MONNAIE;
683 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
684 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
688 if (empty($this->global->ACCOUNTING_MODE)) {
689 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
693 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
694 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
698 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
699 $this->global->PROJECT_BILL_TIME_SPENT = 1;
703 if (!isset($this->global->MAIN_HTML_TITLE)) {
704 $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
708 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
709 $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
711 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
714 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
715 $this->global->PRODUIT_LIMIT_SIZE = 1000;
717 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
720 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
723 if (empty($this->global->MAIN_THEME)) {
724 $this->global->MAIN_THEME =
"eldy";
726 if (!empty($this->global->MAIN_FORCETHEME)) {
727 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
729 $this->theme = $this->global->MAIN_THEME;
730 $this->css =
"/theme/".$this->theme.
"/style.css.php";
733 $this->email_from =
"robot@example.com";
734 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
735 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
739 if (isModEnabled(
'notification')) {
740 $this->notification->email_from = $this->email_from;
741 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
742 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
746 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
747 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
750 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
751 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
755 $this->format_date_short =
"%d/%m/%Y";
756 $this->format_date_short_java =
"dd/MM/yyyy";
757 $this->format_hour_short =
"%H:%M";
758 $this->format_hour_short_duration =
"%H:%M";
759 $this->format_date_text_short =
"%d %b %Y";
760 $this->format_date_text =
"%d %B %Y";
761 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
762 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
763 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
764 $this->format_date_hour_text =
"%d %B %Y %H:%M";
767 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
768 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
772 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
773 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
775 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
776 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
778 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
779 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
783 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
784 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
786 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
787 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
794 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
795 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
799 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
800 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
804 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
805 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
809 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
810 $this->global->MAIN_SHOW_STATE_CODE = 1;
814 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
815 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
819 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
820 $this->global->USE_STRICT_CSV_RULES = 2;
824 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
825 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
829 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
830 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog';
832 if (!empty($this->modules_parts[
'moduleforexternal'])) {
833 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
834 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
839 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
840 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
844 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
845 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
847 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
848 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
852 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
853 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
855 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
856 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
858 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
859 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
861 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
862 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
867 if (isset($this->agenda)) {
868 $this->adherent->subscription =
new stdClass();
869 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
871 if (isset($this->agenda)) {
872 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
874 if (isset($this->projet)) {
875 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
876 $this->projet->task =
new StdClass();
877 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
880 if (isset($this->commande)) {
881 $this->commande->client =
new stdClass();
882 $this->commande->fournisseur =
new stdClass();
883 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
884 $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;
886 if (isset($this->propal)) {
887 $this->propal->cloture =
new stdClass();
888 $this->propal->facturation =
new stdClass();
889 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
890 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
892 if (isset($this->facture)) {
893 $this->facture->client =
new stdClass();
894 $this->facture->fournisseur =
new stdClass();
895 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
896 $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;
898 if (isset($this->contrat)) {
899 $this->contrat->services =
new stdClass();
900 $this->contrat->services->inactifs =
new stdClass();
901 $this->contrat->services->expires =
new stdClass();
902 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
903 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
905 if (isset($this->commande)) {
906 $this->bank->rappro =
new stdClass();
907 $this->bank->cheque =
new stdClass();
908 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
909 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
911 if (isset($this->expensereport)) {
912 $this->expensereport->approve =
new stdClass();
913 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
914 $this->expensereport->payment =
new stdClass();
915 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
917 if (isset($this->holiday)) {
918 $this->holiday->approve =
new stdClass();
919 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
922 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
923 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
927 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
928 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
930 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
931 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
934 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
935 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
939 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
940 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
943 if (!isset($this->global->MAIN_JS_GRAPH)) {
944 $this->global->MAIN_JS_GRAPH =
'chart';
947 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
948 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
950 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
951 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
955 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
959 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
963 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
964 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
967 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
968 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
971 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
972 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
973 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
975 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
976 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
981 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
982 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
983 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
984 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
985 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
989 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
990 $this->global->LDAP_MEMBER_ACTIVE = 2;
993 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
994 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
997 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
998 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
1001 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
1002 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
1004 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1008 if (isset($this->product)) {
1010 $this->produit = $this->product;
1013 if (isset($this->facture)) {
1014 $this->invoice = $this->facture;
1017 if (isset($this->commande)) {
1018 $this->order = $this->commande;
1021 if (isset($this->contrat)) {
1022 $this->contract = $this->contrat;
1025 if (isset($this->categorie)) {
1026 $this->category = $this->categorie;
1029 if (isset($this->projet) && !isset($this->project)) {
1030 $this->project = $this->projet;
1033 if (isset($this->adherent) && !isset($this->member)) {
1034 $this->member = $this->adherent;
1038 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1039 if (is_object($mc)) {
1040 $mc->setValues($this);
1044 if (isModEnabled(
'syslog')) {
1046 if (!empty($this->global->SYSLOG_HANDLERS)) {
1047 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1049 $handlers = array();
1051 foreach ($handlers as $handler) {
1052 $handler_file_found =
'';
1053 $dirsyslogs = array(
'/core/modules/syslog/');
1054 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1055 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1057 foreach ($dirsyslogs as $reldir) {
1060 if (is_dir($newdir)) {
1061 $file = $newdir.$handler.
'.php';
1062 if (file_exists($file)) {
1063 $handler_file_found = $file;
1069 if (empty($handler_file_found)) {
1075 require_once $handler_file_found;
1076 $loghandlerinstance =
new $handler();
1078 throw new Exception(
'Log handler does not extend LogHandlerInterface');
1081 if (empty($this->loghandlers[$handler])) {
1082 $this->loghandlers[$handler] = $loghandlerinstance;
1089 if (!empty($this->file->mailing_limit_sendbyweb)) {
1090 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1092 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1093 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1095 if (!empty($this->file->mailing_limit_sendbycli)) {
1096 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1098 if (!empty($this->file->mailing_limit_sendbyday)) {
1099 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;