Source
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2023 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 CView $this
* @var array $data
*/
$this->addJsFile('class.tagfilteritem.js');
$this->addJsFile('class.calendar.js');
$this->includeJsFile('sla.list.js.php');
$filter = (new CFilter())
->addVar('action', 'sla.list')
->setResetUrl((new CUrl('zabbix.php'))->setArgument('action', 'sla.list'))
->setProfile('web.sla.list.filter')
->setActiveTab($data['active_tab'])
->addFilterTab(_('Filter'), [
(new CFormGrid())
->addClass(CFormGrid::ZBX_STYLE_FORM_GRID_LABEL_WIDTH_TRUE)
->addItem([
new CLabel(_('Name'), 'filter_name'),
new CFormField(
(new CTextBox('filter_name', $data['filter']['name']))
->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH)
)
])
->addItem([
new CLabel(_('Status')),
new CFormField(
(new CRadioButtonList('filter_status', (int) $data['filter']['status']))
->addValue(_('Any'), CSlaHelper::SLA_STATUS_ANY)
->addValue(_('Enabled'), CSlaHelper::SLA_STATUS_ENABLED)
->addValue(_('Disabled'), CSlaHelper::SLA_STATUS_DISABLED)
->setModern(true)
)
]),
(new CFormGrid())
->addClass(CFormGrid::ZBX_STYLE_FORM_GRID_LABEL_WIDTH_TRUE)
->addItem([
new CLabel(_('Service tags')),
new CFormField(
CTagFilterFieldHelper::getTagFilterField([
'evaltype' => $data['filter']['evaltype'],
'tags' => $data['filter']['tags'] ?: [
['tag' => '', 'value' => '', 'operator' => TAG_OPERATOR_LIKE]
]
])
)
])
]);
$form = (new CForm())
->setId('sla-list')
->setName('sla_list');
$view_url = (new CUrl('zabbix.php'))
->setArgument('action', 'sla.list')
->getUrl();
$header = [
$data['has_access'][CRoleHelper::ACTIONS_MANAGE_SLA]
? (new CColHeader(
(new CCheckBox('all_slas'))->onClick("checkAll('sla_list', 'all_slas', 'slaids');")
))->addClass(ZBX_STYLE_CELL_WIDTH)
: null,
make_sorting_header(_('Name'), 'name', $data['sort'], $data['sortorder'], $view_url)
->addStyle('width: 15%;'),
make_sorting_header(_('SLO'), 'slo', $data['sort'], $data['sortorder'], $view_url),
make_sorting_header(_('Effective date'), 'effective_date', $data['sort'], $data['sortorder'], $view_url),
new CColHeader(_('Reporting period')),
new CColHeader(_('Timezone')),