Source
'filter_status' => [T_ZBX_INT, O_OPT, null, IN([-1, MAINTENANCE_STATUS_ACTIVE, MAINTENANCE_STATUS_APPROACH, MAINTENANCE_STATUS_EXPIRED]), null],
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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.
**/
require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/hosts.inc.php';
require_once dirname(__FILE__).'/include/maintenances.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
$page['title'] = _('Configuration of maintenance periods');
$page['file'] = 'maintenance.php';
$page['scripts'] = ['class.calendar.js'];
require_once dirname(__FILE__).'/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = [
'hostids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'groupids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
// maintenance
'maintenanceid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'],
'maintenanceids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'mname' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Name')],
'maintenance_type' => [T_ZBX_INT, O_OPT, null, null, 'isset({add}) || isset({update})'],
'description' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'active_since' => [T_ZBX_ABS_TIME, O_OPT, null, NOT_EMPTY,
'isset({add}) || isset({update})', _('Active since')
],
'active_till' => [T_ZBX_ABS_TIME, O_OPT, null, NOT_EMPTY,
'isset({add}) || isset({update})', _('Active till')
],
'timeperiods' => [T_ZBX_STR, O_OPT, null, null, null],
'tags_evaltype' => [T_ZBX_INT, O_OPT, null, null, null],
'tags' => [T_ZBX_STR, O_OPT, null, null, null],
// actions
'action' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, IN('"maintenance.massdelete"'), null],
'add' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'update' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'clone' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'delete' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'cancel' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
// form
'form' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'form_refresh' => [T_ZBX_INT, O_OPT, null, null, null],
// filter
'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null],