From e0335304cd0735c6f8e10f035f9eac555c9ba7c0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 18 Feb 2014 14:52:26 -0500 Subject: [PATCH] Bug 11787 - Use validation plugin when adding new vendor The vendor entry form uses some custom JavaScript which can be removed in favor of HTML5 validation attributes and Koha's built-in validation plugin. This patch does so. Also corrected: Minor validation issue. To test, apply the patch and go to Acquisitions -> New vendor. Try submitting the form without entering a vendor name. This should trigger a validation warning. Submission of the form with valid data should work correctly. Editing an existing vendor should also work correctly. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart --- .../prog/en/modules/acqui/supplier.tt | 21 +++++++------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 79ae629..14faa11 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -12,13 +12,6 @@ function confirm_deletion() { window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete"; } } -function check(f) { -if (f.company.value == "") { - alert(_("You must specify a name for this vendor.")); - return false; -} - f.submit(); -} $(document).ready(function() { [% IF (dateformat == 'metric') %] @@ -60,13 +53,13 @@ if (f.company.value == "") { [% END %] [% UNLESS ( enter ) %][% INCLUDE 'acquisitions-toolbar.inc' %][% END %] [% IF ( enter ) %] -
+
Company details -
  1. -
  2. +
    1. + Required
    2. @@ -114,7 +107,7 @@ if (f.company.value == "") {
    3. @@ -122,7 +115,7 @@ if (f.company.value == "") {
    4. @@ -159,7 +152,7 @@ if (f.company.value == "") { [% IF gst_values %]
      1. - +
-
[% IF ( booksellerid ) %] +
[% IF ( booksellerid ) %] [% ELSE %] [% END %]Cancel
-- 1.7.10.4