Bugzilla – Attachment 13565 Details for
Bug 8918
ILS-DI: HoldTitle and HoldItem do not calculate rank of hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8918: QA fixes
Bug-8918-QA-fixes.patch (text/plain), 3.45 KB, created by
Julian Maurice
on 2012-11-20 16:10:57 UTC
(
hide
)
Description:
Bug 8918: QA fixes
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-11-20 16:10:57 UTC
Size:
3.45 KB
patch
obsolete
>From f0388cb1a75aacd698c711b2ea6b9241361eb115 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 20 Nov 2012 17:09:55 +0100 >Subject: [PATCH] Bug 8918: QA fixes > >- Move C4::ILSDI::_get_reserve_next_rank to > C4::Reserves::GetReserveNextRank >- Do not calculate rank if ReservesNeedReturns = 0 >--- > C4/ILSDI/Services.pm | 28 ++++++++++------------------ > C4/Reserves.pm | 27 ++++++++++++++++++++++++++- > 2 files changed, 36 insertions(+), 19 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 1c5ae28..3b66f3e 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -26,7 +26,7 @@ use C4::Circulation; > use C4::Branch; > use C4::Accounts; > use C4::Biblio; >-use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved); >+use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved GetReserveNextRank); > use C4::Context; > use C4::AuthoritiesMarc; > use C4::ILSDI::Utility; >@@ -570,18 +570,6 @@ sub RenewLoan { > return $out; > } > >-sub _get_reserve_next_rank { >- my ($biblionumber) = @_; >- >- my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); >- foreach my $res (@$reserves) { >- $count-- if (defined $res->{found} and $res->{found} eq 'W'); >- } >- my $rank = $count + 1; >- >- return $rank; >-} >- > =head2 HoldTitle > > Creates, for a borrower, a biblio-level hold reserve. >@@ -632,7 +620,7 @@ sub HoldTitle { > $branch = $$borrower{branchcode}; > } > >- my $rank = _get_reserve_next_rank($biblionumber); >+ my $rank = GetReserveNextRank($biblionumber); > > # Add the reserve > # $branch, $borrowernumber, $biblionumber, $constraint, $bibitems, $priority, $notes, $title, $checkitem, $found >@@ -709,13 +697,17 @@ sub HoldItem { > $branch = $$borrower{branchcode}; > } > >- my $rank = _get_reserve_next_rank($biblionumber); >+ my $rank; > my $found; > > # Get rank and found >- $rank = '0' unless C4::Context->preference('ReservesNeedReturns'); >- if ( $item->{'holdingbranch'} eq $branch ) { >- $found = 'W' unless C4::Context->preference('ReservesNeedReturns'); >+ if (C4::Context->preference('ReservesNeedReturns')) { >+ $rank = GetReserveNextRank($biblionumber); >+ } else { >+ $rank = '0'; >+ if ($item->{'holdingbranch'} eq $branch) { >+ $found = 'W'; >+ } > } > > # Add the reserve >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 1dc6f72..c6bb104 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -130,8 +130,12 @@ BEGIN { > &ReserveSlip > &ToggleSuspend > &SuspendAll >+ >+ ); >+ @EXPORT_OK = qw( >+ MergeHolds >+ GetReserveNextRank > ); >- @EXPORT_OK = qw( MergeHolds ); > } > > =head2 AddReserve >@@ -2088,6 +2092,27 @@ sub ReserveSlip { > ); > } > >+=head2 GetReserveNextRank >+ >+ my $next_rank = GetReserveNextRank($biblionumber); >+ >+Calculate the next available reseve rank for a biblionumber. >+ >+=cut >+ >+sub GetReserveNextRank { >+ my ($biblionumber) = @_; >+ >+ my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); >+ foreach my $res (@$reserves) { >+ $count-- if (defined $res->{found} and $res->{found} eq 'W'); >+ } >+ my $rank = $count + 1; >+ >+ return $rank; >+} >+ >+ > =head1 AUTHOR > > Koha Development Team <http://koha-community.org/> >-- >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 8918
:
12810
|
13472
|
13565
|
15435
|
17376
|
17881
|
17882
|
17888
|
17889
|
17890
|
21328
|
21329
|
21330
|
22731
|
22732
|
24863
|
24864
|
24880
|
24881
|
24882
|
24883
|
24884
|
24885
|
24886
|
24887
|
24888
|
24920
|
25080
|
25081
|
25082
|
25083
|
25084
|
25118
|
25119
|
25139
|
25140
|
25141
|
25142
|
25143
|
25144