Bugzilla – Attachment 31731 Details for
Bug 12937
Deleting suggestions should ask for a confirmation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12937: Deleting suggestions should ask for a confirmation
PASSED-QA-Bug-12937-Deleting-suggestions-should-as.patch (text/plain), 3.15 KB, created by
Kyle M Hall (khall)
on 2014-09-19 11:27:21 UTC
(
hide
)
Description:
[PASSED QA] Bug 12937: Deleting suggestions should ask for a confirmation
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-09-19 11:27:21 UTC
Size:
3.15 KB
patch
obsolete
>From 37743c6ad2c2d22491ed46cf797284734e3c6e9e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 17 Sep 2014 13:11:00 +0200 >Subject: [PATCH] [PASSED QA] Bug 12937: Deleting suggestions should ask for a confirmation > >On the suggestion management page, the librarian can choose to delete >suggestions but no confirmation is needed. >This could produce unexpected lost of data. > >Test plan: >- go on the suggestion management page >- don't select any suggestion and try to delete (check the checkbox and submit the form). > Verify that you get an alert. >- select 1 suggestion and delete it, verify you get a confirmation > message >- select 1+ suggestions and delete it, verify you get a confirmation > message > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/suggestion/suggestion.tt | 26 +++++++++++++++++++- > 1 files changed, 25 insertions(+), 1 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index a0d9468..70d00ad 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -134,6 +134,30 @@ $(document).ready(function() { > datesAD.not( this ).datepicker( "option", option, date ); > } > }); >+ >+ $("form.update_suggestions").on("submit", function(e){ >+ var form = this; >+ var action_delete_selected = $(this).find("input[value='delete']").is(":checked"); >+ if ( action_delete_selected ) { >+ var suggestions_to_delete = $(this).find("input[name='edit_field']:checked"); >+ if ( suggestions_to_delete.length == 0 ) { >+ alert(_("No suggestion to delete")); >+ e.preventDefault(); >+ return false; >+ } else if ( suggestions_to_delete.length == 1 ) { >+ if ( ! confirm(_("Are you sure you want to delete this suggestion")) ) { >+ e.preventDefault(); >+ return false; >+ } >+ } else if ( suggestions_to_delete.length > 1 ) { >+ if ( ! confirm(_("Are you sure you want to delete these suggestions")) ) { >+ e.preventDefault(); >+ return false; >+ } >+ } >+ } >+ return true; >+ }); > }); > // ]]> > </script> >@@ -460,7 +484,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > > [% FOREACH suggestion IN suggestions %] > <div id="[% suggestion.suggestiontype %]"> >-<form name="f[% suggestion.suggestiontype %]" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype %]"> >+<form class="update_suggestions" name="f[% suggestion.suggestiontype %]" method="post" action="/cgi-bin/koha/suggestion/suggestion.pl#[% suggestion.suggestiontype %]"> > > [% IF ( suggestion.suggestions_loop ) %] > <p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p> >-- >1.7.2.5
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 12937
:
31668
|
31673
|
31674
|
31684
| 31731 |
31732