From 5b9b2431db7998b2fb9feb92580b545c192555e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Aug 2004 21:45:23 +0000 Subject: [PATCH] Optim: Mise en fonction du code d'affichage de la zone de recherche permanante du menu gauche. --- htdocs/main.inc.php | 109 +++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 51 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 525d9033eb1..bec2f032bd4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -546,9 +546,7 @@ function top_menu($head, $title="", $target="") } /* - * Barre de menu gauche - * - * + * \brief Barre de menu gauche * * */ @@ -574,55 +572,44 @@ function left_menu($menu, $help_url='', $form_search='', $author='') print "\n"; } - if ((defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0) || (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0)) + /* + * Affichage des zones de recherche permanantes + */ + print '
'."\n"; + + if ($conf->societe->enabled && defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0) { $langs->load("companies"); - print '
'."\n"; - - if (defined("MAIN_SEARCHFORM_SOCIETE") && MAIN_SEARCHFORM_SOCIETE > 0) - { - if (strstr($_SERVER["SCRIPT_URL"], "/comm/prospect/")) - { - print '
'; - } - else - { - print ''; - } - print ''.$langs->trans("Companies").'
'; - print ''; - print ''; - print ''; - print ' '; - print ''; - print "
\n"; - } - - if (defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0) - { - print '
'; - print ''.$langs->trans("Contacts").'
'; - print ''; - print ''; - print ' '; - print ''; - print "
\n"; - } - if ($conf->produit->enabled) - { - $langs->load("products"); - print '
'; - print ''.$langs->trans("Products").'
'; - print ' '; - print ''; - print "
\n"; - } - print "
"; + if (strstr($_SERVER["SCRIPT_URL"], "/comm/prospect/")) + { + $url=DOL_URL_ROOT.'/comm/prospect/prospects.php'; + } + else + { + $url=DOL_URL_ROOT.'/societe.php'; + } + + printSearchForm($url,DOL_URL_ROOT.'/comm/clients.php',$langs->trans("Companies"),'soc','socname'); } + if ($conf->societe->enabled && defined("MAIN_SEARCHFORM_CONTACT") && MAIN_SEARCHFORM_CONTACT > 0) + { + $langs->load("companies"); + printSearchForm(DOL_URL_ROOT.'/contact/index.php',DOL_URL_ROOT.'/contact/index.php',$langs->trans("Contacts"),'contact','contactname'); + } + + if (($conf->produit->enabled || $conf->service->enabled) && defined("MAIN_SEARCHFORM_PRODUITSERVICE") && MAIN_SEARCHFORM_PRODUITSERVICE > 0) + { + $langs->load("products"); + printSearchForm(DOL_URL_ROOT.'/product/liste.php',DOL_URL_ROOT.'/product/',$langs->trans("Products")."/".$langs->trans("Services"),'products','sall'); + } + + print "
"; + + /* - * Formulaire de recherche + * Zone de recherche supplémentaire */ if (strlen($form_search) > 0) @@ -650,11 +637,31 @@ function left_menu($menu, $help_url='', $form_search='', $author='') print "\n"; } + + + /* - * Impression du pied de page - * - * - * + * \brief Affiche une zone de recherche + * \param urlaction url du post + * \param urlobject url du lien sur titre de la zone de recherche + * \param title titre de la zone de recherche + * \param htmlinputname nom du champ input du formulaire + */ +function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname) +{ + print '
'; + print ''.$title.'
'; + print ''; + print ''; + print ' '; + print ''; + print "
\n"; +} + + +/* + * \brief Impression du pied de page + * \param foot Non utilisé */ function llxFooter($foot='') { @@ -665,7 +672,7 @@ function llxFooter($foot='') */ print "\n"; - /* Supression temporaire, mauvais affichage sur petit ecran + /* Suppression temporaire, mauvais affichage sur petit ecran print '

'; print 'Bug report ';