diff --git a/js/ticket_change_client.js b/js/ticket_change_client.js index dbb91a81..c3b553bc 100644 --- a/js/ticket_change_client.js +++ b/js/ticket_change_client.js @@ -3,16 +3,15 @@ */ // Modal loaded listener - populate client select -changeClientModalLoad = document.getElementById('clientChangeTicketModalLoad'); +const changeClientModalLoad = document.getElementById('clientChangeTicketModalLoad'); changeClientModalLoad.addEventListener('click', function() { populateChangeClientModal_Clients(); }) // Client selected listener - populate contact select // We seem to have to use jQuery to listen for events, as the client input is a select2 component? -clientSelectDropdown = document.getElementById("changeClientSelect"); +const clientSelectDropdown = document.getElementById("changeClientSelect"); $(clientSelectDropdown).on('select2:select', function (e) { - console.log("Fired contacts listener!!!!!!") let client_id = $(this).find(':selected').val(); populateChangeClientModal_Contacts(client_id); }); @@ -43,7 +42,7 @@ function populateChangeClientModal_Clients() { // Client dropdown already defined in listeners as clientSelectDropdown // Clear dropdown - var i, L = clientSelectDropdown.options.length -1; + let i, L = clientSelectDropdown.options.length - 1; for (i = L; i >= 0; i--) { clientSelectDropdown.remove(i); } @@ -76,10 +75,10 @@ function populateChangeClientModal_Contacts(client_id) { const contacts = response.contacts; // Contacts dropdown - var contactSelectDropdown = document.getElementById("changeContactSelect"); + const contactSelectDropdown = document.getElementById("changeContactSelect"); // Clear Category dropdown - var i, L = contactSelectDropdown.options.length -1; + let i, L = contactSelectDropdown.options.length - 1; for (i = L; i >= 0; i--) { contactSelectDropdown.remove(i); } diff --git a/post.php b/post.php index 8517f256..053a619d 100644 --- a/post.php +++ b/post.php @@ -6515,7 +6515,7 @@ if(isset($_POST['change_client_ticket'])){ mysqli_query($mysqli, "UPDATE tickets SET ticket_client_id = $client_id, ticket_contact_id = $contact_id WHERE ticket_id = $ticket_id LIMIT 1"); //Logging - mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket Reply', log_action = 'Modify', log_description = '$session_name modified ticket - client changed', 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_id"); + mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket Reply', log_action = 'Modify', log_description = '$session_name modified ticket - client changed', 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_id"); $_SESSION['alert_message'] = "Ticket client updated"; diff --git a/ticket.php b/ticket.php index 2f29e2f2..8aa1586c 100644 --- a/ticket.php +++ b/ticket.php @@ -651,10 +651,10 @@ if (isset($_GET['ticket_id'])) {
- +
-