NEW Ihm admin - Add tabs
This commit is contained in:
parent
4b89a45ade
commit
a7cb9b2143
@ -43,6 +43,13 @@ if (!$user->admin) {
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
|
||||||
|
|
||||||
|
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'language'; // 'language', 'template', 'login', 'other'
|
||||||
|
|
||||||
|
$defaultlanguage = GETPOST('defaultlanguage', 'alphanohtml');
|
||||||
|
$defaulttemplate = GETPOST('defaulttemplate', 'alphanohtml');
|
||||||
|
$defaultlogin = GETPOST('defaultlogin', 'alphanohtml');
|
||||||
|
$defaultother = GETPOST('defaultother', 'alphanohtml');
|
||||||
|
|
||||||
if (!defined("MAIN_MOTD")) {
|
if (!defined("MAIN_MOTD")) {
|
||||||
define("MAIN_MOTD", "");
|
define("MAIN_MOTD", "");
|
||||||
}
|
}
|
||||||
@ -267,6 +274,8 @@ if ($action == 'update') {
|
|||||||
$wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
$wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
|
||||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||||
|
|
||||||
|
$param = '&mode='.$mode;
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
@ -274,250 +283,246 @@ $formadmin = new FormAdmin($db);
|
|||||||
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
|
||||||
|
print "<br>\n";
|
||||||
|
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
}
|
||||||
|
if ($defaultlanguage) {
|
||||||
|
$param .= '&defaultlanguage='.urlencode($defaultlanguage);
|
||||||
|
}
|
||||||
|
if ($defaulttemplate) {
|
||||||
|
$param .= '&defaulttemplate='.urlencode($defaulttemplate);
|
||||||
|
}
|
||||||
|
if ($defaultlogin) {
|
||||||
|
$param .= '&defaultlogin='.urlencode($defaultlogin);
|
||||||
|
}
|
||||||
|
if ($defaultother) {
|
||||||
|
$param .= '&defaultother='.urlencode($defaultother);
|
||||||
|
}
|
||||||
|
|
||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'?mode='.$mode.'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="page_y" value="">';
|
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
print '<br>';
|
$head = ihm_prepare_head();
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
|
||||||
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Default language
|
print dol_get_fiche_head($head, $mode, '', -1, '');
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
|
||||||
print img_picto('', 'language', 'class="pictofixedwidth"');
|
|
||||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
|
||||||
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Multilingual GUI
|
if ($mode == 'language') {
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
print '</table>'."\n";
|
// Default language
|
||||||
print '</div>';
|
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||||
|
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||||
|
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
||||||
|
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<br>';
|
// Multilingual GUI
|
||||||
print '<div class="center">';
|
print '<tr class="oddeven"><td>' . $langs->trans("EnableMultilangInterface") . '</td><td>';
|
||||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
print '</div>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '<br><br>';
|
print '</table>' . "\n";
|
||||||
|
print '</div>';
|
||||||
// Themes and themes options
|
|
||||||
showSkins(null, 1);
|
|
||||||
print '<br>';
|
|
||||||
print '<div class="center">';
|
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
// Other
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
|
|
||||||
print '<tr class="liste_titre"><th class="titlefieldmiddle">'.$langs->trans("Miscellaneous").'</th>';
|
|
||||||
print '<th></th>';
|
|
||||||
print '<th width="20"> </tg>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Disable javascript and ajax
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
|
|
||||||
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
|
|
||||||
print ' <span class="opacitymedium"> '.$langs->trans("DisableJavascriptNote").'</span>';
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Max size of lists
|
|
||||||
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>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Max size of short lists on customer card
|
|
||||||
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>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// show input border
|
|
||||||
/*
|
|
||||||
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
|
|
||||||
print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// First day for weeks
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
|
|
||||||
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// DefaultWorkingDays
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
|
|
||||||
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').'">';
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// DefaultWorkingHours
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
|
|
||||||
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').'">';
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Firstname/Name
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
|
|
||||||
$array = array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
|
|
||||||
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide unauthorized menus
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
|
|
||||||
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
|
|
||||||
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide unauthorized button
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
|
||||||
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
|
|
||||||
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide version link
|
|
||||||
/*
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
|
|
||||||
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Show bugtrack link
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
|
|
||||||
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="'.(empty($conf->global->MAIN_BUGTRACK_ENABLELINK) ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK).'">';
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide wiki link on login page
|
|
||||||
$pictohelp = '<span class="fa fa-question-circle"></span>';
|
|
||||||
print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
|
|
||||||
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
|
||||||
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Message of the day on home page
|
|
||||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
|
|
||||||
complete_substitutions_array($substitutionarray, $langs);
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
||||||
foreach ($substitutionarray as $key => $val) {
|
|
||||||
$texthelp .= $key.'<br>';
|
|
||||||
}
|
}
|
||||||
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
|
|
||||||
|
|
||||||
print '</td><td colspan="2">';
|
if ($mode == 'template') {
|
||||||
|
// Themes and themes options
|
||||||
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
showSkins(null, 1);
|
||||||
$doleditor->Create();
|
|
||||||
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
print '</table>'."\n";
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<div class="center">';
|
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
// Other
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
|
||||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
|
||||||
print '<tr class="liste_titre"><th class="titlefieldmiddle">'.$langs->trans("LoginPage").'</th>';
|
|
||||||
print '<th></th>';
|
|
||||||
print '<th width="20"> </th>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Hide helpcenter link on login page
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
|
|
||||||
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
|
|
||||||
print '</td>';
|
|
||||||
print '<td width="20"> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Message on login page
|
|
||||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
|
|
||||||
complete_substitutions_array($substitutionarray, $langs);
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
|
||||||
foreach ($substitutionarray as $key => $val) {
|
|
||||||
$texthelp .= $key.'<br>';
|
|
||||||
}
|
}
|
||||||
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
|
|
||||||
print '</td><td colspan="2">';
|
|
||||||
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
|
||||||
$doleditor->Create();
|
|
||||||
print '</td></tr>'."\n";
|
|
||||||
|
|
||||||
// Background
|
if ($mode == 'other') {
|
||||||
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
|
// Other
|
||||||
print '<div class="centpercent inline-block">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
$disabled = '';
|
print '<table summary="otherparameters" class="noborder centpercent editmode tableforfield">';
|
||||||
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
|
||||||
$disabled = ' disabled="disabled"';
|
// Disable javascript and ajax
|
||||||
}
|
print '<tr class="oddeven"><td>' . $langs->trans("DisableJavascript") . '</td><td>';
|
||||||
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"'.$disabled.'>';
|
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
if ($disabled) {
|
print ' <span class="opacitymedium"> ' . $langs->trans("DisableJavascriptNote") . '</span>';
|
||||||
print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
|
print '</td>';
|
||||||
}
|
print '<td>';
|
||||||
if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
|
print '</td>';
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
|
print '</tr>';
|
||||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
|
|
||||||
print ' ';
|
// Max size of lists
|
||||||
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
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>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Max size of short lists on customer card
|
||||||
|
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>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// show input border
|
||||||
|
/*
|
||||||
|
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
|
||||||
|
print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
// First day for weeks
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("WeekStartOnDay") . '</td><td>';
|
||||||
|
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// DefaultWorkingDays
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingDays") . '</td><td>';
|
||||||
|
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') . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// DefaultWorkingHours
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("DefaultWorkingHours") . '</td><td>';
|
||||||
|
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') . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Firstname/Name
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("FirstnameNamePosition") . '</td><td>';
|
||||||
|
$array = array(0 => $langs->trans("Firstname") . ' ' . $langs->trans("Lastname"), 1 => $langs->trans("Lastname") . ' ' . $langs->trans("Firstname"));
|
||||||
|
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide unauthorized menus
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("HideUnauthorizedMenu") . '</td><td>';
|
||||||
|
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
|
||||||
|
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide unauthorized button
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("ButtonHideUnauthorized") . '</td><td>';
|
||||||
|
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
|
||||||
|
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide version link
|
||||||
|
/*
|
||||||
|
|
||||||
|
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
|
||||||
|
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Show bugtrack link
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . '</td><td>';
|
||||||
|
print '<input type="text" name="MAIN_BUGTRACK_ENABLELINK" value="' . (empty($conf->global->MAIN_BUGTRACK_ENABLELINK) ? '' : $conf->global->MAIN_BUGTRACK_ENABLELINK) . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Hide wiki link on login page
|
||||||
|
$pictohelp = '<span class="fa fa-question-circle"></span>';
|
||||||
|
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
|
||||||
|
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
|
||||||
|
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Message of the day on home page
|
||||||
|
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
|
||||||
|
complete_substitutions_array($substitutionarray, $langs);
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
|
||||||
|
foreach ($substitutionarray as $key => $val) {
|
||||||
|
$texthelp .= $key . '<br>';
|
||||||
}
|
}
|
||||||
} else {
|
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
|
||||||
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
|
||||||
}
|
|
||||||
print '</div>';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</td><td colspan="2">';
|
||||||
print '</div>';
|
|
||||||
|
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||||
|
$doleditor->Create();
|
||||||
|
|
||||||
|
print '</td></tr>' . "\n";
|
||||||
|
|
||||||
|
print '</table>' . "\n";
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mode == 'login') {
|
||||||
|
// Other
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
|
|
||||||
|
// Hide helpcenter link on login page
|
||||||
|
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
|
||||||
|
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
|
||||||
|
print '</td>';
|
||||||
|
print '<td width="20"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Message on login page
|
||||||
|
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
|
||||||
|
complete_substitutions_array($substitutionarray, $langs);
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . '<br>';
|
||||||
|
foreach ($substitutionarray as $key => $val) {
|
||||||
|
$texthelp .= $key . '<br>';
|
||||||
|
}
|
||||||
|
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
|
||||||
|
print '</td><td colspan="2">';
|
||||||
|
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||||
|
$doleditor->Create();
|
||||||
|
print '</td></tr>' . "\n";
|
||||||
|
|
||||||
|
// Background
|
||||||
|
print '<tr class="oddeven"><td><label for="imagebackground">' . $langs->trans("BackgroundImageLogin") . ' (png,jpg)</label></td><td colspan="2">';
|
||||||
|
print '<div class="centpercent inline-block">';
|
||||||
|
$disabled = '';
|
||||||
|
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||||
|
$disabled = ' disabled="disabled"';
|
||||||
|
}
|
||||||
|
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"' . $disabled . '>';
|
||||||
|
if ($disabled) {
|
||||||
|
print '(' . $langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND") . ') ';
|
||||||
|
}
|
||||||
|
if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
|
||||||
|
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=removebackgroundlogin">' . img_delete($langs->trans("Delete")) . '</a>';
|
||||||
|
if (file_exists($conf->mycompany->dir_output . '/logos/' . $conf->global->MAIN_LOGIN_BACKGROUND)) {
|
||||||
|
print ' ';
|
||||||
|
print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=mycompany&file=' . urlencode('logos/' . $conf->global->MAIN_LOGIN_BACKGROUND) . '">';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<img class="paddingleft valignmiddle" width="100" src="' . DOL_URL_ROOT . '/public/theme/common/nophoto.png">';
|
||||||
|
}
|
||||||
|
print '</div>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>' . "\n";
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -636,7 +636,7 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0,
|
|||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
*
|
*
|
||||||
* @param int $nbofactivatedmodules Number f oactivated modules
|
* @param int $nbofactivatedmodules Number if activated modules
|
||||||
* @param int $nboftotalmodules Nb of total modules
|
* @param int $nboftotalmodules Nb of total modules
|
||||||
* @return array Array of tabs to show
|
* @return array Array of tabs to show
|
||||||
*/
|
*/
|
||||||
@ -679,6 +679,45 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules)
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare array with list of tabs
|
||||||
|
*
|
||||||
|
* @return array Array of tabs to show
|
||||||
|
*/
|
||||||
|
function ihm_prepare_head()
|
||||||
|
{
|
||||||
|
global $langs, $conf, $user;
|
||||||
|
$h = 0;
|
||||||
|
$head = array();
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=language";
|
||||||
|
$head[$h][1] = $langs->trans("DefaultLanguage");
|
||||||
|
$head[$h][2] = 'language';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=template";
|
||||||
|
$head[$h][1] = $langs->trans("DefaultSkin");
|
||||||
|
$head[$h][2] = 'template';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=login";
|
||||||
|
$head[$h][1] = $langs->trans("LoginPage");
|
||||||
|
$head[$h][2] = 'login';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other";
|
||||||
|
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||||
|
$head[$h][2] = 'other';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin');
|
||||||
|
|
||||||
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin', 'remove');
|
||||||
|
|
||||||
|
|
||||||
|
return $head;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare array with list of tabs
|
* Prepare array with list of tabs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user