Bugzilla – Attachment 25296 Details for
Bug 11770
Use validation plugin when creating new road type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11770 - Use validation plugin when creating new road type
Bug-11770---Use-validation-plugin-when-creating-ne.patch (text/plain), 4.09 KB, created by
Owen Leonard
on 2014-02-14 21:08:15 UTC
(
hide
)
Description:
Bug 11770 - Use validation plugin when creating new road type
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-02-14 21:08:15 UTC
Size:
4.09 KB
patch
obsolete
>From 35f8bafd6aeebead1913061fdb4e0ea35af02198 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 14 Feb 2014 15:51:26 -0500 >Subject: [PATCH] Bug 11770 - Use validation plugin when creating new road > type >Content-Type: text/plain; charset="utf-8" > >The page for adding a new road 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 -> Road types -> New >road type. Try submitting the form without entering a road type. This >should trigger a validation warning. > >Submission of the form with valid data should work correctly. Editing an >existing road type should also work correctly. >--- > .../prog/en/modules/admin/roadtype.tt | 44 +++----------------- > 1 file changed, 5 insertions(+), 39 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt >index 526b445..03f67c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/roadtype.tt >@@ -1,41 +1,6 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › [% IF ( add_form ) %]Road types › [% IF ( roadtypeid ) %] Modify road type[% ELSE %] New road type[% END %][% ELSE %][% IF ( delete_confirm ) %]Road types › Confirm deletion of road type[% ELSE %] Road type[% END %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function isNotNull(f,noalert) { >- if (f.value.length == 0) { >- return false; >- } >- return true; >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function isNum(v,maybenull) { >- var n = new Number(v.value); >- if (isNaN(n)) { >- return false; >- } >- if (maybenull == 0 && v.value =='') { >- return false; >- } >- return true; >- } >- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// >- function Check(f) { >- var ok=1; >- var _alertString=""; >- var alertString2; >- if (f.road_type.value.length == 0 ) { >- _alertString += "\n- " + _("Road type"); >- alert(_alertString); >- } >- else{ >- document.Aform.submit(); >- } >- } >-//]]> >-</script> > </head> > <body id="admin_roadtype" class="admin"> > [% INCLUDE 'header.inc' %] >@@ -55,7 +20,7 @@ > <h1>New road type</h1> > [% END %] > >- <form action="[% script_name %]" name="Aform" method="post"> >+ <form action="[% script_name %]" name="Aform" method="post" class="validated"> > <input type="hidden" name="op" value="add_validate" /> > <input type="hidden" name="checked" value="0" /> > <input type="hidden" name="roadtypeid" value="[% roadtypeid %]" /> >@@ -67,12 +32,13 @@ > </li> > [% END %] > <li> >- <label for="road_type">Road type: </label> >- <input type="text" name="road_type" id="road_type" size="80" maxlength="100" value="[% road_type |html %]" /> >+ <label for="road_type" class="required">Road type: </label> >+ <input type="text" name="road_type" id="road_type" size="80" maxlength="100" value="[% road_type |html %]" required="required" class="required" /> <span class="required">Required</span> > </li></ol></fieldset> > > <fieldset class="action"> >- <input class="button" type="button" onclick="Check(this.form)" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/roadtype.pl">Cancel</a> >+ <input class="button" type="submit" value="Submit" /> >+ <a class="cancel" href="/cgi-bin/koha/admin/roadtype.pl">Cancel</a> > </fieldset> > </form> > [% END %] >-- >1.7.9.5
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 11770
: 25296