Permalink
Browse files

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.
  • Loading branch information...
1 parent e3f6a74 commit 7fc4be502d27d77a653f66fb9ea7de50560cfca6 @joubu joubu committed with jcamins Dec 26, 2012
Showing with 14 additions and 15 deletions.
  1. +7 −8 C4/Circulation.pm
  2. +6 −6 koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
  3. +1 −1 reserve/request.pl
View
@@ -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;
}
@@ -293,12 +293,12 @@
[% UNLESS ( bibitemloo.bib_available ) %]
<div class="bibmessage">No available items.</div>
[% ELSE %]
- [% IF ( bibitemloo.already_patron_possession ) %]
- <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
- [% ELSE %]
- <div class="bibmessage">This title cannot be requested.</div>
- [% END %]
- [% END %]
+ [% IF ( bibitemloo.already_patron_possession ) %]
+ <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
+ [% ELSE %]
+ <div class="bibmessage">This title cannot be requested.</div>
+ [% END %]
+ [% END %]
[% END %]
View
@@ -244,7 +244,7 @@ =head1 request.pl
my $dat = GetBiblioData($biblionumber);
unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
- $warnings = 1;
+ $warnings = 1;
$maxreserves = 1;
}

0 comments on commit 7fc4be5

Please sign in to comment.