Bugzilla – Attachment 59163 Details for
Bug 12063
Change date calculation for reserve expiration to skip all holidays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12063 - Keep patron's requested expiration date if it is prior to the calculated one
Bug-12063---Keep-patrons-requested-expiration-date.patch (text/plain), 1.49 KB, created by
Alex Arnaud
on 2017-01-18 14:15:04 UTC
(
hide
)
Description:
Bug 12063 - Keep patron's requested expiration date if it is prior to the calculated one
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2017-01-18 14:15:04 UTC
Size:
1.49 KB
patch
obsolete
>From cf63e7f22dbe48e3ed130001e7fb2fa49fb08424 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 18 Jan 2017 14:13:33 +0000 >Subject: [PATCH] Bug 12063 - Keep patron's requested expiration date if it is > prior to the calculated one > >--- > Koha/Hold.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index c125bfc..1e2e730 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -127,6 +127,11 @@ sub set_waiting { > waitingdate => $today->ymd, > }; > >+ my $requested_expiration; >+ if ($self->expirationdate) { >+ $requested_expiration = dt_from_string($self->expirationdate); >+ } >+ > if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) { > my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); >@@ -139,7 +144,10 @@ sub set_waiting { > $expirationdate = $calendar->days_forward( dt_from_string($self->waitingdate), $max_pickup_delay ); > } > >- $values->{expirationdate} = $expirationdate->ymd; >+ # If patron's requested expiration date is prior to the >+ # calculated one, we keep the patron's one. >+ my $cmp = $requested_expiration ? DateTime->compare($requested_expiration, $expirationdate) : 0; >+ $values->{expirationdate} = $cmp == -1 ? $requested_expiration->ymd : $expirationdate->ymd; > } > > $self->set($values)->store(); >-- >2.7.4
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 12063
:
26966
|
52558
|
52949
|
52950
|
53100
|
53101
|
59161
|
59162
|
59163
|
59165
|
61401
|
61440
|
61461
|
61735
|
62001
|
62002
|
62003
|
62004
|
62005
|
62474
|
63057
|
63091
|
63092
|
63093
|
63094
|
63095
|
63096
|
63097
|
63098
|
63099