Skip to content

Commit

Permalink
Bug 10752: Alert the librarian if the suggestion has not been added
Browse files Browse the repository at this point in the history
Test plan:
- 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.

Before this patch, the suggestion was not inserted without alert.
With this patch, an alert is displayed on the interface.

Signed-off-by: Mark Tompsett <[email protected]>

NOTE: Love the simplicity and ability to expand. :)

Tested with all pateches applied. Wors as expected.
Signed-off-by: Marc Véron <[email protected]>

Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
joubu authored and tomascohen committed Apr 28, 2015
1 parent 55439f8 commit 81ab20e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,18 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o

<h1>Suggestions management</h1>


[% FOR m IN messages %]
<div class="dialog [% m.type %]">
[% SWITCH m.code %]
[% CASE 'already_exists' %]
The suggestion has not been inserted. The same suggestion already exists (<a href='/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% m.id %]&op=show'>see the suggestion</a>)
[% CASE %]
[% m.code %]
[% END %]
</div>
[% END %]

[% UNLESS ( notabs ) %]
<div id="suggestiontabs" class="toptabs">
<ul class="ui-tabs-nav">
Expand Down
5 changes: 5 additions & 0 deletions suggestion/suggestion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ sub GetCriteriumDesc{
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
Expand Down

0 comments on commit 81ab20e

Please sign in to comment.