<?php declare(strict_types = 0);
class CControllerScheduledReportList extends CController {
protected function init() {
$this->disableCsrfValidation();
protected function checkInput() {
'sortorder' => 'in '.ZBX_SORT_DOWN.','.ZBX_SORT_UP,
'filter_name' => 'string',
'filter_show' => 'in '.ZBX_REPORT_FILTER_SHOW_ALL.','.ZBX_REPORT_FILTER_SHOW_MY,
'filter_status' => 'in -1,'.implode(',', [ZBX_REPORT_STATUS_ENABLED, ZBX_REPORT_STATUS_DISABLED, ZBX_REPORT_STATUS_EXPIRED]),
$ret = $this->validateInput($fields);
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions() {
return $this->checkAccess(CRoleHelper::UI_REPORTS_SCHEDULED_REPORTS);
protected function doAction() {
$sort_field = $this->getInput('sort', CProfile::get('web.scheduledreport.list.sort', 'name'));
$sort_order = $this->getInput('sortorder', CProfile::get('web.scheduledreport.list.sortorder', ZBX_SORT_UP));
CProfile::update('web.scheduledreport.list.sort', $sort_field, PROFILE_TYPE_STR);
CProfile::update('web.scheduledreport.list.sortorder', $sort_order, PROFILE_TYPE_STR);
if ($this->hasInput('filter_set')) {
CProfile::update('web.scheduledreport.filter_name', $this->getInput('filter_name', ''), PROFILE_TYPE_STR);
CProfile::update('web.scheduledreport.filter_show',
$this->getInput('filter_show', ZBX_REPORT_FILTER_SHOW_ALL), PROFILE_TYPE_INT
CProfile::update('web.scheduledreport.filter_status', $this->getInput('filter_status', -1),