Bugzilla – Attachment 10101 Details for
Bug 7710
multiple holds per title
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7710 - multiple holds per title - Part 4 - Add multiple holds per record for the OPAC
Bug-7710---multiple-holds-per-title---Part-4---Add.patch (text/plain), 4.32 KB, created by
Kyle M Hall
on 2012-06-10 13:14:29 UTC
(
hide
)
Description:
Bug 7710 - multiple holds per title - Part 4 - Add multiple holds per record for the OPAC
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-06-10 13:14:29 UTC
Size:
4.32 KB
patch
obsolete
>From 7c515226e9f6344658255a37cec6ca8900c49886 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 22 Mar 2012 13:52:59 -0400 >Subject: [PATCH] Bug 7710 - multiple holds per title - Part 4 - Add multiple holds per record for the OPAC > >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 2 +- > opac/opac-reserve.pl | 19 +++++++++++-------- > 2 files changed, 12 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >index 6de2a81..4da0d5a 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -408,7 +408,7 @@ $.tablesorter.addParser({ > [% IF ( RESERVE.cancelable ) %] > <form action="/cgi-bin/koha/opac-modrequest.pl" method="post"> > <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" /> >- <input type="hidden" name="reservenumber" value="[% RESERVE.reservenumber %]" /> >+ <input type="hidden" name="reservenumber" value="[% RESERVE.reservenumber %]" /> > <input type="submit" name="submit" class="icon delete cancel" value="Cancel" onclick="return confirmDelete('Are you sure you want to cancel this hold?');" /></form> > [% ELSE %] > [% END %] >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index aae8314..c1cfb28 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -37,7 +37,8 @@ use C4::Debug; > use Koha::DateUtils; > # use Data::Dumper; > >-my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves"); >+my $maxreserves = C4::Context->preference("maxreserves"); >+my $max_holds_per_record = C4::Context->preference('MaxHoldsPerRecord'); > > my $query = new CGI; > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >@@ -298,7 +299,7 @@ if ( CheckBorrowerDebarred($borrowernumber) ) { > > my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); > $template->param( RESERVES => \@reserves ); >-if ( $MAXIMUM_NUMBER_OF_RESERVES && (scalar(@reserves) >= $MAXIMUM_NUMBER_OF_RESERVES) ) { >+if ( $maxreserves && (scalar(@reserves) >= $maxreserves) ) { > $template->param( message => 1 ); > $noreserves = 1; > $template->param( too_many_reserves => scalar(@reserves)); >@@ -306,12 +307,10 @@ if ( $MAXIMUM_NUMBER_OF_RESERVES && (scalar(@reserves) >= $MAXIMUM_NUMBER_OF_RES > foreach my $res (@reserves) { > foreach my $biblionumber (@biblionumbers) { > if ( $res->{'biblionumber'} == $biblionumber && $res->{'borrowernumber'} == $borrowernumber) { >-# $template->param( message => 1 ); >-# $noreserves = 1; >-# $template->param( already_reserved => 1 ); >- $biblioDataHash{$biblionumber}->{already_reserved} = 1; >+ $biblioDataHash{$biblionumber}->{holds_count}++; > } > } >+ > } > > unless ($noreserves) { >@@ -353,7 +352,7 @@ foreach my $biblioNum (@biblionumbers) { > $biblioLoopIter{author} = $biblioData->{author}; > $biblioLoopIter{rank} = $biblioData->{rank}; > $biblioLoopIter{reservecount} = $biblioData->{reservecount}; >- $biblioLoopIter{already_reserved} = $biblioData->{already_reserved}; >+ $biblioLoopIter{holds_count} = $biblioData->{holds_count}; > > if (!$itemLevelTypes && $biblioData->{itemtype}) { > $biblioLoopIter{description} = $itemTypes->{$biblioData->{itemtype}}{description}; >@@ -480,7 +479,7 @@ foreach my $biblioNum (@biblionumbers) { > $policy_holdallowed = 0; > } > >- if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{already_reserved} ne 1)) { >+ if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{holds_count} < $max_holds_per_record )) { > $itemLoopIter->{available} = 1; > $numCopiesAvailable++; > } >@@ -513,6 +512,10 @@ foreach my $biblioNum (@biblionumbers) { > $biblioLoopIter{holdable} = undef; > $anyholdable = undef; > } >+ if ($biblioLoopIter{holds_count} >= $max_holds_per_record) { >+ $biblioLoopIter{holdable} = undef; >+ $anyholdable = undef; >+ } > if(not CanBookBeReserved($borrowernumber,$biblioNum)){ > $biblioLoopIter{holdable} = undef; > $anyholdable = undef; >-- >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 7710
:
8598
|
8599
|
8600
|
8601
|
8602
|
8603
|
10091
|
10098
|
10099
|
10100
|
10101
|
10102
|
10818
|
10897
|
12620
|
14083
|
14600
|
14602
|
14603
|
15252
|
15253
|
15295
|
15731
|
15732
|
17448
|
18217
|
18320
|
18321
|
19117
|
27429
|
30218
|
35397
|
35518