mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 03:48:55 +01:00
Filtering email search results on just value
Should catch even more duplicates, though value has both name & email
This commit is contained in:
parent
519306c8d5
commit
a17cbe1f45
@ -3749,9 +3749,19 @@ class mail_compose
|
|||||||
// switch regular JSON response handling off
|
// switch regular JSON response handling off
|
||||||
Api\Json\Request::isJSONRequest(false);
|
Api\Json\Request::isJSONRequest(false);
|
||||||
|
|
||||||
|
$results = array_reduce($results, function ($result, $option)
|
||||||
|
{
|
||||||
|
$value = $option['value'];
|
||||||
|
if(!array_key_exists($value, $result))
|
||||||
|
{
|
||||||
|
$result[$value] = $option;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}, []);
|
||||||
|
|
||||||
//error_log(__METHOD__.__LINE__.array2string($jsArray));
|
//error_log(__METHOD__.__LINE__.array2string($jsArray));
|
||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
echo json_encode(array_values(array_unique($results, SORT_REGULAR)));
|
echo json_encode(array_values($results));
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user