Merge pull request #10199 from ATM-Nicolas/new_set_first_search_entry

NEW : Add hidden conf to set a search entry to the top
This commit is contained in:
Laurent Destailleur 2018-12-15 16:21:48 +01:00 committed by GitHub
commit cced9d30cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');