Merge pull request #4921 from FHenry/3.9
Add hook parameters on New search Box
This commit is contained in:
commit
f8fa2202ed
@ -34,6 +34,8 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
|||||||
$res=@include '../../main.inc.php';
|
$res=@include '../../main.inc.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
||||||
|
|
||||||
|
//global $hookmanager;
|
||||||
|
$hookmanager->initHooks(array('searchform'));
|
||||||
|
|
||||||
$search_boxvalue=GETPOST('q');
|
$search_boxvalue=GETPOST('q');
|
||||||
|
|
||||||
@ -113,16 +115,15 @@ if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFO
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
||||||
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
||||||
{
|
{
|
||||||
$langs->load("hrm");
|
$langs->load("hrm");
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user'));
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user'));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Execute hook addSearchEntry
|
// Execute hook addSearchEntry
|
||||||
$parameters=array();
|
$parameters=array('search_boxvalue'=>$search_boxvalue);
|
||||||
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
|
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
@ -131,13 +132,6 @@ if (empty($reshook))
|
|||||||
else $arrayresult=$hookmanager->resArray;
|
else $arrayresult=$hookmanager->resArray;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print json_encode($arrayresult);
|
print json_encode($arrayresult);
|
||||||
|
|
||||||
if (is_object($db)) $db->close();
|
if (is_object($db)) $db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user