Source
<?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 CView $this
*/
?>
window.update_problem_popup = new class {
init() {
this.problem_suppressible = !document.getElementById('suppress_problem').disabled;
this.problem_unsuppressible = !document.getElementById('unsuppress_problem').disabled;
document
.getElementById('suppress_problem')
.addEventListener('change', () => {
this._update();
});
document
.getElementById('suppress_time_option')
.addEventListener('change', () => {
this._update();
});
document
.getElementById('unsuppress_problem')
.addEventListener('change', () => {
this._update();
});
document
.getElementById('close_problem')
.addEventListener('change', () => {
this._update();
});
}
_update() {
const suppress_checked = document.getElementById('suppress_problem').checked;
const unsuppress_checked = document.getElementById('unsuppress_problem').checked;
const close_problem_checked = document.getElementById('close_problem').checked;
this._update_suppress_problem_state(close_problem_checked || unsuppress_checked);
this._update_unsuppress_problem_state(close_problem_checked || suppress_checked);
this._update_suppress_time_options();
}
_update_suppress_problem_state(state) {
if (this.problem_suppressible) {