Bug 18135: Show alert if no authorities selected in batch record deletion

To test:
1) Go to Tools -> Batch record deletion
2) Select Authorities as record type, put in an auth id, click Continue
3) Unselect the authorities and click Delete selected records
4) Confirm an alert shows up
5) Clear the alert and confirm deleting the authority still works as
normal

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: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 7a5f17ff6e)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
Aleisha Amohia 2017-02-16 22:19:59 +00:00 committed by Katrin Fischer
parent 3dedc5e4ba
commit e817334a06
1 changed files with 9 additions and 1 deletions

View File

@ -68,6 +68,14 @@ $(document).ready(function() {
return false;
}
});
$("#selectauths").on("submit",function(){
var checked = $("#selectauths").find("input[type='checkbox'][name='record_id']:checked").size();
if (checked == 0) {
alert(_("No authorities have been selected."));
return false;
}
});
});
//]]>
</script>
@ -190,7 +198,7 @@ $(document).ready(function() {
| <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
| <a id="clearlinkedtobiblio" href="#">Clear used authorities</a>
</div>
<form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post">
<form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectauths">
<table id="authorities" class="records">
<thead>
<tr>