From 8d047f2a3391bfff0bc86edb9c706959d19ee775 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 14 May 2019 16:42:24 +0200 Subject: [PATCH] Bug 22922: Allow to modify hold dates on reserve/request.pl Test plan: 1. Place some holds 2. Go to the 'Holds' tab of the biblio record 3. Modify dates in the table and click on 'Update holds' button 4. Verify that dates have been correctly updated Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- C4/Reserves.pm | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc | 4 ++-- reserve/modrequest.pl | 4 ++++ reserve/request.pl | 5 ++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 2a77c3dc5b..8f14b293e1 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -906,6 +906,8 @@ sub ModReserve { my $rank = $params->{'rank'}; my $reserve_id = $params->{'reserve_id'}; + my $reservedate = $params->{reservedate} || undef; + my $expirationdate = $params->{expirationdate} || undef; my $branchcode = $params->{'branchcode'}; my $itemnumber = $params->{'itemnumber'}; my $suspend_until = $params->{'suspend_until'}; @@ -937,6 +939,8 @@ sub ModReserve { $hold->set( { priority => $rank, + reservedate => $reservedate, + expirationdate => $expirationdate, branchcode => $branchcode, itemnumber => $itemnumber, found => undef, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index c40d3e638b..77c49e1fbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -106,8 +106,8 @@ [% hold.notes | html %] - [% hold.date | html %] - [% hold.expirationdate | html %] + + [% IF ( hold.found ) %] diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index 0d1b2d0262..7e2c18919f 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -44,6 +44,8 @@ my @reserve_id = $query->multi_param('reserve_id'); my @rank = $query->multi_param('rank-request'); my @biblionumber = $query->multi_param('biblionumber'); my @borrower = $query->multi_param('borrowernumber'); +my @reservedates = $query->multi_param('reservedate'); +my @expirationdates = $query->multi_param('expirationdate'); my @branch = $query->multi_param('pickup'); my @itemnumber = $query->multi_param('itemnumber'); my @suspend_until=$query->multi_param('suspend_until'); @@ -70,6 +72,8 @@ else { ModReserve({ rank => $rank[$i], reserve_id => $reserve_id[$i], + reservedate => $reservedates[$i], + expirationdate => $expirationdates[$i], branchcode => $branch[$i], itemnumber => $itemnumber[$i], suspend_until => $suspend_until[$i] diff --git a/reserve/request.pl b/reserve/request.pl index c7832434a3..c5014820f6 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -661,9 +661,8 @@ foreach my $biblionumber (@biblionumbers) { } } - $reserve{'expirationdate'} = output_pref( { dt => dt_from_string( $res->expirationdate ), dateonly => 1 } ) - unless ( !defined( $res->expirationdate ) || $res->expirationdate eq '0000-00-00' ); - $reserve{'date'} = output_pref( { dt => dt_from_string( $res->reservedate ), dateonly => 1 } ); + $reserve{'expirationdate'} = $res->expirationdate; + $reserve{'date'} = $res->reservedate; $reserve{'borrowernumber'} = $res->borrowernumber(); $reserve{'biblionumber'} = $res->biblionumber(); $reserve{'patron'} = $res->borrower; -- 2.39.5