* * 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 * the Free Software Foundation; either version 2 of the License, or * (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 * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/user/param_ihm.php * \brief Onglet parametrage de la fiche utilisateur * \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php"); require_once(DOL_DOCUMENT_ROOT."/html.formadmin.class.php"); $langs->load("companies"); $langs->load("products"); $langs->load("admin"); $langs->load("users"); // Defini si peux lire/modifier permisssions $canreaduser=($user->admin || $user->rights->user->user->lire); if ($_REQUEST["id"]) { // $user est le user qui edite, $_REQUEST["id"] est l'id de l'utilisateur edit� $caneditfield=( (($user->id == $_REQUEST["id"]) && $user->rights->user->self->creer) || (($user->id != $_REQUEST["id"]) && $user->rights->user->user->creer)); } // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); if ($user->id == $_GET["id"]) // A user can always read its own card { $feature2=''; $canreaduser=1; } $result = restrictedArea($user, 'user', $_GET["id"], '', $feature2); if ($user->id <> $_REQUEST["id"] && ! $canreaduser) accessforbidden(); $id=isset($_GET["id"])?$_GET["id"]:$_POST["id"]; $dirtop = "../includes/menus/barre_top"; $dirleft = "../includes/menus/barre_left"; $dirtheme = "../theme"; // Charge utilisateur edit� $fuser = new User($db, $id); $fuser->fetch(); $fuser->getrights(); // Liste des zone de recherche permanantes support�es $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")); $html = new Form($db); $formadmin=new FormAdmin($db); /* * Actions */ if ($_POST["action"] == 'update' && ($caneditfield || $user->admin)) { if ($_POST["cancel"]) { $_GET["id"]=$_POST["id"]; } else { $tabparam=array(); if ($_POST["check_MAIN_LANG_DEFAULT"]=="on") $tabparam["MAIN_LANG_DEFAULT"]=$_POST["main_lang_default"]; else $tabparam["MAIN_LANG_DEFAULT"]=''; $tabparam["MAIN_MENU_BARRETOP"]=$_POST["main_menu_barretop"]; $tabparam["MAIN_MENU_BARRELEFT"]=$_POST["main_menu_barreleft"]; if ($_POST["check_SIZE_LISTE_LIMIT"]=="on") $tabparam["MAIN_SIZE_LISTE_LIMIT"]=$_POST["main_size_liste_limit"]; else $tabparam["MAIN_SIZE_LISTE_LIMIT"]=''; if ($_POST["check_MAIN_THEME"]=="on") $tabparam["MAIN_THEME"]=$_POST["main_theme"]; else $tabparam["MAIN_THEME"]=''; $tabparam["MAIN_SEARCHFORM_CONTACT"]=$_POST["main_searchform_contact"]; $tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"]; $tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"]; $result=dol_set_user_param($db, $conf, $fuser, $tabparam); $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST["id"]); exit; } } /* * View */ llxHeader(); $head = user_prepare_head($fuser); $title = $langs->trans("User"); dol_fiche_head($head, 'guisetup', $title, 0, 'user'); print ''; // Ref print ''; print ''; print ''; // Nom print ''; print ''; print "\n"; // Prenom print ''; print ''; print "\n"; print '
'.$langs->trans("Ref").''; print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("LastName").''.$fuser->nom.'
'.$langs->trans("FirstName").''.$fuser->prenom.'

'; if ($_GET["action"] == 'edit') { print '
'; print ''; print ''; print ''; clearstatcache(); $var=true; print ''; print ''; // Langue par defaut $var=!$var; print ''; print ''; print ''; print ''; // Taille max des listes $var=!$var; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").'
'.$langs->trans("Language").''.($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$conf->global->MAIN_LANG_DEFAULT).'conf->MAIN_LANG_DEFAULT?" checked":""); print ! empty($dolibarr_main_demo)?' disabled="true"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; $html=new Form($db); $formadmin->select_lang($fuser->conf->MAIN_LANG_DEFAULT,'main_lang_default',1); print '
'.$langs->trans("MaxSizeList").''.$conf->global->MAIN_SIZE_LISTE_LIMIT.'conf->MAIN_SIZE_LISTE_LIMIT?" checked":""); print ! empty($dolibarr_main_demo)?' disabled="true"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").'

'; // Theme show_theme($fuser,empty($dolibarr_main_demo)?1:0,true); print ''; print '
'; print ''; print '     '; print ''; print '
'; print '
'; } else { $var=true; print ''; print ''; $var=!$var; print ''; print ''; print ''; print ''; $var=!$var; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("DefaultValue").' '.$langs->trans("PersonalValue").'
'.$langs->trans("Language").''.($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$conf->global->MAIN_LANG_DEFAULT).'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").''.($fuser->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$fuser->conf->MAIN_LANG_DEFAULT).'
'.$langs->trans("MaxSizeList").''.$conf->global->MAIN_SIZE_LISTE_LIMIT.'conf->MAIN_SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").'' . $fuser->conf->MAIN_SIZE_LISTE_LIMIT . '

'; // Skin show_theme($fuser,0,true); print ''; print '
'; if (! empty($dolibarr_main_demo)) { print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; } else { if ($caneditfield || $user->admin) // Si utilisateur �dit� = utilisateur courant ayant les droits de cr�er ou admin { print ''.$langs->trans("Modify").''; } else { print "trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify").""; } } print '
'; } $db->close(); llxFooter('$Date$ - $Revision$'); ?>