Bugzilla – Attachment 31845 Details for
Bug 12981
Patron attribute type limit by patron category not working on patron entry form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12981 - Patron attribute type limit by patron category not working on patron entry form
Bug-12981---Patron-attribute-type-limit-by-patron-.patch (text/plain), 3.79 KB, created by
Owen Leonard
on 2014-09-23 18:44:16 UTC
(
hide
)
Description:
Bug 12981 - Patron attribute type limit by patron category not working on patron entry form
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-09-23 18:44:16 UTC
Size:
3.79 KB
patch
obsolete
>From df1dbfb9917a17a1a153113e2d5fcc2b529217d2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 23 Sep 2014 14:41:06 -0400 >Subject: [PATCH] Bug 12981 - Patron attribute type limit by patron category > not working on patron entry form >Content-Type: text/plain; charset="utf-8" > >To reproduce this bug: > >- Create a patron attribute type and limit it by patron category >- Create a new patron with that category >- Observe that there is no entry field for the patron attribute type you > created for that patron category. Inspecting the source should show > that the entry field has been hidden. > >The patron entry form tries to hide patron attribute type input fields >based on the currently selected patron category. It does this based on >the value of $("categorycode"). However, instead of pulling the data >from the categorycode input in the body of the entry form, it pulls it >from the patron search box at the top of the page. The value of that >input is always empty because no category is preselected. > >This patch corrects the problem by changing the ID of the categorycode ><select> in the body of the entry form and making corresponding changes >to the JavaScript which depends on it. > >To test, apply the patch and load the patron entry form for a patron >category to which a patron attribute type has been limited. That patron >attribute entry field should appear correctly. > >Choose a different patron category from the "Category" dropdown. Confirm >that the patron attribute entry field has been hidden. >--- > .../prog/en/modules/members/memberentrygen.tt | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 56cc570..e2233ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -32,8 +32,8 @@ > [% IF categorycode %] > update_category_code( "[% categorycode %]" ); > [% ELSE %] >- if ( $("#categorycode").length > 0 ){ >- var category_code = $("#categorycode").find("option:selected").val(); >+ if ( $("#categorycode_entry").length > 0 ){ >+ var category_code = $("#categorycode_entry").find("option:selected").val(); > update_category_code( category_code ); > } > [% END %] >@@ -95,7 +95,7 @@ > > function update_category_code(category_code) { > if ( $(category_code).is("select") ) { >- category_code = $("#categorycode").find("option:selected").val(); >+ category_code = $("#categorycode_entry").find("option:selected").val(); > } > var mytables = $(".attributes_table"); > $(mytables).find("li").hide(); >@@ -924,8 +924,8 @@ > </li> > [% END %] > <li> >- <label for="categorycode" class="required">Category: </label> >- <select id="categorycode" name="categorycode" onchange="update_category_code(this);"> >+ <label for="categorycode_entry" class="required">Category: </label> >+ <select id="categorycode_entry" name="categorycode" onchange="update_category_code(this);"> > [% FOREACH typeloo IN typeloop %] > [% FOREACH categoryloo IN typeloo.categoryloop %] > [% IF ( loop.first ) %] >@@ -1321,7 +1321,7 @@ > $('#memberentry_messaging_prefs > *').change(function() { > message_prefs_dirty = true; > }); >- $('#categorycode').change(function() { >+ $('#categorycode_entry').change(function() { > var categorycode = $(this).val(); > if (message_prefs_dirty) { > if (!confirm('Change messaging preferences to default for this category?')) { >-- >1.7.9.5
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 12981
:
31845
|
32345
|
32503