Fix: hooks for leftmenu must not be loaded if left menu hidden, also

hooks were lost into page search_page.
This commit is contained in:
Laurent Destailleur 2013-06-19 00:11:42 +02:00
parent 66e0f80aa2
commit bd8271ee24
2 changed files with 10 additions and 6 deletions

View File

@ -61,8 +61,12 @@ print '<div>';
$nbofsearch=0;
// Instantiate hooks of thirdparty module
$hookmanager->initHooks(array('searchform'));
// Define $searchform
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
// TODO Mutualize code here with function left_menu into main.inc.php page
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');

View File

@ -1479,18 +1479,18 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
$searchform='';
$bookmarks='';
// Instantiate hooks of thirdparty module
$hookmanager->initHooks(array('searchform','leftblock'));
if (empty($conf->dol_hide_leftmenu))
{
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
// Instantiate hooks of thirdparty module
$hookmanager->initHooks(array('searchform','leftblock'));
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
else print '<div id="id-left">';
print "\n";
// Define $searchform
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');