add condition

This commit is contained in:
Marcos Alconada 2020-09-22 12:15:05 +02:00 committed by Daniel Rodriguez
parent 49d8d1da9a
commit 48e19f3b59
1 changed files with 10 additions and 1 deletions

View File

@ -135,7 +135,7 @@ if (is_ajax()) {
}
if ($search != '') {
$filter['string'] = $search;
$filter['aliasRegex'] = $search;
}
if ($status_agents != AGENT_STATUS_ALL) {
@ -170,6 +170,15 @@ if (is_ajax()) {
$force_serialized
);
$agents_aux = [];
foreach ($agents as $key => $value) {
if (preg_match('/'.$search.'/', io_safe_output($value))) {
$agents_aux[$key] = $value;
}
}
$agents = $agents_aux;
$agents_disabled = [];
// Add keys prefix.
if ($keys_prefix !== '') {