Bug 15128: Do not display "New suggestion" if limit has just been reached
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 1 Jul 2016 16:00:39 +0000 (17:00 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 8 Jul 2016 14:09:50 +0000 (14:09 +0000)
If limit is X and patrons has X-1 pending suggestions, when a new one is
added, the "New suggestion" should not been added.
to avoid another call to SearchSuggestions, we assume than the
suggestion has been correctly added.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
opac/opac-suggestions.pl

index 1cc96c2..628f864 100755 (executable)
@@ -148,6 +148,7 @@ if ( $op eq "add_confirm" ) {
         $suggestion->{branchcode} = $input->param('branchcode') || C4::Context->userenv->{"branch"};
 
         &NewSuggestion($suggestion);
+        $patrons_pending_suggestions_count++;
 
         # delete empty fields, to avoid filter in "SearchSuggestion"
         foreach my $field ( qw( title author publishercode copyrightdate place collectiontitle isbn STATUS ) ) {