Source
schedule.querySelector(`input[name="schedule_periods[${element.value}]"]`).disabled = !element.checked;
<?php declare(strict_types = 0);
/*
** Zabbix
** 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 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
*/
?>
window.sla_edit_popup = {
excluded_downtime_template: null,
slaid: null,
create_url: null,
update_url: null,
delete_url: null,
overlay: null,
dialogue: null,
form: null,
footer: null,
init({slaid, service_tags, excluded_downtimes, create_url, update_url, delete_url}) {
this.initTemplates();
this.slaid = slaid;
this.create_url = create_url;
this.update_url = update_url;
this.delete_url = delete_url;
this.overlay = overlays_stack.getById('sla_edit');
this.dialogue = this.overlay.$dialogue[0];
this.form = this.overlay.$dialogue.$body[0].querySelector('form');
this.footer = this.overlay.$dialogue.$footer[0];
for (const excluded_downtime of excluded_downtimes) {
this.addExcludedDowntime(excluded_downtime);
}
// Update form field state according to the form data.
for (const element of document.querySelectorAll('#schedule_mode input[type="radio"')) {
element.addEventListener('change', () => this.update());
}