Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit 02769ac

Browse files
committed
added actions column
1 parent dc0c966 commit 02769ac

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

actions/GeomapViewAction.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function getHostsProblemsTables(array $hosts) {
5050

5151
$problems = API::Problem()->get([
5252
'output' => ['eventid', 'r_eventid', 'objectid', 'clock', 'ns', 'name', 'acknowledged', 'severity'],
53-
'selectAcknowledges' => ['action'],
53+
'selectAcknowledges' => ['userid', 'clock', 'message', 'action', 'old_severity', 'new_severity'],
5454
'hostids' => array_keys($hostids_problems),
5555
'source' => EVENT_SOURCE_TRIGGERS,
5656
'object' => EVENT_OBJECT_TRIGGER,
@@ -90,6 +90,16 @@ protected function getHostsProblemsTables(array $hosts) {
9090
'acknowledge' => CWebUser::checkAccess(CRoleHelper::ACTIONS_ACKNOWLEDGE_PROBLEMS),
9191
'close' => CWebUser::checkAccess(CRoleHelper::ACTIONS_CLOSE_PROBLEMS)
9292
];
93+
$actions = getEventsActionsIconsData($problems, $triggers);
94+
$users = [];
95+
96+
if ($actions['userids']) {
97+
$users = API::User()->get([
98+
'output' => ['username', 'surname', 'name'],
99+
'userids' => array_keys($actions['userids']),
100+
'preservekeys' => true
101+
]);
102+
}
93103

94104
foreach ($hostids_problems as $hostid => $problems) {
95105
if (!array_key_exists($hostid, $hostids_tables)) {
@@ -147,7 +157,7 @@ protected function getHostsProblemsTables(array $hosts) {
147157
CSeverityHelper::makeSeverityCell((int) $problem['severity'], $problem['name']),
148158
zbx_date2age($problem['clock']),
149159
$problem_update_link,
150-
''
160+
makeEventActionsIcons($problem['eventid'], $actions['data'], $users),
151161
]);
152162
}
153163
}

0 commit comments

Comments
 (0)