63 public $modules = array();
64 public $modules_parts = array(
68 'triggers' => array(),
70 'substitutions' => array(),
83 public $logbuffer = array();
88 public $loghandlers = array();
97 public $dol_hide_topmenu;
98 public $dol_hide_leftmenu;
99 public $dol_optimize_smallscreen;
100 public $dol_no_mouse_hover;
101 public $dol_use_jmobile;
105 public $tzuserinputkey =
'tzserver';
114 $this->file =
new stdClass();
115 $this->
db =
new stdClass();
116 $this->global =
new stdClass();
117 $this->mycompany =
new stdClass();
118 $this->admin =
new stdClass();
119 $this->
user =
new stdClass();
120 $this->syslog =
new stdClass();
121 $this->browser =
new stdClass();
122 $this->medias =
new stdClass();
123 $this->multicompany =
new stdClass();
126 $this->file->character_set_client =
'UTF-8';
130 $this->expedition_bon =
new stdClass();
131 $this->delivery_note =
new stdClass();
132 $this->fournisseur =
new stdClass();
133 $this->product =
new stdClass();
134 $this->service =
new stdClass();
135 $this->contrat =
new stdClass();
136 $this->actions =
new stdClass();
137 $this->agenda =
new stdClass();
138 $this->commande =
new stdClass();
139 $this->propal =
new stdClass();
140 $this->facture =
new stdClass();
141 $this->contrat =
new stdClass();
142 $this->usergroup =
new stdClass();
143 $this->adherent =
new stdClass();
144 $this->bank =
new stdClass();
145 $this->notification =
new stdClass();
146 $this->mailing =
new stdClass();
147 $this->expensereport =
new stdClass();
148 $this->productbatch =
new stdClass();
164 $sql =
"SELECT ".$db->decrypt(
'name').
" as name,";
165 $sql .=
" ".$db->decrypt(
'value').
" as value, entity";
166 $sql .=
" FROM ".MAIN_DB_PREFIX.
"const";
167 $sql .=
" WHERE entity IN (0,".$this->entity.
")";
168 $sql .=
" ORDER BY entity";
170 $resql = $db->query($sql);
174 $numr = $db->num_rows(
$resql);
177 $objp = $db->fetch_object(
$resql);
179 $value = $objp->value;
183 if (isset(
$_SERVER[
'DOLIBARR_'.$key])) {
184 $value =
$_SERVER[
'DOLIBARR_'.$key];
185 } elseif (isset($_ENV[
'DOLIBARR_'.$key])) {
186 $value = $_ENV[
'DOLIBARR_'.$key];
190 $this->global->$key = $value;
192 if ($value && strpos($key,
'MAIN_MODULE_') === 0)
196 if (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i', $key))
199 $params = explode(
':', $value, 2);
200 if (!is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
201 $this->modules_parts[$partname][$params[0]][] = $value;
208 elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg))
210 $modulename = strtolower($reg[1]);
211 $partname = strtolower($reg[2]);
212 if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
213 $arrValue = json_decode($value,
true);
214 if (is_array($arrValue) && !empty($arrValue)) $value = $arrValue;
215 elseif (in_array($partname, array(
'login',
'menus',
'substitutions',
'triggers',
'tpl'))) $value =
'/'.$modulename.
'/core/'.$partname.
'/';
216 elseif (in_array($partname, array(
'models',
'theme'))) $value =
'/'.$modulename.
'/';
217 elseif (in_array($partname, array(
'sms'))) $value =
'/'.$modulename.
'/';
218 elseif ($value == 1) $value =
'/'.$modulename.
'/core/modules/'.$partname.
'/';
219 $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value));
222 elseif (preg_match(
'/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg))
224 $modulename = strtolower($reg[1]);
225 if ($modulename ==
'propale') $modulename =
'propal';
226 if ($modulename ==
'supplierproposal') $modulename =
'supplier_proposal';
227 if (!isset($this->$modulename) || !is_object($this->$modulename)) $this->$modulename =
new stdClass();
228 $this->$modulename->enabled =
true;
229 $this->modules[] = $modulename;
240 if (!empty($this->global->LOCAL_CONSTS_FILES)) {
241 $filesList = explode(
":", $this->global->LOCAL_CONSTS_FILES);
242 foreach ($filesList as
$file) {
254 if (!empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ !=
'auto')
257 date_default_timezone_set($this->global->MAIN_SERVER_TZ);
260 dol_syslog(
"Error: Bad value for parameter MAIN_SERVER_TZ=".$this->global->MAIN_SERVER_TZ, LOG_ERR);
265 if (!defined(
'NOREQUIREMC') && !empty($this->multicompany->enabled)) {
267 $ret = @
dol_include_once(
'/multicompany/class/actions_multicompany.class.php');
269 $mc =
new ActionsMulticompany($db);
275 if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD =
"eldy_menu.php";
276 if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD =
"eldy_menu.php";
277 if (empty($this->global->MAIN_MENU_SMARTPHONE)) $this->global->MAIN_MENU_SMARTPHONE =
"eldy_menu.php";
278 if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE =
"eldy_menu.php";
279 if (!isset($this->global->FACTURE_TVAOPTION)) $this->global->FACTURE_TVAOPTION = 1;
282 if (empty($this->global->LDAP_FIELD_FULLNAME)) $this->global->LDAP_FIELD_FULLNAME =
'';
283 if (!isset($this->global->LDAP_KEY_USERS)) $this->global->LDAP_KEY_USERS = $this->global->LDAP_FIELD_FULLNAME;
284 if (!isset($this->global->LDAP_KEY_GROUPS)) $this->global->LDAP_KEY_GROUPS = $this->global->LDAP_FIELD_FULLNAME;
285 if (!isset($this->global->LDAP_KEY_CONTACTS)) $this->global->LDAP_KEY_CONTACTS = $this->global->LDAP_FIELD_FULLNAME;
286 if (!isset($this->global->LDAP_KEY_MEMBERS)) $this->global->LDAP_KEY_MEMBERS = $this->global->LDAP_FIELD_FULLNAME;
287 if (!isset($this->global->LDAP_KEY_MEMBERS_TYPES)) $this->global->LDAP_KEY_MEMBERS_TYPES = $this->global->LDAP_FIELD_FULLNAME;
290 if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT =
"en_US";
292 $rootfordata = DOL_DATA_ROOT;
293 $rootforuser = DOL_DATA_ROOT;
295 if (!empty($this->multicompany->enabled) && !empty($this->entity) && $this->entity > 1)
297 $rootfordata .=
'/'.$this->entity;
300 $rootfortemp = empty($this->global->MAIN_TEMP_DIR) ? $rootfordata : $this->global->MAIN_TEMP_DIR;
303 foreach ($this->modules as $module)
307 $this->$module->multidir_output = array($this->entity => $rootfordata.
"/".$module);
308 $this->$module->multidir_temp = array($this->entity => $rootfortemp.
"/".$module.
"/temp");
310 $this->$module->dir_output = $rootfordata.
"/".$module;
311 $this->$module->dir_temp = $rootfortemp.
"/".$module.
"/temp";
315 if (!empty($this->modules_parts[
'dir']))
317 foreach ($this->modules_parts[
'dir'] as $module => $dirs)
319 if (!empty($this->$module->enabled))
321 foreach ($dirs as $type => $name)
323 $multidirname =
'multidir_'.$type;
324 $dirname =
'dir_'.$type;
329 $this->$module->$multidirname = array($this->entity => $rootfordata.
"/".$name);
332 $this->$module->$dirname = $rootfordata.
"/".$name;
335 $this->$module->$multidirname = array($this->entity => $rootfortemp.
"/".$name.
"/temp");
338 $this->$module->$dirname = $rootfortemp.
"/".$name.
"/temp";
346 $this->mycompany->dir_output = $rootfordata.
"/mycompany";
347 $this->mycompany->dir_temp = $rootfortemp.
"/mycompany/temp";
350 $this->admin->dir_output = $rootfordata.
'/admin';
351 $this->admin->dir_temp = $rootfortemp.
'/admin/temp';
354 $this->
user->multidir_output = array($this->entity => $rootfordata.
"/users");
355 $this->
user->multidir_temp = array($this->entity => $rootfortemp.
"/users/temp");
357 $this->
user->dir_output = $rootforuser.
"/users";
358 $this->
user->dir_temp = $rootfortemp.
"/users/temp";
361 $this->usergroup->dir_output = $rootforuser.
"/usergroups";
362 $this->usergroup->dir_temp = $rootfortemp.
"/usergroups/temp";
365 $this->propal->multidir_output = array($this->entity => $rootfordata.
"/propale");
366 $this->propal->multidir_temp = array($this->entity => $rootfortemp.
"/propale/temp");
368 $this->propal->dir_output = $rootfordata.
"/propale";
369 $this->propal->dir_temp = $rootfortemp.
"/propale/temp";
372 $this->medias->multidir_output = array($this->entity => $rootfordata.
"/medias");
373 $this->medias->multidir_temp = array($this->entity => $rootfortemp.
"/medias/temp");
378 $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0);
380 $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0);
383 if (!empty($this->fournisseur))
385 $this->fournisseur->commande =
new stdClass();
386 $this->fournisseur->commande->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
387 $this->fournisseur->commande->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
388 $this->fournisseur->commande->dir_output = $rootfordata.
"/fournisseur/commande";
389 $this->fournisseur->commande->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
391 $this->fournisseur->facture =
new stdClass();
392 $this->fournisseur->facture->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
393 $this->fournisseur->facture->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
394 $this->fournisseur->facture->dir_output = $rootfordata.
"/fournisseur/facture";
395 $this->fournisseur->facture->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
397 $this->supplierproposal =
new stdClass();
398 $this->supplierproposal->multidir_output = array($this->entity => $rootfordata.
"/supplier_proposal");
399 $this->supplierproposal->multidir_temp = array($this->entity => $rootfortemp.
"/supplier_proposal/temp");
400 $this->supplierproposal->dir_output = $rootfordata.
"/supplier_proposal";
401 $this->supplierproposal->dir_temp = $rootfortemp.
"/supplier_proposal/temp";
403 $this->fournisseur->payment =
new stdClass();
404 $this->fournisseur->payment->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/payment");
405 $this->fournisseur->payment->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/payment/temp");
406 $this->fournisseur->payment->dir_output = $rootfordata.
"/fournisseur/payment";
407 $this->fournisseur->payment->dir_temp = $rootfortemp.
"/fournisseur/payment/temp";
410 if (!empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD))
412 $this->supplier_order =
new stdClass();
413 $this->supplier_order->enabled = 1;
414 $this->supplier_order->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/commande");
415 $this->supplier_order->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/commande/temp");
416 $this->supplier_order->dir_output = $rootfordata.
"/fournisseur/commande";
417 $this->supplier_order->dir_temp = $rootfortemp.
"/fournisseur/commande/temp";
419 $this->supplier_invoice =
new stdClass();
420 $this->supplier_invoice->enabled = 1;
421 $this->supplier_invoice->multidir_output = array($this->entity => $rootfordata.
"/fournisseur/facture");
422 $this->supplier_invoice->multidir_temp = array($this->entity => $rootfortemp.
"/fournisseur/facture/temp");
423 $this->supplier_invoice->dir_output = $rootfordata.
"/fournisseur/facture";
424 $this->supplier_invoice->dir_temp = $rootfortemp.
"/fournisseur/facture/temp";
429 $this->product->multidir_output = array($this->entity => $rootfordata.
"/produit");
430 $this->product->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
431 $this->service->multidir_output = array($this->entity => $rootfordata.
"/produit");
432 $this->service->multidir_temp = array($this->entity => $rootfortemp.
"/produit/temp");
434 $this->product->dir_output = $rootfordata.
"/produit";
435 $this->product->dir_temp = $rootfortemp.
"/produit/temp";
436 $this->service->dir_output = $rootfordata.
"/produit";
437 $this->service->dir_temp = $rootfortemp.
"/produit/temp";
440 $this->productbatch->multidir_output = array($this->entity => $rootfordata.
"/productlot");
441 $this->productbatch->multidir_temp = array($this->entity => $rootfortemp.
"/productlot/temp");
444 $this->contrat->multidir_output = array($this->entity => $rootfordata.
"/contract");
445 $this->contrat->multidir_temp = array($this->entity => $rootfortemp.
"/contract/temp");
447 $this->contrat->dir_output = $rootfordata.
"/contract";
448 $this->contrat->dir_temp = $rootfortemp.
"/contract/temp";
451 $this->bank->multidir_output = array($this->entity => $rootfordata.
"/bank");
452 $this->bank->multidir_temp = array($this->entity => $rootfortemp.
"/bank/temp");
454 $this->bank->dir_output = $rootfordata.
"/bank";
455 $this->bank->dir_temp = $rootfortemp.
"/bank/temp";
459 $this->global->MAIN_MAIL_USE_MULTI_PART = 1;
462 if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON =
"mod_codeclient_leopard";
463 if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON =
"mod_codecompta_panicum";
465 if (empty($this->global->CHEQUERECEIPTS_ADDON)) $this->global->CHEQUERECEIPTS_ADDON =
'mod_chequereceipt_mint';
466 if (empty($this->global->TICKET_ADDON)) $this->global->TICKET_ADDON =
'mod_ticket_simple';
469 if (empty($this->global->USER_PASSWORD_GENERATED)) $this->global->USER_PASSWORD_GENERATED =
'standard';
470 if (empty($this->global->MAIN_UMASK)) $this->global->MAIN_UMASK =
'0664';
473 $this->use_javascript_ajax = 1;
474 if (isset($this->global->MAIN_DISABLE_JAVASCRIPT)) $this->use_javascript_ajax = !$this->global->MAIN_DISABLE_JAVASCRIPT;
476 if (empty($this->use_javascript_ajax))
478 unset($this->global->PRODUIT_USE_SEARCH_TO_SELECT);
479 unset($this->global->COMPANY_USE_SEARCH_TO_SELECT);
480 unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
481 unset($this->global->PROJECT_USE_SEARCH_TO_SELECT);
484 if (!empty($this->productbatch->enabled))
486 $this->global->STOCK_CALCULATE_ON_BILL = 0;
487 $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER = 0;
488 $this->global->STOCK_CALCULATE_ON_SHIPMENT = 1;
489 $this->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE = 0;
490 $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL = 0;
491 $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER = 0;
492 if (empty($this->reception->enabled)) {
493 $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER = 1;
496 $this->global->STOCK_CALCULATE_ON_RECEPTION = 1;
497 $this->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE = 0;
502 if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE =
'EUR';
503 $this->currency = $this->global->MAIN_MONNAIE;
505 if (empty($this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY)) $this->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY = 30;
508 if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE =
'RECETTES-DEPENSES';
511 if (!isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
514 if (!isset($this->global->PROJECT_BILL_TIME_SPENT)) $this->global->PROJECT_BILL_TIME_SPENT = 1;
517 if (!isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE =
'noapp,thirdpartynameonly,contactnameonly,projectnameonly';
520 if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT = 25;
521 $this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
524 if (!isset($this->global->PRODUIT_LIMIT_SIZE)) $this->global->PRODUIT_LIMIT_SIZE = 1000;
525 $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
528 if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME =
"eldy";
529 if (!empty($this->global->MAIN_FORCETHEME)) $this->global->MAIN_THEME = $this->global->MAIN_FORCETHEME;
530 $this->theme = $this->global->MAIN_THEME;
531 $this->css =
"/theme/".$this->theme.
"/style.css.php";
534 $this->email_from =
"robot@example.com";
535 if (!empty($this->global->MAIN_MAIL_EMAIL_FROM)) $this->email_from = $this->global->MAIN_MAIL_EMAIL_FROM;
538 $this->notification->email_from = $this->email_from;
539 if (!empty($this->global->NOTIFICATION_EMAIL_FROM)) $this->notification->email_from = $this->global->NOTIFICATION_EMAIL_FROM;
542 $this->mailing->email_from = $this->email_from;
543 if (!empty($this->global->MAILING_EMAIL_FROM)) $this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
544 if (!isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) $this->global->MAIN_EMAIL_ADD_TRACK_ID = 1;
546 if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) $this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
549 $this->format_date_short =
"%d/%m/%Y";
550 $this->format_date_short_java =
"dd/MM/yyyy";
551 $this->format_hour_short =
"%H:%M";
552 $this->format_hour_short_duration =
"%H:%M";
553 $this->format_date_text_short =
"%d %b %Y";
554 $this->format_date_text =
"%d %B %Y";
555 $this->format_date_hour_short =
"%d/%m/%Y %H:%M";
556 $this->format_date_hour_sec_short =
"%d/%m/%Y %H:%M:%S";
557 $this->format_date_hour_text_short =
"%d %b %Y %H:%M";
558 $this->format_date_hour_text =
"%d %B %Y %H:%M";
561 if (!isset($this->global->MAIN_DURATION_OF_WORKDAY)) $this->global->MAIN_DURATION_OF_WORKDAY = 86400;
564 if (!isset($this->global->MAIN_MAX_DECIMALS_UNIT)) $this->global->MAIN_MAX_DECIMALS_UNIT = 5;
565 if (!isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT = 2;
566 if (!isset($this->global->MAIN_MAX_DECIMALS_SHOWN)) $this->global->MAIN_MAX_DECIMALS_SHOWN = 8;
569 if (!isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES = 1;
570 if (!isset($this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) $this->global->PDF_ALLOW_HTML_FOR_FREE_TEXT = 1;
573 $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : (int) $this->global->MAIN_UPLOAD_DOC * 1024);
576 if (!isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN =
'*';
579 if (!isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY = 0;
582 if (!isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE = 1;
585 if (!isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE = 1;
588 if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;
591 if (!isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL =
'user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog';
592 if (!empty($this->modules_parts[
'moduleforexternal']))
594 foreach ($this->modules_parts[
'moduleforexternal'] as $key=>$value) $this->global->MAIN_MODULES_FOR_EXTERNAL .=
",".$key;
598 if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT ==
'1') $this->global->MAIN_USE_JQUERY_MULTISELECT =
'select2';
601 if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT = 10;
602 if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) $this->global->MAIN_USE_RESPONSE_TIMEOUT = 30;
605 if (empty($this->global->TAX_MODE_SELL_PRODUCT)) $this->global->TAX_MODE_SELL_PRODUCT =
'invoice';
606 if (empty($this->global->TAX_MODE_BUY_PRODUCT)) $this->global->TAX_MODE_BUY_PRODUCT =
'invoice';
607 if (empty($this->global->TAX_MODE_SELL_SERVICE)) $this->global->TAX_MODE_SELL_SERVICE =
'payment';
608 if (empty($this->global->TAX_MODE_BUY_SERVICE)) $this->global->TAX_MODE_BUY_SERVICE =
'payment';
612 if (isset($this->agenda)) {
613 $this->adherent->subscription =
new stdClass();
614 $this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
616 if (isset($this->agenda)) {
617 $this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
619 if (isset($this->projet))
621 $this->projet->warning_delay = (isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE) ? $this->global->MAIN_DELAY_PROJECT_TO_CLOSE : 7) * 86400;
622 $this->projet->task =
new StdClass();
623 $this->projet->task->warning_delay = (isset($this->global->MAIN_DELAY_TASKS_TODO) ? $this->global->MAIN_DELAY_TASKS_TODO : 7) * 86400;
626 if (isset($this->commande)) {
627 $this->commande->client =
new stdClass();
628 $this->commande->fournisseur =
new stdClass();
629 $this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
630 $this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
632 if (isset($this->propal)) {
633 $this->propal->cloture =
new stdClass();
634 $this->propal->facturation =
new stdClass();
635 $this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
636 $this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
638 if (isset($this->facture)) {
639 $this->facture->client =
new stdClass();
640 $this->facture->fournisseur =
new stdClass();
641 $this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
642 $this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
644 if (isset($this->contrat)) {
645 $this->contrat->services =
new stdClass();
646 $this->contrat->services->inactifs =
new stdClass();
647 $this->contrat->services->expires =
new stdClass();
648 $this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
649 $this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
651 if (isset($this->commande)) {
652 $this->bank->rappro =
new stdClass();
653 $this->bank->cheque =
new stdClass();
654 $this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
655 $this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
657 if (isset($this->expensereport)) {
658 $this->expensereport->approve =
new stdClass();
659 $this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
660 $this->expensereport->payment =
new stdClass();
661 $this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
663 if (isset($this->holiday)) {
664 $this->holiday->approve =
new stdClass();
665 $this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
668 if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT))
670 $this->global->PRODUIT_MULTIPRICES_LIMIT = 5;
674 if (!empty($this->global->MAIN_HIDE_TOP_MENU)) $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU;
675 if (!empty($this->global->MAIN_HIDE_LEFT_MENU)) $this->dol_hide_leftmenu = $this->global->MAIN_HIDE_LEFT_MENU;
677 if (empty($this->global->MAIN_SIZE_SHORTLIST_LIMIT)) $this->global->MAIN_SIZE_SHORTLIST_LIMIT = 3;
679 if (!isset($this->global->THEME_HIDE_BORDER_ON_INPUT)) $this->global->THEME_HIDE_BORDER_ON_INPUT = 0;
682 if (empty($this->global->AGENDA_USE_EVENT_TYPE) && (!isset($this->global->AGENDA_DEFAULT_FILTER_TYPE) || $this->global->AGENDA_DEFAULT_FILTER_TYPE ==
'AC_NON_AUTO'))
684 $this->global->AGENDA_DEFAULT_FILTER_TYPE =
'0';
687 if (!isset($this->global->MAIN_JS_GRAPH)) $this->global->MAIN_JS_GRAPH =
'chart';
689 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_SRV)) $this->global->MAIN_MODULE_DOLISTORE_API_SRV =
'https://www.dolistore.com';
690 if (empty($this->global->MAIN_MODULE_DOLISTORE_API_KEY)) $this->global->MAIN_MODULE_DOLISTORE_API_KEY =
'dolistorecatalogpublickey1234567';
693 if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN) && $this->global->MAIN_FEATURES_LEVEL >= 2) $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1;
695 if (defined(
'MAIN_ANTIVIRUS_COMMAND')) $this->global->MAIN_ANTIVIRUS_COMMAND = constant(
'MAIN_ANTIVIRUS_COMMAND');
696 if (defined(
'MAIN_ANTIVIRUS_PARAM')) $this->global->MAIN_ANTIVIRUS_PARAM = constant(
'MAIN_ANTIVIRUS_PARAM');
698 if (!empty($this->global->MAIN_TZUSERINPUTKEY)) $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY;
701 if (isset($this->product)) $this->produit = $this->product;
702 if (isset($this->facture)) $this->invoice = $this->facture;
703 if (isset($this->commande)) $this->order = $this->commande;
704 if (isset($this->contrat)) $this->contract = $this->contrat;
705 if (isset($this->categorie)) $this->category = $this->categorie;
706 if (isset($this->project)) $this->project = $this->projet;
709 if (!defined(
'NOREQUIREMC') && !empty($this->multicompany->enabled))
711 if (is_object($mc)) $mc->setValues($this);
714 if (!empty($this->syslog->enabled)) {
716 if (!empty($this->global->SYSLOG_HANDLERS)) {
717 $handlers = json_decode($this->global->SYSLOG_HANDLERS);
721 foreach ($handlers as $handler) {
722 $handler_file_found =
'';
723 $dirsyslogs = array_merge(array(
'/core/modules/syslog/'), $this->modules_parts[
'syslog']);
724 foreach ($dirsyslogs as $reldir) {
727 if (is_dir($newdir)) {
728 $file = $newdir.$handler.
'.php';
729 if (file_exists(
$file)) {
730 $handler_file_found =
$file;
736 if (empty($handler_file_found)) {
737 throw new Exception(
'Missing log handler file '.$handler.
'.php');
740 require_once $handler_file_found;
741 $loghandlerinstance =
new $handler();
743 throw new Exception(
'Log handler does not extend LogHandlerInterface');
746 if (empty($this->loghandlers[$handler])) {
747 $this->loghandlers[$handler] = $loghandlerinstance;
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
Class to stock current configuration.
$entities
Used to store list of entities to use for each element.
$theme
Used to store current css (from theme)
$global
To store properties found into database.
$multicompany
To store properties of multi-company.
$currency
Used to store current currency (ISO code like 'USD', 'EUR', ...)
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
$conf db
API class for accounts.
$disable_compute
To store if javascript/ajax is enabked.
$file
To store properties found in conf file.
$use_javascript_ajax
To store if javascript/ajax is enabked.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
$browser
To store browser info.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
print $_SERVER["PHP_SELF"]
Edit parameters.
setValues($db)
Load setup values into conf object (read llx_const) Note that this->db->xxx, this->file->xxx and this...
__construct()
Constructor.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
$entity
Used to store running instance for multi-company (default 1)
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
$standard_menu
Used to store current menu handler.