You cannot place any more suggestions
+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.
+ [% ELSE %]Enter a new purchase suggestion
Please fill out this form to make a purchase suggestion. You will receive an email when the library processes your suggestion
@@ -88,6 +92,7 @@ Cancel + [% END %] [% END # IF op_add %] [% IF ( op_else ) %] @@ -145,7 +150,11 @@ [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] [% END %] @@ -245,7 +254,11 @@There are no pending purchase suggestions.
[% END %] [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] - + [% IF ( Koha.Preference('MaxOpenSuggestions') && own_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] +You have reached your limit of suggestions you can place at this time.Once the library has processed those suggestions you will be able to place more
+ [% ELSE %] + + [% END %] [% END %] [% END # / IF suggestions_loop %] --- a/opac/opac-suggestions.pl +++ a/opac/opac-suggestions.pl @@ -157,9 +157,13 @@ map{ $library ? $s->{branchcodesuggestedby} = $library->branchname : () } @$suggestions_loop; +my $own_suggestions_count = 0; foreach my $suggestion(@$suggestions_loop) { if($suggestion->{'suggestedby'} == $borrowernumber) { $suggestion->{'showcheckbox'} = $borrowernumber; + if ( $suggestion->{'STATUS'} eq 'ASKED' ) { + $own_suggestions_count++; + } } else { $suggestion->{'showcheckbox'} = 0; } @@ -195,6 +199,7 @@ $template->param( messages => \@messages, suggestionsview => 1, suggested_by_anyone => $suggested_by_anyone, + own_suggestions_count => $own_suggestions_count, ); output_html_with_http_headers $input, $cookie, $template->output; --