Source
elseif (hasRequest('action') && str_in_array(getRequest('action'), ['item.massenable', 'item.massdisable']) && hasRequest('group_itemid')) {
<?php
/*
** 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.
**/
require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/hosts.inc.php';
require_once dirname(__FILE__).'/include/items.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
$page['title'] = _('Configuration of items');
$page['file'] = 'items.php';
$page['scripts'] = ['multilineinput.js', 'items.js', 'class.tagfilteritem.js'];
require_once dirname(__FILE__).'/include/page_header.php';
$paramsFieldName = getParamFieldNameByType(getRequest('type', 0));
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = [
'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID.NOT_ZERO, 'isset({form}) && !isset({itemid})'],
'interfaceid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null, _('Interface')],
'itemid' => [T_ZBX_INT, O_NO, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'],
'name' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})',
_('Name')
],
'description' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'key' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})', _('Key')],
'master_itemid' => [T_ZBX_STR, O_OPT, null, null,
'(isset({add}) || isset({update})) && isset({type})'.
' && {type} == '.ITEM_TYPE_DEPENDENT,
_('Master item')
],
'delay' => [T_ZBX_TU, O_OPT, P_ALLOW_USER_MACRO, null,
'(isset({add}) || isset({update})) && isset({type})'.
' && ({type} != '.ITEM_TYPE_TRAPPER.' && {type} != '.ITEM_TYPE_SNMPTRAP.
' && {type} != '.ITEM_TYPE_DEPENDENT.
' && !({type} == '.ITEM_TYPE_ZABBIX_ACTIVE.
' && isset({key}) && strncmp({key}, "mqtt.get", 8) === 0))',
_('Update interval')
],
'delay_flex' => [T_ZBX_STR, O_OPT, P_ONLY_TD_ARRAY, null, null],
'history_mode' => [T_ZBX_INT, O_OPT, null, IN([ITEM_STORAGE_OFF, ITEM_STORAGE_CUSTOM]), null],
'history' => [T_ZBX_STR, O_OPT, null, null, '(isset({add}) || isset({update}))'.
' && isset({history_mode}) && {history_mode}=='.ITEM_STORAGE_CUSTOM,
_('History')
],