From 092c9e4784f2e145d7a603f8581c3bf4feca566e Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Tue, 3 Sep 2019 11:08:49 +0200 Subject: [PATCH] bug23531 : fix ILSDI non-implemented but documented parameters test plan : 1/ Submit a hold through ILSDI with needed_before_date and pickup_expiry_date parameters 2/ Verify in Koha those parameters are not applied to the newly created reserve. Delete reserve. 3/ Apply patch and repeat 1. 4/ Verify the reserve created by same request as 1 now has both dates applied and visible in Koha. Signed-off-by: Christophe Croullebois --- C4/ILSDI/Services.pm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 049ddcf600..bc64387542 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -725,12 +725,22 @@ sub HoldTitle { return { code => 'libraryNotPickupLocation' } unless $destination->pickup_location; return { code => 'cannotBeTransferred' } unless $biblio->can_be_transferred({ to => $destination }); + my $resdate; + if ( $cgi->param('needed_before_date') ) { + $resdate = $cgi->param('needed_before_date'); + } + + my $expdate; + if ( $cgi->param('pickup_expiry_date') ) { + $expdate = $cgi->param('pickup_expiry_date'); + } + # Add the reserve # $branch, $borrowernumber, $biblionumber, # $constraint, $bibitems, $priority, $resdate, $expdate, $notes, # $title, $checkitem, $found my $priority= C4::Reserves::CalculatePriority( $biblionumber ); - AddReserve( $branch, $borrowernumber, $biblionumber, undef, $priority, undef, undef, undef, $title, undef, undef ); + AddReserve( $branch, $borrowernumber, $biblionumber, undef, $priority, $resdate, $expdate, undef, $title, undef, undef ); # Hashref building my $out; @@ -801,12 +811,22 @@ sub HoldItem { my $canitembereserved = C4::Reserves::CanItemBeReserved( $borrowernumber, $itemnumber, $branch )->{status}; return { code => $canitembereserved } unless $canitembereserved eq 'OK'; + my $resdate; + if ( $cgi->param('needed_before_date') ) { + $resdate = $cgi->param('needed_before_date'); + } + + my $expdate; + if ( $cgi->param('pickup_expiry_date') ) { + $expdate = $cgi->param('pickup_expiry_date'); + } + # Add the reserve # $branch, $borrowernumber, $biblionumber, # $constraint, $bibitems, $priority, $resdate, $expdate, $notes, # $title, $checkitem, $found my $priority= C4::Reserves::CalculatePriority( $biblionumber ); - AddReserve( $branch, $borrowernumber, $biblionumber, undef, $priority, undef, undef, undef, $title, $itemnumber, undef ); + AddReserve( $branch, $borrowernumber, $biblionumber, undef, $priority, $resdate, $expdate, undef, $title, $itemnumber, undef ); # Hashref building my $out; -- 2.17.1