Bugzilla – Attachment 71684 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: Use Koha::Patron->is_adult where needed
Bug-18789-Use-KohaPatron-isadult-where-needed.patch (text/plain), 10.60 KB, created by
Jonathan Druart
on 2018-02-15 18:49:50 UTC
(
hide
)
Description:
Bug 18789: Use Koha::Patron->is_adult where needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-15 18:49:50 UTC
Size:
10.60 KB
patch
obsolete
>From 57642996df0e88d606c89c27194acd2079f8448e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 1 Jun 2017 13:57:12 -0300 >Subject: [PATCH] Bug 18789: Use Koha::Patron->is_adult where needed > >Test plan: >When editing adult's info you must see the "Add child" button > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > circ/circulation.pl | 3 --- > koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- > members/boraccount.pl | 2 -- > members/deletemem.pl | 2 -- > members/files.pl | 4 ---- > members/housebound.pl | 4 +--- > members/mancredit.pl | 2 -- > members/maninvoice.pl | 2 -- > members/member-flags.pl | 2 -- > members/member-password.pl | 2 -- > members/moremember.pl | 2 -- > members/notices.pl | 1 - > members/printfeercpt.pl | 2 -- > members/printinvoice.pl | 2 -- > members/readingrec.pl | 1 - > members/routing-lists.pl | 2 -- > members/statistics.pl | 2 -- > 17 files changed, 2 insertions(+), 35 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 4ce738c13a..a64844e852 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -466,9 +466,6 @@ if ($patron) { > holds_count => $holds->count(), > WaitingHolds => $waiting_holds, > ); >- >- my $category_type = $patron->category->category_type; >- $template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' ); > } > > #title >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 59d4c0d2ba..467997fd60 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -15,7 +15,7 @@ > [% END %] > > [% IF CAN_user_borrowers_edit_borrowers %] >- [% IF adultborrower AND Koha.Preference("borrowerRelationship") %] >+ [% IF patron.is_adult AND Koha.Preference("borrowerRelationship") %] > <a id="addchild" class="btn btn-default btn-sm" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% patron.borrowernumber %]"><i class="fa fa-plus"></i> Add child</a> > [% END %] > [% IF CAN_user_borrowers_edit_borrowers %] >diff --git a/members/boraccount.pl b/members/boraccount.pl >index d30dfe34fd..8643b901b1 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -96,8 +96,6 @@ foreach my $accountline ( @{$accts}) { > } > } > >-$template->param( adultborrower => 1 ) if ( $patron->category->category_type =~ /^(A|I)$/ ); >- > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); > $template->param( >diff --git a/members/deletemem.pl b/members/deletemem.pl >index ec5abe167b..86ba249621 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -109,8 +109,6 @@ my $dbh = C4::Context->dbh; > my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member); > if ( $op eq 'delete_confirm' or $countissues > 0 or $flags->{'CHARGES'} or $is_guarantor or $deletelocal == 0) { > >- $template->param( adultborrower => 1 ) if $patron->category->category_type =~ /^(A|I)$/; >- > $template->param( > patron => $patron, > ); >diff --git a/members/files.pl b/members/files.pl >index 4fc42fc1ac..7927eae1bf 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -114,10 +114,6 @@ else { > ); > } > >- >- $template->param( adultborrower => 1 ) >- if ( $patron_category->category_type eq 'A' || $patron_category->category_type eq 'I' ); >- > $template->param( > files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) > ->GetFilesInfo(), >diff --git a/members/housebound.pl b/members/housebound.pl >index 0e52085193..9d65f4f632 100755 >--- a/members/housebound.pl >+++ b/members/housebound.pl >@@ -62,9 +62,8 @@ 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 } ); > > # Get supporting cast >-my ( $branch, $category, $houseboundprofile, $visit ); >+my ( $branch, $houseboundprofile, $visit ); > if ( $patron ) { # FIXME This test is not needed - output_and_exit_if_error handles it >- $category = Koha::Patron::Categories->new->find($patron->categorycode); > $houseboundprofile = $patron->housebound_profile; > } > if ( $visit_id ) { >@@ -167,7 +166,6 @@ if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) { > ); > } > >-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' ); > $template->param( > housebound_profile => $houseboundprofile, > visit => $houseboundvisit, >diff --git a/members/mancredit.pl b/members/mancredit.pl >index b1de0cc497..9dfd2e697b 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -85,8 +85,6 @@ if ($add){ > $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; > } > >- $template->param( adultborrower => 1 ) if ( $patron->category->category_type =~ /^(A|I)$/ ); >- > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); > $template->param( >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 67001884a4..68a4850e1b 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -113,8 +113,6 @@ if ($add){ > $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; > } > >- $template->param( adultborrower => 1 ) if ( $patron->category->category_type =~ /^(A|I)$/ ); >- > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); > $template->param( >diff --git a/members/member-flags.pl b/members/member-flags.pl >index 66debb66af..63bb249e7a 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -187,8 +187,6 @@ if ($input->param('newflags')) { > $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; > } > >-$template->param( adultborrower => 1 ) if ( $category_type =~ /^(A|I)$/ ); >- > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); > $template->param( >diff --git a/members/member-password.pl b/members/member-password.pl >index 1a56dad41b..0e4db74567 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -101,8 +101,6 @@ if ( $category_type eq 'C') { > $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; > } > >-$template->param( adultborrower => 1 ) if ( $category_type =~ /^(A|I)$/ ); >- > if ( C4::Context->preference('ExtendedPatronAttributes') ) { > my $attributes = GetBorrowerAttributes( $bor->{'borrowernumber'} ); > $template->param( >diff --git a/members/moremember.pl b/members/moremember.pl >index 8550dee70e..ebbdcac0a3 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -196,8 +196,6 @@ my $relatives_issues_count = > Koha::Database->new()->schema()->resultset('Issue') > ->count( { borrowernumber => \@relatives } ); > >-$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' ); >- > my %bor; > $bor{'borrowernumber'} = $borrowernumber; > >diff --git a/members/notices.pl b/members/notices.pl >index 0541fd834f..f307393b63 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -74,7 +74,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > ); > } > >-$template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' ); > $template->param( > patron => $patron, > QUEUED_MESSAGES => $queued_messages, >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index da02121567..d6080fb6b3 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -114,8 +114,6 @@ for (my $i=0;$i<$numaccts;$i++){ > push(@accountrows, \%row); > } > >-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' ); >- > $template->param( > patron => $patron, > finesview => 1, >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index 0a36d22c50..552e0cdca3 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -114,8 +114,6 @@ for ( my $i = 0 ; $i < $numaccts ; $i++ ) { > push( @accountrows, \%row ); > } > >-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' ); >- > $template->param( > patron => $patron, > finesview => 1, >diff --git a/members/readingrec.pl b/members/readingrec.pl >index a8eaffef2b..7a63201c05 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -99,7 +99,6 @@ if ( $category->category_type eq 'C') { > $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; > } > >-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' ); > if (! $limit){ > $limit = 'full'; > } >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index ff2de5189d..ca150ab5a8 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -72,8 +72,6 @@ $template->param( > routinglistview => 1 > ); > >-$template->param( adultborrower => 1 ) if ( $category->category_type =~ /^(A|I)$/ ); >- > $template->param( > patron => $patron, > findborrower => $findborrower, >diff --git a/members/statistics.pl b/members/statistics.pl >index 98c157e404..2e3087eddd 100755 >--- a/members/statistics.pl >+++ b/members/statistics.pl >@@ -84,8 +84,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > ); > } > >-$template->param( adultborrower => 1 ) if ( $category->category_type eq 'A' || $category->category_type eq 'I' ); >- > $template->param( > patron => $patron, > statisticsview => 1, >-- >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