diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php new file mode 100644 index 00000000000..bcb55259d6c --- /dev/null +++ b/htdocs/user/param_ihm.php @@ -0,0 +1,273 @@ + + * + * 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$ + * $Source$ + */ + +/** + \file htdocs/user/param_ihm.php + \brief Onglet parametrage de la fiche utilisateur + \version $Revision$ +*/ + + +require("./pre.inc.php"); + +$langs->load("companies"); +$langs->load("products"); +$langs->load("admin"); +$langs->load("users"); + + +if (!$user->admin) +accessforbidden(); + + +$dirtop = "../includes/menus/barre_top"; +$dirleft = "../includes/menus/barre_left"; +$dirtheme = "../theme"; + +// 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 + */ +if ($_POST["action"] == 'update') +{ + 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["SIZE_LISTE_LIMIT"]=$_POST["size_liste_limit"]; + else $tabparam["SIZE_LISTE_LIMIT"]=''; + + $tabparam["MAIN_THEME"]=$_POST["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, $user, '', $tabparam); + + $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer + + Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_POST["id"]); + exit; + } +} + + + +llxHeader(); + + +$fuser = new User($db, $_GET["id"]); +$fuser->fetch(); +$fuser->getrights(); + + +/* + * Affichage onglets + */ + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id; +$head[$h][1] = $langs->trans("UserCard"); +$h++; + +$head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$fuser->id; +$head[$h][1] = $langs->trans("UserRights"); +$h++; + +$head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$fuser->id; +$head[$h][1] = $langs->trans("UserGUISetup"); +$hselected=$h; +$h++; + +if ($conf->bookmark4u->enabled) +{ + $head[$h][0] = DOL_URL_ROOT.'/user/addon.php?id='.$fuser->id; + $head[$h][1] = $langs->trans("Bookmark4u"); + $h++; +} + +if ($conf->clicktodial->enabled) +{ + $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$fuser->id; + $head[$h][1] = $langs->trans("ClickToDial"); + $h++; +} + +dolibarr_fiche_head($head, $hselected, $langs->trans("User").": ".$fuser->fullname); + + + + +if ($_GET["action"] == 'edit') +{ + 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.'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + $html=new Form($db); + $html->select_lang($user->conf->MAIN_LANG_DEFAULT,'main_lang_default'); + print '
'.$langs->trans("MaxSizeList").''.$conf->global->SIZE_LISTE_LIMIT.'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").'

'; + + + // Theme + show_theme(1); + print '
'; + + 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.'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").'' . $user->conf->MAIN_LANG_DEFAULT . '
'.$langs->trans("MaxSizeList").''.$conf->global->SIZE_LISTE_LIMIT.'conf->SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").'' . $user->conf->SIZE_LISTE_LIMIT . '

'; + + + // Skin + show_theme(0); + print '
'; + + print ''; + + print '
'; + if ($user->id == $_GET["id"]) // Si fiche de l'utilisateur courant + { + print ''.$langs->trans("Edit").''; + } + print '
'; + +} + +$db->close(); + +llxFooter('$Date$ - $Revision$'); + + +function show_theme($edit=0) +{ + global $langs,$dirtheme,$bc; + + $nbofthumbs=5; + print ''; + print ''; + + $handle=opendir($dirtheme); + $var=false; + $i=0; + while (($subdir = readdir($handle))!==false) + { + if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS') + { + if ($i % $nbofthumbs == 0) { + print ''; + } + + print ''; + + $i++; + + if ($i % $nbofthumbs == 0) print ''; + } + } + if ($i % $nbofthumbs != 0) { + while ($i % $nbofthumbs != 0) { + print ''; + $i++; + } + print ''; + } + + print '
'.$langs->trans("Skin").'
'; + $file=$dirtheme."/".$subdir."/thumb.png"; + if (! file_exists($file)) $file=$dirtheme."/nophoto.jpg"; + print '
'; + if ($subdir == MAIN_THEME) + { + print ' '.$subdir.''; + } + else + { + print ' '.$subdir; + } + print '
 
'; +} + +?>