Bugzilla – Attachment 25481 Details for
Bug 11787
Use validation plugin when adding new vendor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11787 - Use validation plugin when adding new vendor
Bug-11787---Use-validation-plugin-when-adding-new-.patch (text/plain), 5.35 KB, created by
Jonathan Druart
on 2014-02-20 09:50:39 UTC
(
hide
)
Description:
Bug 11787 - Use validation plugin when adding new vendor
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-02-20 09:50:39 UTC
Size:
5.35 KB
patch
obsolete
>From e0335304cd0735c6f8e10f035f9eac555c9ba7c0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <chris@bigballofwax.co.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../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 ) %] >- <form action="updatesupplier.pl" name="updatesupplier" method="post"> >+ <form action="updatesupplier.pl" name="updatesupplier" class="validated" method="post"> > <div class="yui-g"> > <input type="hidden" name="booksellerid" value="[% booksellerid %]" /> > <fieldset class="rows"> > <legend>Company details</legend> >- <ol><li><label for="company" class="required">Name: * </label> >- <input type="text" size="40" id="company" name="company" value="[% name %]" class="focus" /></li> >+ <ol><li><label for="company" class="required">Name:</label> >+ <input type="text" size="40" id="company" name="company" value="[% name %]" required="required" class="required" /><span class="required">Required</span></li> > <li><label for="company_postal">Postal address: </label> > <textarea id="company_postal" name="company_postal" cols="40" rows="3">[% postal %]</textarea></li> > <li><label for="physical">Physical address: </label> >@@ -114,7 +107,7 @@ if (f.company.value == "") { > <li><label for="list_currency">List prices are: </label> > <select name="list_currency" id="list_currency"> > [% FOREACH loop_currenc IN loop_currency %] >- [% IF ( loop_currenc.listprice ) %]<option value="[% loop_currenc.currency %]" selected="1">[% loop_currenc.currency %]</option> >+ [% IF ( loop_currenc.listprice ) %]<option value="[% loop_currenc.currency %]" selected="selected">[% loop_currenc.currency %]</option> > [% ELSE %]<option value="[% loop_currenc.currency %]">[% loop_currenc.currency %]</option>[% END %] > [% END %] > </select> >@@ -122,7 +115,7 @@ if (f.company.value == "") { > <li><label for="invoice_currency">Invoice prices are: </label> > <select name="invoice_currency" id="invoice_currency"> > [% FOREACH loop_currenc IN loop_currency %] >- [% IF ( loop_currenc.invoiceprice ) %]<option value="[% loop_currenc.currency %]" selected="1">[% loop_currenc.currency %]</option> >+ [% IF ( loop_currenc.invoiceprice ) %]<option value="[% loop_currenc.currency %]" selected="selected">[% loop_currenc.currency %]</option> > [% ELSE %]<option value="[% loop_currenc.currency %]">[% loop_currenc.currency %]</option>[% END %] > [% END %] > </select> >@@ -159,7 +152,7 @@ if (f.company.value == "") { > [% IF gst_values %] > <ol> > <li> >- <label for="gst">Tax rate: </label> >+ <label for="gstrate">Tax rate: </label> > <select name="gstrate" id="gstrate"> > [% FOREACH gst IN gst_values %] > [% IF ( gstrate == gst.option ) %] >@@ -184,7 +177,7 @@ if (f.company.value == "") { > <li><label for="notes">Notes: </label> > <textarea cols="40" rows="4" id="notes" name="notes" >[% notes %]</textarea></li></ol> > </fieldset> >- <fieldset class="action"><input type="button" value="Save" onclick="check(this.form);" /> [% IF ( booksellerid ) %] >+ <fieldset class="action"><input type="submit" value="Save" /> [% IF ( booksellerid ) %] > <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/acqui-home.pl"> > [% END %]Cancel</a></fieldset> > </div> >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11787
:
25394
|
25406
| 25481