From 7ef5f8a392f91d77112d9d8b283037f128919c76 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 16 Mar 2021 14:33:15 +1300 Subject: [PATCH] Bug 24194: (follow-up) Use ReservesExpiration in other places --- C4/ILSDI/Services.pm | 4 ++-- C4/Reserves.pm | 2 +- Koha/Club/Hold.pm | 2 +- Koha/REST/V1/Clubs/Holds.pm | 2 +- Koha/REST/V1/Holds.pm | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index a28c382d68..7032b67508 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -778,7 +778,7 @@ sub HoldTitle { } my $expdate; - if ( $cgi->param('expiry_date') ) { + if ( C4::Context->preference('ReserveExpiration') and $cgi->param('expiry_date') ) { $expdate = $cgi->param('expiry_date'); } @@ -880,7 +880,7 @@ sub HoldItem { } my $expdate; - if ( $cgi->param('expiry_date') ) { + if ( C4::Context->preference('ReserveExpiration') and $cgi->param('expiry_date') ) { $expdate = $cgi->param('expiry_date'); } diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 93e3d4276b..9af5bd077b 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -182,7 +182,7 @@ sub AddReserve { my $biblionumber = $params->{biblionumber}; my $priority = $params->{priority}; my $resdate = $params->{reservation_date}; - my $expdate = $params->{expiration_date}; + my $expdate = C4::Context->preference('ReserveExpiration') ? $params->{expiration_date} : undef; my $notes = $params->{notes}; my $title = $params->{title}; my $checkitem = $params->{itemnumber}; diff --git a/Koha/Club/Hold.pm b/Koha/Club/Hold.pm index 378cd027f7..4a26a09c4d 100644 --- a/Koha/Club/Hold.pm +++ b/Koha/Club/Hold.pm @@ -123,7 +123,7 @@ sub add { borrowernumber => $patron_id, biblionumber => $params->{biblio_id}, priority => $priority, - expiration_date => $params->{expiration_date}, + expiration_date => C4::Context->preference('ReserveExpiration') ? $params->{expiration_date} : undef, notes => $params->{notes}, title => $biblio->title, itemnumber => $params->{item_id}, diff --git a/Koha/REST/V1/Clubs/Holds.pm b/Koha/REST/V1/Clubs/Holds.pm index 726f6f20de..7f1be41f39 100644 --- a/Koha/REST/V1/Clubs/Holds.pm +++ b/Koha/REST/V1/Clubs/Holds.pm @@ -56,7 +56,7 @@ sub add { my $pickup_library_id = $body->{pickup_library_id}; my $item_id = $body->{item_id}; my $item_type = $body->{item_type}; - my $expiration_date = $body->{expiration_date}; + my $expiration_date = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef; my $notes = $body->{notes}; my $default_patron_home = $body->{default_patron_home}; diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 9020c57a47..cfe6695980 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -75,7 +75,7 @@ sub add { my $item_id = $body->{item_id}; my $patron_id = $body->{patron_id}; my $item_type = $body->{item_type}; - my $expiration_date = $body->{expiration_date}; + my $expiration_date = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef; my $notes = $body->{notes}; my $hold_date = $body->{hold_date}; my $non_priority = $body->{non_priority}; -- 2.11.0