Bugzilla – Attachment 17888 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]
[SIGNED-OFF] Bug 8918: ILS-DI: Calculate rank when placing hold
Bug-8918-ILS-DI-Calculate-rank-when-placing-hold.patch (text/plain), 5.40 KB, created by
Julian Maurice
on 2013-05-02 09:24:12 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 8918: ILS-DI: Calculate rank when placing hold
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2013-05-02 09:24:12 UTC
Size:
5.40 KB
patch
obsolete
>From 0d02068b5254db95ebbc86f72f6fc731314dd7e8 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 > >This is a squash of the 3 following patches > >Bug 8918: ILS-DI: Calculate rank when placing hold > >Signed-off-by: Srikanth Dhondi <srikanth@catalyst.net.nz> > >-- > >Bug 8918: QA fixes > >- Move C4::ILSDI::_get_reserve_next_rank to > C4::Reserves::GetReserveNextRank >- Do not calculate rank if ReservesNeedReturns = 0 > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >-- > >8918 QA Followup for pref descriptions > >Updating pref descriptions for ReservesNeedReturns and ILS-DI:AuthorizedIPs. >Just sideway related to this report, but not important enough to separate. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/ILSDI/Services.pm | 16 ++++++++--- > C4/Reserves.pm | 27 +++++++++++++++++++- > .../en/modules/admin/preferences/circulation.pref | 2 +- > .../en/modules/admin/preferences/web_services.pref | 3 +- > 4 files changed, 40 insertions(+), 8 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 68cbdb3..51d807a 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; >@@ -626,9 +626,11 @@ sub HoldTitle { > $branch = $$borrower{branchcode}; > } > >+ my $rank = GetReserveNextRank($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; >@@ -705,9 +707,13 @@ sub HoldItem { > 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 c8b0cdd..def4c69 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 >@@ -2168,6 +2172,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/> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index f88d964..4668f2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -399,7 +399,7 @@ Circulation: > choices: > yes: "Don't automatically" > no: Automatically >- - mark holds as found and waiting when a hold is placed specifically on them and they are already checked in. >+ - mark a hold as found and waiting when a hold is placed on a specific item and that item is already checked in. > - > - Patrons can only have > - pref: maxreserves >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >index 7244675..7a4c910 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >@@ -35,9 +35,10 @@ Web services: > no: Disable > - ILS-DI services for OPAC users > - >+ - Allow IP addresses > - pref: ILS-DI:AuthorizedIPs > class: Text >- - allowed IPs to use the ILS-DI services >+ - to use the ILS-DI services (when enabled). Separate the IP addresses with commas and without spaces. Leave the field blank to allow any IP address. > Reporting: > - > - Only return >-- >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