@@ -, +, @@
added
- Create a new suggestion, chose a short term as your title and copy it.
- Leave all other fields of the suggestion form untouched.
- Save your first suggestion.
- Enter a second suggestion with the same title.
---
.../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt | 12 ++++++++++++
suggestion/suggestion.pl | 5 +++++
2 files changed, 17 insertions(+)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -457,6 +457,18 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
Suggestions management
+
+[% FOR m IN messages %]
+
+ [% SWITCH m.code %]
+ [% CASE 'already_exists' %]
+ The suggestion has not been inserted. The same suggestion already exists (
see the suggestion)
+ [% CASE %]
+ [% m.code %]
+ [% END %]
+
+[% END %]
+
[% UNLESS ( notabs ) %]
--- a/suggestion/suggestion.pl
+++ a/suggestion/suggestion.pl
@@ -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
--