diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index f6f65abb6a5..b7f83d8572a 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -33,17 +33,23 @@ $langs->load("products");
$langs->load("admin");
$langs->load("users");
-
+$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"));
+
/*
* Actions
*/
@@ -72,7 +78,7 @@ if ($_POST["action"] == 'update')
$tabparam["MAIN_SEARCHFORM_SOCIETE"]=$_POST["main_searchform_societe"];
$tabparam["MAIN_SEARCHFORM_PRODUITSERVICE"]=$_POST["main_searchform_produitservice"];
- dolibarr_set_user_page_param($db, $user, '', $tabparam);
+ dolibarr_set_user_page_param($db, $fuser, '', $tabparam);
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
@@ -86,10 +92,6 @@ if ($_POST["action"] == 'update')
llxHeader();
-$fuser = new User($db, $_GET["id"]);
-$fuser->fetch();
-$fuser->getrights();
-
/*
* Affichage onglets
@@ -145,24 +147,24 @@ if ($_GET["action"] == 'edit')
$var=!$var;
print '
| '.$langs->trans("Language").' | ';
print ''.$conf->global->MAIN_LANG_DEFAULT.' | ';
- print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
print '';
$html=new Form($db);
- $html->select_lang($user->conf->MAIN_LANG_DEFAULT,'main_lang_default');
+ $html->select_lang($fuser->conf->MAIN_LANG_DEFAULT,'main_lang_default');
print ' |
';
// Taille max des listes
$var=!$var;
print '| '.$langs->trans("MaxSizeList").' | ';
print ''.$conf->global->SIZE_LISTE_LIMIT.' | ';
- print 'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
- print ' |
';
+ print 'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print ' | ';
print '
';
// Theme
- show_theme(1);
+ show_theme($fuser,1);
print '';
@@ -184,25 +186,25 @@ else
$var=!$var;
print '| '.$langs->trans("Language").' | ';
print ''.$conf->global->MAIN_LANG_DEFAULT.' | ';
- print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
- print '' . $user->conf->MAIN_LANG_DEFAULT . ' |
';
+ print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print '' . $fuser->conf->MAIN_LANG_DEFAULT . ' | ';
$var=!$var;
print '| '.$langs->trans("MaxSizeList").' | ';
print ''.$conf->global->SIZE_LISTE_LIMIT.' | ';
- print 'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
- print '' . $user->conf->SIZE_LISTE_LIMIT . ' |
';
+ print 'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").' | ';
+ print '' . $fuser->conf->SIZE_LISTE_LIMIT . ' | ';
print '
';
// Skin
- show_theme(0);
+ show_theme($fuser,0);
print '';
print '';
- if ($user->id == $_GET["id"]) // Si fiche de l'utilisateur courant
+ if ($fuser->id == $user->id) // Si utilisateur édité = utilisateur courant
{
print '
'.$langs->trans("Edit").'';
}
@@ -215,9 +217,9 @@ $db->close();
llxFooter('$Date$ - $Revision$');
-function show_theme($edit=0)
+function show_theme($fuser,$edit=0)
{
- global $user,$langs,$dirtheme,$bc;
+ global $langs,$dirtheme,$bc;
$nbofthumbs=5;
print '
';
@@ -238,7 +240,7 @@ function show_theme($edit=0)
$file=$dirtheme."/".$subdir."/thumb.png";
if (! file_exists($file)) $file=$dirtheme."/nophoto.jpg";
print '