Bugzilla – Attachment 185301 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 barcode list input to batch extend due dates
Bug-27248-Add-barcode-list-input-to-batch-extend-d.patch (text/plain), 4.22 KB, created by
OpenFifth Sandboxes
on 2025-08-11 07:37:29 UTC
(
hide
)
Description:
Bug 27248: Add barcode list input to batch extend due dates
Filename:
MIME Type:
Creator:
OpenFifth Sandboxes
Created:
2025-08-11 07:37:29 UTC
Size:
4.22 KB
patch
obsolete
>From 0aabf1c4e69a3dd0c5986afcda8f252693af09e0 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Wed, 23 Jul 2025 15:04:39 +0000 >Subject: [PATCH] Bug 27248: Add barcode list input to batch extend due dates >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds a barcode list input to batch extend due dates > >Test plan: >1. Have some checkouts and copy the barcodes >2. Go to Tools > Batch extend due dates >3. Paste the barcodes in the new input one line at a time >4. Confirm you can extend the due dates for those items >5. Confirm the other limits still work > For example if you enter a branchcode and a list of barcodes > only items that were checked out from that branchcode and > are on the list of items get an updated due date > >Signed-off-by: Anneli Ãsterman <anneli.osterman@koha-suomi.fi> >--- > .../modules/tools/batch_extend_due_dates.tt | 6 +++++ > tools/batch_extend_due_dates.pl | 27 +++++++++++++++++-- > 2 files changed, 31 insertions(+), 2 deletions(-) > >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 26787e4662..2ba3f7bfc0 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 >@@ -123,6 +123,12 @@ > <input type="text" size="10" id="to" name="to_due_date" class="flatpickr" /> > </li> > </ol> >+ <ol> >+ <li> >+ <label for="barcodelist">Barcode list (one barcode per line): </label> >+ <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea> >+ </li> >+ </ol> > </fieldset> > <fieldset class="rows"> > <legend>New due date:</legend> >diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl >index abc504288a..78a8034b44 100755 >--- a/tools/batch_extend_due_dates.pl >+++ b/tools/batch_extend_due_dates.pl >@@ -22,11 +22,14 @@ use Modern::Perl; > > use CGI; > >-use C4::Auth qw( get_template_and_user ); >-use C4::Output qw( output_html_with_http_headers ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_html_with_http_headers ); >+use C4::Circulation qw( barcodedecode ); >+use C4::Context; > use Koha::Checkouts; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Items; >+use List::MoreUtils qw( uniq ); > > my $input = CGI->new; > my $op = $input->param('op') // q|form|; >@@ -50,6 +53,7 @@ if ( $op eq 'form' ) { > my @categorycodes = $input->multi_param('categorycodes'); > my @itemtypecodes = $input->multi_param('itemtypecodes'); > my @branchcodes = $input->multi_param('branchcodes'); >+ my $list = $input->param('barcodelist'); > my $from_due_date = $input->param('from_due_date'); > my $to_due_date = $input->param('to_due_date'); > my $new_hard_due_date = $input->param('new_hard_due_date'); >@@ -71,6 +75,25 @@ if ( $op eq 'form' ) { > if (@branchcodes) { > $search_params->{'me.branchcode'} = { -in => \@branchcodes }; > } >+ if ($list) { >+ my $split_chars = C4::Context->preference('BarcodeSeparators'); >+ my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list ); >+ @barcodelist = uniq @barcodelist; >+ >+ @barcodelist = map { barcodedecode($_) } @barcodelist; >+ >+ # Note: adding lc for case insensitivity >+ my %itemdata = >+ map { lc( $_->{barcode} ) => $_->{itemnumber} } @{ Koha::Items->search( >+ { barcode => { -in => \@barcodelist } }, >+ { columns => [ 'itemnumber', 'barcode' ] } >+ )->unblessed >+ }; >+ my @itemnumbers = map { exists $itemdata{ lc $_ } ? $itemdata{ lc $_ } : () } @barcodelist; >+ my @notfoundbarcodes = grep { !exists $itemdata{ lc $_ } } @barcodelist; >+ >+ $search_params->{'itemnumber'} = { -in => \@itemnumbers }; >+ } > > if ( $from_due_date and $to_due_date ) { > my $to_due_date_endday = dt_from_string($to_due_date); >-- >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