diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 3ed5dc78aa..35f79d3fd2 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -468,7 +468,7 @@ $document['title'] = $text['title-dashboard']; require_once "resources/header.php"; -//get the child groups +//get the dashboard groups $sql = "SELECT * FROM v_dashboard_groups as x, v_groups as g "; $sql .= "WHERE x.dashboard_uuid = :dashboard_uuid "; $sql .= "AND x.group_uuid = g.group_uuid "; @@ -477,9 +477,9 @@ unset ($sql, $parameters); //get the groups - $sql = "SELECT group_uuid, group_name FROM v_groups "; + $sql = "SELECT group_uuid, domain_uuid, group_name FROM v_groups "; $sql .= "WHERE (domain_uuid = :domain_uuid or domain_uuid is null)"; - $sql .= "ORDER by group_name asc "; + $sql .= "ORDER BY domain_uuid desc, group_name asc "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $groups = $database->execute($sql, $parameters, 'all'); unset ($sql, $parameters); @@ -779,7 +779,7 @@ if (!empty($field['group_name'])) { echo "\n"; echo " \n"; - echo $field['group_name'].((!empty($field['group_domain_uuid'])) ? "@".$_SESSION['domains'][$field['group_domain_uuid']]['domain_name'] : null); + echo $field['group_name'].((!empty($field['domain_uuid'])) ? "@".$_SESSION['domains'][$field['domain_uuid']]['domain_name'] : null); echo " \n"; if (permission_exists('dashboard_group_delete') || if_group("superadmin")) { echo " \n";