Bugzilla – Attachment 23274 Details for
Bug 11333
use jQuery validator plugin for CSV profile forms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11333: use jQuery validator plugin for CSV profiles forms
Bug-11333-use-jQuery-validator-plugin-for-CSV-prof.patch (text/plain), 3.48 KB, created by
Galen Charlton
on 2013-12-03 17:12:44 UTC
(
hide
)
Description:
Bug 11333: use jQuery validator plugin for CSV profiles forms
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-12-03 17:12:44 UTC
Size:
3.48 KB
patch
obsolete
>From 3e525723dc2683cee64eb87bcbba8e0bf4734edc Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Tue, 3 Dec 2013 17:06:48 +0000 >Subject: [PATCH] Bug 11333: use jQuery validator plugin for CSV profiles > forms > >This patch adds the use of the jQuery validator plugin for >the two forms (new and edit) on the CSV profiles page. Doing >this standardizes messages that gets displayed on validation >errors. > >This patch, in the process, fixes a bug where if a page has >more than one validated form, only the first such form would >get the validator plugin applied to it -- it looks like $.validate() >does not do implicit iteration. > >To test: > >[1] Apply the patch, then go to Tools | CSV profiles. >[2] Create a new profile, but leave the name and the MARC/SQL > fields blank. When you click the submit button, the form > should not be submitted; instead, text will be displayed > to the right of each input that lacks required input. >[3] As above, but change the profile type and verify that the form > is not submitted unless all of the required fields are filled in. >[4] Edit an existing form, then empty the MARC/SQL field. Try > submitting the form; it should refuse to submit the form > and display text saying that the field is required. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 4 +++- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt | 4 ++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >index 91da8e0..234a871 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -13,7 +13,9 @@ function _(s) { return s; } // dummy function for gettext > if($("#header_search #catalog_search").length > 0){ shortcut.add('Alt+q',function (){ $("#header_search").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { shortcut.add('Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); } > > $(".focus").focus(); >- $(".validated").validate(); >+ $(".validated").each(function() { >+ $(this).validate(); >+ }); > > $("#logout").on("click",function(){ > logOut(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >index f3356de..4419bcf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt >@@ -84,7 +84,7 @@ function reloadPage(p) { > <div id="csvnew"> > <h3>New CSV export profile</h3> > >- <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post"> >+ <form action="/cgi-bin/koha/tools/csv-profiles.pl" class="validated" method="post"> > <fieldset class="rows"> > <ol> > <li><label for="profile_name" class="required">Profile name: </label> >@@ -176,7 +176,7 @@ function reloadPage(p) { > <div id="csvedit"> > <h3>Modify or delete a CSV export profile</h3> > >- <form action="/cgi-bin/koha/tools/csv-profiles.pl" method="post"> >+ <form action="/cgi-bin/koha/tools/csv-profiles.pl" class="validated" method="post"> > <fieldset class="rows"> > <ol> > <li><label for="modify_profile_name" class="required">Profile name: </label> >-- >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 11333
:
23274
|
23287
|
23326