Bugzilla – Attachment 128307 Details for
Bug 24194
Add system preference to disable the use of expiration dates for holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24194: (follow-up) Use ExpireReservesMaxPickUpDelay when setting hold waiting
Bug-24194-follow-up-Use-ExpireReservesMaxPickUpDel.patch (text/plain), 3.52 KB, created by
Aleisha Amohia
on 2021-12-07 04:09:59 UTC
(
hide
)
Description:
Bug 24194: (follow-up) Use ExpireReservesMaxPickUpDelay when setting hold waiting
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2021-12-07 04:09:59 UTC
Size:
3.52 KB
patch
obsolete
>From 15b341babcbd5f16049344162d172ca1cad9918e Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 7 Dec 2021 04:07:09 +0000 >Subject: [PATCH] Bug 24194: (follow-up) Use ExpireReservesMaxPickUpDelay when > setting hold waiting > >If ExpireReservesMaxPickUpDelay is disabled then we don't need to set an >expiration date when setting a hold as waiting >--- > Koha/Hold.pm | 47 ++++++++++++++++++++++++----------------------- > 1 file changed, 24 insertions(+), 23 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 8ef19de31a..a8b776226c 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -185,37 +185,38 @@ sub set_waiting { > desk_id => $desk_id, > }; > >- if ( !C4::Context->preference('ReserveExpiration') ){ >- $values->{expirationdate} = undef; >- } else { >- my $requested_expiration; >- if ($self->expirationdate) { >- $requested_expiration = dt_from_string($self->expirationdate); >- } >+ my $requested_expiration; >+ if ($self->expirationdate) { >+ $requested_expiration = dt_from_string($self->expirationdate); >+ } > >- my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); >- my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); >+ my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); >+ my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); > >- my $expirationdate = $today->clone; >- $expirationdate->add(days => $max_pickup_delay); >+ my $expirationdate = $today->clone; >+ $expirationdate->add(days => $max_pickup_delay); > >- if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { >- my $itemtype = $self->item ? $self->item->effective_itemtype : $self->biblio->itemtype; >- my $daysmode = Koha::CirculationRules->get_effective_daysmode( >- { >- categorycode => $self->borrower->categorycode, >- itemtype => $itemtype, >- branchcode => $self->branchcode, >- } >- ); >- my $calendar = Koha::Calendar->new( branchcode => $self->branchcode, days_mode => $daysmode ); >- $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay ); >- } >+ if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { >+ my $itemtype = $self->item ? $self->item->effective_itemtype : $self->biblio->itemtype; >+ my $daysmode = Koha::CirculationRules->get_effective_daysmode( >+ { >+ categorycode => $self->borrower->categorycode, >+ itemtype => $itemtype, >+ branchcode => $self->branchcode, >+ } >+ ); >+ my $calendar = Koha::Calendar->new( branchcode => $self->branchcode, days_mode => $daysmode ); >+ $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay ); >+ } > >+ if ( C4::Context->preference('ExpireReservesMaxPickUpDelay') ) { > # 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; >+ } else { >+ # if holds don't need a waiting expiration date to be expired automatically, don't set one >+ $values->{expirationdate} = undef; > } > > $self->set($values)->store(); >-- >2.11.0
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 24194
:
96120
|
96121
|
98048
|
98368
|
100927
|
110082
|
110127
|
111443
|
113284
|
113285
|
116626
|
116627
|
117016
|
117085
|
117089
|
117097
|
117098
|
117099
|
117100
|
117101
|
118258
|
118259
|
118260
|
118261
|
118262
|
118263
|
128301
|
128302
|
128303
|
128304
|
128305
|
128306
|
128307
|
128308
|
140646
|
140647
|
144076
|
147527
|
147528
|
150799
|
150800
|
159060
|
159061
|
167796
|
167797
|
169174
|
174650
|
174651
|
174652