Bug 23184: Don't select branches for export by default

This patch changes the include to require passing "selectall=1" to select all items

This include is only used in this page, so changes should not have side effects
git grep "branch-selector\.inc"

This patch also corrects a mismatch in the class names

To test:
1 - Browse to Tools->Export data
2 - Note all branches are selected
3 - Note this will exclude records wiuthout items if you click 'Export bibiographic records'
4 - Apply patch
5 - Visit page again
6 - Note no branches are selected by default
7 - Confirm 'Select all/Clear all' still work
8 - Note record with no items are exported by default now

Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-11-04 12:45:16 +00:00 committed by Martin Renvoize
parent 5cd071d66e
commit 2e310fa7f3
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 8 deletions

View File

@ -1,10 +1,4 @@
[%# First check to see if we have anything selected, otherwise we select all %]
[% selectall = 1 %]
[% FOREACH branch IN branches %]
[% IF branch.selected %]
[% selectall = 0 %]
[% END %]
[% END %]
[%# To select all include with selectall = 1 %]
<div class="branchselector">
<p><a href="#" id="checkall"> <i class="fa fa-check"></i> Select all</a> | <a href="#" id="checknone"> <i class="fa fa-remove"></i> Clear all</a></p>
<div class="branchgridrow">
@ -13,7 +7,7 @@
[% IF branch.selected || (selectall == 1) %]
<input id="branch_[% branch.branchcode | html %]" class="branch_select" type="checkbox" name="branch" value="[% branch.branchcode | html %]" checked="checked" />
[% ELSE %]
<input id="branch_[% branch.branchcode | html %]" class="branch-select" type="checkbox" name="branch" value="[% branch.branchcode | html %]" />
<input id="branch_[% branch.branchcode | html %]" class="branch_select" type="checkbox" name="branch" value="[% branch.branchcode | html %]" />
[% END %]
<label for="branch_[% branch.branchcode | html %]">[% branch.branchname | html %]</label>