Bugzilla – Attachment 25424 Details for
Bug 11766
Use validation plugin when creating new authority type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
r Attachment to Bug 11766 - Use validation plugin when creating new authority type
Bug-11766---Use-validation-plugin-when-creating-ne.patch (text/plain), 4.45 KB, created by
Jonathan Druart
on 2014-02-19 08:49:09 UTC
(
hide
)
Description:
r Attachment to Bug 11766 - Use validation plugin when creating new authority type
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-02-19 08:49:09 UTC
Size:
4.45 KB
patch
obsolete
>From f6d2a02740ab28b608d40227773b1cb238cccbcd Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 14 Feb 2014 13:11:04 -0500 >Subject: [PATCH] Bug 11766 - Use validation plugin when creating new > authority type > >The new authority type entry form uses custom form validation >JavaScript. This patch removes it in favor of using HTML5 validation >attributes and Koha's built-in validation plugin. > >To test, go to Administration -> Authority types and click "New >authority type." Try submitting the form without entering any data. You >should see a warning about required fields. Upon entering text in those >fields the warning should disappear. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../prog/en/modules/admin/authtypes.tt | 43 ++++---------------- > 1 file changed, 7 insertions(+), 36 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >index 7823108..dcc606d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt >@@ -7,38 +7,8 @@ > [% 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 Check(f) { >- var _alertString=""; >- var alertString2; >- if (f.authtypecode.value.length==0) { >- _alertString += "\n- " + _("Authority type : code missing"); >- } >- if (!(isNotNull(window.document.Aform.authtypetext,1))) { >- _alertString += "\n- " + _("Description missing"); >- } >- if (_alertString.length==0) { >- document.Aform.submit(); >- } else { >- alertString2 = _("Form not submitted because of the following problem(s)"); >- alertString2 += "\n------------------------------------------------------------------------------------\n"; >- alertString2 += _alertString; >- alert(alertString2); >- } >-} >- >-//]]> >-</script> > </head> >+ > <body id="admin_authtypes" class="admin"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >@@ -61,7 +31,7 @@ function Check(f) { > > [% IF ( add_form ) %] > >- <form action="[% script_name %]" name="Aform" method="post"> >+ <form action="[% script_name %]" name="Aform" method="post" class="validated"> > <fieldset class="rows"> > <legend> > [% IF ( authtypecode ) %] >@@ -78,11 +48,11 @@ function Check(f) { > <input type="hidden" name="checked" value="0" /> > <input type="hidden" name="authtypecode" value="[% authtypecode %]" />[% authtypecode %] > [% ELSE %] >- <label for="authtypecode">Authority type: </label> >- <input id="authtypecode" type="text" name="authtypecode" size="10" maxlength="10" onblur="toUC(this)" /> >+ <label for="authtypecode" class="required">Authority type: </label> >+ <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" onblur="toUC(this)" /> > [% END %] > </li> >- <li><label for="authtypetext">Description: </label><input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authtypetext |html %]" /></li> >+ <li><label for="authtypetext" class="required">Description: </label><input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authtypetext |html %]" class="required" required="required" /></li> > <li><label for="summary">Summary: </label><textarea id="summary" name="summary" cols="55" rows="7">[% summary %]</textarea></li> > <li> > <p class="tip">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</p> >@@ -94,7 +64,8 @@ function Check(f) { > </li> > </ol> > </fieldset> >- <fieldset class="action"><input type="submit" value="Submit" onclick="Check(this.form); return false;" /> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" /> > <a class="cancel" href="[% script_name %]">Cancel</a> > </fieldset> > </form> >-- >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 11766
:
25291
|
25409
| 25424