Bugzilla – Attachment 39224 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 14070 Improved handling of Notice saving
Bug-14070-Improved-handling-of-Notice-saving.patch (text/plain), 4.19 KB, created by
Mark Tompsett
on 2015-05-15 19:27:02 UTC
(
hide
)
Description:
Bug 14070 Improved handling of Notice saving
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-05-15 19:27:02 UTC
Size:
4.19 KB
patch
obsolete
>From 5c067fa52c9d5e4e721878eefbc028a4a17d4a53 Mon Sep 17 00:00:00 2001 >From: Indranil Das Gupta <indradg@gmail.com> >Date: Fri, 15 May 2015 19:34:28 +0530 >Subject: [PATCH] Bug 14070 Improved handling of Notice saving > >Addresses the issue of losing already entered data when an user >attempts to save a new or existing letter / notice. Happened if >the used template's (i.e. email, phone, print or sms) mandatory >field(s) i.e. subject or content were left empty. > >Revised Test plan >================= > >1) Set the SMSSendDriver system preference to *anything* > in order to enable entry of SMS notices. > (Home -> Koha administration -> Global system preferences -> Patrons) >2) Set the TalkingTechItivaPhoneNotification system preference > to Enable in order to enable entry of Phone notices. > (Home -> Koha administration -> Global system preferences -> Patrons) >3) Home -> Tools -> Notices & slips -> + New notice >4) For each of the four types (Email, Phone, Print, SMS): > a) Enter a code and description. > (e.g. TST, testing) > b) type 'test' into the letter box. > c) Click 'Submit' > -- You should get a warning, but it will force you back to the > Notices & Slips page! This is WRONG! >5) Apply this patch >6) Repeat steps 4a-c for each type, but also. > -- when you click Submit, you will get a warning, but not > be redirected > d) After the warning, clear out the letter box before > attempting the next type. The warning gets caught for the > first problem section, not all of them. Fixing that is beyond > the scope of this bug. >7) run koha qa test tools > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 28 +++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 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..4334acf 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,9 @@ $(document).ready(function() { > $("#submit_form").click( function(event) { > event.preventDefault(); > var at_least_one_exists = 0; >+ var submit_trigger = 0; >+ var check_mtt_fieldsets = new Array (); >+ > $("fieldset.mtt").each( function(){ > var title = $(this).find('input[name="title"]').val(); > var content = $(this).find('textarea[name="content"]').val(); >@@ -41,10 +44,12 @@ $(document).ready(function() { > var msg = _("Please specify title and content for %s"); > msg = msg.replace( "%s", mtt ); > at_least_one_exists = 1; >- alert(msg) >+ check_mtt_fieldsets.push("0"); >+ alert(msg); > return false; > } else if ( title.length > 0 && content.length > 0 ) { > at_least_one_exists = 1; >+ check_mtt_fieldsets.push("1"); > } > } ); > if ( ! at_least_one_exists ) { >@@ -52,6 +57,19 @@ $(document).ready(function() { > return false; > } > >+ for(var i = 0; i < check_mtt_fieldsets.length; i++) >+ { >+ if ( check_mtt_fieldsets[i] !== check_mtt_fieldsets[0] ) >+ { >+ submit_trigger = 0; >+ return false; >+ } else { >+ if ( check_mtt_fieldsets[0] == 1 ) { >+ submit_trigger = 1; >+ } >+ } >+ } >+ > // Test if code already exists in DB > var new_lettercode = $("#code").val(); > var new_branchcode = $("#branch").val(); >@@ -71,13 +89,17 @@ $(document).ready(function() { > } > return false; > } else { >- $("#add_notice").submit(); >+ if ( submit_trigger == 1) { >+ $("#add_notice").submit(); >+ } > } > }, > }); > [% IF ( add_form and code ) %] > } else { >- $("#add_notice").submit(); >+ if ( submit_trigger == 1) { >+ $("#add_notice").submit(); >+ } > } > [% END %] > }); >-- >2.1.4
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