Skip to content
Snippets Groups Projects
Commit bd8271ee authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

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

hooks were lost into page search_page.
parent 66e0f80a
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment