Bugzilla – Attachment 52625 Details for
Bug 15128
Add ability to limit the number of open purchase suggestions a patron can make
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit
Bug-15128-QA-Followup-2---Only-count-pending-sugge.patch (text/plain), 4.95 KB, created by
Kyle M Hall (khall)
on 2016-06-20 19:26:23 UTC
(
hide
)
Description:
Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-06-20 19:26:23 UTC
Size:
4.95 KB
patch
obsolete
>From 988bfd92fa9c5a818ba3cd5ea33584b740409ee0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 20 Jun 2016 19:25:12 +0000 >Subject: [PATCH] Bug 15128 [QA Followup 2] - Only count pending suggestions > for the limit > >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 6 +++--- > opac/opac-suggestions.pl | 10 ++++------ > 2 files changed, 7 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 140b902..3764852 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -28,7 +28,7 @@ > <div class="span10"> > <div id="usersuggestions" class="maincontent"> > [% IF ( op_add ) %] >- [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <h1 class="TooManySuggestions">You cannot place any more suggestions</h1> > <h2 class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]). Once the library has processed those suggestions you will be able to place more.</h2> > [% ELSE %] >@@ -152,7 +152,7 @@ > <input type="hidden" name="op" value="delete_confirm" /> > [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] > <div id="toolbar" class="toolbar clearfix"> >- [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]).</br>Once the library has processed those suggestions you will be able to place more.</p> > [% ELSE %] > <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a> >@@ -256,7 +256,7 @@ > <p>There are no pending purchase suggestions.</p> > [% END %] > [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] >- [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time.</br>Once the library has processed those suggestions you will be able to place more</p> > [% ELSE %] > <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 4624658..6d2b88b 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -112,10 +112,12 @@ if ( $op eq 'else' ) { > } > } > >+my $patrons_pending_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, STATUS => 'ASKED' } ) }; >+ > my $suggestions_loop = &SearchSuggestion($suggestion); > if ( $op eq "add_confirm" ) { > my $count_own_suggestions = $borrowernumber ? &SearchSuggestion( { suggestedby => $borrowernumber } ) : 0; >- if ( @$count_own_suggestions >= C4::Context->preference("MaxOpenSuggestions") ) >+ if ( $patrons_pending_suggestions_count >= C4::Context->preference("MaxOpenSuggestions") ) > { > push @messages, { type => 'error', code => 'too_many' }; > } >@@ -209,11 +211,7 @@ $template->param( > messages => \@messages, > suggestionsview => 1, > suggested_by_anyone => $suggested_by_anyone, >- own_suggestions_count => scalar @{ >- SearchSuggestion( >- { suggestedby => $borrowernumber, STATUS => 'ASKED' } >- ) >- }, >+ patrons_pending_suggestions_count => $patrons_pending_suggestions_count, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.1.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 15128
:
52452
|
52502
|
52596
|
52610
|
52611
|
52623
|
52624
|
52625
|
52626
|
52715
|
52716
|
52717
|
52718
|
52719
|
52720
|
52721
|
52722
|
52997
|
53033
|
53034
|
53037
|
53038
|
53039
|
53040
|
53041
|
53042
|
53043
|
53044
|
53045