From 7fc4be502d27d77a653f66fb9ea7de50560cfca6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Dec 2012 14:52:52 +0100 Subject: [PATCH] Bug 9206: Followup QA FIX - Fix indentation - It is useless to loop on all items. If at least 1 item is already issued, we want to return 1. --- C4/Circulation.pm | 15 +++++++-------- .../opac-tmpl/prog/en/modules/opac-reserve.tt | 12 ++++++------ reserve/request.pl | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 55b89f96cb..71fe20f835 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -83,7 +83,7 @@ BEGIN { &GetBiblioIssues &GetOpenIssue &AnonymiseIssueHistory - &CheckIfIssuedToPatron + &CheckIfIssuedToPatron ); # subs to deal with returns @@ -3455,16 +3455,15 @@ sub TransferSlip { =cut sub CheckIfIssuedToPatron { - my ($borrowernumber, $biblionumber) = @_; - my $isissued = 0; + my ($borrowernumber, $biblionumber) = @_; - my $items = GetItemsByBiblioitemnumber($biblionumber); + my $items = GetItemsByBiblioitemnumber($biblionumber); - foreach my $item (@{$items}) { - $isissued = 1 if ($item->{borrowernumber} && $item->{borrowernumber} eq $borrowernumber); - } + foreach my $item (@{$items}) { + return 1 if ($item->{borrowernumber} && $item->{borrowernumber} eq $borrowernumber); + } - return $isissued; + return; } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt index 1c5205dfed..53ccbbf9e9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt @@ -293,12 +293,12 @@ [% UNLESS ( bibitemloo.bib_available ) %]
No available items.
[% ELSE %] - [% IF ( bibitemloo.already_patron_possession ) %] -
This title cannot be requested because it's already in your possession.
- [% ELSE %] -
This title cannot be requested.
- [% END %] - [% END %] + [% IF ( bibitemloo.already_patron_possession ) %] +
This title cannot be requested because it's already in your possession.
+ [% ELSE %] +
This title cannot be requested.
+ [% END %] + [% END %] [% END %] diff --git a/reserve/request.pl b/reserve/request.pl index f12e0ace7d..705f4f6fa5 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -244,7 +244,7 @@ foreach my $biblionumber (@biblionumbers) { my $dat = GetBiblioData($biblionumber); unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) { - $warnings = 1; + $warnings = 1; $maxreserves = 1; } -- 2.39.5