Source
elseif (hasRequest('action') && str_in_array(getRequest('action'), ['action.massenable', 'action.massdisable']) && hasRequest('g_actionid')) {
<?php
/*
** 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.
**/
require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
require_once dirname(__FILE__).'/include/actions.inc.php';
require_once dirname(__FILE__).'/include/triggers.inc.php';
$page['title'] = _('Configuration of actions');
$page['file'] = 'actionconf.php';
$page['scripts'] = ['popup.condition.common.js', 'popup.operation.common.js'];
require_once dirname(__FILE__).'/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = [
'actionid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'],
'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})',
_('Name')
],
'eventsource' => [T_ZBX_INT, O_OPT, P_SYS,
IN([EVENT_SOURCE_TRIGGERS, EVENT_SOURCE_DISCOVERY,
EVENT_SOURCE_AUTOREGISTRATION, EVENT_SOURCE_INTERNAL,
EVENT_SOURCE_SERVICE
]),
null
],
'evaltype' => [T_ZBX_INT, O_OPT, null,
IN([CONDITION_EVAL_TYPE_AND_OR, CONDITION_EVAL_TYPE_AND,
CONDITION_EVAL_TYPE_OR, CONDITION_EVAL_TYPE_EXPRESSION
]),
'isset({add}) || isset({update})'
],
'formula' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'esc_period' => [T_ZBX_STR, O_OPT, null, null, null, _('Default operation step duration')],
'status' => [T_ZBX_INT, O_OPT, null, IN([ACTION_STATUS_ENABLED, ACTION_STATUS_DISABLED]),
null
],
'g_actionid' => [T_ZBX_INT, O_OPT, P_ONLY_ARRAY, DB_ID, null],
'conditions' => [null, O_OPT, P_ONLY_TD_ARRAY, null, null],
'new_condition' => [null, O_OPT, P_ONLY_ARRAY, null, 'isset({add_condition})'],
'operations' => [null, O_OPT, P_ONLY_TD_ARRAY, null, null],
'edit_operationid' => [T_ZBX_STR, O_OPT, P_ACT, null, null],
'new_operation' => [null, O_OPT, P_ONLY_ARRAY, null, null],
'recovery_operations' => [null, O_OPT, P_ONLY_TD_ARRAY, null, null],
'edit_recovery_operationid' => [T_ZBX_STR, O_OPT, P_ACT, null, null],
'new_recovery_operation' => [null, O_OPT, P_ONLY_ARRAY, null, null],
'update_operations' => [null, O_OPT, P_ONLY_TD_ARRAY, null, null],
'edit_update_operationid' => [T_ZBX_STR, O_OPT, P_ACT, null, null],
'new_update_operation' => [null, O_OPT, P_ONLY_ARRAY, null, null],
'opconditions' => [null, O_OPT, P_ONLY_ARRAY, null, null],
// actions
'action' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT,
IN('"action.massdelete","action.massdisable","action.massenable"'),
null
],
'add_condition' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'cancel_new_condition' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'add_operation' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'add_recovery_operation' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'add_update_operation' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'pause_suppressed' => [T_ZBX_STR, O_OPT, null,
IN([ACTION_PAUSE_SUPPRESSED_FALSE, ACTION_PAUSE_SUPPRESSED_TRUE]),
null,
_('Pause operations for suppressed problems')
],
'notify_if_canceled' => [T_ZBX_STR, O_OPT, null,
IN([ACTION_NOTIFY_IF_CANCELED_FALSE, ACTION_NOTIFY_IF_CANCELED_TRUE]),
null,
_('Notify about canceled escalations')
],
'add' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'update' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],
'delete' => [T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null],