227 if (!empty($this->modules)) {
228 foreach ($this->modules as $m) {
229 if (isset($this->$m)) unset($this->$m);
234 $this->mycompany =
new stdClass();
235 $this->admin =
new stdClass();
236 $this->medias =
new stdClass();
237 $this->global =
new stdClass();
244 $this->fournisseur =
new stdClass();
245 $this->product =
new stdClass();
246 $this->service =
new stdClass();
247 $this->contrat =
new stdClass();
248 $this->actions =
new stdClass();
249 $this->agenda =
new stdClass();
250 $this->commande =
new stdClass();
251 $this->propal =
new stdClass();
252 $this->facture =
new stdClass();
253 $this->contrat =
new stdClass();
254 $this->
user =
new stdClass();
255 $this->adherent =
new stdClass();
256 $this->bank =
new stdClass();
257 $this->notification =
new stdClass();
258 $this->expensereport =
new stdClass();
259 $this->productbatch =
new stdClass();
262 $this->cache = array();
263 $this->modules = array();
264 $this->modules_parts = array(
268 'triggers' => array(),
270 'substitutions' => array(),
275 'barcode' => array(),
277 'societe' => array(),
284 if (!is_null($db) && is_object($db)) {
285 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
288 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
289 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
290 $sql .=
" FROM ".$db->prefix().
"const";
291 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
292 $sql .=
" ORDER BY entity";
294 $resql = $db->query($sql);
297 $numr = $db->num_rows($resql);
299 $objp = $db->fetch_object($resql);
301 $value = $objp->value;
304 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
305 $value = $_SERVER[
'DOLIBARR_'.$key];
306 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
307 $value = $_ENV[
'DOLIBARR_'.$key];
312 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
315 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
317 $params = explode(
':', $value, 2);
318 if (!is_array($this->modules_parts[$partname])) {
319 $this->modules_parts[$partname] = array();
321 $this->modules_parts[$partname][$params[0]][] = $value;
322 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
329 $modulename = strtolower($reg[1]);
330 $partname = strtolower($reg[2]);
331 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
332 $this->modules_parts[$partname] = array();
335 $arrValue = json_decode($value,
true);
337 if (is_array($arrValue)) {
338 $newvalue = $arrValue;
339 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
340 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
341 } elseif (in_array($partname, array(
'models',
'theme'))) {
342 $newvalue =
'/'.$modulename.
'/';
343 } elseif (in_array($partname, array(
'sms'))) {
344 $newvalue =
'/'.$modulename.
'/';
345 } elseif ($value == 1) {
346 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
351 if (!empty($newvalue)) {
352 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
354 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
356 $modulename = strtolower($reg[1]);
357 if ($modulename ==
'propale') {
358 $modulename =
'propal';
360 if ($modulename ==
'supplierproposal') {
361 $modulename =
'supplier_proposal';
363 $this->modules[$modulename] = $modulename;
365 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
366 $this->$modulename =
new stdClass();
368 $this->$modulename->enabled =
true;
379 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
380 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
381 foreach ($filesList as $file) {
393 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
395 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
397 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
402 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
404 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
406 $mc =
new ActionsMulticompany($db);
412 if (empty($this->global->MAIN_MENU_STANDARD)) {
413 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
415 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
416 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
418 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
419 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
421 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
422 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
424 if (!isset($this->global->FACTURE_TVAOPTION)) {
425 $this->global->FACTURE_TVAOPTION = 1;
429 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
430 $this->global->LDAP_FIELD_FULLNAME =
'';
432 if (!isset($this->global->LDAP_KEY_USERS)) {
433 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
435 if (!isset($this->global->LDAP_KEY_GROUPS)) {
436 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
438 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
439 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
441 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
442 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
444 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
445 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
449 if (empty($this->global->MAIN_LANG_DEFAULT)) {
450 $this->global->MAIN_LANG_DEFAULT =
"en_US";
453 $rootfordata = DOL_DATA_ROOT;
454 $rootforuser = DOL_DATA_ROOT;
456 if (isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
457 $rootfordata .=
'/'.$this->entity;
460 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
463 foreach ($this->modules as $module) {
466 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
467 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
469 $this->$module->dir_output = $rootfordata.
"/".$module;
470 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
474 if (!empty($this->modules_parts[
'dir'])) {
475 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
476 if (!empty($this->$module->enabled)) {
477 foreach ($dirs as $type => $name) {
478 $multidirname =
'multidir_'.$type;
479 $dirname =
'dir_'.$type;
481 if ($type !=
'temp') {
483 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
486 $this->$module->$dirname = $rootfordata.
"/".$name;
489 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
492 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
500 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
501 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
504 $this->admin->dir_output = $rootfordata.
'/admin';
505 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
508 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
509 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
511 $this->
user->dir_output = $rootforuser.
"/users";
512 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
515 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
516 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
518 $this->propal->dir_output = $rootfordata.
"/propale";
519 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
522 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
523 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
528 if (!empty($this->fournisseur)) {
529 $this->fournisseur->commande =
new stdClass();
530 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
531 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
532 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
533 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
535 $this->fournisseur->facture =
new stdClass();
536 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
537 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
538 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
539 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
541 $this->supplierproposal =
new stdClass();
542 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
543 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
544 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
545 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
547 $this->fournisseur->payment =
new stdClass();
548 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
549 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
550 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
551 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
554 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) {
555 $this->supplier_order =
new stdClass();
556 $this->supplier_order->enabled = 1;
557 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
558 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
559 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
560 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
562 $this->supplier_invoice =
new stdClass();
563 $this->supplier_invoice->enabled = 1;
564 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
565 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
566 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
567 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
572 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
573 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
574 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
575 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
577 $this->product->dir_output = $rootfordata.
"/produit";
578 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
579 $this->service->dir_output = $rootfordata.
"/produit";
580 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
583 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
584 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
587 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
588 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
590 $this->contrat->dir_output = $rootfordata.
"/contract";
591 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
594 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
595 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
597 $this->bank->dir_output = $rootfordata.
"/bank";
598 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
602 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
605 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
606 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
608 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
609 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
612 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
613 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
615 if (empty($this->global->TICKET_ADDON)) {
616 $this->global->TICKET_ADDON =
'mod_ticket_simple';
620 if (empty($this->global->USER_PASSWORD_GENERATED)) {
621 $this->global->USER_PASSWORD_GENERATED =
'standard';
623 if (empty($this->global->MAIN_UMASK)) {
624 $this->global->MAIN_UMASK =
'0660';
627 $tmpumask = (octdec($this->global->MAIN_UMASK) & 0666);
628 $tmpumask = decoct($tmpumask);
629 if (!preg_match(
'/^0/', $tmpumask)) {
630 $tmpumask =
'0'.$tmpumask;
632 if (empty($tmpumask) || $tmpumask ===
'0') {
635 $this->global->MAIN_UMASK = $tmpumask;
639 $this->use_javascript_ajax = 1;
640 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
641 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
644 if (empty($this->use_javascript_ajax)) {
645 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
646 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
647 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
648 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
651 if (isModEnabled(
'productbatch')) {
653 $this->global->STOCK_CALCULATE_ON_BILL = 0;
654 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
655 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
656 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
657 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
658 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
659 if (!isModEnabled(
'reception')) {
660 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
662 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
663 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
667 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
668 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
672 if (empty($this->global->MAIN_MONNAIE)) {
673 $this->global->MAIN_MONNAIE =
'EUR';
675 $this->currency = $this->global->MAIN_MONNAIE;
677 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
678 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
682 if (empty($this->global->ACCOUNTING_MODE)) {
683 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
687 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
688 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
692 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
693 $this->global->PROJECT_BILL_TIME_SPENT = 1;
697 if (!isset($this->global->MAIN_HTML_TITLE)) {
698 $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
702 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
703 $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
705 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
708 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
709 $this->global->PRODUIT_LIMIT_SIZE = 1000;
711 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
714 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
717 if (empty($this->global->MAIN_THEME)) {
718 $this->global->MAIN_THEME =
"eldy";
720 if (!empty($this->global->MAIN_FORCETHEME)) {
721 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
723 $this->theme = $this->global->MAIN_THEME;
724 $this->css =
"/theme/".$this->theme.
"/style.css.php";
727 $this->email_from =
"robot@example.com";
728 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
729 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
733 if (isModEnabled(
'notification')) {
734 $this->notification->email_from = $this->email_from;
735 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
736 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
740 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
741 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
744 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
745 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
749 $this->format_date_short =
"%d/%m/%Y";
750 $this->format_date_short_java =
"dd/MM/yyyy";
751 $this->format_hour_short =
"%H:%M";
752 $this->format_hour_short_duration =
"%H:%M";
753 $this->format_date_text_short =
"%d %b %Y";
754 $this->format_date_text =
"%d %B %Y";
755 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
756 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
757 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
758 $this->format_date_hour_text =
"%d %B %Y %H:%M";
761 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
762 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
766 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
767 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
769 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
770 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
772 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
773 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
777 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
778 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
780 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
781 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
788 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
789 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
793 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
794 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
798 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
799 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
803 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
804 $this->global->MAIN_SHOW_STATE_CODE = 1;
808 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
809 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
813 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
814 $this->global->USE_STRICT_CSV_RULES = 2;
818 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
819 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
823 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
824 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog';
826 if (!empty($this->modules_parts[
'moduleforexternal'])) {
827 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
828 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
833 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
834 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
838 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
839 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
841 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
842 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
846 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
847 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
849 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
850 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
852 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
853 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
855 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
856 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
861 if (isset($this->agenda)) {
862 $this->adherent->subscription =
new stdClass();
863 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
865 if (isset($this->agenda)) {
866 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
868 if (isset($this->projet)) {
869 $this->projet->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_PROJECT_TO_CLOSE', 7) * 86400);
870 $this->projet->task =
new StdClass();
871 $this->projet->task->warning_delay = (
getDolGlobalInt(
'MAIN_DELAY_TASKS_TODO', 7) * 86400);
874 if (isset($this->commande)) {
875 $this->commande->client =
new stdClass();
876 $this->commande->fournisseur =
new stdClass();
877 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
878 $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;
880 if (isset($this->propal)) {
881 $this->propal->cloture =
new stdClass();
882 $this->propal->facturation =
new stdClass();
883 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
884 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
886 if (isset($this->facture)) {
887 $this->facture->client =
new stdClass();
888 $this->facture->fournisseur =
new stdClass();
889 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
890 $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;
892 if (isset($this->contrat)) {
893 $this->contrat->services =
new stdClass();
894 $this->contrat->services->inactifs =
new stdClass();
895 $this->contrat->services->expires =
new stdClass();
896 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
897 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
899 if (isset($this->commande)) {
900 $this->bank->rappro =
new stdClass();
901 $this->bank->cheque =
new stdClass();
902 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
903 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
905 if (isset($this->expensereport)) {
906 $this->expensereport->approve =
new stdClass();
907 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
908 $this->expensereport->payment =
new stdClass();
909 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
911 if (isset($this->holiday)) {
912 $this->holiday->approve =
new stdClass();
913 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
916 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
917 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
921 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
922 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
924 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
925 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
928 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
929 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
933 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
934 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
937 if (!isset($this->global->MAIN_JS_GRAPH)) {
938 $this->global->MAIN_JS_GRAPH =
'chart';
941 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
942 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
944 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
945 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
949 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
953 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
957 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
958 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
961 if (!isset($this->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
962 $this->global->MAIL_SMTP_USE_FROM_FOR_HELO = 2;
965 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
966 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
967 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
969 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
970 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
975 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
976 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
977 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
978 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
979 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
983 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
984 $this->global->LDAP_MEMBER_ACTIVE = 2;
987 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
988 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
991 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
992 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
995 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
996 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
998 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
1002 if (isset($this->product)) {
1004 $this->produit = $this->product;
1007 if (isset($this->facture)) {
1008 $this->invoice = $this->facture;
1011 if (isset($this->commande)) {
1012 $this->order = $this->commande;
1015 if (isset($this->contrat)) {
1016 $this->contract = $this->contrat;
1019 if (isset($this->categorie)) {
1020 $this->category = $this->categorie;
1023 if (isset($this->projet) && !isset($this->project)) {
1024 $this->project = $this->projet;
1027 if (isset($this->adherent) && !isset($this->member)) {
1028 $this->member = $this->adherent;
1032 if (!defined(
'NOREQUIREMC') && isModEnabled(
'multicompany')) {
1033 if (is_object($mc)) {
1034 $mc->setValues($this);
1038 if (isModEnabled(
'syslog')) {
1040 if (!empty($this->global->SYSLOG_HANDLERS)) {
1041 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1043 $handlers = array();
1045 foreach ($handlers as $handler) {
1046 $handler_file_found =
'';
1047 $dirsyslogs = array(
'/core/modules/syslog/');
1048 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1049 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1051 foreach ($dirsyslogs as $reldir) {
1054 if (is_dir($newdir)) {
1055 $file = $newdir.$handler.
'.php';
1056 if (file_exists($file)) {
1057 $handler_file_found = $file;
1063 if (empty($handler_file_found)) {
1069 require_once $handler_file_found;
1070 $loghandlerinstance =
new $handler();
1072 throw new Exception(
'Log handler does not extend LogHandlerInterface');
1075 if (empty($this->loghandlers[$handler])) {
1076 $this->loghandlers[$handler] = $loghandlerinstance;
1083 if (!empty($this->file->mailing_limit_sendbyweb)) {
1084 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1086 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1087 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1089 if (!empty($this->file->mailing_limit_sendbycli)) {
1090 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1092 if (!empty($this->file->mailing_limit_sendbyday)) {
1093 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;