Bugzilla – Attachment 26649 Details for
Bug 9016
Multi transport types for notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9016: Add some validation on the letter form
Bug-9016-Add-some-validation-on-the-letter-form.patch (text/plain), 3.75 KB, created by
Jonathan Druart
on 2014-03-27 15:09:59 UTC
(
hide
)
Description:
Bug 9016: Add some validation on the letter form
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-27 15:09:59 UTC
Size:
3.75 KB
patch
obsolete
>From 8e55423abd7f318a7ef53ae07816143d2869a6bc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 27 Mar 2014 16:01:22 +0100 >Subject: [PATCH] Bug 9016: Add some validation on the letter form > >1/ Code and Name are mandatory. >2/ At least 1 template should be filled on saving. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 37 +++++++++++++++----- > 1 file changed, 28 insertions(+), 9 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 d26785a..f24bb33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -26,6 +26,7 @@ $(document).ready(function() { > [% END %] > > $("#submit").click( function(event) { >+ var at_least_one_exists = 0; > $("fieldset.mtt").each( function(){ > var title = $(this).find('input[name="title"]').val(); > var content = $(this).find('textarea[name="content"]').val(); >@@ -36,10 +37,19 @@ $(document).ready(function() { > var mtt = $(this).find('input[name="message_transport_type"]').val(); > var msg = _("Please specify title and content for %s"); > msg = msg.replace( "%s", mtt ); >+ at_least_one_exists = 1; > alert(msg) > event.preventDefault(); >+ return false; >+ } else if ( title.length > 0 && content.length > 0 ) { >+ at_least_one_exists = 1; > } > } ); >+ if ( ! at_least_one_exists ) { >+ alert( _("Please fill at least one template.") ); >+ event.preventDefault(); >+ return false; >+ } > return true; > }); > >@@ -212,7 +222,7 @@ $(document).ready(function() { > > [% IF ( add_form ) %] > <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> >- <form name="Aform" method="post" enctype="multipart/form-data"> >+ <form name="Aform" method="post" enctype="multipart/form-data" class="validate"> > <input type="hidden" name="op" id="op" value="add_validate" /> > <input type="hidden" name="checked" value="0" /> > [% IF ( modify ) %] >@@ -280,14 +290,23 @@ $(document).ready(function() { > [% ELSE %] > <option value="suggestions">Suggestions</option> > [% END %] >- </select> >- </li> >- <li> >- <span class="label">Code:</span>[% IF ( adding ) %]<input type="text" id="code" name="code" size="20" maxlength="20" />[% ELSE %]<input type="hidden" id="code" name="code" value="[% code %]" />[% code %][% END %] >- </li> >- <li> >- <label for="name">Name:</label><input type="text" id="name" name="name" size="60" value="[% letter_name %]" /> >- </li> >+ </select> >+ </li> >+ <li> >+ [% IF adding %] >+ <label for"code" class="required">Code:</label> >+ <input type="text" id="code" name="code" size="20" maxlength="20" required="required" /> >+ <span class="required">Required</span> >+ [% ELSE %] >+ <label for="code">Code:</label> >+ <input type="hidden" id="code" name="code" value="[% code %]" />[% code %] >+ [% END %] >+ </li> >+ <li> >+ <label for="name" class="required">Name:</label> >+ <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" /> >+ <span class="required">Required</span> >+ </li> > > [% FOREACH letter IN letters %] > <li> >-- >1.7.10.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 9016
:
13276
|
20814
|
20815
|
20816
|
20916
|
21164
|
21165
|
21166
|
21167
|
21636
|
21637
|
21638
|
21639
|
22814
|
23272
|
23273
|
23289
|
23290
|
23291
|
23292
|
23293
|
23562
|
23955
|
23956
|
23957
|
23958
|
23959
|
23960
|
24571
|
24572
|
24573
|
24574
|
24575
|
24576
|
25006
|
25123
|
25124
|
25125
|
25126
|
25127
|
25128
|
25129
|
25130
|
25415
|
25416
|
25417
|
25418
|
25419
|
25420
|
25421
|
25422
|
25606
|
25899
|
26182
|
26209
|
26210
|
26211
|
26216
|
26226
|
26233
|
26648
|
26649
|
26650
|
26656
|
26657
|
26658
|
26659
|
26660
|
26661
|
26662
|
26663
|
26664
|
26665
|
26666
|
26667
|
26668
|
26670
|
26672
|
26673
|
27794
|
27795
|
27796
|
27797
|
27798
|
27799
|
27800
|
27801
|
27802
|
27803
|
27804
|
27805
|
27806
|
27807
|
27808
|
27809