Rather than getting the description in the script and passing, we should
just use the tmeplate plugin to get the description from the category
code.
To test:
1 - Find a patron, note their category
2 - Visit Tools - Batch patron modification
3 - Enter barcode of patron above
4 - Note category does not show in the display of patrons to be modified
5 - Apply patch
6 - Reload the page, note the patron category displays
7 - Modify the patron (anything but category)
8 - Check that category still diplays correctly in results
Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Andreas Roussos <arouss1980@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Batch patron modification</title>
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Batch patron modification</title>
<td>[% borrower.surname | html %]</td>
<td>[% borrower.firstname | html %]</td>
<td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
<td>[% borrower.surname | html %]</td>
<td>[% borrower.firstname | html %]</td>
<td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
- <td>[% borrower.category_description | html %]</td>
+ <td>[% Categories.GetName(borrower.categorycode) | html %]</td>
<td>[% borrower.city | html %]</td>
<td>[% borrower.state | html %]</td>
<td>[% borrower.zipcode | html %]</td>
<td>[% borrower.city | html %]</td>
<td>[% borrower.state | html %]</td>
<td>[% borrower.zipcode | html %]</td>
for my $borrowernumber ( @borrowernumbers ) {
my $patron = Koha::Patrons->find( $borrowernumber );
if ( $patron ) {
for my $borrowernumber ( @borrowernumbers ) {
my $patron = Koha::Patrons->find( $borrowernumber );
if ( $patron ) {
- my $category_description = $patron->category->description;
$patron = $patron->unblessed;
$patron = $patron->unblessed;
- $patron->{category_description} = $category_description;
$patron->{patron_attributes} = C4::Members::Attributes::GetBorrowerAttributes( $patron->{borrowernumber} );
$max_nb_attr = scalar( @{ $patron->{patron_attributes} } )
if scalar( @{ $patron->{patron_attributes} } ) > $max_nb_attr;
$patron->{patron_attributes} = C4::Members::Attributes::GetBorrowerAttributes( $patron->{borrowernumber} );
$max_nb_attr = scalar( @{ $patron->{patron_attributes} } )
if scalar( @{ $patron->{patron_attributes} } ) > $max_nb_attr;
$template->param( borrowers => \@borrowers );
$template->param( attributes_header => \@attributes_header );
$template->param( borrowers => \@borrowers );
$template->param( attributes_header => \@attributes_header );
- $template->param( borrowers => \@borrowers );
$template->param( errors => \@errors );
} else {
$template->param( errors => \@errors );
} else {