Source
* @param bool $has_checkboxes True if this is block is represented in Problem view with checkboxes.
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* A class to display problems as a screen element.
*/
class CScreenProblem extends CScreenBase {
/**
* Data
*
* @var array
*/
public $data;
/**
* Init screen data.
*
* @param array $options
* @param array $options['data']
*/
public function __construct(array $options = []) {
parent::__construct($options);
$this->data = array_key_exists('data', $options) ? $options['data'] : null;
if ($this->data['filter']['show'] == TRIGGERS_OPTION_ALL) {
$this->data['filter']['from'] = $this->timeline['from_ts'];
$this->data['filter']['to'] = $this->timeline['to_ts'];
}
}
/**
* Get problems from "events" table.
*
* @param array $options
* @param array|null $options['groupids']
* @param array|null $options['hostids']
* @param array|null $options['objectids']
* @param string|null $options['eventid_till']
* @param int|null $options['time_from']
* @param int|null $options['time_till']
* @param array $options['severities'] (optional)
* @param bool $options['acknowledged'] (optional)
* @param array $options['tags'] (optional)
* @param int $options['limit']
*
* @return array
*/
private static function getDataEvents(array $options) {
return API::Event()->get([