diff --git a/footer.php b/footer.php index 30492039..2c178589 100644 --- a/footer.php +++ b/footer.php @@ -18,7 +18,7 @@ - + diff --git a/js/ticket_button_respond_note.js b/js/ticket_button_respond_note.js new file mode 100644 index 00000000..bbc2fd0c --- /dev/null +++ b/js/ticket_button_respond_note.js @@ -0,0 +1,19 @@ +// Ticket.php - Changes the wording of the "Respond" button to "Add note" if reply is not a public update (based on checkbox) + +// Get Internal/Public Checkbox +checkbox = document.getElementById('ticket_reply_type_checkbox'); + +// Get Respond button +respond = document.getElementById('ticket_add_reply'); + +// When checkbox is checked/unchecked, update button wording +checkbox.addEventListener('change', e => { + if (e.target.checked) { + // Public reply + respond.innerHTML = "Respond"; + + } else { + // Internal note + respond.innerHTML = "Add note"; + } +}); diff --git a/post.php b/post.php index 02ae6837..8a25ca7d 100644 --- a/post.php +++ b/post.php @@ -6658,7 +6658,7 @@ if(isset($_POST['add_ticket_reply'])){ // Logging mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket Reply', log_action = 'Create', log_description = '$session_name replied to ticket $ticket_prefix$ticket_number - $ticket_subject and was a $ticket_reply_type reply', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $ticket_reply_id"); - $_SESSION['alert_message'] = "Ticket $prefix$ticket_number has been updated with your reply and was $ticket_reply_type"; + $_SESSION['alert_message'] = "Ticket $ticket_prefix$ticket_number has been updated with your reply and was $ticket_reply_type"; header("Location: " . $_SERVER["HTTP_REFERER"]); diff --git a/ticket.php b/ticket.php index 05130d24..d2209355 100644 --- a/ticket.php +++ b/ticket.php @@ -309,14 +309,14 @@ if (isset($_GET['ticket_id'])) {