From 647fa98d7634cb01b270de4bfb114f5de96e5407 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 19 Feb 2014 12:29:34 -0500 Subject: [PATCH] Bug 11793 - Use validation plugin when creating new item type Content-Type: text/plain; charset="utf-8" The page for adding a new item type includes some custom form validation JavaScript which can be removed in favor of HTML5 validation attributes and Koha's built-in validation plugin. This patch does so. To test, apply the patch and go to Administration -> Item types -> New item type. Try submitting the form with the following error conditions: - Missing item type - Missing description - A non-number in the "rental charge" field These errors should trigger a validation warning. Submission of the form with valid data should work correctly. Editing an existing item type should also work correctly. --- .../prog/en/modules/admin/itemtypes.tt | 60 ++++---------------- 1 file changed, 11 insertions(+), 49 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index 0c1d368..2a8ce12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -22,47 +22,6 @@ Data deleted [% INCLUDE 'datatables.inc' %] @@ -124,7 +90,7 @@ Item types administration [% ELSE %]

Add item type

[% END %] -
+ @@ -137,15 +103,11 @@ Item types administration [% ELSE %]
  • - + Required
  • [% END %]
  • - [% IF ( itemtype ) %] -
  • - [% ELSE %] - - [% END %] + Required [% IF ( noItemTypeImages ) %]
  • Image: Item type images are disabled. To enable them, turn off the noItemTypeImages system preference
  • [% ELSE %] @@ -242,7 +204,7 @@ Item types administration
    - + Cancel
    -- 1.7.9.5