2005-08-11 20:35:00 +02:00
|
|
|
<?php
|
2017-04-14 12:52:32 +02:00
|
|
|
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
2018-10-27 14:43:12 +02:00
|
|
|
* Copyright (C) 2010-2015 Regis Houssin <regis.houssin@inodbox.com>
|
2013-02-22 09:42:02 +01:00
|
|
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro.com>
|
2018-09-04 11:54:13 +02:00
|
|
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
2005-08-11 20:35:00 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2005-08-11 20:35:00 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2005-08-11 20:35:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-08-17 19:32:38 +02:00
|
|
|
* \file htdocs/user/param_ihm.php
|
2010-02-27 11:11:00 +01:00
|
|
|
* \brief Page to show user setup for display
|
2009-08-17 19:32:38 +02:00
|
|
|
*/
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2018-05-26 16:24:54 +02:00
|
|
|
// Load translation files required by page
|
|
|
|
|
$langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members'));
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2007-10-11 17:41:42 +02:00
|
|
|
// Defini si peux lire/modifier permisssions
|
2020-04-10 10:59:32 +02:00
|
|
|
$canreaduser = ($user->admin || $user->rights->user->user->lire);
|
2007-10-11 17:41:42 +02:00
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
$id = GETPOST('id', 'int');
|
2020-09-16 19:39:50 +02:00
|
|
|
$action = GETPOST('action', 'aZ09');
|
2020-04-10 10:59:32 +02:00
|
|
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search
|
2011-11-02 20:24:51 +01:00
|
|
|
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($id) {
|
2020-09-07 10:18:17 +02:00
|
|
|
// $user est le user qui edite, $id est l'id de l'utilisateur edite
|
|
|
|
|
$caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
|
|
|
|
|
|| (($user->id != $id) && $user->rights->user->user->creer));
|
2007-10-11 17:41:42 +02:00
|
|
|
}
|
2009-08-06 15:07:25 +02:00
|
|
|
|
|
|
|
|
// Security check
|
2020-04-10 10:59:32 +02:00
|
|
|
$socid = 0;
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($user->socid > 0) {
|
|
|
|
|
$socid = $user->socid;
|
|
|
|
|
}
|
2020-04-10 10:59:32 +02:00
|
|
|
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
|
2019-01-16 19:25:19 +01:00
|
|
|
|
2015-05-13 09:32:54 +02:00
|
|
|
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($user->id <> $id && !$canreaduser) {
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
2007-10-11 17:41:42 +02:00
|
|
|
|
2011-10-24 14:11:49 +02:00
|
|
|
$dirtop = "../core/menus/standard";
|
|
|
|
|
$dirleft = "../core/menus/standard";
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2010-02-18 15:39:51 +01:00
|
|
|
// Charge utilisateur edite
|
2015-06-26 15:26:08 +02:00
|
|
|
$object = new User($db);
|
2017-04-14 12:52:32 +02:00
|
|
|
$object->fetch($id, '', '', 1);
|
2015-06-26 15:26:08 +02:00
|
|
|
$object->getrights();
|
2005-08-14 19:42:31 +02:00
|
|
|
|
2010-02-18 15:39:51 +01:00
|
|
|
// Liste des zone de recherche permanentes supportees
|
2016-01-03 19:34:19 +01:00
|
|
|
/* deprecated
|
2005-08-11 20:35:00 +02:00
|
|
|
$searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
|
|
|
|
|
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE);
|
|
|
|
|
$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
|
2016-01-03 19:34:19 +01:00
|
|
|
*/
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2011-11-08 10:18:45 +01:00
|
|
|
$form = new Form($db);
|
2020-04-10 10:59:32 +02:00
|
|
|
$formadmin = new FormAdmin($db);
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2017-06-10 12:56:28 +02:00
|
|
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
2020-04-10 10:59:32 +02:00
|
|
|
$hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
|
2005-08-14 19:42:31 +02:00
|
|
|
|
2017-04-14 12:52:32 +02:00
|
|
|
|
2005-08-11 20:35:00 +02:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2017-04-14 12:52:32 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$parameters = array('id'=>$socid);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($reshook < 0) {
|
|
|
|
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
|
|
|
|
}
|
2015-09-16 09:37:49 +02:00
|
|
|
|
|
|
|
|
if (empty($reshook)) {
|
2015-11-23 14:21:25 +01:00
|
|
|
if ($action == 'update' && ($caneditfield || !empty($user->admin))) {
|
2021-03-24 19:06:44 +01:00
|
|
|
if (!GETPOST("cancel")) {
|
2015-11-23 14:21:25 +01:00
|
|
|
$tabparam = array();
|
|
|
|
|
|
2016-07-26 21:12:52 +02:00
|
|
|
if (GETPOST("check_MAIN_LANDING_PAGE") == "on") {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["MAIN_LANDING_PAGE"] = GETPOST("MAIN_LANDING_PAGE", 'alphanohtml');
|
2016-07-26 21:12:52 +02:00
|
|
|
} else {
|
|
|
|
|
$tabparam["MAIN_LANDING_PAGE"] = '';
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-23 14:21:25 +01:00
|
|
|
if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["MAIN_LANG_DEFAULT"] = GETPOST("main_lang_default", 'aZ09');
|
2015-11-23 14:21:25 +01:00
|
|
|
} else {
|
|
|
|
|
$tabparam["MAIN_LANG_DEFAULT"] = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOST("main_size_liste_limit", 'int');
|
2015-11-23 14:21:25 +01:00
|
|
|
} else {
|
|
|
|
|
$tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-14 11:23:15 +02:00
|
|
|
if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09');
|
2018-09-14 11:23:15 +02:00
|
|
|
} else {
|
|
|
|
|
$tabparam["AGENDA_DEFAULT_VIEW"] = '';
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-23 14:21:25 +01:00
|
|
|
if (GETPOST("check_MAIN_THEME") == "on") {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["MAIN_THEME"] = GETPOST('main_theme', 'aZ09');
|
2015-11-23 14:21:25 +01:00
|
|
|
} else {
|
|
|
|
|
$tabparam["MAIN_THEME"] = '';
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-16 12:55:32 +01:00
|
|
|
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array()))));
|
2015-11-23 14:21:25 +01:00
|
|
|
if ($val == '') {
|
|
|
|
|
$tabparam['THEME_ELDY_TOPMENU_BACK1'] = '';
|
|
|
|
|
} else {
|
2021-02-26 13:18:40 +01:00
|
|
|
$tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(
|
|
|
|
|
',',
|
|
|
|
|
colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())
|
|
|
|
|
);
|
2015-11-23 14:21:25 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-16 12:55:32 +01:00
|
|
|
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()))));
|
2015-11-23 14:21:25 +01:00
|
|
|
if ($val == '') {
|
|
|
|
|
$tabparam['THEME_ELDY_BACKTITLE1'] = '';
|
|
|
|
|
} else {
|
2021-02-26 13:18:40 +01:00
|
|
|
$tabparam['THEME_ELDY_BACKTITLE1'] = join(
|
|
|
|
|
',',
|
|
|
|
|
colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())
|
|
|
|
|
);
|
2015-11-23 14:21:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') {
|
|
|
|
|
$tabparam["THEME_ELDY_USE_HOVER"] = 1;
|
|
|
|
|
} else {
|
|
|
|
|
$tabparam["THEME_ELDY_USE_HOVER"] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-04 11:54:13 +02:00
|
|
|
if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') {
|
|
|
|
|
$tabparam["THEME_ELDY_USE_CHECKED"] = 1;
|
|
|
|
|
} else {
|
|
|
|
|
$tabparam["THEME_ELDY_USE_CHECKED"] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-02 18:48:27 +01:00
|
|
|
if (GETPOST('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
2020-09-07 10:18:17 +02:00
|
|
|
$tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 1;
|
2019-01-02 18:48:27 +01:00
|
|
|
} else {
|
2020-09-07 10:18:17 +02:00
|
|
|
$tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
|
2019-01-02 18:48:27 +01:00
|
|
|
}
|
|
|
|
|
|
2019-08-07 11:11:47 +02:00
|
|
|
if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) {
|
2020-02-16 12:55:32 +01:00
|
|
|
$tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND', 'aZ09');
|
2019-08-07 11:11:47 +02:00
|
|
|
} else {
|
|
|
|
|
$tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-23 14:21:25 +01:00
|
|
|
$result = dol_set_user_param($db, $conf, $object, $tabparam);
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
2015-11-23 14:21:25 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-08-11 20:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
2009-08-05 19:19:55 +02:00
|
|
|
* View
|
2005-08-11 20:35:00 +02:00
|
|
|
*/
|
2009-08-05 19:19:55 +02:00
|
|
|
|
|
|
|
|
llxHeader();
|
|
|
|
|
|
2016-07-26 21:12:52 +02:00
|
|
|
// List of possible landing pages
|
2020-04-10 10:59:32 +02:00
|
|
|
$tmparray = array('index.php'=>'Dashboard');
|
2021-02-26 13:18:40 +01:00
|
|
|
if (!empty($conf->societe->enabled)) {
|
|
|
|
|
$tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->projet->enabled)) {
|
|
|
|
|
$tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
|
|
|
|
|
$tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
|
|
|
|
$tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
|
|
|
|
|
$tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
|
|
|
|
|
$tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->adherent->enabled)) {
|
|
|
|
|
$tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
|
|
|
|
|
}
|
|
|
|
|
if (!empty($conf->agenda->enabled)) {
|
|
|
|
|
$tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
|
|
|
|
|
}
|
2016-07-26 21:12:52 +02:00
|
|
|
|
2015-06-26 15:26:08 +02:00
|
|
|
$head = user_prepare_head($object);
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2009-05-05 02:20:17 +02:00
|
|
|
$title = $langs->trans("User");
|
2013-04-24 03:56:13 +02:00
|
|
|
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($action == 'edit') {
|
2013-06-05 16:12:07 +02:00
|
|
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
2019-12-01 10:20:11 +01:00
|
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
2013-06-05 16:12:07 +02:00
|
|
|
print '<input type="hidden" name="action" value="update">';
|
|
|
|
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
2013-04-24 03:56:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($action == 'edit') {
|
2020-10-22 22:50:03 +02:00
|
|
|
print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
|
2017-04-09 14:09:33 +02:00
|
|
|
|
|
|
|
|
$linkback = '';
|
|
|
|
|
|
|
|
|
|
if ($user->rights->user->user->lire || $user->admin) {
|
2018-10-09 14:20:53 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
2017-04-09 14:09:33 +02:00
|
|
|
}
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2021-05-19 13:07:25 +02:00
|
|
|
print dol_get_fiche_end();
|
|
|
|
|
|
|
|
|
|
|
2021-02-26 13:18:40 +01:00
|
|
|
if (!empty($conf->use_javascript_ajax)) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<script type="text/javascript" language="javascript">
|
2015-09-09 12:11:57 +02:00
|
|
|
jQuery(document).ready(function() {
|
|
|
|
|
function init_myfunc()
|
|
|
|
|
{
|
2016-07-26 21:12:52 +02:00
|
|
|
if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
|
|
|
|
|
else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2016-07-26 21:12:52 +02:00
|
|
|
if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
|
2015-09-09 12:11:57 +02:00
|
|
|
else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2015-09-09 12:11:57 +02:00
|
|
|
if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
|
|
|
|
|
else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2018-09-14 11:23:15 +02:00
|
|
|
if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
|
|
|
|
|
else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
|
|
|
|
|
|
2015-09-09 12:11:57 +02:00
|
|
|
if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
|
|
|
|
|
else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
|
2017-11-04 15:40:35 +01:00
|
|
|
|
2015-09-09 12:11:57 +02:00
|
|
|
if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
|
|
|
|
|
else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
|
|
|
|
|
}
|
|
|
|
|
init_myfunc();
|
2016-07-26 21:12:52 +02:00
|
|
|
jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
|
2015-09-09 12:11:57 +02:00
|
|
|
jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
|
2018-09-14 11:23:15 +02:00
|
|
|
jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
|
|
|
|
|
jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
|
2015-09-09 12:11:57 +02:00
|
|
|
jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
|
|
|
|
|
jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
|
|
|
|
|
jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
|
|
|
|
|
});
|
|
|
|
|
</script>';
|
2020-09-07 10:18:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clearstatcache();
|
|
|
|
|
|
2021-05-19 13:07:25 +02:00
|
|
|
print '<table class="noborder centpercent">';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td> </td><td>'.$langs->trans("PersonalValue").'</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Language by default
|
2021-05-19 13:07:25 +02:00
|
|
|
print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<td>';
|
|
|
|
|
$s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
|
|
|
|
print $s ? $s.' ' : '';
|
|
|
|
|
print ($conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "");
|
|
|
|
|
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
|
|
|
|
print '> <label for="check_MAIN_LANG_DEFAULT">'.$langs->trans("UsePersonalValue").'</label></td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print $formadmin->select_language((!empty($object->conf->MAIN_LANG_DEFAULT) ? $object->conf->MAIN_LANG_DEFAULT : ''), 'main_lang_default', 1, null, 0, 0, (!empty($dolibarr_main_demo)));
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Landing page
|
|
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANDING_PAGE" id="check_MAIN_LANDING_PAGE" type="checkbox" '.(!empty($object->conf->MAIN_LANDING_PAGE) ? " checked" : "");
|
|
|
|
|
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
|
|
|
|
print '> <label for="check_MAIN_LANDING_PAGE">'.$langs->trans("UsePersonalValue").'</label></td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (!empty($object->conf->MAIN_LANDING_PAGE) ? $object->conf->MAIN_LANDING_PAGE : ''), 0, 0, 0, '', 1);
|
|
|
|
|
//print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Landing page for Agenda - AGENDA_DEFAULT_VIEW
|
|
|
|
|
print '<tr class="oddeven">'."\n";
|
|
|
|
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
|
|
|
|
print '<td class="center"> </td>'."\n";
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_AGENDA_DEFAULT_VIEW" id="check_AGENDA_DEFAULT_VIEW" type="checkbox" '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "");
|
|
|
|
|
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
|
|
|
|
print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
|
|
|
|
|
print '<td>'."\n";
|
|
|
|
|
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
|
|
|
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
|
|
|
|
|
print '</td></tr>'."\n";
|
|
|
|
|
|
|
|
|
|
// Max size of lists
|
|
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
|
|
|
|
print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" name="check_SIZE_LISTE_LIMIT" id="check_SIZE_LISTE_LIMIT" type="checkbox" '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "");
|
|
|
|
|
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
|
|
|
|
print '> <label for="check_SIZE_LISTE_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>';
|
|
|
|
|
print '<td><input class="flat" name="main_size_liste_limit" id="main_size_liste_limit" size="4" value="'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '').'"></td></tr>';
|
|
|
|
|
|
|
|
|
|
print '</table><br>';
|
|
|
|
|
|
|
|
|
|
// Theme
|
|
|
|
|
showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<div class="center">';
|
2020-11-19 20:23:38 +01:00
|
|
|
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
2020-09-07 10:18:17 +02:00
|
|
|
print ' ';
|
2020-11-23 15:12:52 +01:00
|
|
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
2020-09-07 10:18:17 +02:00
|
|
|
print '</div>';
|
2020-05-21 15:05:19 +02:00
|
|
|
} else {
|
2020-10-22 22:50:03 +02:00
|
|
|
print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
|
2020-09-07 10:18:17 +02:00
|
|
|
|
|
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
|
|
|
|
|
|
|
|
|
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
|
|
|
|
|
|
2021-05-19 13:07:25 +02:00
|
|
|
print dol_get_fiche_end();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
|
|
|
|
print '<table class="noborder centpercent">';
|
|
|
|
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td> </td><td>'.$langs->trans("PersonalValue").'</td></tr>';
|
2020-09-07 10:18:17 +02:00
|
|
|
|
|
|
|
|
// Language
|
|
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
$s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
|
|
|
|
|
print ($s ? $s.' ' : '');
|
|
|
|
|
print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
$s = (isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
|
|
|
|
|
print ($s ? $s.' ' : '');
|
|
|
|
|
print (isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : (!empty($object->conf->MAIN_LANG_DEFAULT) ? $langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT) : ''));
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Landing page
|
|
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
|
|
|
|
|
print '<td>';
|
|
|
|
|
print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td class="nowrap"><input class="oddeven" name="check_MAIN_LANDING_PAGE" disabled id="check_MAIN_LANDING_PAGE" type="checkbox" '.(!empty($object->conf->MAIN_LANDING_PAGE) ? " checked" : "");
|
|
|
|
|
print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
|
|
|
|
|
print '> '.$langs->trans("UsePersonalValue").'</td>';
|
|
|
|
|
print '<td>';
|
2021-02-26 13:18:40 +01:00
|
|
|
if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
|
2021-02-26 13:18:40 +01:00
|
|
|
} else {
|
|
|
|
|
print $object->conf->MAIN_LANDING_PAGE;
|
|
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
//print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Landing page for Agenda - AGENDA_DEFAULT_VIEW
|
|
|
|
|
print '<tr class="oddeven">'."\n";
|
|
|
|
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
|
|
|
|
print '<td class="center"> </td>'."\n";
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
|
|
|
|
|
print '<td>'."\n";
|
|
|
|
|
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
2021-02-26 13:18:40 +01:00
|
|
|
if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
|
|
|
|
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
|
|
|
|
|
}
|
2020-09-07 10:18:17 +02:00
|
|
|
print '</td></tr>'."\n";
|
|
|
|
|
|
|
|
|
|
// Max size for lists
|
|
|
|
|
print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
|
|
|
|
|
print '<td>'.(!empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? $conf->global->MAIN_SIZE_LISTE_LIMIT : ' ').'</td>';
|
|
|
|
|
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
|
|
|
|
|
print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : ' ').'</td></tr>';
|
|
|
|
|
|
2021-05-19 13:07:25 +02:00
|
|
|
print '</table>';
|
|
|
|
|
print '</div>';
|
|
|
|
|
print '<br>';
|
2020-09-07 10:18:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Skin
|
|
|
|
|
showSkins($object, 0, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<div class="tabsAction">';
|
2021-02-26 13:18:40 +01:00
|
|
|
if (empty($user->admin) && !empty($dolibarr_main_demo)) {
|
2020-09-07 10:18:17 +02:00
|
|
|
print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify")."</a>";
|
|
|
|
|
} else {
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($caneditfield || !empty($user->admin)) { // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin
|
2020-09-07 10:18:17 +02:00
|
|
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
|
|
|
|
} else {
|
|
|
|
|
print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify")."</a>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</div>';
|
2005-08-11 20:35:00 +02:00
|
|
|
}
|
|
|
|
|
|
2021-02-26 13:18:40 +01:00
|
|
|
if ($action == 'edit') {
|
2020-09-07 10:18:17 +02:00
|
|
|
print '</form>';
|
2015-10-11 16:12:12 +02:00
|
|
|
}
|
2005-08-11 20:35:00 +02:00
|
|
|
|
2018-08-04 15:58:05 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-07-10 13:20:53 +02:00
|
|
|
$db->close();
|