Bugzilla – Attachment 12810 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: ILS-DI: Calculate rank when placing hold
Bug-8918-ILS-DI-Calculate-rank-when-placing-hold.patch (text/plain), 1.64 KB, created by
Julian Maurice
on 2012-10-15 12:14:18 UTC
(
hide
)
Description:
Bug 8918: ILS-DI: Calculate rank when placing hold
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-10-15 12:14:18 UTC
Size:
1.64 KB
patch
obsolete
>From 4143456ceb743924a5dd051df9bf54ff06f99a30 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 15 Oct 2012 14:06:04 +0200 >Subject: [PATCH] Bug 8918: ILS-DI: Calculate rank when placing hold > >--- > C4/ILSDI/Services.pm | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 5a62954..1c5ae28 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -570,6 +570,18 @@ 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. >@@ -620,9 +632,11 @@ sub HoldTitle { > $branch = $$borrower{branchcode}; > } > >+ my $rank = _get_reserve_next_rank($biblionumber); >+ > # Add the reserve > # $branch, $borrowernumber, $biblionumber, $constraint, $bibitems, $priority, $notes, $title, $checkitem, $found >- AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, 0, undef, $title, undef, undef ); >+ AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, $rank, undef, $title, undef, undef ); > > # Hashref building > my $out; >@@ -695,7 +709,7 @@ sub HoldItem { > $branch = $$borrower{branchcode}; > } > >- my $rank; >+ my $rank = _get_reserve_next_rank($biblionumber); > my $found; > > # Get rank and found >-- >1.7.10.4
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