Source
xxxxxxxxxx
* @param array $data['tasks'] List of tasks. Used to determine current problem status.
<?php declare(strict_types = 0);
/*
** 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/>.
**/
namespace Widgets\Problems\Includes;
use CButtonIcon,
CCol,
CColHeader,
CHintBoxHelper,
CIcon,
CLink,
CLinkAction,
CMacrosResolverHelper,
CMenuPopupHelper,
CRow,
CScreenProblem,
CSeverityHelper,
CSpan,
CTableInfo,
CUrl;
class WidgetProblems extends CTableInfo {
private array $data;
public function __construct(array $data) {
$this->data = $data;
parent::__construct();
}
private function build(): void {
$sort_div = (new CSpan())->addClass(
($this->data['sortorder'] === ZBX_SORT_DOWN) ? ZBX_STYLE_ARROW_DOWN : ZBX_STYLE_ARROW_UP
);
$show_timeline = ($this->data['sortfield'] === 'clock' && $this->data['fields']['show_timeline']);
$show_recovery_data = in_array($this->data['fields']['show'],
[TRIGGERS_OPTION_RECENT_PROBLEM, TRIGGERS_OPTION_ALL]
);
$header_time = (new CColHeader(($this->data['sortfield'] === 'clock')
? [_x('Time', 'compact table header'), $sort_div]
: _x('Time', 'compact table header')))->addStyle('width: 120px;');
$header = [];
if ($this->data['show_three_columns']) {
$header[] = new CColHeader();
$header[] = (new CColHeader())->addClass(ZBX_STYLE_CELL_WIDTH);
}