@@ -, +, @@ - In the table of quotes, clicking the "ID" table header should trigger an alert, "Click on the quote's ide to select..." - Go to "Import quotes" and select a file to upload. - On the upload preview page you should see a new "Cancel import" button. Clicking it should return you to the quotes upload page after asking for confirmation. - Test the upload cancel button: - If you have fast reflexes or are uploading a file large enough, you should be able to see a "Cancel upload" button during the upload process. - Clicking this button should cancel the upload and return you to the quote upload page. --- .../prog/en/includes/quotes-upload-toolbar.inc | 3 ++- .../intranet-tmpl/prog/en/modules/tools/quotes-upload.tt | 14 +++++++++++--- koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt | 9 ++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/quotes-upload-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/quotes-upload-toolbar.inc @@ -1,4 +1,5 @@ --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt @@ -11,6 +11,14 @@ var oTable; //DataTable object $(document).ready(function() { + $("#cancel_upload").on("click",function(e){ + e.preventDefault(); + fnAbortRead(); + }); + $("#cancel_quotes").on("click",function(){ + return confirm( _("Are you sure you want to cancel this import?") ); + }); + // Credits: // FileReader() code copied and hacked from: // http://www.html5rocks.com/en/tutorials/file/dndfiles/ @@ -222,14 +230,14 @@ parent.location='quotes-upload.pl'; }; reader.onloadstart = function(e) { - $('#cancel_upload').css("visibility","visible"); + $('#cancel_upload').show(); $('#progress_bar').addClass("loading"); }; reader.onload = function(e) { // Ensure that the progress bar displays 100% at the end. progress.style.width = '100%'; progress.textContent = '100%'; - $('#cancel_upload').css("visibility","hidden"); + $('#cancel_upload').hide(); quotes = fnCSVToArray(e.target.result, ','); fnDataTable(quotes); } @@ -333,7 +341,7 @@ Upload quotes
- +
0%
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt @@ -8,7 +8,6 @@