Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit
Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
5aa3313239
commit
1bfe7c7512
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue