Bugzilla – Attachment 91146 Details for
Bug 16787
'Too many holds' message appears inappropriately and is missing data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16787: 'Too many holds' message appears inappropriately and is missing data
Bug-16787-Too-many-holds-message-appears-inappropr.patch (text/plain), 5.33 KB, created by
Nick Clemens (kidclamp)
on 2019-07-01 14:02:35 UTC
(
hide
)
Description:
Bug 16787: 'Too many holds' message appears inappropriately and is missing data
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-07-01 14:02:35 UTC
Size:
5.33 KB
patch
obsolete
>From 51d68fba2d3564b612fbacd9b27fb001f117b4fb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 21 Jun 2016 09:52:47 -0400 >Subject: [PATCH] Bug 16787: 'Too many holds' message appears inappropriately > and is missing data > >This patch alters C4/Reserves.pm to pass back 'noReservesAllowed' when >allowedreserves=0. This allows passing to the user an appropriate >message about the availability of items for holds > >To test: >1 - Set an item type to allow no holds >2 - Attempt to place a hold for a patron >3 - Message should be "No holds allowed: [Firstname Surname] cannot >place holds on any of these items" >4 - Try placing a multihold with the record above and a holdable record, > message should end "...cannot place holds on some of these titles' > items" >--- > C4/Reserves.pm | 3 +++ > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 7 ++++++- > reserve/request.pl | 9 ++++++++- > 3 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 097a5c09d6..af960d63e0 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -421,6 +421,9 @@ sub CanItemBeReserved { > } > > # we check if it's ok or not >+ if( $allowedreserves == 0 ){ >+ return 'noReservesAllowed'; >+ } > if ( $reservecount >= $allowedreserves ) { > return { status => 'tooManyReserves', limit => $allowedreserves }; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index f11f0cffff..b75135deaa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -108,7 +108,9 @@ > [% UNLESS ( multi_hold ) %] > <h3>Cannot place hold</h3> > <ul> >- [% IF ( exceeded_maxreserves ) %] >+ [% IF ( no_reserves_allowed) %] >+ <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> cannot place any holds on these items.</li> >+ [% ELSIF ( exceeded_maxreserves ) %] > <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% maxreserves | html %] total holds.</li> > [% ELSIF ( exceeded_holds_per_record ) %] > <li><strong>Too many holds for this record: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li> >@@ -126,6 +128,9 @@ > </ul> > [% ELSE %] > <h3>Cannot place hold on some items</h3> >+ [% IF ( no_reserves_allowed) %] >+ <li><strong>No holds allowed: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %] </a> cannot place holds on some of these title's items.</li> >+ [% END %] > [% IF ( exceeded_maxreserves ) %] > <li><strong>Too many holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can place [% new_reserves_allowed | html %] of the requested [% new_reserves_count | html %] holds for a maximum of [% maxreserves | html %] total holds.</li> > [% ELSIF ( exceeded_holds_per_record ) %] >diff --git a/reserve/request.pl b/reserve/request.pl >index c709cec7e5..589cd456e5 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -162,6 +162,8 @@ if ($borrowernumber_hold && !$action) { > my $new_reserves_count = scalar( @biblionumbers ); > > my $maxreserves = C4::Context->preference('maxreserves'); >+ $template->param( maxreserves => $maxreserves ); >+ > if ( $maxreserves > && ( $reserves_count + $new_reserves_count > $maxreserves ) ) > { >@@ -217,6 +219,7 @@ if ($patron) { > my $itemdata_enumchron = 0; > my $itemdata_ccode = 0; > my @biblioloop = (); >+my $no_reserves_allowed = 0; > foreach my $biblionumber (@biblionumbers) { > next unless $biblionumber =~ m|^\d+$|; > >@@ -232,7 +235,10 @@ foreach my $biblionumber (@biblionumbers) { > > #All is OK and we can continue > } >- elsif ( $canReserve->{status} eq 'tooManyReserves' ) { >+ elsif ( $canReserve eq 'noReservesAllowed') { >+ $no_reserves_allowed = 1; >+ } >+ elsif ( $canReserve eq 'tooManyReserves' ) { > $exceeded_maxreserves = 1; > $template->param( maxreserves => $canReserve->{limit} ); > } >@@ -662,6 +668,7 @@ foreach my $biblionumber (@biblionumbers) { > > $template->param( biblioloop => \@biblioloop ); > $template->param( biblionumbers => $biblionumbers ); >+$template->param( no_reserves_allowed => $no_reserves_allowed ); > $template->param( exceeded_maxreserves => $exceeded_maxreserves ); > $template->param( exceeded_holds_per_record => $exceeded_holds_per_record ); > $template->param( subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber)); >-- >2.11.0
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 16787
:
52652
|
68894
|
68895
|
72827
|
72828
|
72889
|
91146
|
91147
|
91148
|
91149
|
96152
|
97403
|
99949
|
99950
|
100951
|
101473
|
101474
|
101475
|
101895
|
107793
|
107794
|
107795
|
114675
|
114676
|
114677
|
119279
|
119280
|
119281
|
119335
|
119336
|
119337
|
119616
|
119617
|
119619
|
119620
|
119621
|
119622
|
119623
|
119738
|
119739
|
119740
|
119741
|
119942
|
120009