Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin
Owen Leonard c28f7d7de5 Bug 6209 [Revised] Standardize on one plugin for client-side form validation
This patch adds the jQuery "Validation" plugin
(http://docs.jquery.com/Plugins/Validation) and includes it by
default in the staff client along with an include file containing
translatable strings for all of the plugin's possible messages.

The staff client's main JavaScript file has been modified to perform
automatic validation of any form with the class "validated."

For a simple example I have modified the library entry form
to mark required fields as required (something which had not
been done before). Each required field has been given a class,
"required" and the HTML5 attribute "required." The former adds
the hook for the plugin, the latter adds browser-based validation
in recent browsers (and which will be superceded by the plugin
if JavaScript is enabled).

This will check for inputs classed "required" without any
additional configuration. More complex forms (with specific
data types, for instance) will require more inline JavaScript
configuration.

$("#FormID").validate({ /* configuration details */ });

Also added to the library entry form are checks on the email and URL
fields via classes ("email" and "url", respectively). This demonstrates
validation of content without forcing the field to be required.

To test, go to Administration -> Libraries and Groups and choose
"New library." Submit the form without entering a library code
or name. You should be prevented from submitting the form and be
shown an error message by each field. Perform the same check with an
existing entry.

To test browser-based validation, disable JavaScript and follow
the same procedure.

Revision rebases the patch against current master and adds missing
"//<![CDATA["

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described with new or existing library.
No errors.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-23 00:12:36 -04:00
..
preferences Bug 7740 - Followup - Add Non-XSLT Caveaut to system preference 2013-03-22 22:57:32 -04:00
searchengine/solr Bug 9265 - Switch to HTML5 doctype in OPAC and staff client 2013-01-31 11:47:04 -05:00
admin-home.tt Bug 7440 - Remove NoZebra vestiges 2013-03-19 21:17:04 -04:00
aqbudget_user_search.tt Bug 7304: More permissions for budgets 2012-06-27 16:25:44 +02:00
aqbudgetperiods.tt Bug 8117 [Follow-up] Divide budget periods into two tabs 2012-12-02 09:21:40 -05:00
aqbudgets.tt Bug 4266: Hide Encumbrance and Expenditure in aqbudgets.tt 2013-03-15 18:54:04 -04:00
aqcontract.tt Bug 8913 [Revised] Improve acquisitions navigation 2013-02-20 09:17:21 -05:00
aqplan.tt Bug 8181 [REVISED] Replace DynArch calendar widget with jQueryUI version 2012-06-25 18:26:26 +02:00
auth_subfields_structure.tt Bug 7483 follow-up replacing tabs by 4 spaces in both templates 2012-10-22 17:07:37 +02:00
auth_tag_structure.tt Bug 9428 [Revised] Use DataTables in Authority MARC frameworks page 2013-03-07 10:54:37 -05:00
authorised_values.tt Bug 9429 [Revised] Use DataTables on Authorized Values page 2013-03-07 10:52:15 -05:00
authtypes.tt Bug 9623 - Replace YUI button on authority types administration page with Bootstrap 2013-02-18 08:07:13 -05:00
biblio_framework.tt Bug 9622 - Replace YUI button on MARC fameworks page with Bootstrap 2013-02-18 08:05:33 -05:00
branch_transfer_limits.tt Bug 9430 [Revised] Use DataTables on library transfer limits page 2013-03-07 10:50:19 -05:00
branches.tt Bug 6209 [Revised] Standardize on one plugin for client-side form validation 2013-03-23 00:12:36 -04:00
categorie.tt Bug 9431 [Revised] Use DataTables on Patron Category Administration page 2013-03-11 08:46:22 -04:00
checkmarc.tt Bug 2780 - Capitalize strings consistently (Admin pages) 2012-04-10 10:03:21 +02:00
cities.tt Bug 9436 [Revised] Use DataTables on cities administration page 2013-03-15 19:24:31 -04:00
classsources.tt Bug 9631 - Replace YUI buttons on classification sources administration page with Bootstrap 2013-02-18 08:50:22 -05:00
clone-rules.tt Bug 2780 - Capitalize strings consistently (Admin pages) 2012-04-10 10:03:21 +02:00
currency.tt Bug 9632 - Replace YUI button on the currencies administration page with Bootstrap 2013-02-18 08:51:45 -05:00
didyoumean.tt Bug 8726: Followup FIX save didyoumean syspref 2012-09-28 17:14:17 +02:00
fieldmapping.tt Bug 6037 [Follow-up] Invalid markup, missing breadcrumbs on Keyword to MARC Mapping page 2012-10-08 17:11:12 +02:00
item_circulation_alerts.tt Bug 8942: Translation process breaks javascript 2013-01-31 11:00:24 -05:00
itemtypes.tt Bug 9437 [Revised] Use DataTables on itemtypes administration page 2013-03-07 10:45:51 -05:00
koha2marclinks.tt Bug 2780 - Capitalize strings consistently (Admin pages) 2012-04-10 10:03:21 +02:00
marc_subfields_structure.tt Bug 8229: Tabs in marc subfield structure is not shown correctly 2012-06-20 11:10:13 +02:00
marctagstructure.tt Bug 9639 - Replace YUI button on MARC tag structure toolbar with Bootstrap 2013-02-18 09:03:33 -05:00
matching-rules.tt Bug 9640 - Replace YUI button on record matching rules page with Bootstrap 2013-02-18 09:04:46 -05:00
oai_set_mappings.tt Bug 8906: Followup replace 'Clear' with 'Delete' 2013-02-15 09:08:10 -05:00
oai_sets.tt Bug 9689 - Replace YUI buttons on the OAI sets administration page with Bootstrap 2013-03-07 10:16:36 -05:00
patron-attr-types.tt Bug 9642 - Replace YUI button on the patron attribute types page with Bootstrap 2013-02-18 09:06:49 -05:00
preferences.tt Bug 7596 - System prefs editor JS contains untranslatable English string 2013-03-15 19:03:49 -04:00
printers.tt Bug 9646 - Replace YUI button on the printers administration page with Bootstrap 2013-02-18 09:11:25 -05:00
roadtype.tt Bug 9643 - Replace YUI button on the road types administration page with Bootstrap 2013-02-18 09:07:33 -05:00
smart-rules.tt Bug 8365: Add unit tests and fix QA issues 2013-03-22 07:57:02 -04:00
stopwords.tt Bug 9265 - Switch to HTML5 doctype in OPAC and staff client 2013-01-31 11:47:04 -05:00
systempreferences.tt Bug 9760: Simplify local use preferences 2013-03-13 08:56:30 -04:00
transport-cost-matrix.tt Bug 8935 - transport cost matrix could be prettier 2012-10-22 17:51:11 +02:00
z3950servers.tt Bug 9446 [Revised] Use DataTables on Z39.50 servers administration page 2013-03-20 15:27:49 -04:00