diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9e33dd63b6f..3dc91212bad 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1022,46 +1022,45 @@ function left_menu($menu_array, $helppagename='', $form_search='') $menuleft->showmenu(); // Affichage des zones de recherche permanantes - $addzonerecherche=0; - if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE) $addzonerecherche=1; - if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT) $addzonerecherche=1; - if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE) $addzonerecherche=1; - - if ($addzonerecherche && ($user->rights->societe->lire || $user->rights->produit->lire)) + $ret=''; + if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire) { - print '
'; + $langs->load("companies"); + $ret.=printSearchForm(DOL_URL_ROOT.'/societe.php', DOL_URL_ROOT.'/societe.php', + img_object($langs->trans("List"),'company').' '.$langs->trans("Companies"), 'soc', 'socname'); } + if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire) + { + $langs->load("companies"); + $ret.=printSearchForm(DOL_URL_ROOT.'/contact/index.php', DOL_URL_ROOT.'/contact/index.php', + img_object($langs->trans("List"),'contact').' '.$langs->trans("Contacts"), 'contact', 'contactname'); + } + + if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire) + { + $langs->load("products"); + $ret.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/index.php', + img_object($langs->trans("List"),'product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall'); + } + + if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire) + { + $langs->load("members"); + $ret.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', + img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall'); + } + + if ($ret) + { + print "\n"; + print "\n"; + print ''."\n"; + print "\n"; + } + // Zone de recherche supplementaire if ($form_search) { @@ -1131,18 +1130,17 @@ function left_menu($menu_array, $helppagename='', $form_search='') function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname) { global $langs; - print "\n\n"; - print '"; - print "\n\n"; + $ret ='\n"; + return $ret; }