Source
foreach (array_slice($service['problem_events'], 0, $data['max_in_table']) as $problem_event) {
<?php declare(strict_types = 0);
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* @var CPartial $this
* @var array $data
*/
$form = (new CForm())
->cleanItems()
->setId('service-list')
->setName('service_list');
if ($data['is_filtered']) {
$path = null;
$header = [
(new CColHeader(_('Parent services')))->addStyle('width: 15%;'),
(new CColHeader(_('Name')))->addStyle('width: 10%;')
];
}
else {
$path = $data['path'];
if ($data['service'] !== null) {
$path[] = $data['service']['serviceid'];
}
$header = [
(new CColHeader(_('Name')))->addStyle('width: 25%;')
];
}
$table = (new CTableInfo())
->setHeader(array_merge($header, [
(new CColHeader(_('Status')))->addStyle('width: 14%;'),
(new CColHeader(_('Root cause')))->addStyle('width: 25%;'),
(new CColHeader(_('Created at')))->addStyle('width: 10%;'),
(new CColHeader(_('Tags')))->addClass(ZBX_STYLE_COLUMN_TAGS_3)
]));
foreach ($data['services'] as $serviceid => $service) {
$row = [];
if ($data['is_filtered']) {
$parents = [];