Bug 16337 - Remove the use of "onclick" from the stage MARC records template
authorOwen Leonard <oleonard@myacpl.org>
Mon, 25 Apr 2016 01:11:52 +0000 (21:11 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 16:43:55 +0000 (16:43 +0000)
This patch reviseds the stage MARC records template, removing "onclick"
attributes from the markup and defining those events in the script.

To test, apply the patch and go to Tools -> Stage MARC records for
import.

- Select a MARC file for import.
- Click the "Upload file" button. Your upload should be processed
  correctly.
- Select a MARC file for import.
- Click the "Upload file" button.
- Click the "Cancel" button before the file has been uploaded. The
  upload should be cancelled.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt

index b55d685..af24281 100644 (file)
@@ -23,6 +23,14 @@ $(document).ready(function(){
             $('#items').show();
         }
     });
+    $("#fileuploadbutton").on("click",function(e){
+        e.preventDefault();
+        StartUpload();
+    });
+    $("#fileuploadcancel").on("click",function(e){
+        e.preventDefault();
+        CancelUpload();
+    });
 });
 function CheckForm(f) {
     if ($("#fileToUpload").value == '') {
@@ -137,8 +145,8 @@ function cbUpload( status, fileid ) {
         </div> </li>
 </ol>
     <fieldset class="action">
-        <button id="fileuploadbutton" onclick="StartUpload(); return false;">Upload file</button>
-        <button id="fileuploadcancel" onclick="CancelUpload(); return false;">Cancel</button>
+        <button id="fileuploadbutton">Upload file</button>
+        <button id="fileuploadcancel">Cancel</button>
     </fieldset>
 </fieldset>