Bug 19074: Fix category display in Batch patron modification.
authorAlex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com>
Thu, 10 Aug 2017 11:33:36 +0000 (13:33 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Aug 2017 19:25:33 +0000 (16:25 -0300)
* tools/modborrowers.pl (GetBorrowerInfos): Fix setting of patron
  category description.
* koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt: Use
  it.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
tools/modborrowers.pl

index 0ff04f5..7470563 100644 (file)
                                                     <td>[% borrower.surname %]</td>
                                                     <td>[% borrower.firstname %]</td>
                                                     <td>[% Branches.GetName( borrower.branchcode ) %]</td>
-                                                    <td>[% borrower.categorycode %]</td>
+                                                    <td>[% borrower.category_description %]</td>
                                                     <td>[% borrower.city %]</td>
                                                     <td>[% borrower.state %]</td>
                                                     <td>[% borrower.zipcode %]</td>
index 720e2a1..7acc9a8 100755 (executable)
@@ -367,6 +367,7 @@ exit;
 sub GetBorrowerInfos {
     my ( %info ) = @_;
     my $borrower = Koha::Patrons->find( \%info );
+    my $catdesc = $borrower->category->description;
     if ( $borrower ) {
         $borrower = $borrower->unblessed;
         for ( qw(dateenrolled dateexpiry) ) {
@@ -377,7 +378,7 @@ sub GetBorrowerInfos {
             }
             $borrower->{$_} = $userdate || '';
         }
-        $borrower->{category_description} = Koha::Patron::Categories->find( $borrower->{categorycode} )->{description};
+        $borrower->{category_description} = $catdesc;
         my $attr_loop = C4::Members::Attributes::GetBorrowerAttributes( $borrower->{borrowernumber} );
         $borrower->{patron_attributes} = $attr_loop;
     }