Bugzilla – Attachment 39388 Details for
Bug 14070
Notice not saved when mandatory fields are not filled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14118: Prevent to save a letter if an error occurred
Bug-14118-Prevent-to-save-a-letter-if-an-error-occ.patch (text/plain), 2.16 KB, created by
Jonathan Druart
on 2015-05-22 10:02:55 UTC
(
hide
)
Description:
Bug 14118: Prevent to save a letter if an error occurred
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-05-22 10:02:55 UTC
Size:
2.16 KB
patch
obsolete
>From fd4f27fe1c83e31cab54c406a547d25a27eea93b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Fri, 22 May 2015 11:58:18 +0200 >Subject: [PATCH] Bug 14118: Prevent to save a letter if an error occurred > >On saving a letter, if the title or the content of a template is not >defined, a JS alert is raised. But the form is submitted anyway. >This patch prevent the form to be submitted. > >Test plan: >- Create or edit a letter >- Fill the title for a template, not the content >- Save >- Confirm you get the alert and that the form is not submitted > >http://bugs.koha-community.org/show_bug.cgi?id=14070 >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 3106498..06bf585 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -30,6 +30,7 @@ $(document).ready(function() { > $("#submit_form").click( function(event) { > event.preventDefault(); > var at_least_one_exists = 0; >+ var are_valid = 1; > $("fieldset.mtt").each( function(){ > var title = $(this).find('input[name="title"]').val(); > var content = $(this).find('textarea[name="content"]').val(); >@@ -41,8 +42,8 @@ $(document).ready(function() { > var msg = _("Please specify title and content for %s"); > msg = msg.replace( "%s", mtt ); > at_least_one_exists = 1; >- alert(msg) >- return false; >+ alert(msg); >+ return are_valid = false; > } else if ( title.length > 0 && content.length > 0 ) { > at_least_one_exists = 1; > } >@@ -51,6 +52,9 @@ $(document).ready(function() { > alert( _("Please fill at least one template.") ); > return false; > } >+ if ( ! are_valid ) { >+ return false; >+ } > > // Test if code already exists in DB > var new_lettercode = $("#code").val(); >-- >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 14070
:
39212
|
39224
|
39388
|
39404
|
39721