From 9e02040f058b583e2d3b542a808b9b700862c188 Mon Sep 17 00:00:00 2001 From: SourceDoctor Date: Wed, 21 Aug 2019 10:08:58 +0200 Subject: [PATCH] Sort Devices and Groups in Alert Rules 'map to' droplist (#10530) * alphabetic order of Devices and Groups in Alert Rules --- includes/html/list/devices.inc.php | 2 ++ includes/html/list/groups.inc.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/html/list/devices.inc.php b/includes/html/list/devices.inc.php index 8b1d3b9dc6..46d8306b1a 100644 --- a/includes/html/list/devices.inc.php +++ b/includes/html/list/devices.inc.php @@ -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]; diff --git a/includes/html/list/groups.inc.php b/includes/html/list/groups.inc.php index b1bd7f9990..a511c8c835 100644 --- a/includes/html/list/groups.inc.php +++ b/includes/html/list/groups.inc.php @@ -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;