From 1d9b86aabccf1bc916b6b27e568ad984caf081f6 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 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. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../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 0c1d36836c..2a8ce121ae 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
    -- 2.39.2