Source
&& ($data['host']['status'] == HOST_STATUS_MONITORED || $data['host']['status'] == HOST_STATUS_NOT_MONITORED)) {
<?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 CPartial $this
* @var array $data
*/
$item = $data['item'];
$readonly = $item['templated'] || $item['discovered'];
$formgrid = (new CFormGrid())
->addItem($item['parent_items']
? [
new CLabel(_('Parent items')),
(new CFormField($item['parent_items']))->addClass('js-parent-items')
]
: null
)
->addItem($item['discovered'] ? [
new CLabel(_('Discovered by')),
(new CFormField(
(new CLink($item['discoveryRule']['name']))
->setAttribute('data-action', 'item.prototype.edit')
->setAttribute('data-parent_discoveryid', $item['discoveryRule']['itemid'])
->setAttribute('data-itemid', $item['itemDiscovery']['parent_itemid'])
->setAttribute('data-context', $item['context'])
))->addClass('js-parent-items')
] : null)
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $item['name'], $readonly, DB::getFieldLength('items', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
new CLabel(_('Type'), 'label-type'),
new CFormField(
(new CSelect('type'))
->setId('type')
->setFocusableElementId('label-type')
->setValue($item['type'])
->addOptions(CSelect::createOptionsFromArray($data['types']))
->setReadonly($readonly)
)
])
->addItem([