Bug 11642: Add confirmation and tooltips to batch deletion tool
authorNick Clemens <nick@bywatersolutions.com>
Thu, 6 Jun 2019 15:16:35 +0000 (15:16 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 15 Jul 2019 11:42:55 +0000 (12:42 +0100)
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt

index 40aae31..0ba2d02 100644 (file)
         <br />
             [% IF patrons_to_delete.size %]
                 <fieldset><legend>What do you want to do for deleted patrons?</legend>
-                <input id="delete" type="radio" name="radio" value="delete" />
+                <input id="delete" type="radio" name="radio" value="delete" title="Delete patrons directly from the database, not recoverable"/>
                 <label for="delete">Permanently delete these patrons</label>
 
-                <br /><input id="trash" type="radio" name="radio" value="trash" />
+                <br /><input id="trash" type="radio" name="radio" value="trash" title="Move patrons to the deleted borrowers table, they can be deleted permanently by the cleanup_database script"/>
                 <label for="trash">Move these patrons to the trash</label>
 
                 <br /><input id="testrun" type="radio" name="radio" value="testrun" checked="checked" />
             $('#branch').change(function() {
                 $('#selectlibrary').submit();
             });
+            $("form[name='f2']").on('submit',function(){
+                if( $("#delete").attr("checked") ){
+                    if( !confirm(_("These patrons will be permanently removed from the database and cannot be recovered")) ){
+                        return false;
+                    }
+                }
+            });
         });
 
         /**