Sort Devices and Groups in Alert Rules 'map to' droplist (#10530)

* alphabetic order of Devices and Groups in Alert Rules
This commit is contained in:
SourceDoctor
2019-08-21 10:08:58 +02:00
committed by PipoCanaja
parent e7a86add93
commit 9e02040f05
2 changed files with 3 additions and 1 deletions

View File

@ -68,4 +68,6 @@ $devices = array_map(function ($device) {
$more = ($offset + count($devices)) < $total;
array_multisort(array_column($devices, 'text'), SORT_ASC, $devices);
return [$devices, $more];

View File

@ -50,7 +50,7 @@ if (!empty($_REQUEST['limit'])) {
}
$sql = "SELECT `id`, `name` AS `text` FROM `device_groups` $query";
$sql = "SELECT `id`, `name` AS `text` FROM `device_groups` $query order by `name`";
$groups = dbFetchRows($sql, $params);
$more = ($offset + count($groups)) < $total;