Source
<?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/>.
**/
class CControllerSlaReportList extends CController {
protected function init(): void {
$this->disableCsrfValidation();
}
/**
* @throws Exception
*/
protected function checkInput(): bool {
$fields = [
'filter_slaid' => 'id',
'filter_serviceid' => 'id',
'filter_date_from' => 'string',
'filter_date_to' => 'string',
'filter_set' => 'in 1',
'filter_rst' => 'in 1',
'page' => 'ge 1',
'sort' => 'in name',
'sortorder' => 'in '.ZBX_SORT_UP.','.ZBX_SORT_DOWN
];
$ret = $this->validateInput($fields);
if (!$ret) {
$this->setResponse(new CControllerResponseFatal());
}
return $ret;
}
protected function checkPermissions(): bool {
return $this->checkAccess(CRoleHelper::UI_SERVICES_SLA_REPORT);
}
/**
* @throws Exception
*/
protected function doAction(): void {
if ($this->hasInput('filter_set')) {
CProfile::update('web.slareport.list.filter.slaid', $this->getInput('filter_slaid', 0), PROFILE_TYPE_ID);
CProfile::update('web.slareport.list.filter.serviceid', $this->getInput('filter_serviceid', 0),
PROFILE_TYPE_ID
);
CProfile::update('web.slareport.list.filter.date_from', $this->getInput('filter_date_from', ''),
PROFILE_TYPE_STR
);