65 public $modules_parts;
74 public $logbuffer = array();
79 public $loghandlers = array();
88 public $dol_hide_topmenu;
89 public $dol_hide_leftmenu;
90 public $dol_optimize_smallscreen;
91 public $dol_no_mouse_hover;
92 public $dol_use_jmobile;
96 public $tzuserinputkey =
'tzserver';
105 $this->file =
new stdClass();
106 $this->
db =
new stdClass();
108 $this->file->character_set_client =
'UTF-8';
111 $this->mycompany =
new stdClass();
112 $this->admin =
new stdClass();
113 $this->medias =
new stdClass();
114 $this->global =
new stdClass();
117 $this->browser =
new stdClass();
120 $this->cache = array();
121 $this->modules = array();
122 $this->modules_parts = array(
126 'triggers' => array(),
128 'substitutions' => array(),
133 'barcode' => array(),
135 'societe' => array(),
144 $this->syslog =
new stdClass();
145 $this->multicompany =
new stdClass();
146 $this->expedition_bon =
new stdClass();
147 $this->delivery_note =
new stdClass();
148 $this->fournisseur =
new stdClass();
149 $this->product =
new stdClass();
150 $this->service =
new stdClass();
151 $this->contrat =
new stdClass();
152 $this->actions =
new stdClass();
153 $this->agenda =
new stdClass();
154 $this->commande =
new stdClass();
155 $this->propal =
new stdClass();
156 $this->facture =
new stdClass();
157 $this->contrat =
new stdClass();
158 $this->
user =
new stdClass();
159 $this->adherent =
new stdClass();
160 $this->bank =
new stdClass();
161 $this->notification =
new stdClass();
162 $this->mailing =
new stdClass();
163 $this->expensereport =
new stdClass();
164 $this->productbatch =
new stdClass();
177 if ($this->entity !=
$entity) {
198 if (!empty($this->modules)) {
199 foreach ($this->modules as $m) {
200 if (isset($this->$m)) unset($this->$m);
205 $this->mycompany =
new stdClass();
206 $this->admin =
new stdClass();
207 $this->medias =
new stdClass();
208 $this->global =
new stdClass();
215 $this->syslog =
new stdClass();
216 $this->expedition_bon =
new stdClass();
217 $this->delivery_note =
new stdClass();
218 $this->fournisseur =
new stdClass();
219 $this->product =
new stdClass();
220 $this->service =
new stdClass();
221 $this->contrat =
new stdClass();
222 $this->actions =
new stdClass();
223 $this->agenda =
new stdClass();
224 $this->commande =
new stdClass();
225 $this->propal =
new stdClass();
226 $this->facture =
new stdClass();
227 $this->contrat =
new stdClass();
228 $this->
user =
new stdClass();
229 $this->adherent =
new stdClass();
230 $this->bank =
new stdClass();
231 $this->notification =
new stdClass();
232 $this->mailing =
new stdClass();
233 $this->expensereport =
new stdClass();
234 $this->productbatch =
new stdClass();
237 $this->cache = array();
238 $this->modules = array();
239 $this->modules_parts = array(
243 'triggers' => array(),
245 'substitutions' => array(),
250 'barcode' => array(),
252 'societe' => array(),
259 if (!is_null($db) && is_object($db)) {
260 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
263 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
264 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
265 $sql .=
" FROM ".$db->prefix().
"const";
266 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
267 $sql .=
" ORDER BY entity";
269 $resql = $db->query($sql);
272 $numr = $db->num_rows(
$resql);
274 $objp = $db->fetch_object(
$resql);
276 $value = $objp->value;
279 if (isset($_SERVER[
'DOLIBARR_'.$key])) {
280 $value = $_SERVER[
'DOLIBARR_'.$key];
281 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
282 $value = $_ENV[
'DOLIBARR_'.$key];
287 if ($value && strpos($key,
'MAIN_MODULE_') === 0) {
290 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key)) {
292 $params = explode(
':', $value, 2);
293 if (!is_array($this->modules_parts[$partname])) {
294 $this->modules_parts[$partname] = array();
296 $this->modules_parts[$partname][$params[0]][] = $value;
297 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
304 $modulename = strtolower($reg[1]);
305 $partname = strtolower($reg[2]);
306 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
307 $this->modules_parts[$partname] = array();
310 $arrValue = json_decode($value,
true);
312 if (is_array($arrValue)) {
313 $newvalue = $arrValue;
314 } elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) {
315 $newvalue =
'/'.$modulename.
'/core/'.$partname.
'/';
316 } elseif (in_array($partname, array(
'models',
'theme'))) {
317 $newvalue =
'/'.$modulename.
'/';
318 } elseif (in_array($partname, array(
'sms'))) {
319 $newvalue =
'/'.$modulename.
'/';
320 } elseif ($value == 1) {
321 $newvalue =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
326 if (!empty($newvalue)) {
327 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $newvalue));
329 } elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
331 $modulename = strtolower($reg[1]);
332 if ($modulename ==
'propale') {
333 $modulename =
'propal';
335 if ($modulename ==
'supplierproposal') {
336 $modulename =
'supplier_proposal';
338 if (!isset($this->$modulename) || !is_object($this->$modulename)) {
339 $this->$modulename =
new stdClass();
341 $this->$modulename->enabled =
true;
342 $this->modules[] = $modulename;
353 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
354 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
355 foreach ($filesList as $file) {
367 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto') {
369 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
371 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
376 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
378 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
380 $mc =
new ActionsMulticompany($db);
386 if (empty($this->global->MAIN_MENU_STANDARD)) {
387 $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
389 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) {
390 $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
392 if (empty($this->global->MAIN_MENU_SMARTPHONE)) {
393 $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
395 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) {
396 $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
398 if (!isset($this->global->FACTURE_TVAOPTION)) {
399 $this->global->FACTURE_TVAOPTION = 1;
403 if (empty($this->global->LDAP_FIELD_FULLNAME)) {
404 $this->global->LDAP_FIELD_FULLNAME =
'';
406 if (!isset($this->global->LDAP_KEY_USERS)) {
407 $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
409 if (!isset($this->global->LDAP_KEY_GROUPS)) {
410 $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
412 if (!isset($this->global->LDAP_KEY_CONTACTS)) {
413 $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
415 if (!isset($this->global->LDAP_KEY_MEMBERS)) {
416 $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
418 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) {
419 $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
423 if (empty($this->global->MAIN_LANG_DEFAULT)) {
424 $this->global->MAIN_LANG_DEFAULT =
"en_US";
427 $rootfordata = DOL_DATA_ROOT;
428 $rootforuser = DOL_DATA_ROOT;
430 if (
isModEnabled(
'multicompany') && !empty($this->entity) && $this->entity > 1) {
431 $rootfordata .=
'/'.$this->entity;
434 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
437 foreach ($this->modules as $module) {
440 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
441 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
443 $this->$module->dir_output = $rootfordata.
"/".$module;
444 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
448 if (!empty($this->modules_parts[
'dir'])) {
449 foreach ($this->modules_parts[
'dir'] as $module => $dirs) {
450 if (!empty($this->$module->enabled)) {
451 foreach ($dirs as $type => $name) {
452 $multidirname =
'multidir_'.$type;
453 $dirname =
'dir_'.$type;
455 if ($type !=
'temp') {
457 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
460 $this->$module->$dirname = $rootfordata.
"/".$name;
463 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
466 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
474 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
475 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
478 $this->admin->dir_output = $rootfordata.
'/admin';
479 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
482 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
483 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
485 $this->
user->dir_output = $rootforuser.
"/users";
486 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
489 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
490 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
492 $this->propal->dir_output = $rootfordata.
"/propale";
493 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
496 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
497 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
502 $this->expedition_bon->enabled = (empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? 0 : $this->global->MAIN_SUBMODULE_EXPEDITION);
504 $this->delivery_note->enabled = (empty($this->global->MAIN_SUBMODULE_DELIVERY) ? 0 : $this->global->MAIN_SUBMODULE_DELIVERY);
507 if (!empty($this->fournisseur)) {
508 $this->fournisseur->commande =
new stdClass();
509 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
510 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
511 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
512 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
514 $this->fournisseur->facture =
new stdClass();
515 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
516 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
517 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
518 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
520 $this->supplierproposal =
new stdClass();
521 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
522 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
523 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
524 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
526 $this->fournisseur->payment =
new stdClass();
527 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
528 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
529 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
530 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
533 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) {
534 $this->supplier_order =
new stdClass();
535 $this->supplier_order->enabled = 1;
536 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
537 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
538 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
539 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
541 $this->supplier_invoice =
new stdClass();
542 $this->supplier_invoice->enabled = 1;
543 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
544 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
545 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
546 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
551 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
552 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
553 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
554 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
556 $this->product->dir_output = $rootfordata.
"/produit";
557 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
558 $this->service->dir_output = $rootfordata.
"/produit";
559 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
562 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
563 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
566 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
567 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
569 $this->contrat->dir_output = $rootfordata.
"/contract";
570 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
573 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
574 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
576 $this->bank->dir_output = $rootfordata.
"/bank";
577 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
581 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
584 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) {
585 $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
587 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) {
588 $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
591 if (empty($this->global->CHEQUERECEIPTS_ADDON)) {
592 $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
594 if (empty($this->global->TICKET_ADDON)) {
595 $this->global->TICKET_ADDON =
'mod_ticket_simple';
599 if (empty($this->global->USER_PASSWORD_GENERATED)) {
600 $this->global->USER_PASSWORD_GENERATED =
'standard';
602 if (empty($this->global->MAIN_UMASK)) {
603 $this->global->MAIN_UMASK =
'0664';
607 $this->use_javascript_ajax = 1;
608 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) {
609 $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
612 if (empty($this->use_javascript_ajax)) {
613 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
614 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
615 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
616 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
619 if (!empty($this->productbatch->enabled)) {
620 $this->global->STOCK_CALCULATE_ON_BILL = 0;
621 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
622 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
623 if (empty($this->global->STOCK_CALCULATE_ON_SHIPMENT)) $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 1;
624 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
625 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
626 if (empty($this->reception->enabled)) {
627 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
629 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
630 if (empty($this->global->STOCK_CALCULATE_ON_RECEPTION)) $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 1;
634 if (!isset($this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT)) {
635 $this->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT = 1;
639 if (empty($this->global->MAIN_MONNAIE)) {
640 $this->global->MAIN_MONNAIE =
'EUR';
642 $this->currency = $this->global->MAIN_MONNAIE;
644 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) {
645 $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
649 if (empty($this->global->ACCOUNTING_MODE)) {
650 $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
654 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) {
655 $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
659 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) {
660 $this->global->PROJECT_BILL_TIME_SPENT = 1;
664 if (!isset($this->global->MAIN_HTML_TITLE)) {
665 $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
669 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
670 $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
672 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
675 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
676 $this->global->PRODUIT_LIMIT_SIZE = 1000;
678 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
681 $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
684 if (empty($this->global->MAIN_THEME)) {
685 $this->global->MAIN_THEME =
"eldy";
687 if (!empty($this->global->MAIN_FORCETHEME)) {
688 $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
690 $this->theme = $this->global->MAIN_THEME;
691 $this->css =
"/theme/".$this->theme.
"/style.css.php";
694 $this->email_from =
"robot@example.com";
695 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) {
696 $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
700 $this->notification->email_from = $this->email_from;
701 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) {
702 $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
706 $this->mailing->email_from = $this->email_from;
707 if (!empty($this->global->MAILING_EMAIL_FROM)) {
708 $this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
711 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
712 $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
715 if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
716 $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
720 $this->format_date_short =
"%d/%m/%Y";
721 $this->format_date_short_java =
"dd/MM/yyyy";
722 $this->format_hour_short =
"%H:%M";
723 $this->format_hour_short_duration =
"%H:%M";
724 $this->format_date_text_short =
"%d %b %Y";
725 $this->format_date_text =
"%d %B %Y";
726 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
727 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
728 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
729 $this->format_date_hour_text =
"%d %B %Y %H:%M";
732 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) {
733 $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
737 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) {
738 $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
740 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) {
741 $this->global->MAIN_MAX_DECIMALS_TOT = 2;
743 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) {
744 $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
748 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) {
749 $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
751 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
752 $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
759 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) {
760 $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
764 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) {
765 $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
769 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) {
770 $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
774 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) {
775 $this->global->MAIN_SHOW_STATE_CODE = 1;
779 if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
780 $this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
784 if (!isset($this->global->USE_STRICT_CSV_RULES)) {
785 $this->global->USE_STRICT_CSV_RULES = 2;
789 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
790 $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
794 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) {
795 $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,reception,agenda,resource,adherent,blockedlog';
797 if (!empty($this->modules_parts[
'moduleforexternal'])) {
798 foreach ($this->modules_parts[
'moduleforexternal'] as $key => $value) {
799 $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
804 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') {
805 $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
809 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) {
810 $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
812 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) {
813 $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
817 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) {
818 $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
820 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) {
821 $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
823 if (empty($this->global->TAX_MODE_SELL_SERVICE)) {
824 $this->global->TAX_MODE_SELL_SERVICE =
'payment';
826 if (empty($this->global->TAX_MODE_BUY_SERVICE)) {
827 $this->global->TAX_MODE_BUY_SERVICE =
'payment';
832 if (isset($this->agenda)) {
833 $this->adherent->subscription =
new stdClass();
834 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
836 if (isset($this->agenda)) {
837 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
839 if (isset($this->projet)) {
840 $this->projet->warning_delay = (isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE) ? $this->global->MAIN_DELAY_PROJECT_TO_CLOSE : 7) * 86400;
841 $this->projet->task =
new StdClass();
842 $this->projet->task->warning_delay = (isset($this->global->MAIN_DELAY_TASKS_TODO) ? $this->global->MAIN_DELAY_TASKS_TODO : 7) * 86400;
845 if (isset($this->commande)) {
846 $this->commande->client =
new stdClass();
847 $this->commande->fournisseur =
new stdClass();
848 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
849 $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
851 if (isset($this->propal)) {
852 $this->propal->cloture =
new stdClass();
853 $this->propal->facturation =
new stdClass();
854 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
855 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
857 if (isset($this->facture)) {
858 $this->facture->client =
new stdClass();
859 $this->facture->fournisseur =
new stdClass();
860 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
861 $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
863 if (isset($this->contrat)) {
864 $this->contrat->services =
new stdClass();
865 $this->contrat->services->inactifs =
new stdClass();
866 $this->contrat->services->expires =
new stdClass();
867 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
868 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
870 if (isset($this->commande)) {
871 $this->bank->rappro =
new stdClass();
872 $this->bank->cheque =
new stdClass();
873 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
874 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
876 if (isset($this->expensereport)) {
877 $this->expensereport->approve =
new stdClass();
878 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
879 $this->expensereport->payment =
new stdClass();
880 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
882 if (isset($this->holiday)) {
883 $this->holiday->approve =
new stdClass();
884 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
887 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {
888 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
892 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) {
893 $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
895 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) {
896 $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
899 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) {
900 $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
904 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO')) {
905 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
908 if (!isset($this->global->MAIN_JS_GRAPH)) {
909 $this->global->MAIN_JS_GRAPH =
'chart';
912 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) {
913 $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
915 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) {
916 $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
920 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
924 $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2;
928 if (!isset($this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
929 $this->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA = 1;
932 if (!defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
933 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) {
934 $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
936 if (defined(
'MAIN_ANTIVIRUS_PARAM')) {
937 $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
942 if (!empty($this->global->LDAP_SYNCHRO_ACTIVE)) {
943 if ($this->global->LDAP_SYNCHRO_ACTIVE ==
'dolibarr2ldap') {
944 $this->global->LDAP_SYNCHRO_ACTIVE = 1;
945 } elseif ($this->global->LDAP_SYNCHRO_ACTIVE ==
'ldap2dolibarr') {
946 $this->global->LDAP_SYNCHRO_ACTIVE = 2;
950 if (!empty($this->global->LDAP_MEMBER_ACTIVE) && $this->global->LDAP_MEMBER_ACTIVE ==
'ldap2dolibarr') {
951 $this->global->LDAP_MEMBER_ACTIVE = 2;
954 if (!empty($this->global->LDAP_MEMBER_TYPE_ACTIVE) && $this->global->LDAP_MEMBER_TYPE_ACTIVE ==
'ldap2dolibarr') {
955 $this->global->LDAP_MEMBER_TYPE_ACTIVE = 2;
958 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
959 $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
962 if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
963 $this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
965 unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
969 if (isset($this->product)) {
971 $this->produit = $this->product;
974 if (isset($this->facture)) {
975 $this->invoice = $this->facture;
978 if (isset($this->commande)) {
979 $this->order = $this->commande;
982 if (isset($this->contrat)) {
983 $this->contract = $this->contrat;
986 if (isset($this->categorie)) {
987 $this->category = $this->categorie;
990 if (isset($this->projet) && !isset($this->project)) {
991 $this->project = $this->projet;
994 if (isset($this->adherent) && !isset($this->member)) {
995 $this->member = $this->adherent;
999 if (!defined(
'NOREQUIREMC') &&
isModEnabled(
'multicompany')) {
1000 if (is_object($mc)) {
1001 $mc->setValues($this);
1005 if (!empty($this->syslog->enabled)) {
1007 if (!empty($this->global->SYSLOG_HANDLERS)) {
1008 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
1010 $handlers = array();
1012 foreach ($handlers as $handler) {
1013 $handler_file_found =
'';
1014 $dirsyslogs = array(
'/core/modules/syslog/');
1015 if (!empty($this->modules_parts[
'syslog']) && is_array($this->modules_parts[
'syslog'])) {
1016 $dirsyslogs = array_merge($dirsyslogs, $this->modules_parts[
'syslog']);
1018 foreach ($dirsyslogs as $reldir) {
1021 if (is_dir($newdir)) {
1022 $file = $newdir.$handler.
'.php';
1023 if (file_exists($file)) {
1024 $handler_file_found = $file;
1030 if (empty($handler_file_found)) {
1036 require_once $handler_file_found;
1037 $loghandlerinstance =
new $handler();
1039 throw new Exception(
'Log handler does not extend LogHandlerInterface');
1042 if (empty($this->loghandlers[$handler])) {
1043 $this->loghandlers[$handler] = $loghandlerinstance;
1050 if (!empty($this->file->mailing_limit_sendbyweb)) {
1051 $this->global->MAILING_LIMIT_SENDBYWEB = $this->file->mailing_limit_sendbyweb;
1053 if (empty($this->global->MAILING_LIMIT_SENDBYWEB)) {
1054 $this->global->MAILING_LIMIT_SENDBYWEB = 25;
1056 if (!empty($this->file->mailing_limit_sendbycli)) {
1057 $this->global->MAILING_LIMIT_SENDBYCLI = $this->file->mailing_limit_sendbycli;
1059 if (!empty($this->file->mailing_limit_sendbyday)) {
1060 $this->global->MAILING_LIMIT_SENDBYDAY = $this->file->mailing_limit_sendbyday;
Class to stock current configuration.
setValues($db)
Load setup values into conf object (read llx_const) Note that this->db->xxx, this->file->xxx have bee...
$use_javascript_ajax
To store if javascript/ajax is enabked.
$standard_menu
Used to store current menu handler.
$theme
Used to store current css (from theme)
$entity
Used to store running instance for multi-company (default 1)
$browser
To store browser info.
__construct()
Constructor.
$entities
Used to store list of entities to use for each element.
setEntityValues($db, $entity)
Load setup values into conf object (read llx_const) for a specified entity Note that this->db->xxx,...
$currency
Used to store current currency (ISO code like 'USD', 'EUR', ...). To get the currency symbol: $langs-...
$disable_compute
To store if javascript/ajax is enabked.
$multicompany
To store properties of multi-company.
$global
To store properties found into database.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dolDecrypt($chain, $key='')
Decode a string with a symetric encryption.
$conf db
API class for accounts.