@@ -, +, @@ usability - Add "select all/clear all" links for the checkboxes - Add a "remove selected" to the top of the table (see also Lists) - Split functionality of add from from delete form - Hide "Add patrons" button until at least one patron has been selected - Remove non-standard trash can icon from table's checkbox column - Exclude checkbox column from table sorting - Add confirmation to deletion actions - Improve breadcrumb specificity - Add title-string sorting to date column to accommodate sorting for all date format types trigger the display of an "Add patrons" button. correctly. existing patron. Click "Add patrons" and confirm that no patron is removed. should be prompted to confirm your choice. 4.a. Click cancel and confirm that the deletion process aborts. 4.b. Click OK and confirm that the deletion process completes. page. name. table sorting by date is correct in both cases. --- .../intranet-tmpl/prog/en/css/staff-global.css | 2 +- .../prog/en/modules/patron_lists/list.tt | 74 ++++++++++++++++---- 2 files changed, 62 insertions(+), 14 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1441,7 +1441,7 @@ li.email { background-color : #E6F0F2; font-size : 80%; margin : 0 0 .5em -1px; - padding : .1em 0 .4em 1em; + padding : .4em 0 .4em 1em; border-radius : 5px 5px 0 0; border : 1px solid #B9D8D9; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -1,6 +1,6 @@ [% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Tools › Patron lists › New list +Koha › Tools › Patron lists › [% list.name %] › Add patrons [% INCLUDE 'doc-head-close.inc' %] @@ -11,7 +11,14 @@ $(document).ready(function() { $('#patrons_to_add_fieldset').hide(); - $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults)); + $('#patron-list-table').dataTable($.extend(true, {}, dataTablesDefaults, { + "aoColumns": [ + null,null,null,null,null,null,null,{ "sType": "title-string" },null + ], + "aoColumnDefs": [ + { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, + ] + } )); $( "#find_patron" ).autocomplete({ source: "/cgi-bin/koha/circ/ysearch.pl", @@ -34,6 +41,36 @@ $(document).ready(function() { var cardnumber = divid.replace("borrower_",""); RemovePatron(cardnumber); }); + + var checkBoxes = $("input[type='checkbox']","#patron-list-table"); + + $("#CheckAll").click(function(e){ + e.preventDefault(); + checkBoxes.each(function(){ + $(this).prop("checked",1); + }); + }); + $("#CheckNone").click(function(e){ + e.preventDefault(); + checkBoxes.each(function(){ + $(this).prop("checked",0); + }); + }); + + $("#remove_patrons").submit(function(){ + var checkedItems = $("input:checked"); + if ($(checkedItems).size() == 0) { + alert(_("You must select one or more patrons to remove")); + return false; + } + $(checkedItems).parents('tr').addClass("warn"); + if( confirm(_("Are you sure you want to remove the selected patrons?")) ) { + return true; + } else { + $(checkedItems).parents('tr').removeClass("warn"); + return false; + } + }); }); function AddPatron( name, cardnumber ) { @@ -60,13 +97,13 @@ function RemovePatron( cardnumber ) { [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +

[% list.name %]

-
+
Add patrons @@ -77,21 +114,33 @@ function RemovePatron( cardnumber ) {
Patrons to be added
+ +
+ + + Cancel +
+
+ +
-

- - Cancel -

+
+ Select all | + Clear all | +
+ +
+
- + - + @@ -121,7 +170,7 @@ function RemovePatron( cardnumber ) { - + [% END %] @@ -129,8 +178,7 @@ function RemovePatron( cardnumber ) {
  CardFirstnameFirst name Surname Address Category [% p.borrowernumber.categorycode.description %] ([% p.borrowernumber.categorycode.categorycode %]) [% p.borrowernumber.branchcode.branchname %][% p.borrowernumber.dateexpiry | $KohaDates %][% p.borrowernumber.dateexpiry | $KohaDates %] [% p.borrowernumber.borrowernotes %]
- - Cancel +
--