From 9e428504916150edac6d201065610c587bf9ee4e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 29 Feb 2016 11:53:14 -0500 Subject: [PATCH] Bug 15938 - Use validation plugin when adding or editing classification sources and filing rules MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In Administration -> Classification sources there is some embedded JavaScript which checks for empty form values. This patch removes that JS and adds validation using the globally-included validation plugin instead. To test, apply the patch and go to Administration -> Classification sources. - Click to add a new classification source and confirm that you cannot submit the form with empty required values. - Edit an existing classification source and confirm that you cannot empty a required field and submit the form. - Repeat the previous two steps with filing rules. Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../prog/en/modules/admin/classsources.tt | 90 +++++-------------- 1 file changed, 23 insertions(+), 67 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt index 6779e434da..2785ebbd5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt @@ -17,56 +17,8 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] - - + [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] @@ -101,7 +53,7 @@ function CheckRuleForm(f) { [% ELSE %]

Add classification source

[% END %] -
+
    @@ -111,20 +63,21 @@ function CheckRuleForm(f) { [% class_source %] [% ELSE %] - - + + + Required [% END %] -
  1. - +
  2. + + Required
  3. [% IF ( used ) %][% ELSE %] [% END %]
  4. -
  5. - [% FOREACH rules_dropdow IN rules_dropdown %] [% IF ( rules_dropdow.selected ) %] @@ -133,11 +86,12 @@ function CheckRuleForm(f) { [% END %] [% END %] + Required
- + Cancel
@@ -149,7 +103,7 @@ function CheckRuleForm(f) { [% ELSE %]

Add filing rule

[% END %] -
+
    @@ -159,16 +113,17 @@ function CheckRuleForm(f) { [% sort_rule %] [% ELSE %] - - + + + Required [% END %] -
  1. - +
  2. + + Required
  3. -
  4. - [% FOREACH routines_dropdow IN routines_dropdown %] [% IF ( routines_dropdow.selected ) %] @@ -177,11 +132,12 @@ function CheckRuleForm(f) { [% END %] [% END %] + Required
- + Cancel
-- 2.39.5