Bugzilla – Attachment 100915 Details for
Bug 24846
Add a tool to enable bulk edit of due dates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24846: Update items.onloan with the new due date
Bug-24846-Update-itemsonloan-with-the-new-due-date.patch (text/plain), 1.63 KB, created by
Jonathan Druart
on 2020-03-17 16:00:21 UTC
(
hide
)
Description:
Bug 24846: Update items.onloan with the new due date
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-17 16:00:21 UTC
Size:
1.63 KB
patch
obsolete
>From 7be0deb81b9fade866305d58574412d2f271b8c1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Mar 2020 16:59:44 +0100 >Subject: [PATCH] Bug 24846: Update items.onloan with the new due date > >--- > tools/batch_extend_due_dates.pl | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl >index 5f0001df1c..e79e5bdeb3 100755 >--- a/tools/batch_extend_due_dates.pl >+++ b/tools/batch_extend_due_dates.pl >@@ -24,6 +24,7 @@ use CGI; > > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); >+use C4::Items qw( ModItem ); > use Koha::Checkouts; > use Koha::DateUtils qw( dt_from_string ); > >@@ -126,14 +127,15 @@ elsif ( $op eq 'modify' ) { > my $checkouts = > Koha::Checkouts->search( { issue_id => { -in => \@issue_ids } } ); > while ( my $checkout = $checkouts->next ) { >- if ($new_hard_due_date) { >- $checkout->date_due($new_hard_due_date)->store; >- } >- else { >- my $dt = dt_from_string( $checkout->date_due ) >- ->add( days => $due_date_days ); >- $checkout->date_due($dt)->store; >- } >+ my $new_due_date = $new_hard_due_date >+ || dt_from_string( $checkout->date_due )->add( days => $due_date_days ); >+ >+ # Update checkout's due date >+ $checkout->date_due($new_due_date)->store; >+ >+ # Update items.onloan >+ ModItem( { onloan => $new_due_date->strftime('%Y-%m-%d %H:%M') }, >+ undef, $checkout->itemnumber ); > } > > $template->param( >-- >2.20.1
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 24846
:
100729
|
100730
|
100731
|
100749
|
100750
|
100752
|
100753
|
100754
|
100914
|
100915
|
100969
|
100998
|
100999
|
101000
|
101001