27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
37 $langs->loadLangs(array(
'admin',
'languages',
'other',
'companies',
'products',
'members',
'projects',
'hrm',
'agenda'));
41 $action =
GETPOST(
'action',
'aZ09');
42 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'adminihm';
44 if (!defined(
"MAIN_MOTD")) define(
"MAIN_MOTD",
"");
52 $parameters = array();
53 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
54 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
63 if (preg_match(
'/^(set|del)_([A-Z_]+)$/', $action, $regs)) {
64 if ($regs[1] ==
'set')
dolibarr_set_const($db, $regs[2], 1,
'chaine', 0,
'', $conf->entity);
68 if ($action ==
'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKGROUND))
70 dolibarr_set_const($db,
"MAIN_IHM_PARAMS_REV", (
int) $conf->global->MAIN_IHM_PARAMS_REV + 1,
'chaine', 0,
'', $conf->entity);
71 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
73 $logofile = $conf->mycompany->dir_output.
'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
89 if ($action ==
'update')
92 dolibarr_set_const($db,
"MAIN_IHM_PARAMS_REV", (
int) $conf->global->MAIN_IHM_PARAMS_REV + 1,
'chaine', 0,
'', $conf->entity);
103 else dolibarr_set_const($db,
'THEME_ELDY_BACKBODY', $val,
'chaine', 0,
'', $conf->entity);
107 else dolibarr_set_const($db,
'THEME_ELDY_TOPMENU_BACK1', $val,
'chaine', 0,
'', $conf->entity);
111 else dolibarr_set_const($db,
'THEME_ELDY_VERMENU_BACK1', $val,
'chaine', 0,
'', $conf->entity);
115 else dolibarr_set_const($db,
'THEME_ELDY_TEXTTITLENOTAB', $val,
'chaine', 0,
'', $conf->entity);
119 else dolibarr_set_const($db,
'THEME_ELDY_BACKTITLE1', $val,
'chaine', 0,
'', $conf->entity);
123 else dolibarr_set_const($db,
'THEME_ELDY_TEXTTITLE', $val,
'chaine', 0,
'', $conf->entity);
127 else dolibarr_set_const($db,
'THEME_ELDY_TEXTTITLELINK', $val,
'chaine', 0,
'', $conf->entity);
131 else dolibarr_set_const($db,
'THEME_ELDY_LINEIMPAIR1', $val,
'chaine', 0,
'', $conf->entity);
134 else dolibarr_set_const($db,
'THEME_ELDY_LINEIMPAIR2', $val,
'chaine', 0,
'', $conf->entity);
138 else dolibarr_set_const($db,
'THEME_ELDY_LINEPAIR1', $val,
'chaine', 0,
'', $conf->entity);
141 else dolibarr_set_const($db,
'THEME_ELDY_LINEPAIR2', $val,
'chaine', 0,
'', $conf->entity);
145 else dolibarr_set_const($db,
'THEME_ELDY_TEXTLINK', $val,
'chaine', 0,
'', $conf->entity);
149 else dolibarr_set_const($db,
"THEME_ELDY_USE_HOVER", $val,
'chaine', 0,
'', $conf->entity);
153 else dolibarr_set_const($db,
"THEME_ELDY_USE_CHECKED", $val,
'chaine', 0,
'', $conf->entity);
155 dolibarr_set_const($db,
"MAIN_SIZE_LISTE_LIMIT",
GETPOST(
"main_size_liste_limit",
'int'),
'chaine', 0,
'', $conf->entity);
156 dolibarr_set_const($db,
"MAIN_SIZE_SHORTLIST_LIMIT",
GETPOST(
"main_size_shortliste_limit",
'int'),
'chaine', 0,
'', $conf->entity);
163 dolibarr_set_const($db,
"MAIN_DEFAULT_WORKING_DAYS",
GETPOST(
"MAIN_DEFAULT_WORKING_DAYS",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
164 dolibarr_set_const($db,
"MAIN_DEFAULT_WORKING_HOURS",
GETPOST(
"MAIN_DEFAULT_WORKING_HOURS",
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
166 dolibarr_set_const($db,
"MAIN_FIRSTNAME_NAME_POSITION",
GETPOST(
"MAIN_FIRSTNAME_NAME_POSITION",
'aZ09'),
'chaine', 0,
'', $conf->entity);
173 $varforimage =
'imagebackground'; $dirforimage = $conf->mycompany->dir_output.
'/logos/';
174 if ($_FILES[$varforimage][
"tmp_name"])
177 if (preg_match(
'/([^\\/:]+)$/i', $_FILES[$varforimage][
"name"], $reg))
179 $original_file = $reg[1];
184 dol_syslog(
"Move file ".$_FILES[$varforimage][
"tmp_name"].
" to ".$dirforimage.$original_file);
185 if (!is_dir($dirforimage))
189 $result =
dol_move_uploaded_file($_FILES[$varforimage][
"tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage][
'error']);
192 dolibarr_set_const($db,
"MAIN_LOGIN_BACKGROUND", $original_file,
'chaine', 0,
'', $conf->entity);
193 } elseif (preg_match(
'/^ErrorFileIsInfectedWithAVirus/', $result))
196 $langs->load(
"errors");
197 $tmparray = explode(
':', $result);
198 setEventMessages($langs->trans(
'ErrorFileIsInfectedWithAVirus', $tmparray[1]), null,
'errors');
205 $langs->load(
"errors");
213 $_SESSION[
"mainmenu"] =
"";
215 header(
"Location: ".
$_SERVER[
"PHP_SELF"].
"?mainmenu=home&leftmenu=setup");
224 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
227 $form =
new Form($db);
233 print '<span class="opacitymedium">'.$langs->trans(
"DisplayDesc").
"</span><br>\n";
236 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
238 print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
239 print '<input type="hidden" name="token" value="'.newToken().
'">';
240 print '<input type="hidden" name="action" value="update">';
245 print '<div class="div-table-responsive-no-min">';
246 print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
247 print '<tr class="liste_titre"><th>'.img_picto(
'',
'language').
' '.$langs->trans(
"Language").
'</th><th></th>';
251 print '<tr class="oddeven"><td>'.$langs->trans(
"DefaultLanguage").
'</td><td>';
252 print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,
'MAIN_LANG_DEFAULT', 1, null,
'', 0, 0,
'minwidth300', 2);
253 print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans(
"Save").
'">';
258 print '<tr class="oddeven"><td>'.$langs->trans(
"EnableMultilangInterface").
'</td><td>';
263 print '</table><br>'.
"\n";
271 print '<div class="div-table-responsive-no-min">';
272 print '<table summary="otherparameters" class="noborder centpercent editmode">';
273 print '<tr class="liste_titre"><th>'.$langs->trans(
"Miscellaneous").
'</th><th></th>';
274 print '<th width="20"> </tg>';
278 print '<tr class="oddeven"><td>'.$langs->trans(
"DisableJavascript").
'</td><td>';
280 print ' <span class="opacitymedium"> '.$langs->trans(
"DisableJavascriptNote").
'</span>';
287 print '<tr class="oddeven"><td>'.$langs->trans(
"DefaultMaxSizeList").
'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="'.$conf->global->MAIN_SIZE_LISTE_LIMIT.
'"></td>';
288 print '<td width="20"> </td>';
292 print '<tr class="oddeven"><td>'.$langs->trans(
"DefaultMaxSizeShortList").
'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="'.$conf->global->MAIN_SIZE_SHORTLIST_LIMIT.
'"></td>';
293 print '<td width="20"> </td>';
306 print '<tr class="oddeven"><td>'.$langs->trans(
"WeekStartOnDay").
'</td><td>';
307 print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK :
'1'),
'MAIN_START_WEEK', 0);
309 print '<td width="20"> </td>';
313 print '<tr class="oddeven"><td>'.$langs->trans(
"DefaultWorkingDays").
'</td><td>';
314 print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS :
'1-5').
'">';
316 print
'<td width="20"> </td>';
320 print
'<tr class="oddeven"><td>'.$langs->trans(
"DefaultWorkingHours").
'</td><td>';
321 print
'<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS :
'9-18').
'">';
323 print
'<td width="20"> </td>';
327 print
'<tr class="oddeven"><td>'.$langs->trans(
"FirstnameNamePosition").
'</td><td>';
328 $array = array(0=>$langs->trans(
"Firstname").
' '.$langs->trans(
"Lastname"), 1=>$langs->trans(
"Lastname").
' '.$langs->trans(
"Firstname"));
329 print $form->selectarray(
'MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
331 print
'<td width="20"> </td>';
335 print
'<tr class="oddeven"><td>'.$langs->trans(
"HideUnauthorizedMenu").
'</td><td>';
337 print
ajax_constantonoff(
"MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
339 print
'<td width="20"> </td>';
343 print
'<tr class="oddeven"><td>'.$langs->trans(
"ButtonHideUnauthorized").
'</td><td>';
345 print
ajax_constantonoff(
"MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
347 print
'<td width="20"> </td>';
361 print
'<tr class="oddeven"><td>'.$langs->trans(
"ShowBugTrackLink", $langs->transnoentitiesnoconv(
"FindBug")).
'</td><td>';
362 print
ajax_constantonoff(
"MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
365 print
'<td width="20"> </td>';
369 $pictohelp =
'<span class="fa fa-question-circle"></span>';
370 print
'<tr class="oddeven"><td>'.str_replace(
'{picto}', $pictohelp, $langs->trans(
"DisableLinkToHelp",
'{picto}')).
'</td><td>';
371 print
ajax_constantonoff(
"MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
374 print
'<td width="20"> </td>';
381 print
'<tr class="oddeven"><td>';
382 $texthelp = $langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
383 foreach ($substitutionarray as $key => $val)
385 $texthelp .= $key.
'<br>';
387 print $form->textwithpicto($langs->trans(
"MessageOfDay"), $texthelp, 1,
'help',
'', 0, 2,
'tooltipmessageofday');
389 print
'</td><td colspan="2">';
391 $doleditor =
new DolEditor(
'main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD :
''),
'', 142,
'dolibarr_notes',
'In',
false,
true,
true, ROWS_4,
'90%');
392 $doleditor->Create();
394 print
'</td></tr>'.
"\n";
396 print
'</table>'.
"\n";
402 print
'<div class="div-table-responsive-no-min">';
403 print
'<table summary="edit" class="noborder centpercent editmode">';
404 print
'<tr class="liste_titre"><th>'.$langs->trans(
"LoginPage").
'</th><th></th>';
405 print
'<th width="20"> </th>';
409 print
'<tr class="oddeven"><td>'.$langs->trans(
"DisableLinkToHelpCenter").
'</td><td>';
410 print
ajax_constantonoff(
"MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
412 print
'<td width="20"> </td>';
418 print
'<tr class="oddeven"><td>';
419 $texthelp = $langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
420 foreach ($substitutionarray as $key => $val)
422 $texthelp .= $key.
'<br>';
424 print $form->textwithpicto($langs->trans(
"MessageLogin"), $texthelp, 1,
'help',
'', 0, 2,
'tooltipmessagelogin');
425 print
'</td><td colspan="2">';
426 $doleditor =
new DolEditor(
'main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME :
''),
'', 142,
'dolibarr_notes',
'In',
false,
true,
true, ROWS_4,
'90%');
427 $doleditor->Create();
428 print
'</td></tr>'.
"\n";
431 print
'<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans(
"BackgroundImageLogin").
' (png,jpg)</label></td><td colspan="2">';
432 print
'<div class="centpercent inline-block">';
434 if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) $disabled =
' disabled="disabled"';
435 print
'<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground"'.$disabled.
'>';
438 print
'('.$langs->trans(
"DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").
') ';
440 if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
441 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removebackgroundlogin">'.
img_delete($langs->trans(
"Delete")).
'</a>';
442 if (file_exists($conf->mycompany->dir_output.
'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
444 print
'<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&file='.urlencode(
'logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).
'">';
447 print
'<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.
'/public/theme/common/nophoto.png">';
452 print
'</table>'.
"\n";
456 print
'<div class="center">';
457 print
'<input class="button button-save" type="submit" name="submit" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255).
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
showSkins($fuser, $edit=0, $foruserprofile=false)
Show list of themes.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles= 'addedfile', $upload_dir= '')
Make control on an uploaded file from an GUI page and move it to final destination.
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
Class to manage a WYSIWYG editor.
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
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...