From 9365fd21167dc9b1917ac5524f022fa06a5db2ff Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 9 Jun 2021 11:35:27 +0000 Subject: [PATCH] Bug 28495: Improve validation of library entry form This patch adds validation of the "Library code" field so that entry is limited to letters and numbers. Also changed: Updated the email fields to add the "email" type attribute (see also Bug 27805). To test, apply the patch and go to Administration -> Libraries -> New library. - Try entering various strings in the "Library code" field. If you enter anything other than letters and numbers an error message should be displaed on blur or on submit. - Try submitting the form with no data in the "Library code" and/or "Name" field. The fields should be required. - Test entering various strings in the email-type fields: Email, Ill staff email, Reply-To, and Return-Path. Non-email entries should trigger a message, "Please enter a valid email address." Signed-off-by: Salman Ali Signed-off-by: Nick Clemens --- .../prog/en/modules/admin/branches.tt | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 01b2c0f455..8ddda78da3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -125,7 +125,7 @@ Libraries › Administration › Koha [% IF op == 'add_form' %]

[% IF library %]Modify library[% ELSE %]New library[% END %]

-
+
[% IF library %] @@ -182,11 +182,11 @@ Libraries › Administration › Koha
  • -
  • +
  • [% IF (Koha.Preference('ILLModule')) %]
  • - +
    [% IF ( CAN_user_parameters_manage_sysprefs ) %] Default: ILLDefaultStaffEmail system preference @@ -198,7 +198,7 @@ Libraries › Administration › Koha [% END %]
  • - +
    [% IF ( CAN_user_parameters_manage_sysprefs ) %] Default: ReplyToDefault system preference @@ -209,7 +209,7 @@ Libraries › Administration › Koha
  • - +
    [% IF ( CAN_user_parameters_manage_sysprefs ) %] Default: ReturnpathDefault system preference @@ -328,6 +328,16 @@ Libraries › Administration › Koha [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] [% INCLUDE 'str/tinymce_i18n.inc' %]