<?php declare(strict_types = 0);
this.readonly = readonly;
const usertype_select = document.getElementById('user-type');
if (usertype_select !== null) {
usertype_select.addEventListener('change', this.events.usertypeChange);
this.updateAccessUiElementsFieldsGroup(usertype_select.value);
.getElementById('api-access')
.addEventListener('change', this.events.apiaccessChange);
.getElementById('service-write-access')
.addEventListener('change', this.events.serviceWriteAccessChange);
this.updateServicesWriteAccessFields();
jQuery('#service_write_list_')
.multiSelect('getSelectButton')
.addEventListener('click', () => {
this.selectServiceAccessList(jQuery('#service_write_list_'));
.getElementById('service-read-access')
.addEventListener('change', this.events.serviceReadAccessChange);
this.updateServicesReadAccessFields();
jQuery('#service_read_list_')
.multiSelect('getSelectButton')
.addEventListener('click', () => {
this.selectServiceAccessList(jQuery('#service_read_list_'));
const clone_button = document.getElementById('clone');
if (clone_button !== null) {
clone_button.addEventListener('click', this.events.cloneClick);
updateAccessUiElementsFieldsGroup(user_type) {
const access_min = <?= json_encode([
CRoleHelper::UI_MONITORING_DASHBOARD => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_MONITORING_PROBLEMS => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_MONITORING_HOSTS => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_MONITORING_LATEST_DATA => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_MONITORING_MAPS => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_MONITORING_DISCOVERY => USER_TYPE_ZABBIX_ADMIN,
CRoleHelper::UI_SERVICES_SERVICES => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_SERVICES_SLA => USER_TYPE_ZABBIX_ADMIN,
CRoleHelper::UI_SERVICES_SLA_REPORT => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_INVENTORY_OVERVIEW => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_INVENTORY_HOSTS => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_REPORTS_SYSTEM_INFO => USER_TYPE_SUPER_ADMIN,
CRoleHelper::UI_REPORTS_AVAILABILITY_REPORT => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_REPORTS_TOP_TRIGGERS => USER_TYPE_ZABBIX_USER,
CRoleHelper::UI_REPORTS_AUDIT => USER_TYPE_SUPER_ADMIN,
CRoleHelper::UI_REPORTS_ACTION_LOG => USER_TYPE_SUPER_ADMIN,