Source
(new CLabel([_s('%1$s group pattern', $source), $name_hint_icon], 'group_pattern'))->setAsteriskMark(),
<?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
* @var array $data
*/
$form_action = (new CUrl('zabbix.php'))
->setArgument('action', 'popup.usergroupmapping.check')
->getUrl();
$form = (new CForm('post', $form_action))
->setId('user-group-mapping-edit-form')
->setName('user-group-mapping-edit-form');
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$usergroup_multiselect = (new CMultiSelect([
'name' => 'user_groups[]',
'object_name' => 'usersGroups',
'multiple' => true,
'data' => $data['user_groups'],
'popup' => [
'parameters' => [
'srctbl' => 'usrgrp',
'srcfld1' => 'usrgrpid',
'srcfld2' => 'name',
'dstfrm' => $form->getName(),
'dstfld1' => 'user_groups_'
]
]
]))
->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH);
$inline_js = $usergroup_multiselect->getPostJS();
$user_role_multiselect = (new CMultiSelect([
'name' => 'roleid',
'object_name' => 'roles',
'data' => $data['user_role'],
'multiple' => false,
'popup' => [
'parameters' => [
'srctbl' => 'roles',
'srcfld1' => 'roleid',
'dstfrm' => $form->getName(),
'dstfld1' => 'roleid'
]
]