mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-09 01:24:07 +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
a97e34c29a
commit
9540d1f941
@ -3749,9 +3749,19 @@ class mail_compose
|
||||
// switch regular JSON response handling off
|
||||
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));
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user