* * 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"); require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php"); $langs->load("companies"); $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 */ 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["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").": ".$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=='auto'?$langs->trans("AutoDetectLang"):$conf->global->MAIN_LANG_DEFAULT).'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; $html=new Form($db); $html->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":"").'> '.$langs->trans("UsePersonalValue").'

'; // Theme show_theme($fuser,1); 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); print ''; print '
'; if (($fuser->id == $user->id) || $user->admin) // Si utilisateur édité = utilisateur courant ou admin { print ''.$langs->trans("Edit").''; } print '
'; } $db->close(); llxFooter('$Date$ - $Revision$'); function show_theme($fuser,$edit=0) { global $conf,$langs,$dirtheme,$bc; $thumbsbyrow=6; print ''; print ''; $var=false; print ''; print ''; print ''; print ''; $var=!$var; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("DefaultValue").' 
'.$langs->trans("DefaultSkin").''.$conf->global->MAIN_THEME.'conf->MAIN_THEME?" checked":"").'> '.$langs->trans("UsePersonalValue").' 
'; print ''; $handle=opendir($dirtheme); $i=0; while (($subdir = readdir($handle))!==false) { if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && ! eregi('common',$subdir)) { if ($i % $thumbsbyrow == 0) { print ''; } print ''; $i++; if ($i % $thumbsbyrow == 0) print ''; } } if ($i % $thumbsbyrow != 0) { while ($i % $thumbsbyrow != 0) { print ''; $i++; } print ''; } print '
'; $file=$dirtheme."/".$subdir."/thumb.png"; if (! file_exists($file)) $file=$dirtheme."/common/nophoto.jpg"; print '
'; if ($subdir == $fuser->conf->MAIN_THEME) { print ' '.$subdir.''; } else { print ' '.$subdir; } print '
 
'; print '
'; } ?>