From 36599e90c0ef58fc993df6abdc73ea88627d4b64 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 --- 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 205ed78..1a1a543 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -908,6 +908,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'}; @@ -939,6 +941,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 a878658..bb4d534 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 0d1b2d0..7e2c189 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 f559ed0..41b61a9 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -599,9 +599,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.7.4