Bugzilla – Attachment 152878 Details for
Bug 29181
Allow patron card creator to use a report to get list of borrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29181: Create patron card creator batch from report result
Bug-29181-Create-patron-card-creator-batch-from-re.patch (text/plain), 8.45 KB, created by
Sam Lau
on 2023-06-29 18:41:45 UTC
(
hide
)
Description:
Bug 29181: Create patron card creator batch from report result
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2023-06-29 18:41:45 UTC
Size:
8.45 KB
patch
obsolete
>From d2a94017d9d99bd846cd5474c99d6cf42e8cae5d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 26 Jun 2023 14:38:41 +0000 >Subject: [PATCH] Bug 29181: Create patron card creator batch from report > result > >This patch adds the option of taking the results of a report that >returns borrowernumbers and create a new patron card creator batch with >those results. > >The logic of the dropdown menu has been modified in order to ensure that >duplicate patron modification options aren't shown in the menu when a >report return both borrowernumber and cardnumber. > >To test, apply the patch and create a new report which will return >patron borrowernumbers, e.g. > >SELECT borrowernumber, cardnumber, surname, firstname FROM borrowers >order by RAND() LIMIT 20 > >- Run your report >- Click the "Batch operations with..." button at the top of the result > - Click "Patron card creator" >- A new tab should open with a new patron card creator batch with the > patrons from your report. > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > .../modules/reports/guided_reports_start.tt | 42 +++++++++++++++---- > 1 file changed, 34 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index ecb9480af4..c8e0150797 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -987,6 +987,15 @@ > </textarea> > </form> > >+ <form action="/cgi-bin/koha/patroncards/edit-batch.pl" id="patron_card_creator" method="post" target="_blank"> >+ <input type="hidden" name="op" value="add" /> >+ <input type="hidden" name="batch_id" value="0" /> >+ [% # Preserve the whitespace of the following textarea in order to format the values correctly %] >+ <textarea style="display:none;" name="bor_num_list" id="bor_num_list"> >+ [%- borrowernumbers = PROCESS batch_list results=results batch_type='borrowernumber' | trim | html %][% IF borrowernumbers %][% SET batch_borrowernumbers = 1 %][% borrowernumbers | html %][% END -%] >+ </textarea> >+ </form> >+ > [% BLOCK batch_list %] > [%- FOREACH result IN results %] > [%- FOREACH cells IN result.cells %] >@@ -1010,15 +1019,38 @@ > <input type="hidden" name="limit" id="limit" value="20" /> > </form> <!-- /#limitselect --> > >- [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) || ( unlimited_total > 10 && limit <= 1000 ) %] >+ [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) || ( unlimited_total > 10 && limit <= 1000 ) %] > <div id="toolbar" class="btn-toolbar"> >- [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %] >+ [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) %] > <div class="btn-group"> > <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="batch_mod_menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> > Batch operations with [% IF unlimited_total >= limit %][% limit | html %][% ELSE %][% unlimited_total | html %][% END %] visible records > <span class="caret"></span> > </button> > <ul class="dropdown-menu" aria-labelledby="batch_mod_menu"> >+ [% FOREACH header_ro IN header_row %] >+ [% IF header_ro.cell == 'cardnumber' || header_types.item( header_ro.cell ) == 'cardnumber' || header_ro.cell == 'borrowernumber' || header_types.item( header_ro.cell ) == 'borrowernumber' %] >+ [% IF header_ro.cell == 'cardnumber' || header_types.item( header_ro.cell ) == 'cardnumber' %] >+ [% SET show_cardnumber_ops = 1 %] >+ [% END %] >+ [% IF header_ro.cell == 'borrowernumber' || header_types.item( header_ro.cell ) == 'borrowernumber' %] >+ [% SET show_borrowernumber_ops = 1 %] >+ [% END %] >+ [% END %] >+ [% END %] >+ [% IF show_cardnumber_ops || show_borrowernumber_ops %] >+ <li class="dropdown-header">Patron records</li> >+ [% IF show_cardnumber_ops %] >+ <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 %] >+ [% IF show_borrowernumber_ops %] >+ <li> >+ <a href="#" data-submit="patron_card_creator" data-toggle="tooltip" data-placement="right" title="Send visible results to a new patron card batch" class="batch_op send_to_patron_card_batch">Patron card creator</a> >+ </li> >+ [% END %] >+ [% END %] > [% FOREACH header_ro IN header_row %] > [% IF header_ro.has_biblionumbers && ( header_ro.cell == 'biblionumber' || header_types.item( header_ro.cell ) == 'biblionumber' ) %] > <li class="dropdown-header">Bibliographic records</li> >@@ -1041,12 +1073,6 @@ > <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' || header_types.item( header_ro.cell ) == 'cardnumber' %] >- <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 # /FOREACH header_ro %] > </ul> <!-- /.dropdown-menu --> > </div> <!-- /.dropdown --> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29181
:
152697
|
152878
|
156009