Bug 13458: Display the correct patron categories
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 26 Dec 2014 09:22:34 +0000 (10:22 +0100)
committerMason James <mtj@kohaaloha.com>
Fri, 16 Jan 2015 19:41:53 +0000 (08:41 +1300)
Bug 9811 removes useful code.
Actually the AddPatronLists pref is not sent to the template from
members/member.pl.

To fix this issue, we can use the existing not clean way, or compare the
syspref value directly in the template. This second solution is
implemented in this patch.

Test plan:
1/ Set the AddPatronLists pref to 'specific'
2/ On the patron home page (members/members-home/pl), the patron search
result page (members/member.pl after launching a search) and on the
checkouts page/patron search result (circ/circulation.pl after searching
a patron using the check out), verify that the patron category list is
the specific ones.
3/ Test there are no regression with the AddPatronLists pref set to
'general'.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Works as described and fixes the problem.

Note: I am not sure if AddPatronLists makes sense -
if you set it to general patron types, it still preselects the
wrong category type (tried organization, a child patron category
was selected). Also the name is confusiong nowadays with the
Patron list feature.
Signed-off-by: Mason James <mtj@kohaaloha.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/includes/patron-toolbar.inc
members/members-home.pl

index 81737ee..18a95d9 100755 (executable)
@@ -183,9 +183,6 @@ my $message;
 if ($findborrower) {
     my $borrowers = Search($findborrower, 'cardnumber') || [];
     if (C4::Context->preference("AddPatronLists")) {
-        $template->param(
-            "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
-        );
         if (C4::Context->preference("AddPatronLists")=~/code/){
             my $categories = GetBorrowercategoryList;
             $categories->[0]->{'first'} = 1;
index 8d36da3..f67f64c 100644 (file)
@@ -3,7 +3,7 @@
     <div class="btn-group">
         <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-plus"></i> New patron <span class="caret"></span></button>
             <ul class="dropdown-menu">
-                [% IF ( AddPatronLists_categorycode ) %]
+                [% IF Koha.Preference('AddPatronLists') == 'categorycode' %]
                     [% FOREACH categorie IN categories %]<li><a href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;categorycode=[% categorie.categorycode %]">[% categorie.description | html_entity %]</a></li>[% END %]
                 [% ELSE %]
                     <li><a href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;category_type=A">Adult patron</a></li>
index 9d1e3e5..3ed0f15 100755 (executable)
@@ -81,7 +81,6 @@ my $pending_borrower_modifications =
   Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
 
 $template->param( 
-        "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
         no_add => $no_add,
         pending_borrower_modifications => $pending_borrower_modifications,
             );