Bugzilla – Attachment 64221 Details for
Bug 18789
Send a Koha::Patron object to the templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18789: Update other occurences where is->child should be used
Bug-18789-Update-other-occurences-where-is-child-s.patch (text/plain), 7.70 KB, created by
Jonathan Druart
on 2017-06-12 16:59:48 UTC
(
hide
)
Description:
Bug 18789: Update other occurences where is->child should be used
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-06-12 16:59:48 UTC
Size:
7.70 KB
patch
obsolete
>From 679a99520b460f1ab8047f0a882e1b430a9a2c73 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 1 Jun 2017 14:03:52 -0300 >Subject: [PATCH] Bug 18789: Update other occurences where is->child should be > used > >Trivial changes here, just do a code review on the QA step >--- > members/boraccount.pl | 2 +- > members/mancredit.pl | 2 +- > members/maninvoice.pl | 2 +- > members/member-flags.pl | 2 +- > members/member-password.pl | 2 +- > members/moremember.pl | 2 +- > members/printfeercpt.pl | 4 +--- > members/printinvoice.pl | 4 +--- > members/readingrec.pl | 3 +-- > members/routing-lists.pl | 2 -- > 10 files changed, 9 insertions(+), 16 deletions(-) > >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 616982a52c..5e488d10e5 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -61,7 +61,7 @@ if ( $action eq 'reverse' ) { > ReversePayment( $input->param('accountlines_id') ); > } > >-if ( $patron->category->category_type eq 'C') { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/mancredit.pl b/members/mancredit.pl >index d976d83933..b01cf15eba 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -76,7 +76,7 @@ if ($add){ > ); > my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; > output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); >- if ( $patron->category->category_type eq 'C') { >+ if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 9f035751f9..b12ca57def 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -103,7 +103,7 @@ if ($add){ > } > $template->param( invoice_types_loop => \@invoice_types ); > >- if ( $patron->category->category_type eq 'C') { >+ if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/member-flags.pl b/members/member-flags.pl >index 0aca1b08a0..d848bf9b15 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -177,7 +177,7 @@ if ($input->param('newflags')) { > push @loop, \%row; > } > >- if ( $category_type eq 'C') { >+ if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/member-password.pl b/members/member-password.pl >index c1ac16ca15..aa1ed4a788 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -101,7 +101,7 @@ else { > $template->param( defaultnewpassword => $defaultnewpassword ); > } > >-if ( $category_type eq 'C') { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/moremember.pl b/members/moremember.pl >index c38aec8bda..f389bfebce 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -165,7 +165,7 @@ if ( $patron->is_debarred ) { > > $data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex}; > >-if ( $category_type eq 'C') { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 7b897cdcc3..0bf6705de8 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -54,13 +54,11 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" > my $patron = Koha::Patrons->find( $borrowernumber ); > output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); > >-my $category = $patron->category; >- > if ( $action eq 'print' ) { > # ReversePayment( $borrowernumber, $input->param('accountno') ); > } > >-if ( $category->category_type eq 'C') { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index fecca42437..4e5b9abd9a 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -53,9 +53,7 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" > my $patron = Koha::Patrons->find( $borrowernumber ); > output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); > >-my $category = $patron->category; >- >-if ( $category->category_type eq 'C' ) { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/readingrec.pl b/members/readingrec.pl >index cbf4878662..756be312a2 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -93,8 +93,7 @@ if ( $op eq 'export_barcodes' ) { > } > } > >-my $category = $patron->category; >-if ( $category->category_type eq 'C') { >+if ( $patron->is_child ) { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index ed0215e86d..6dd611f6d7 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -51,8 +51,6 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" > my $patron = Koha::Patrons->find( $borrowernumber ); > output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); > >-my $category = $patron->category; >- > my $count; > my @borrowerSubscriptions; > ($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber ); >-- >2.11.0
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 18789
:
64211
|
64212
|
64213
|
64214
|
64215
|
64216
|
64218
|
64219
|
64221
|
64229
|
71301
|
71302
|
71303
|
71304
|
71305
|
71306
|
71307
|
71308
|
71309
|
71310
|
71311
|
71485
|
71486
|
71487
|
71488
|
71489
|
71490
|
71491
|
71492
|
71493
|
71494
|
71495
|
71496
|
71679
|
71680
|
71681
|
71682
|
71683
|
71684
|
71685
|
71686
|
71687
|
71688
|
71689
|
71690
|
71691
|
71713
|
71714
|
71715
|
71716
|
71717
|
71718
|
71719
|
71720
|
71721
|
71722
|
71723
|
71724
|
71725
|
71726
|
71727
|
71728
|
71729
|
71730
|
71731
|
71732
|
71733
|
71734
|
71735
|
71736
|
71827
|
71838
|
71841
|
73293
|
73890
|
75237