Bugzilla – Attachment 186207 Details for
Bug 27248
Allow to use list of barcodes/itemnumbers with Batch extend due dates tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27248: Add batch extend due dates to report batch ops
Bug-27248-Add-batch-extend-due-dates-to-report-bat.patch (text/plain), 6.15 KB, created by
Brendan Lawlor
on 2025-09-05 13:27:14 UTC
(
hide
)
Description:
Bug 27248: Add batch extend due dates to report batch ops
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2025-09-05 13:27:14 UTC
Size:
6.15 KB
patch
obsolete
>From 6c946f87d01a3922fc0518b3bb14e28da5889dc6 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Fri, 5 Sep 2025 13:11:35 +0000 >Subject: [PATCH] Bug 27248: Add batch extend due dates to report batch ops > >This patch adds a new batch operation for reports that return item numbers > >To test: >1. Apply patches and restart_all >2. Have some checkouts >3. Create a report that returns itemnumbers > example: select * from issues >4. Run the report >6. In the Batch operations drop down menu under Item records > see a new link for Batch extend due dates >7. Click Batch extend due dates >8. Confirm the tool loads with the item barcodes filled in the form >--- > .../modules/reports/guided_reports_start.tt | 27 +++++++++++++++++++ > .../modules/tools/batch_extend_due_dates.tt | 7 ++++- > tools/batch_extend_due_dates.pl | 11 +++++++- > 3 files changed, 43 insertions(+), 2 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 57e7a1d74c..80f8a02962 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 >@@ -1024,6 +1024,22 @@ > [% END %] > </form> > >+ <form method="POST" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="batch_extend_due_dates" target="_blank"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="op" value="cud-form" /> >+ [% FOREACH result IN results %] >+ [% FOREACH cells IN result.cells %] >+ [% place = loop.index %] >+ [% NEXT UNLESS cells.cell.match('^(\d+)$') %] >+ [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] >+ [% SET batch_itemnumbers = 1 %] >+ [% SET header_row.$place.has_itemnumbers = 1 %] >+ <input type="hidden" name="[% header_row.$place.cell | html %]" value="[% cells.cell | html %]" /> >+ [% END %] >+ [% END %] >+ [% END %] >+ </form> >+ > <form method="get" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl" id="batch_add_to_list" target="_blank"> > [% FOREACH result IN results %] > [% FOREACH cells IN result.cells %] >@@ -1214,6 +1230,17 @@ > >Batch item deletion</a > > > </li> >+ <li> >+ <a >+ href="#" >+ data-submit="batch_extend_due_dates" >+ data-bs-toggle="tooltip" >+ data-bs-placement="right" >+ title="Send visible items to batch extend due dates" >+ class="dropdown-item batch_op send_to_extend_due" >+ >Batch extend due dates</a >+ > >+ </li> > [% END %] > [% IF header_ro.cell == 'reserve_id' || header_types.item( header_ro.cell ) == 'reserve_id' %] > <li class="dropdown-header">Hold records</li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >index 565aab6dec..09972c8d2b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt >@@ -126,7 +126,12 @@ > <ol> > <li> > <label for="barcodelist">Barcode list (one barcode per line): </label> >- <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea> >+ <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"> >+ [%- FOREACH item IN items %] >+ [%- item.barcode -%] >+ [% END -%] >+ </textarea >+ > > </li> > </ol> > </fieldset> >diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl >index 78a8034b44..44306748be 100755 >--- a/tools/batch_extend_due_dates.pl >+++ b/tools/batch_extend_due_dates.pl >@@ -46,8 +46,17 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > my @issue_ids; > >-if ( $op eq 'form' ) { >+if ( $op eq 'form' || $op eq 'cud-form' ) { > $template->param( view => 'form', ); >+ >+ my @list = $input->multi_param('itemnumber'); >+ if (@list) { >+ my $items_rs = Koha::Items->search( { itemnumber => { -in => \@list } } ); >+ >+ my @items = $items_rs->as_list; >+ $template->param( items => \@items, ); >+ } >+ > } elsif ( $op eq 'cud-list' ) { > > my @categorycodes = $input->multi_param('categorycodes'); >-- >2.39.5
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 27248
:
184562
|
184563
|
185301
|
185302
|
186205
|
186206
| 186207