Bug 23206: Batch patron modification from reports which return cardnumber

This patch adds an option to submit patron card numbers from report
results to the batch patron modification tool.

As with a report which returns biblionumbers or itemnumbers, a button
appears at the top of report results which triggers a menu of batch
operation options.

To test, apply the patch and create a report which includes patron card
number in the results.

 - Run the report and confirm that under the "Batch operations" button
   a batch patron modification menu item appears.
   - Confirm that selecting this option sends the correct patrons to the
     batch patron modification tool.
 - Test also with a report which returns both patron cardnumber and
   biblionumber or itemnumber.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: George <george@nekls.org>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-06-25 16:47:42 +00:00 committed by Martin Renvoize
parent 68f128939b
commit b5e03a8e2b
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 17 additions and 1 deletions

View File

@ -788,7 +788,14 @@ canned reports and writing custom SQL reports.</p>
[% END %]
</form>
[% IF ( batch_biblionumbers || batch_itemnumbers ) %]
<form method="POST" action="/cgi-bin/koha/tools/modborrowers.pl" id="batch_patron_modification">
<input type="hidden" name="op" value="show" />
[% # Preserve the whitespace of the following textarea in order to format the values correctly %]
<textarea style="display:none" name="cardnumberlist" id="cardnumberlist">[% FOREACH result IN results %][% FOREACH cells IN result.cells %][% place = loop.index %][% IF header_row.$place.cell == 'cardnumber' %][% SET batch_cardnumbers = 1 %]
[% cells.cell | html %][% END %][% END %][% END %]</textarea>
</form>
[% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %]
<p>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="batch_mod_menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
@ -821,6 +828,15 @@ canned reports and writing custom SQL reports.</p>
<a href="#" data-submit="batch_item_deletion" data-toggle="tooltip" data-placement="right" title="Send visible items to batch item deletion" class="batch_op send_to_item_del">Batch item deletion</a>
</li>
[% END %]
[% IF header_ro.cell == 'cardnumber' %]
[% IF ( batch_biblionumbers || batch_itemnumbers ) %]
<li role="separator" class="divider"></li>
[% END %]
<li class="dropdown-header">Patron records</li>
<li>
<a href="#" data-submit="batch_patron_modification" data-toggle="tooltip" data-placement="right" title="Send visible results to batch patron modification" class="batch_op send_to_patron_mod">Batch patron modification</a>
</li>
[% END %]
[% END %]
</ul> <!-- /.dropdown-menu -->
</div> <!-- /.dropdown -->