From 4414f9bbafaa4143fb4e5f4d88bce30fe6fa9615 Mon Sep 17 00:00:00 2001 From: JediKev <kevin@enhancesoft.com> Date: Wed, 22 Aug 2018 10:08:07 -0500 Subject: [PATCH] issue: Duplicate Page Requests This addresses an issue where clicking Open, Post Reply, etc. more than once whilst creating/responding to a ticket will generate duplicate requests. This causes duplicate responses to be sent out or duplicate tickets being created. This adds jQuery, on both Agent and User side, to disable the submit buttons when the "Loading" popup appears so you cannot click the button more than once. --- js/osticket.js | 3 +++ scp/js/scp.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/js/osticket.js b/js/osticket.js index bd2f937e6..c88c925b8 100644 --- a/js/osticket.js +++ b/js/osticket.js @@ -45,6 +45,9 @@ $(document).ready(function(){ $('form').submit(function() { $(window).unbind('beforeunload'); + // Disable client-side Post Reply/Create Ticket buttons to help + // prevent duplicate POST + $(':submit', $(this)).attr('disabled', true); $('#overlay, #loading').show(); return true; }); diff --git a/scp/js/scp.js b/scp/js/scp.js index 27d8e6167..c6e6f3c87 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -163,6 +163,9 @@ var scp_prep = function() { $('form.save, form:has(table.list)').submit(function() { $(window).unbind('beforeunload'); + // Disable staff-side Post Reply/Open buttons to help prevent + // duplicate POST + $(':submit', $(this)).attr('disabled', true); $('#overlay, #loading').show(); return true; }); -- GitLab