From 3a20d515c9df81bb94a89561e526bff0c6573299 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 34465a7caf..b29e8033e6 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -779,7 +779,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'); } @@ -881,7 +881,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 ab4a3093e7..f55b98e26d 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -185,7 +185,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 fbf35f4314..63a0eef74b 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 3333d75e7d..57f396135b 100644 --- a/Koha/REST/V1/Clubs/Holds.pm +++ b/Koha/REST/V1/Clubs/Holds.pm @@ -54,7 +54,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 0ca60b1459..ec4becf8ad 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -74,7 +74,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