mirror of https://github.com/itflow-org/itflow
Add the ability to delete a ticket watcher
This commit is contained in:
parent
a9d49c9785
commit
a9dfc0d5fe
|
|
@ -278,6 +278,21 @@ if (isset($_POST['edit_ticket_watchers'])) {
|
|||
|
||||
}
|
||||
|
||||
if (isset($_GET['delete_ticket_watcher'])) {
|
||||
|
||||
validateTechRole();
|
||||
|
||||
$watcher_id = intval($_GET['delete_ticket_watcher']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM ticket_watchers WHERE watcher_id = $watcher_id");
|
||||
|
||||
|
||||
$_SESSION['alert_message'] = "You <b>removed</b> a ticket watcher";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if (isset($_POST['edit_ticket_asset'])) {
|
||||
|
||||
validateTechRole();
|
||||
|
|
|
|||
|
|
@ -600,10 +600,15 @@ if (isset($_GET['ticket_id'])) {
|
|||
// Get Watchers
|
||||
$sql_ticket_watchers = mysqli_query($mysqli, "SELECT * FROM ticket_watchers WHERE watcher_ticket_id = $ticket_id ORDER BY watcher_email DESC");
|
||||
while ($ticket_watcher_row = mysqli_fetch_array($sql_ticket_watchers)) {
|
||||
$watcher_id = intval($ticket_watcher_row['watcher_id']);
|
||||
$ticket_watcher_email = nullable_htmlentities($ticket_watcher_row['watcher_email']);
|
||||
?>
|
||||
<div class='mt-1'>
|
||||
<i class="fa fa-fw fa-eye text-secondary ml-1 mr-2"></i><?php echo $ticket_watcher_email; ?>
|
||||
<a class="confirm-link"
|
||||
href="post.php?delete_ticket_watcher=<?php echo $watcher_id; ?>">
|
||||
<i class="fas fa-fw fa-times text-secondary ml-1"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue