Bugzilla – Attachment 38160 Details for
Bug 10752
Impossible to add 2 identical suggestions, but without any explanation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10752: Alert if the suggestion has not been added - OPAC
Bug-10752-Alert-if-the-suggestion-has-not-been-add.patch (text/plain), 4.09 KB, created by
Jonathan Druart
on 2015-04-20 08:10:09 UTC
(
hide
)
Description:
Bug 10752: Alert if the suggestion has not been added - OPAC
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-20 08:10:09 UTC
Size:
4.09 KB
patch
obsolete
>From 6856ddffdd80688249cdfac2ded1d7d51df2ba03 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 20 Apr 2015 10:08:07 +0200 >Subject: [PATCH] Bug 10752: Alert if the suggestion has not been added - OPAC > >Same as previous patches for the OPAC. > >Test plan is the same. >--- > .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 13 ++++++++++++- > opac/opac-suggestions.pl | 15 ++++++++++----- > 2 files changed, 22 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 46d0031..8ac7035 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -111,9 +111,20 @@ > [% END %] > [% END %] > </h1> >+ [% FOR m IN messages %] >+ <div class="alert alert-[% m.type %]"> >+ [% SWITCH m.code %] >+ [% CASE 'already_exists' %] >+ The suggestion has not been inserted. The same suggestion already exists. >+ [% CASE 'success_on_inserted' %] >+ Your suggestion has been submitted. >+ [% CASE %] >+ [% m.code %] >+ [% END %] >+ </div> >+ [% END %] > > [% IF ( deleted ) %]<div class="alert alert-info">The selected suggestions have been deleted.</div>[% END %] >- [% IF ( submitted ) %]<div class="alert alert-info">Your suggestion has been submitted.</div>[% END %] > > [% IF ( suggestions_loop ) %] > [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %] >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 16aadf8..4b17562 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -54,7 +54,7 @@ if ( ! C4::Context->preference('suggestion') ) { > delete $$suggestion{$_} foreach qw<op suggestedbyme>; > $op = 'else' unless $op; > >-my ( $template, $borrowernumber, $cookie ); >+my ( $template, $borrowernumber, $cookie, @messages ); > my $deleted = $input->param('deleted'); > my $submitted = $input->param('submitted'); > >@@ -94,6 +94,10 @@ my $suggestions_loop = > if ( $op eq "add_confirm" ) { > if (@$suggestions_loop>=1){ > #some suggestion are answering the request Donot Add >+ for my $suggestion ( @$suggestions_loop ) { >+ push @messages, { type => 'error', code => 'already_exists', id => $suggestion->{suggestionid} }; >+ last; >+ } > } > else { > my $scrubber = C4::Scrubber->new(); >@@ -109,10 +113,9 @@ if ( $op eq "add_confirm" ) { > $$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>; > $suggestions_loop = > &SearchSuggestion( $suggestion ); >+ push @messages, { type => 'info', code => 'success_on_inserted' }; > } >- $op = 'else'; >- print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else&submitted=1"); >- exit; >+ $op = 'else'; > } > > if ( $op eq "delete_confirm" ) { >@@ -121,7 +124,7 @@ if ( $op eq "delete_confirm" ) { > &DelSuggestion( $borrowernumber, $delete_field ); > } > $op = 'else'; >- print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else&deleted=1"); >+ print $input->redirect("/cgi-bin/koha/opac-suggestions.pl?op=else"); > exit; > } > map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; >@@ -171,6 +174,8 @@ $template->param( > patron_reason_loop => $patron_reason_loop, > showall => $allsuggestions, > "op_$op" => 1, >+ $op => 1, >+ messages => \@messages, > suggestionsview => 1, > ); > >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10752
:
37967
|
37991
|
38159
|
38160
|
38204
|
38205
|
38206
|
38213
|
38214
|
38215
|
38216