Koha/koha-tmpl/intranet-tmpl/prog/en/includes/branch-selector.inc
Nick Clemens 2e310fa7f3
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>
2019-11-21 11:32:31 +00:00

21 lines
1 KiB
HTML

[%# 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">
[% FOREACH branch IN branches %]
<div class="branchgriditem">
[% 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 %]" />
[% END %]
<label for="branch_[% branch.branchcode | html %]">[% branch.branchname | html %]</label>
</div>
[% IF loop.count() % 4 == 0 && !loop.last() %]
</div>
<div class="branchgridrow">
[% END %]
[% END %]
</div>
</div>