Bug 15128: Do not display "New suggestion" if limit has just been reached

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>
This commit is contained in:
Jonathan Druart 2016-07-01 17:00:39 +01:00 committed by Kyle M Hall
parent 2c2efbf4a6
commit 1b89150d42

View file

@ -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 ) ) {