diff options
author | Dace Petra <dace.petra@zabbix.com> | 2022-08-08 09:54:46 +0300 |
---|---|---|
committer | Dace Petra <dace.petra@zabbix.com> | 2022-08-08 09:54:46 +0300 |
commit | ae00fc5248e2d8aee87350da0d512c558e25a6e4 (patch) | |
tree | 4378ecf3c2c3934bf5766ce8e9842bdc1ceb9680 /ui/hostgroups.php | |
parent | c26a88d3fdbe0a9fb78e3be685e67632128629d1 (diff) |
..F....... [ZBX-21070] fixed missing discovery rule for a discovered host group and updated links to host prototype
Diffstat (limited to 'ui/hostgroups.php')
-rw-r--r-- | ui/hostgroups.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ui/hostgroups.php b/ui/hostgroups.php index f2b903c9cd6..dda4ccdee7a 100644 --- a/ui/hostgroups.php +++ b/ui/hostgroups.php @@ -236,6 +236,18 @@ if (hasRequest('form')) { $data['group'] = reset($groups); + $data['group']['is_discovery_rule_editable'] = false; + if ($data['group']['discoveryRule']) { + $data['group']['is_discovery_rule_editable'] = (bool) API::DiscoveryRule()->get([ + 'output' => [], + 'itemids' => $data['group']['discoveryRule']['itemid'], + 'editable' => true, + 'preservekeys' => true + ]); + } + + $data['allowed_ui_conf_hosts'] = CWebUser::checkAccess(CRoleHelper::UI_CONFIGURATION_HOSTS); + if (!hasRequest('form_refresh')) { $data['name'] = $data['group']['name']; } @@ -332,6 +344,15 @@ else { order_result($data['groups'], $sortField, $sortOrder); foreach ($data['groups'] as &$group) { + $group['is_discovery_rule_editable'] = false; + if ($group['discoveryRule']) { + $group['is_discovery_rule_editable'] = (bool) API::DiscoveryRule()->get([ + 'output' => [], + 'itemids' => $group['discoveryRule']['itemid'], + 'editable' => true, + 'preservekeys' => true + ]); + } order_result($group['hosts'], 'name'); order_result($group['templates'], 'name'); } |