Bug 2324: Adding confirm dialog when undoing import
authorAleisha <aleishaamohia@hotmail.com>
Tue, 29 Mar 2016 01:40:35 +0000 (01:40 +0000)
committerBrendan Gallagher <bredan@bywatersolutions.com>
Wed, 27 Apr 2016 16:28:05 +0000 (16:28 +0000)
EDIT: Comment 3

To test:
1) Go to Tools -> Staged MARC Management
2) Click on a batch to see details
3) If not already imported, then import, otherwise you should already see the button to undo import into catalog.
4) Click this button. Confirm you are asked to confirm. Confirm clicking Cancel will cancel the undo. Confirm clicking OK will continue with the undo.

Sponsored-by: Catalyst IT
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt

index d06ff67..0108ed0 100644 (file)
@@ -38,6 +38,7 @@
 <script type="text/javascript">
 //<![CDATA[
 var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch?  This cannot be undone.");
+var MSG_CONFIRM_UNDO_IMPORT = _("Are you sure you want to undo the import of this batch into the catalog?");
 
 $(document).ready(function(){
   $("#staged-record-matching-rules select").change(function(){
@@ -363,7 +364,7 @@ $(document).ready(function(){
     <input type="hidden" name="runinbackground" value="" />
     <input type="hidden" name="completedJobID" value="" />
     <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
-    <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
+    <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return confirm(MSG_CONFIRM_UNDO_IMPORT) && submitBackgroundJob(this.form);" /></fieldset>
   </form>
   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
      <div id="jobfailed"></div></div>