33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
52$langs->loadLangs(array(
'admin',
'languages',
'other',
'companies',
'products',
'members',
'projects',
'hrm',
'agenda'));
58$action =
GETPOST(
'action',
'aZ09');
59$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'adminihm';
61$mode =
GETPOST(
'mode',
'aZ09') ?
GETPOST(
'mode',
'aZ09') :
'other';
63if (!defined(
"MAIN_MOTD")) {
64 define(
"MAIN_MOTD",
"");
72$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
77if (
GETPOST(
'cancel',
'alpha')) {
83if (preg_match(
'/^(set|del)_([A-Z_]+)$/', $action, $regs)) {
84 if ($regs[1] ==
'set') {
91if ($action ==
'removebackgroundlogin' &&
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND')) {
93 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
111if ($action ==
'update') {
114 if ($mode ==
'template') {
120 if (GETPOSTISSET(
'THEME_ELDY_USECOMOACTROW')) {
124 if (GETPOSTISSET(
'THEME_DARKMODEENABLED')) {
125 $val =
GETPOST(
'THEME_DARKMODEENABLED');
134 if (GETPOSTISSET(
'THEME_TOPMENU_DISABLE_IMAGE')) {
135 $val =
GETPOST(
'THEME_TOPMENU_DISABLE_IMAGE');
143 if (GETPOSTISSET(
'THEME_ELDY_BORDER_RADIUS')) {
144 $val =
GETPOST(
'THEME_ELDY_BORDER_RADIUS');
259 if ($mode ==
'dashboard') {
263 if ($mode ==
'other') {
270 if (GETPOSTISSET(
"MAIN_CHECKBOX_LEFT_COLUMN")) {
287 if ($mode ==
'login') {
291 $varforimage =
'imagebackground';
292 $dirforimage =
$conf->mycompany->dir_output .
'/logos/';
293 if ($_FILES[$varforimage][
"tmp_name"]) {
295 if (preg_match(
'/([^\\/:]+)$/i', $_FILES[$varforimage][
"name"], $reg)) {
296 $original_file = $reg[1];
300 dol_syslog(
"Move file " . $_FILES[$varforimage][
"tmp_name"] .
" to " . $dirforimage . $original_file);
301 if (!is_dir($dirforimage)) {
304 $result =
dol_move_uploaded_file($_FILES[$varforimage][
"tmp_name"], $dirforimage . $original_file, 1, 0, $_FILES[$varforimage][
'error']);
307 } elseif (preg_match(
'/^ErrorFileIsInfectedWithAVirus/', $result)) {
309 $langs->load(
"errors");
310 $tmparray = explode(
':', $result);
311 setEventMessages($langs->trans(
'ErrorFileIsInfectedWithAVirus', $tmparray[1]),
null,
'errors');
318 $langs->load(
"errors");
325 if ($mode ==
'css') {
328 $csscontent =
GETPOST(
'MAIN_IHM_CUSTOM_CSS',
'restricthtml');
336 $_SESSION[
"mainmenu"] =
"";
338 if (
GETPOST(
'dol_resetcache')) {
342 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mainmenu=home&leftmenu=setup&mode=".$mode.(GETPOSTISSET(
'page_y') ?
'&page_y='.GETPOSTINT(
'page_y') :
''));
351$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
355 $langs->trans(
"Setup"),
361 '/includes/ace/src/ace.js',
362 '/includes/ace/src/ext-statusbar.js',
363 '/includes/ace/src/ext-language_tools.js',
370$form =
new Form($db);
376print
'<span class="opacitymedium">'.$langs->trans(
"DisplayDesc").
"</span><br>\n";
380require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
382print
'<form enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
383print
'<input type="hidden" name="token" value="'.newToken().
'">';
384print
'<input type="hidden" name="action" value="update">';
385print
'<input type="hidden" name="page_y" value="">';
386print
'<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).
'">';
387print
'<input type="hidden" name="dol_resetcache" value="1">';
397if ($mode ==
'other') {
398 print
'<div class="div-table-responsive-no-min">';
399 print
'<table summary="edit" class="noborder centpercent editmode tableforfield">';
401 print
'<tr class="liste_titre"><td class="titlefieldmiddle">';
402 print $langs->trans(
"Language");
407 print
'<tr class="oddeven"><td>'.$langs->trans(
"DefaultLanguage").
'</td><td>';
408 print
img_picto(
'',
'language',
'class="pictofixedwidth"');
409 print $formadmin->select_language(
getDolGlobalString(
'MAIN_LANG_DEFAULT'),
'MAIN_LANG_DEFAULT', 1, array(),
'', 0, 0,
'minwidth300', 2);
415 print
'<tr class="oddeven"><td>' . $langs->trans(
"EnableMultilangInterface") .
'</td><td>';
416 print ajax_constantonoff(
"MAIN_MULTILANGS", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'language');
420 print
'</table>' .
"\n";
423 print
'<div class="center">';
424 print
'<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans(
"Save") .
'">';
425 print
'<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans(
"Cancel") .
'">';
432 print
'<div class="div-table-responsive-no-min">';
433 print
'<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
435 print
'<tr class="liste_titre"><td class="titlefieldmiddle">';
436 print $langs->trans(
"Miscellaneous");
441 if (!empty(
$conf->use_javascript_ajax)) {
443 print
'<tr class="oddeven"><td>' . $langs->trans(
"ShowQuickAddLink") .
'</td><td>';
444 print ajax_constantonoff(
"MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
450 $pictohelp =
'<span class="fa fa-question-circle"></span>';
451 print
'<tr class="oddeven"><td>' . str_replace(
'{picto}', $pictohelp, $langs->trans(
"DisableLinkToHelp",
'{picto}')) .
'</td><td>';
452 print ajax_constantonoff(
"MAIN_HELP_DISABLELINK", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
458 print
'<tr class="oddeven"><td>' . $langs->trans(
"DefaultMaxSizeList") .
'</td><td><input class="flat width50" name="MAIN_SIZE_LISTE_LIMIT" value="';
464 print
' <span class="opacitymedium">('.$langs->trans(
"Automatic").
')</span>';
470 print
'<tr class="oddeven"><td>' . $langs->trans(
"DefaultMaxSizeShortList") .
'</td><td><input class="flat width50" name="MAIN_SIZE_SHORTLIST_LIMIT" value="' .
getDolGlobalString(
'MAIN_SIZE_SHORTLIST_LIMIT') .
'"></td>';
474 print
'<tr class="oddeven"><td>' . $langs->trans(
"MAIN_CHECKBOX_LEFT_COLUMN") .
'</td><td>';
475 print ajax_constantonoff(
"MAIN_CHECKBOX_LEFT_COLUMN", array(),
$conf->entity, 0, 0, 1, 0, 0, 1,
'',
'other');
480 print
'<tr class="oddeven"><td>' . $langs->trans(
"WeekStartOnDay") .
'</td><td>';
481 print $formother->select_dayofweek(
getDolGlobalString(
'MAIN_START_WEEK',
'1'),
'MAIN_START_WEEK', 0);
486 print
'<tr class="oddeven"><td>' . $langs->trans(
"DefaultWorkingDays") .
'</td><td>';
487 print
'<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="' .
getDolGlobalString(
'MAIN_DEFAULT_WORKING_DAYS',
'1-5') .
'">';
492 print
'<tr class="oddeven"><td>' . $langs->trans(
"DefaultWorkingHours") .
'</td><td>';
493 print
'<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="' .
getDolGlobalString(
'MAIN_DEFAULT_WORKING_HOURS',
'9-18') .
'">';
498 print
'<tr class="oddeven"><td>' . $langs->trans(
"FirstnameNamePosition") .
'</td><td>';
499 $array = array(0 => $langs->trans(
"Firstname") .
' ' . $langs->trans(
"Lastname"), 1 => $langs->trans(
"Lastname") .
' ' . $langs->trans(
"Firstname"));
500 print $form->selectarray(
'MAIN_FIRSTNAME_NAME_POSITION', $array,
getDolGlobalInt(
'MAIN_FIRSTNAME_NAME_POSITION', 0));
505 print
'<tr class="oddeven"><td>' . $langs->trans(
"HideUnauthorizedMenu") .
'</td><td>';
507 print ajax_constantonoff(
"MAIN_MENU_HIDE_UNAUTHORIZED", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
512 print
'<tr class="oddeven"><td>' . $langs->trans(
"ButtonHideUnauthorized") .
'</td><td>';
514 print ajax_constantonoff(
"MAIN_BUTTON_HIDE_UNAUTHORIZED", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
529 print
'<tr class="oddeven"><td>' . $langs->trans(
"ShowSearchAreaInTopMenu") .
'</td><td>';
530 print ajax_constantonoff(
"MAIN_USE_TOP_MENU_SEARCH_DROPDOWN", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
535 print
'<tr class="oddeven"><td>';
536 print $form->textwithpicto($langs->trans(
"ShowBugTrackLink", $langs->transnoentitiesnoconv(
"FindBug")), $langs->trans(
"ShowBugTrackLinkDesc"));
538 print
'<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="' .
getDolGlobalString(
'MAIN_BUGTRACK_ENABLELINK') .
'">';
543 print
'<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans(
"DisableJavascript"), $langs->trans(
"DisableJavascriptNote")) .
'</td><td>';
544 print ajax_constantonoff(
"MAIN_DISABLE_JAVASCRIPT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'other');
548 print
'</table>' .
"\n";
553if ($mode ==
'template') {
559if ($mode ==
'dashboard') {
560 print
'<div class="div-table-responsive-no-min">';
561 print
'<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
567 print
'<tr class="oddeven width25p"><td>';
568 $texthelp = $langs->trans(
"FollowingConstantsWillBeSubstituted") .
'<br>';
569 foreach ($substitutionarray as $key => $val) {
570 $texthelp .= $key .
'<br>';
572 print $form->textwithpicto($langs->trans(
"MessageOfDay"), $texthelp, 1,
'help',
'', 0, 2,
'tooltipmessageofday');
576 $doleditor =
new DolEditor(
'main_motd',
getDolGlobalString(
'MAIN_MOTD'),
'', 142,
'dolibarr_notes',
'In',
false,
true,
true, ROWS_4,
'90%');
577 $doleditor->Create();
579 print
'</td></tr>'.
"\n";
586 print
'<div class="div-table-responsive-no-min">';
587 print
'<table summary="blockdashboard" class="noborder centpercent editmode tableforfield">';
589 print
'<tr class="liste_titre"><td class="titlefieldmiddle">';
590 print $langs->trans(
"DashboardDisableBlocks");
591 print
'</td><td class="titlefieldmiddle">';
594 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableGlobal') .
'</td><td>';
595 print ajax_constantonoff(
"MAIN_DISABLE_GLOBAL_WORKBOARD", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
601 print
'<tr class="oddeven"><td>' . $langs->trans(
'MAIN_DISABLE_METEO') .
'</td><td>';
602 print ajax_constantonoff(
"MAIN_DISABLE_METEO", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
607 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockAgenda') .
'</td><td>';
608 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_AGENDA", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
613 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockProject') .
'</td><td>';
614 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_PROJECT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
619 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockCustomer') .
'</td><td>';
620 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_CUSTOMER", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
625 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockSupplier') .
'</td><td>';
626 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_SUPPLIER", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
631 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockContract') .
'</td><td>';
632 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_CONTRACT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
637 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockTicket') .
'</td><td>';
638 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_TICKET", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
643 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockBank') .
'</td><td>';
644 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_BANK", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
649 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockAdherent') .
'</td><td>';
650 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_ADHERENT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
655 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockExpenseReport') .
'</td><td>';
656 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
661 print
'<tr class="oddeven"><td>' . $langs->trans(
'DashboardDisableBlockHoliday') .
'</td><td>';
662 print ajax_constantonoff(
"MAIN_DISABLE_BLOCK_HOLIDAY", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'_red',
'dashboard');
667 print
'</table>' .
"\n";
672if ($mode ==
'login') {
674 print
'<div class="div-table-responsive-no-min">';
675 print
'<table summary="edit" class="noborder centpercent editmode tableforfield">';
677 print
'<tr class="liste_titre"><td class="titlefieldmax45">';
678 print $langs->trans(
"Parameter");
680 print $langs->trans(
"Value");
694 print
'<tr class="oddeven"><td>';
695 $texthelp = $langs->trans(
"FollowingConstantsWillBeSubstituted") .
'<br>';
696 foreach ($substitutionarray as $key => $val) {
697 $texthelp .= $key .
'<br>';
699 print $form->textwithpicto($langs->trans(
"MessageLogin"), $texthelp, 1,
'help',
'', 0, 2,
'tooltipmessagelogin');
701 $doleditor =
new DolEditor(
'main_home', (isset(
$conf->global->MAIN_HOME) ?
$conf->global->MAIN_HOME :
''),
'', 142,
'dolibarr_notes',
'In', false, true, true, ROWS_4,
'90%');
702 $doleditor->Create();
703 print
'</td></tr>' .
"\n";
706 print
'<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans(
"BackgroundImageLogin") .
' (png,jpg)</label></td><td>';
707 print
'<div class="centpercent inline-block">';
710 $disabled =
' disabled="disabled"';
713 $maxmin = $maxfilesizearray[
'maxmin'];
715 print
'<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).
'">';
717 print
'<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"' . $disabled .
'>';
719 print
'(' . $langs->trans(
"DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND") .
') ';
722 print
'<a class="reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?action=removebackgroundlogin&token='.newToken().
'&mode=login">' .
img_delete($langs->trans(
"Delete")) .
'</a>';
725 print
'<img class="marginleftonly boxshadow valignmiddle" width="100" src="' . DOL_URL_ROOT .
'/viewimage.php?modulepart=mycompany&file=' . urlencode(
'logos/' .
getDolGlobalString(
'MAIN_LOGIN_BACKGROUND')) .
'">';
728 print
'<img class="marginleftonly valignmiddle" width="100" src="' . DOL_URL_ROOT .
'/public/theme/common/nophoto.png">';
733 print
'</table>' .
"\n";
738 print
'<div class="div-table-responsive-no-min">';
739 print
'<table summary="edit" class="noborder centpercent editmode tableforfield">';
741 print
'<tr class="liste_titre">';
742 print
'<td colspan="2">';
747 $doleditor =
new DolEditor(
'MAIN_IHM_CUSTOM_CSS', $customcssValue,
'80%', 400,
'Basic',
'In',
true,
false,
'ace', 10,
'90%');
748 $doleditor->Create(0,
'',
true,
'css',
'css');
749 print
'</td></tr>'.
"\n";
751 print
'</table>'.
"\n";
756print
'<div class="center">';
757print
'<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="' . $langs->trans(
"Save") .
'">';
758print
'<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans(
"Cancel") .
'">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
ihm_prepare_head()
Prepare array with list of tabs.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null, $include=null)
Return array of possible common substitutions.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
getMaxFileSizeArray()
Return the max allowed for file upload.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
showSkins($fuser, $edit=0, $foruserprofile=false)
Show list of themes.