Source
if (this.data.creator_type == <?= ZBX_REPORT_CREATOR_TYPE_RECIPIENT ?> || this.data.creator_inaccessible) {
<?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
*/
?>
<script>
var row_num = 0;
var userids = new Set();
var usrgrpids = new Set();
var allowed_edit = <?= json_encode($data['allowed_edit']) ?>;
var ReportSubscription = class {
constructor(data, edit = null) {
this.data = data;
this.row = document.createElement('tr');
this.row.appendChild(this.createRecipientCell());
this.row.appendChild(this.createCreatorCell());
this.row.appendChild(this.createStatusCell());
this.row.appendChild(this.createActionCell());
this.render(edit);
row_num++;
}
render(edit) {
if (edit instanceof Element) {
if (this.data.recipientid != this.data.old_recipientid) {
if (this.data.recipient_type == <?= ZBX_REPORT_RECIPIENT_TYPE_USER ?>) {
userids
.add(this.data.recipientid)
.delete(this.data.old_recipientid);
}
else {
usrgrpids
.add(this.data.recipientid)
.delete(this.data.old_recipientid);
}
}
return edit.replaceWith(this.row);
}
return document
.querySelector('#subscriptions-table tbody')
.append(this.row);