Bug 10752: Alert the librarian if the suggestion has not been added
[koha.git] / suggestion / suggestion.pl
index b329d27..43834f6 100755 (executable)
@@ -134,6 +134,11 @@ if ( $op =~ /save/i ) {
             SearchSuggestion( $suggestion_only );
         if (@$suggestions_loop>=1){
             #some suggestion are answering the request Donot Add
+            my @messages;
+            for my $suggestion ( @$suggestions_loop ) {
+                push @messages, { type => 'error', code => 'already_exists', id => $suggestion->{suggestionid} };
+            }
+            $template->param( messages => \@messages );
         } 
         else {    
             ## Adding some informations related to suggestion