Source
(new CVisibilityBox('visible[ipmi_privilege]', 'ipmi_privilege', _('Original')))->setLabel(_('Privilege level')),
<?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/>.
**/
/**
* @var CView $this
*/
// create form
$form = (new CForm())
->addItem((new CVar(CSRF_TOKEN_NAME, CCsrfTokenHelper::get('host')))->removeId())
->setId('massupdate-form')
->addVar('action', 'popup.massupdate.host')
->addVar('hostids', $data['hostids'], 'ids')
->addVar('tls_accept', HOST_ENCRYPTION_NONE)
->addVar('update', '1')
->addVar('location_url', $data['location_url'])
->disablePasswordAutofill();
$host_tab = new CFormList('hostFormList');
$host_tab->addRow(
(new CVisibilityBox('visible[templates]', 'linked-templates-field', _('Original')))
->setLabel(_('Link templates'))
->setAttribute('autofocus', 'autofocus'),
(new CDiv([
(new CRadioButtonList('mass_action_tpls', ZBX_ACTION_ADD))
->addValue(_('Link'), ZBX_ACTION_ADD)
->addValue(_('Replace'), ZBX_ACTION_REPLACE)
->addValue(_('Unlink'), ZBX_ACTION_REMOVE)
->setModern(true)
->addStyle('margin-bottom: 5px;'),
(new CMultiSelect([
'name' => 'templates[]',
'object_name' => 'templates',
'data' => [],
'popup' => [
'parameters' => [
'srctbl' => 'templates',
'srcfld1' => 'hostid',
'srcfld2' => 'host',
'dstfrm' => $form->getName(),
'dstfld1' => 'templates_'
]
]
]))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->addStyle('margin-bottom: 5px;'),
(new CList())
->addClass(ZBX_STYLE_LIST_CHECK_RADIO)
->addItem((new CCheckBox('mass_clear_tpls'))->setLabel(_('Clear when unlinking')))
]))->setId('linked-templates-field')
);
$host_tab->addRow(
(new CVisibilityBox('visible[groups]', 'groups-field', _('Original')))->setLabel(_('Host groups')),
(new CDiv([
(new CRadioButtonList('mass_update_groups', ZBX_ACTION_ADD))
->addValue(_('Add'), ZBX_ACTION_ADD)
->addValue(_('Replace'), ZBX_ACTION_REPLACE)
->addValue(_('Remove'), ZBX_ACTION_REMOVE)
->setModern(true)
->addStyle('margin-bottom: 5px;'),
(new CMultiSelect([
'name' => 'groups[]',
'object_name' => 'hostGroup',
'add_new' => (CWebUser::getType() == USER_TYPE_SUPER_ADMIN),
'data' => [],
'popup' => [
'parameters' => [
'srctbl' => 'host_groups',
'srcfld1' => 'groupid',
'dstfrm' => $form->getName(),
'dstfld1' => 'groups_',
'editable' => true
]
]
]))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
]))->setId('groups-field')