Bugzilla – Attachment 33077 Details for
Bug 13116
Make it possible to propagate errors from C4::Reserves::CanItemBeReserved() to the web-templates.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13116 [QA Followup] - Remove tabs, use unless instead of if
Bug-13116-QA-Followup---Remove-tabs-use-unless-ins.patch (text/plain), 3.10 KB, created by
Kyle M Hall (khall)
on 2014-10-31 14:46:01 UTC
(
hide
)
Description:
Bug 13116 [QA Followup] - Remove tabs, use unless instead of if
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-10-31 14:46:01 UTC
Size:
3.10 KB
patch
obsolete
>From a8381f9b9cb61b020893ae5ffe7eedfbd2e388a1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 31 Oct 2014 09:51:43 -0400 >Subject: [PATCH] Bug 13116 [QA Followup] - Remove tabs, use unless instead of if > >--- > C4/Reserves.pm | 6 +++--- > opac/opac-reserve.pl | 13 +++++-------- > reserve/request.pl | 27 ++++++++++++++------------- > 3 files changed, 22 insertions(+), 24 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 19a8e97..01f2372 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -465,9 +465,9 @@ sub CanBookBeReserved{ > push (@$items,@hostitems); > } > >- my $canReserve; >- foreach my $item (@$items){ >- $canReserve = CanItemBeReserved($borrowernumber, $item); >+ my $canReserve; >+ foreach my $item (@$items) { >+ $canReserve = CanItemBeReserved( $borrowernumber, $item ); > return 'OK' if $canReserve eq 'OK'; > } > return $canReserve; >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 4343936..3ef36f6 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -548,14 +548,11 @@ foreach my $biblioNum (@biblionumbers) { > if ($biblioLoopIter{already_reserved}) { > $biblioLoopIter{holdable} = undef; > } >- my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); >- if ($canReserve eq 'OK') { >- #All is OK! >- } >- else { >- $biblioLoopIter{holdable} = undef; >- $biblioLoopIter{ $canReserve } = 1; >- } >+ my $canReserve = CanBookBeReserved($borrowernumber,$biblioNum); >+ unless ($canReserve eq 'OK') { >+ $biblioLoopIter{holdable} = undef; >+ $biblioLoopIter{ $canReserve } = 1; >+ } > if(not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowernumber,$biblioNum)) { > $biblioLoopIter{holdable} = undef; > $biblioLoopIter{already_patron_possession} = 1; >diff --git a/reserve/request.pl b/reserve/request.pl >index dd271e6..70c002a 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -191,20 +191,21 @@ foreach my $biblionumber (@biblionumbers) { > > my $dat = GetBiblioData($biblionumber); > >- my $canReserve = CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber); >- if ($canReserve eq 'OK') { >- #All is OK and we can continue >- } >- elsif ( $canReserve eq 'tooManyReserves' ) { >- $maxreserves = 1; >+ my $canReserve = CanBookBeReserved( $borrowerinfo->{borrowernumber}, $biblionumber ); >+ if ( $canReserve eq 'OK' ) { >+ >+ #All is OK and we can continue >+ } >+ elsif ( $canReserve eq 'tooManyReserves' ) { >+ $maxreserves = 1; >+ } >+ elsif ( $canReserve eq 'ageRestricted' ) { >+ $template->param( $canReserve => 1 ); >+ $biblioloopiter{$canReserve} = 1; >+ } >+ else { >+ $biblioloopiter{$canReserve} = 1; > } >- elsif ( $canReserve eq 'ageRestricted' ) { >- $template->param( $canReserve => 1 ); >- $biblioloopiter{ $canReserve } = 1; >- } >- else { >- $biblioloopiter{ $canReserve } = 1; >- } > > my $alreadypossession; > if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) { >-- >1.7.2.5
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 13116
:
32544
|
32550
|
32551
|
32552
|
32627
|
32662
|
32920
|
33075
|
33076
| 33077