*
* 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.
*
* $Id$
*/
/**
\file htdocs/user/param_ihm.php
\brief Onglet parametrage de la fiche utilisateur
\version $Revision$
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php");
$langs->load("companies");
$langs->load("products");
$langs->load("admin");
$langs->load("users");
// Defini si peux lire/modifier permisssions
$canreadperms=($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));
}
if ($user->id <> $_REQUEST["id"] && ! $canreadperms)
{
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);
/*
* 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"];
dolibarr_set_user_page_param($db, $fuser, '', $tabparam);
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST["id"]);
exit;
}
}
llxHeader();
/*
* Affichage onglets
*/
$head = user_prepare_head($fuser);
dolibarr_fiche_head($head, 'guisetup', $langs->trans("User"));
print '
';
// Ref
print '| '.$langs->trans("Ref").' | ';
print '';
print $html->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
print ' | ';
print '
';
// Nom
print '| '.$langs->trans("Lastname").' | ';
print ''.$fuser->nom.' | ';
print "
\n";
// Prenom
print '| '.$langs->trans("Firstname").' | ';
print ''.$fuser->prenom.' | ';
print "
\n";
print '
';
if ($_GET["action"] == 'edit')
{
print '';
}
else
{
$var=true;
print '
';
// Skin
show_theme($fuser,0);
print '';
print '';
}
$db->close();
llxFooter('$Date$ - $Revision$');
function show_theme($fuser,$edit=0)
{
global $conf,$langs,$dirtheme,$bc;
$thumbsbyrow=6;
print '';
}
?>