Bugzilla – Attachment 80539 Details for
Bug 20689
Improve usability of Item search fields administration page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields
Bug-20689-follow-up-Make-it-possible-to-add-capita.patch (text/plain), 4.16 KB, created by
Katrin Fischer
on 2018-10-12 16:43:20 UTC
(
hide
)
Description:
Bug 20689: (follow-up) Make it possible to add capital letter subfields to item search fields
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-10-12 16:43:20 UTC
Size:
4.16 KB
patch
obsolete
>From c8aa35f35e8ea74cc0528d63d84ef836b9cdbb10 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 12 Oct 2018 15:46:43 +0000 >Subject: [PATCH] Bug 20689: (follow-up) Make it possible to add capital letter > subfields to item search fields > >This patch adds some custom validation to the MARC tag and subfield >fields so that they are limited to alphanumeric characters. > >To test, apply the patch and test the form by entering a variety of >different character combinations. The "MARC field" and "MARC subfield" >inputs should only accept alphanumeric entries. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../en/includes/admin-items-search-field-form.inc | 8 ++++---- > .../prog/en/modules/admin/items_search_field.tt | 22 +++++++++++++++++++++- > 2 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >index 52bcb7c..b95e263 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >@@ -23,18 +23,18 @@ > <li> > <label class="required" for="tagfield">MARC field: </label> > [% IF field && field.tagfield == tagfield %] >- <input type="text" id="tagfield" name="tagfield" maxlength="3" size="3" class="required" required="required" value="[% tagfield | html %] /> >+ <input type="text" id="tagfield" name="tagfield" maxlength="3" size="3" class="required" pattern="[a-zA-Z0-9]+" required="required" value="[% tagfield | html %]" /> > [% ELSE %] >- <input type="text" id="tagfield" name="tagfield" maxlenght="3" size="3" class="required" required="required" /> >+ <input type="text" id="tagfield" name="tagfield" maxlenght="3" size="3" class="required" pattern="[a-zA-Z0-9]+" required="required" /> > [% END %] > <span class="required">Required</span> > </li> > <li> > <label for="tagsubfield">MARC subfield: </label> > [% IF field && field.tagsubfield == tagsubfield %] >- <input type="text" id="tagsubfield" name="tagsubfield" maxlength="1" size="1" value="[% tagsubfield | html %]" /> >+ <input type="text" id="tagsubfield" name="tagsubfield" pattern="[a-zA-Z0-9]+" maxlength="1" size="1" value="[% tagsubfield | html %]" /> > [% ELSE %] >- <input type="text" id="tagsubfield" name="tagsubfield" maxlength="1" size="1" /> >+ <input type="text" id="tagsubfield" name="tagsubfield" pattern="[a-zA-Z0-9]+" maxlength="1" size="1" /> > [% END %] > </li> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >index 3cf8791..e73b629 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >@@ -23,7 +23,7 @@ > > <h1>Item search field: [% field.label | html %]</h1> > >- <form action="/cgi-bin/koha/admin/items_search_field.pl" method="POST" class="validated"> >+ <form action="/cgi-bin/koha/admin/items_search_field.pl" method="POST" id="edit_search_fields"> > <fieldset class="rows"> > <legend>Edit field</legend> > [% INCLUDE 'admin-items-search-field-form.inc' field=field %] >@@ -49,6 +49,26 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] >+ <script> >+ jQuery.validator.addMethod("marcfield", function(value, element) { >+ return this.optional(element) || /[0-9a-zA-Z]+/.test(value); >+ }, _("Please enter letters or numbers") ); >+ >+ $(document).ready(function(){ >+ $("#edit_search_fields").validate({ >+ rules: { >+ label: "required", >+ tagfield: { >+ required: true, >+ marcfield: true >+ }, >+ tagsubfield: { >+ marcfield: true >+ } >+ } >+ }); >+ }); >+ </script> > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.1.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 20689
:
77640
|
79554
|
79779
|
80538
|
80539
|
80712
|
80713
|
81137
|
81150
|
81151
|
83795
|
83796
|
83827
|
87955
|
87956
|
87957
|
88294
|
124056
|
124057
|
124058
|
124059
|
131038
|
131039
|
131040
|
131041