Source
(new CTextBox('name', $data['name'], !$data['allowed_edit'], DB::getFieldLength('report', 'name')))
<?php
/*
** 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
*/
$form_grid = new CFormGrid();
$user_multiselect = (new CMultiSelect([
'name' => 'userid',
'object_name' => 'users',
'multiple' => false,
'readonly' => (CWebUser::getType() != USER_TYPE_SUPER_ADMIN) || !$data['allowed_edit'],
'data' => $data['ms_user'],
'popup' => [
'parameters' => [
'srctbl' => 'users',
'srcfld1' => 'userid',
'srcfld2' => 'fullname',
'dstfrm' => $data['form'],
'dstfld1' => 'userid'
]
],
'add_post_js' => false
]))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH);
$dashboard_multiselect = (new CMultiSelect([
'name' => 'dashboardid',
'object_name' => 'dashboard',
'multiple' => false,
'readonly' => !$data['allowed_edit'],
'data' => $data['ms_dashboard'],
'popup' => [
'parameters' => [
'srctbl' => 'dashboard',
'srcfld1' => 'dashboardid',
'dstfrm' => $data['form'],
'dstfld1' => 'dashboardid'
]
],
'add_post_js' => false
]))->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH);
$form_grid
->addItem([
(new CLabel(_('Owner'), 'userid_ms'))->setAsteriskMark(),
new CFormField($user_multiselect)
])