From 8f49753ee38cdf29deae42c86022339ef6c2aa41 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Aug 2004 22:10:58 +0000 Subject: [PATCH] New: La liste des zones de recherches permanantes du menu gauche est dynamique dans la page de configuration de lIHM. --- htdocs/admin/ihm.php | 53 ++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 990273d4f86..ded8f940eb6 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -21,20 +21,33 @@ */ require("./pre.inc.php"); +$langs->load("companies"); +$langs->load("products"); + + if (!$user->admin) accessforbidden(); +// Liste des zone de recherche permanantes supportées +$searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice"); +$searchformconst=array(MAIN_SEARCHFORM_SOCIETE,MAIN_SEARCHFORM_CONTACT,MAIN_SEARCHFORM_PRODUITSERVICE); +$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices")); + + + if ($_POST["action"] == 'update') { dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"]); dolibarr_set_const($db, "SIZE_LISTE_LIMIT", $_POST["size_liste_limit"]); dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]); - dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",$_POST["main_searchform_contact"]); - dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE",$_POST["main_searchform_societe"]); dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]); dolibarr_set_const($db, "MAIN_MOTD", trim($_POST["main_motd"])); + dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",$_POST["main_searchform_contact"]); + dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE",$_POST["main_searchform_societe"]); + dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["main_searchform_produitservice"]); + Header("Location: ihm.php"); } @@ -50,6 +63,8 @@ print_titre($langs->trans("GUISetup")); print "
\n"; + + if ($_GET["action"] == 'edit') { print '
'; @@ -110,16 +125,22 @@ if ($_GET["action"] == 'edit') $html=new Form($db); $html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default'); print ''; - - print 'Afficher formulaire de recherche Contacts dans la barre de gauche'; - print 'Afficher formulaire de recherche Sociétés dans la barre de gauche'; - - print 'Message du jour'; - print '
'; - + + // Liste des zone de recherche permanantes supportées + print ''; + print ''; + $var=True; + foreach ($searchform as $key => $value) { + $var=!$var; + print ''; + } + print '
Zone de recherche permanante du menu de gauche'.$langs->trans("Active").'
'.$searchformtitle[$key].''; + $html->selectyesnonum($searchform[$key],$searchformconst[$key]); + print '

'; + print '
'; print ''; print '
'; @@ -138,16 +159,20 @@ else print $filelib; print ''; print 'Langue par défaut à utiliser (code langue)' . MAIN_LANG_DEFAULT . ''; - print 'Afficher zone de recherche Contacts dans le menu gauche' . (MAIN_SEARCHFORM_CONTACT?"oui":"non") . ''; - print 'Afficher zone de recherche Sociétés dans le menu gauche' . (MAIN_SEARCHFORM_SOCIETE?"oui":"non") . ''; - print 'Message du jour' . stripslashes(nl2br(MAIN_MOTD)) . ''; print '
'; - - + // Liste des zone de recherche permanantes supportées + print ''; + print ''; + $var=True; + foreach ($searchform as $key => $value) { + $var=!$var; + print ''; + } + print '
Zone de recherche permanante du menu de gauche'.$langs->trans("Active").'
'.$searchformtitle[$key].'' . ($searchformconst[$key]?"oui":"non") . '

'; print '