Bugzilla – Attachment 65013 Details for
Bug 18932
Validation not being completed on member entry for number fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18932: Implementing rules for validating number fields for borrower info
Bug-18932-Implementing-rules-for-validating-number.patch (text/plain), 5.08 KB, created by
Aleisha Amohia
on 2017-07-13 04:36:50 UTC
(
hide
)
Description:
Bug 18932: Implementing rules for validating number fields for borrower info
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-07-13 04:36:50 UTC
Size:
5.08 KB
patch
obsolete
>From 24e66fdb22f9a2537dd6ff1608a0f2f5fc561891 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 13 Jul 2017 04:30:47 +0000 >Subject: [PATCH] Bug 18932: Implementing rules for validating number fields > for borrower info > >The fields I've added validation for are (in both OPAC and staff >client): >- phone >- secondary phone >- other phone >- fax >- zipcode >- alt address zipcode >- alt address phone >- alt contact zipcode >- alt contact phone >- SMS number (messaging preferences, may have to enable the >EnhancedMessagingPreferences and EnhancedMessagingPreferencesOPAC >sysprefs to see this) > >To test: >1) In staff client, add a new patron or edit an existing one. Confirm >that attempting to enter symbols or letters in the above fields prevents >form submission >2) In OPAC, log in and edit your personal details. Confirm that >attempting to enter symbols or letters in the above fields prevents form >submission. >3) Go to your messaging preferences and confirm you can only save >numbers in the SMS number field > >Sponsored-by: Catalyst IT >--- > koha-tmpl/intranet-tmpl/prog/js/members.js | 32 +++++++++++++++++++++- > .../bootstrap/en/modules/opac-memberentry.tt | 27 ++++++++++++++++++ > .../bootstrap/en/modules/opac-messaging.tt | 18 ++++++++++++ > 3 files changed, 76 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 28853b2..52a1e50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -334,7 +334,37 @@ $(document).ready(function(){ > }, > B_email: { > email: true >- } >+ }, >+ phone: { >+ number: true >+ }, >+ phonepro: { >+ number: true >+ }, >+ mobile: { >+ number: true >+ }, >+ fax: { >+ number: true >+ }, >+ zipcode: { >+ number: true >+ }, >+ B_zipcode: { >+ number: true >+ }, >+ B_phone: { >+ number: true >+ }, >+ altcontactzipcode: { >+ number: true >+ }, >+ altcontactphone: { >+ number: true >+ }, >+ SMSnumber: { >+ number: true >+ }, > }, > submitHandler: function(form) { > $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 231e2bf..3b5d4a3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -1011,6 +1011,33 @@ > }, > borrower_B_email: { > email: true >+ }, >+ borrower_zipcode: { >+ number: true >+ }, >+ borrower_phone: { >+ number: true >+ }, >+ borrower_phonepro: { >+ number: true >+ }, >+ borrower_mobile: { >+ number: true >+ }, >+ borrower_fax: { >+ number: true >+ }, >+ borrower_B_zipcode: { >+ number: true >+ }, >+ borrower_B_phone: { >+ number: true >+ }, >+ borrower_altcontactzipcode: { >+ number: true >+ }, >+ borrower_altcontactphone: { >+ number: true > } > }, > submitHandler: function(form) { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >index 84cb228..6257277 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -161,6 +161,7 @@ > > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.validate.min.js"></script> > <script type="text/javascript">//<![CDATA[ > $(document).ready(function(){ > $(".none").click(function(){ >@@ -173,6 +174,23 @@ > $("#rss"+newid).removeAttr("checked"); > } > }); >+ >+ $("form[name='opacmessaging']").validate({ >+ rules: { >+ SMSnumber: { >+ number: true >+ } >+ }, >+ submitHandler: function(form) { >+ if (form.beenSubmitted){ >+ return false; >+ } else { >+ form.beenSubmitted = true; >+ form.submit(); >+ } >+ } >+ }); >+ > $("#info_digests").tooltip(); > }); > //]]> >-- >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 18932
: 65013