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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
8d047f2a33
commit
95174eb36a
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue