Source
$data['form']['propagation_value_number'] !== null ? (int) $data['form']['propagation_value_number'] : null
<?php declare(strict_types = 0);
/*
** 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.
**/
/**
* @var CView $this
* @var array $data
*/
$form = (new CForm('post'))
->setId('service-form')
->setName('service_form')
->addItem(getMessages());
// Enable form submitting on Enter.
$form->addItem((new CInput('submit'))->addStyle('display: none;'));
// Service tab.
$parent_services = (new CMultiSelect([
'name' => 'parent_serviceids[]',
'object_name' => 'services',
'data' => CArrayHelper::renameObjectsKeys($data['form']['parents'], ['serviceid' => 'id']),
'custom_select' => true
]))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH);
$service_tab = (new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['form']['name'], false, DB::getFieldLength('services', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
new CLabel(_('Parent services'), 'parent_serviceids__ms'),
new CFormField($parent_services)
])
->addItem([
new CLabel(_('Problem tags')),
new CFormField(
(new CDiv([
(new CTable())
->setId('problem_tags')