Bugzilla – Attachment 10922 Details for
Bug 7628
Required format is not enforced for Patron Categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7628 - Required format is not enforced for Patron Categories
Bug-7628---Required-format-is-not-enforced-for-Pat.patch (text/plain), 2.10 KB, created by
David Cook
on 2012-07-18 07:13:40 UTC
(
hide
)
Description:
Bug 7628 - Required format is not enforced for Patron Categories
Filename:
MIME Type:
Creator:
David Cook
Created:
2012-07-18 07:13:40 UTC
Size:
2.10 KB
patch
obsolete
>From 1438a9b3b6823bd99937231c88612cfb6b6fa071 Mon Sep 17 00:00:00 2001 >From: Marc Veron <veron@veron.ch> >Date: Wed, 18 Jul 2012 07:57:36 +0200 >Subject: [PATCH] Bug 7628 - Required format is not enforced for Patron > Categories >Content-Type: text/plain; charset="utf-8" > >Enforces category code with allowed characters only. > >Test plan: > >- Before applying patch, create a category code like Test+ > >- Try to delete category with this code -> does not work > >- Apply patch > >- Try to create category with code containg other characters than letters, numbers, - and _ > >- Result: You are not allowed to do so, appropriate message pops up > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > .../prog/en/modules/admin/categorie.tt | 16 ++++++++++++---- > 1 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >index e0be34b..7ca8805 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt >@@ -53,10 +53,18 @@ > var ok=0; > var _alertString=_("Form not submitted because of the following problem(s)"); > _alertString +="\n-------------------------------------------------------------------\n\n"; >- if (ff.categorycode.value.length==0) { >- ok=1; >- _alertString += _("- categorycode missing") + "\n"; >- } >+ ff.categorycode.value = ff.categorycode.value.trim(); >+ if (ff.categorycode.value.length==0) { >+ ok=1; >+ _alertString += _("- categorycode missing") + "\n"; >+ } >+ else{ >+ var patt=/^[a-zA-Z0-9\-_]+$/g; >+ if ( !patt.test(ff.categorycode.value) ) { >+ ok=1; >+ _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n"; >+ } >+ } > if (!(ff.category_type.value)){ > ok=1; > _alertString += _("- category type missing") + "\n"; >-- >1.7.7.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 7628
:
10918
|
10921
|
10922
|
10923
|
11034
|
11072