diff --git a/ui/app/controllers/CControllerNotificationsGet.php b/ui/app/controllers/CControllerNotificationsGet.php index 97d2c75d8c0..2ac8f899571 100644 --- a/ui/app/controllers/CControllerNotificationsGet.php +++ b/ui/app/controllers/CControllerNotificationsGet.php @@ -92,7 +92,7 @@ class CControllerNotificationsGet extends CController { 'sortorder' => ZBX_SORT_DOWN, 'sortfield' => 'eventid', 'limit' => 15, - 'preservekeys' => true, + 'preservekeys' => true ]; $options += $this->settings['show_recovered'] diff --git a/ui/app/controllers/CControllerPopupAcknowledgeCreate.php b/ui/app/controllers/CControllerPopupAcknowledgeCreate.php index 027ec154060..06a2b984583 100644 --- a/ui/app/controllers/CControllerPopupAcknowledgeCreate.php +++ b/ui/app/controllers/CControllerPopupAcknowledgeCreate.php @@ -62,7 +62,7 @@ class CControllerPopupAcknowledgeCreate extends CController { private $unsuppress; /** - * @var bool + * @var int */ private $suppress_until; @@ -367,9 +367,9 @@ class CControllerPopupAcknowledgeCreate extends CController { * @param string $events[]['eventid'] Event ID. * @param string $events[]['objectid'] Trigger ID that has generated particular event. * @param string $events[]['r_eventid'] Recovery event ID. - * @param string $events[]['acknowledged'] Array containing previously performed actions. + * @param string $events[]['acknowledged'] Indicates if event is acknowledged. * @param array $editable_triggers[] Arrays containing editable trigger IDs as keys. - * @param string $editable_triggers[]['manual_close'] Trigger's manual_close configuration. + * @param int $editable_triggers[]['manual_close'] Trigger's manual_close configuration. * * @param array */ @@ -423,7 +423,7 @@ class CControllerPopupAcknowledgeCreate extends CController { * @param array $event['acknowledges'] List of problem updates. * @param string $event['acknowledges'][]['action'] Action performed in update. * @param array $editable_triggers[] List of editable triggers. - * @param string $editable_triggers[]['manual_close'] Trigger's manual_close configuration. + * @param int $editable_triggers[]['manual_close'] Trigger's manual_close configuration. * * @return bool */ diff --git a/ui/include/events.inc.php b/ui/include/events.inc.php index 5548e3d25c3..d8a45fa5798 100644 --- a/ui/include/events.inc.php +++ b/ui/include/events.inc.php @@ -817,7 +817,7 @@ function validateEventRankChangeToSymptom(array $eventids, string $cause_eventid $dst_event = $events[$cause_eventid]; - foreach ($eventids as $eventid => $foo) { + foreach (array_keys($eventids) as $eventid) { $event = $events[$eventid]; // Given cause is being moved. diff --git a/ui/js/menupopup.js b/ui/js/menupopup.js index e61fa5f5ca4..ecafddac998 100644 --- a/ui/js/menupopup.js +++ b/ui/js/menupopup.js @@ -833,7 +833,7 @@ function getMenuPopupTrigger(options, trigger_element) { fetch(curl.getUrl(), { method: 'POST', - headers: {'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'}, + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, body: urlEncodeData({ eventids: [options.eventid], change_rank: ZBX_PROBLEM_UPDATE_RANK_TO_CAUSE @@ -849,7 +849,7 @@ function getMenuPopupTrigger(options, trigger_element) { true )); } - else if('success' in response) { + else if ('success' in response) { addMessage(makeMessageBox('good', [], response.success.title, true, false)); $.publish('event.rank_change'); @@ -879,7 +879,7 @@ function getMenuPopupTrigger(options, trigger_element) { fetch(curl.getUrl(), { method: 'POST', - headers: {'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'}, + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, body: urlEncodeData({ eventids: options.eventids, cause_eventid: options.eventid, @@ -896,7 +896,7 @@ function getMenuPopupTrigger(options, trigger_element) { true )); } - else if('success' in response) { + else if ('success' in response) { addMessage(makeMessageBox('good', [], response.success.title, true, false)); const uncheckids = Object.keys(chkbxRange.getSelectedIds()); diff --git a/ui/widgets/problems/actions/WidgetView.php b/ui/widgets/problems/actions/WidgetView.php index 93cd0bcfa63..8f6227d1120 100644 --- a/ui/widgets/problems/actions/WidgetView.php +++ b/ui/widgets/problems/actions/WidgetView.php @@ -95,9 +95,9 @@ class WidgetView extends CControllerDashboardWidgetView { if ($problem['cause_eventid'] == 0) { $options = [ + 'countOutput' => true, 'filter' => ['cause_eventid' => $problem['eventid']], - 'limit' => $search_limit, - 'countOutput' => true + 'limit' => $search_limit ]; $problem['symptom_count'] = ($this->fields_values['show'] == TRIGGERS_OPTION_ALL) @@ -141,7 +141,7 @@ class WidgetView extends CControllerDashboardWidgetView { $data['correlations'] += $symptom_data['correlations']; foreach ($symptom_data['actions'] as $key => $actions) { - $data['actions'][$key] += $symptom_data['actions'][$key]; + $data['actions'][$key] += $actions; } if ($symptom_data['triggers']) { diff --git a/ui/widgets/problems/assets/js/class.widget.js b/ui/widgets/problems/assets/js/class.widget.js index 707025f4178..17c15707f29 100644 --- a/ui/widgets/problems/assets/js/class.widget.js +++ b/ui/widgets/problems/assets/js/class.widget.js @@ -21,18 +21,16 @@ class CWidgetProblems extends CWidget { // Must be synced with PHP ZBX_STYLE_BTN_WIDGET_EXPAND; - static ZBX_STYLE_BTN_WIDGET_EXPAND; + static ZBX_STYLE_BTN_WIDGET_EXPAND = 'btn-widget-expand'; // Must be synced with PHP ZBX_STYLE_BTN_WIDGET_COLLAPSE; - static ZBX_STYLE_BTN_WIDGET_COLLAPSE; + static ZBX_STYLE_BTN_WIDGET_COLLAPSE = 'btn-widget-collapse'; _init() { super._init(); this._has_contents = false; this._opened_eventids = []; - this.ZBX_STYLE_BTN_WIDGET_EXPAND = 'btn-widget-expand'; - this.ZBX_STYLE_BTN_WIDGET_COLLAPSE = 'btn-widget-collapse'; } _registerEvents() { diff --git a/ui/widgets/problems/views/widget.view.php b/ui/widgets/problems/views/widget.view.php index f3637c08349..e151bcc7a8b 100644 --- a/ui/widgets/problems/views/widget.view.php +++ b/ui/widgets/problems/views/widget.view.php @@ -81,9 +81,9 @@ $table = (new CTableInfo()) ($data['fields']['show_opdata'] == OPERATIONAL_DATA_SHOW_SEPARATELY) ? _x('Operational data', 'compact table header') : null, - _x('Duration', 'compact table header'), - _x('Ack', 'compact table header'), - _x('Actions', 'compact table header'), + _x('Duration', 'compact table header'), + _x('Ack', 'compact table header'), + _x('Actions', 'compact table header'), $data['fields']['show_tags'] ? _x('Tags', 'compact table header') : null ]));