Bug 11333: use jQuery validator plugin for CSV profiles forms
authorGalen Charlton <gmc@esilibrary.com>
Tue, 3 Dec 2013 17:06:48 +0000 (17:06 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 6 Dec 2013 15:12:20 +0000 (15:12 +0000)
commit31a3fe1537de393cad1e215bb43f6f1e659c6f72
treef3e36cd596dd4684b80fba6c722098594f479068
parentff0b85a0e0d86bc95ed78056f5225a3a1c14c6ea
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>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed some tabs, works nicely and as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js
koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt