Bugzilla – Attachment 94384 Details for
Bug 22922
Allow to modify hold and hold expiration date in staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22922: Allow reservedate changes only if AllowHoldDateInFuture is on
Bug-22922-Allow-reservedate-changes-only-if-AllowH.patch (text/plain), 4.01 KB, created by
Katrin Fischer
on 2019-10-18 06:22:35 UTC
(
hide
)
Description:
Bug 22922: Allow reservedate changes only if AllowHoldDateInFuture is on
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-10-18 06:22:35 UTC
Size:
4.01 KB
patch
obsolete
>From 6d673fa5983d665f2a853479f2b887cdcbc378fe Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 17 May 2019 14:40:12 +0200 >Subject: [PATCH] Bug 22922: Allow reservedate changes only if > AllowHoldDateInFuture is on > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Reserves.pm | 28 ++++++++++++---------- > .../intranet-tmpl/prog/en/includes/holds_table.inc | 8 ++++++- > reserve/modrequest.pl | 10 +++++--- > 3 files changed, 29 insertions(+), 17 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 8f14b293e1..57fb686801 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -906,8 +906,6 @@ 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'}; >@@ -936,17 +934,21 @@ sub ModReserve { > logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) ) > if C4::Context->preference('HoldsLog'); > >- $hold->set( >- { >- priority => $rank, >- reservedate => $reservedate, >- expirationdate => $expirationdate, >- branchcode => $branchcode, >- itemnumber => $itemnumber, >- found => undef, >- waitingdate => undef >- } >- )->store(); >+ my $properties = { >+ priority => $rank, >+ branchcode => $branchcode, >+ itemnumber => $itemnumber, >+ found => undef, >+ waitingdate => undef >+ }; >+ if (exists $params->{reservedate}) { >+ $properties->{reservedate} = $params->{reservedate} || undef; >+ } >+ if (exists $params->{expirationdate}) { >+ $properties->{expirationdate} = $params->{expirationdate} || undef; >+ } >+ >+ $hold->set($properties)->store(); > > if ( defined( $suspend_until ) ) { > if ( $suspend_until ) { >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 77c49e1fbe..8b0a174b11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -106,7 +106,13 @@ > </td> > > <td>[% hold.notes | html %]</td> >- <td><input type="date" value="[% hold.date | html %]" required name="reservedate"></td> >+ <td> >+ [% IF Koha.Preference('AllowHoldDateInFuture') %] >+ <input type="date" value="[% hold.date | html %]" required name="reservedate"> >+ [% ELSE %] >+ [% hold.date | $KohaDates %] >+ [% END %] >+ </td> > <td><input type="date" value="[% hold.expirationdate | html %]" name="expirationdate"></td> > > <td> >diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl >index 7e2c18919f..04c1b7d162 100755 >--- a/reserve/modrequest.pl >+++ b/reserve/modrequest.pl >@@ -69,15 +69,19 @@ if ($CancelBorrowerNumber) { > else { > for (my $i=0;$i<$count;$i++){ > undef $itemnumber[$i] if !$itemnumber[$i]; >- ModReserve({ >+ my $params = { > 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] >- }); >+ }; >+ if (C4::Context->preference('AllowHoldDateInFuture')) { >+ $params->{reservedate} = $reservedates[$i]; >+ } >+ >+ ModReserve($params); > } > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22922
:
89824
|
89896
|
89902
|
89915
|
89916
|
89917
|
94372
|
94383
| 94384 |
94385
|
94386