From de2e1918174ef5db449612c94fce51c1cf7a2baf Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 6 May 2014 15:44:05 +0000 Subject: [PATCH] Bug 12197: (follow-up) rename variable for greater clarity "maxreserves" was referring both to the system preference and to the condition of having exceeded the number of hold requests allowed. This patch renames a variable to remove the ambguity. Test plan: * Same as the main patch. Signed-off-by: Galen Charlton --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 4 ++-- reserve/request.pl | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index cafc072..2b0679a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -237,13 +237,13 @@ function checkMultiHold() { [% ELSE %] -[% IF ( maxreserves || alreadyreserved || none_available || alreadypossession ) %] +[% IF ( exceeded_maxreserves || alreadyreserved || none_available || alreadypossession ) %]
[% UNLESS ( multi_hold ) %]

Cannot place hold

    - [% IF ( maxreserves ) %] + [% IF ( exceeded_maxreserves ) %]
  • Too many holds: [% borrowerfirstname %] [% borrowersurname %] has too many holds.
  • [% END %] [% IF ( alreadyreserved ) %] diff --git a/reserve/request.pl b/reserve/request.pl index b3beb92..94d4dc4 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -77,7 +77,7 @@ $findborrower = '' unless defined $findborrower; $findborrower =~ s|,| |g; my $borrowernumber_hold = $input->param('borrowernumber') || ''; my $messageborrower; -my $maxreserves; +my $exceeded_maxreserves; my $date = C4::Dates->today('iso'); my $action = $input->param('action'); @@ -129,7 +129,7 @@ if ($borrowernumber_hold && !$action) { GetReserveCount( $borrowerinfo->{'borrowernumber'} ); if ( C4::Context->preference('maxreserves') && ($number_reserves >= C4::Context->preference('maxreserves')) ) { - $maxreserves = 1; + $exceeded_maxreserves = 1; } # we check the date expiry of the borrower (only if there is an expiry date, otherwise, set to 1 (warn) @@ -187,7 +187,9 @@ foreach my $biblionumber (@biblionumbers) { my $dat = GetBiblioData($biblionumber); unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) { - $maxreserves = 1; + $exceeded_maxreserves = 1; # note that exceeding the circ policy's hold + # limit is not the only reason CanBookBeReserved() + # can return false } my $alreadypossession; @@ -406,7 +408,7 @@ foreach my $biblionumber (@biblionumbers) { if ( $policy_holdallowed - && !$maxreserves + && !$exceeded_maxreserves && !$item->{cantreserve} && IsAvailableForItemLevelRequest($itemnumber) && CanItemBeReserved( @@ -572,7 +574,7 @@ foreach my $biblionumber (@biblionumbers) { $template->param( biblioloop => \@biblioloop ); $template->param( biblionumbers => $biblionumbers ); -$template->param( maxreserves => $maxreserves ); +$template->param( exceeded_maxreserves => $exceeded_maxreserves ); if ($multihold) { $template->param( multi_hold => 1 ); -- 1.7.10.4