From 19bf1e9a40ab5a8f3c86fb07dd6429bfc44f703b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 19 Feb 2014 13:05:19 -0500 Subject: [PATCH] Bug 11795 - Use validation plugin when creating new Z39.50 server The page for adding a new Z39.50 server 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 -> Z39.50 client targets -> New Z39.50 server. Try submitting the form with any of the following error conditions: - Missing Z39.50 server name - Missing hostname - Missing port - Non-numeric port - Missing database - Non-numeric rank - Non-numeric timeout These errors should trigger a validation warning. Submission of the form with valid data should work correctly. Editing an existing Z39.50 server should also work correctly. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart Amended patch: replace tabs with spaces Signed-off-by: Galen Charlton --- .../prog/en/modules/admin/z3950servers.tt | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index a1dc45f678..6e9a1ffc11 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -13,46 +13,22 @@ [% IF ( add_form ) %] [% END %] [% IF ( else ) %] @@ -93,7 +69,7 @@ [% IF ( add_form ) %] -
+ [% IF ( searchfield ) %]

Modify Z39.50 server

@@ -104,14 +80,14 @@
    [% IF ( searchfield ) %]
  1. Z39.50 server: [% searchfield %]
  2. [% ELSE %] -
  3. +
  4. Required
  5. [% END %] -
  6. +
  7. Required
  8. -
  9. +
  10. Required
  11. -
  12. +
  13. Required
  14. @@ -124,7 +100,7 @@ [% END %] -
  15. +
  16. - seconds + seconds
  17. Cancel + +
    Cancel
  18. [% END %] -- 2.39.5