From b640035f3df534111ec7fcb9662737d120ee9cdd Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Fri, 7 Dec 2018 15:28:36 +0100 Subject: [PATCH] NEW : Add conf to set a search entry to the top --- htdocs/core/ajax/selectsearchbox.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 364903c9cd7..8d6c4fe0c31 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -155,6 +155,12 @@ if (empty($reshook)) } else $arrayresult=$hookmanager->resArray; +// This allow to keep a search entry to the top +if(! empty($conf->global->DEFAULT_SEARCH_INTO_MODULE)) { + $key = 'searchinto'.$conf->global->DEFAULT_SEARCH_INTO_MODULE; + if(array_key_exists($key, $arrayresult)) $arrayresult[$key]['position'] = -10; +} + // Sort on position $arrayresult = dol_sort_array($arrayresult, 'position');