Bugzilla – Attachment 71306 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.57 KB, created by
Jonathan Druart
on 2018-02-07 18:36:41 UTC
(
hide
)
Description:
Bug 18789: Use Koha::Patron->is_adult where needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-07 18:36:41 UTC
Size:
10.57 KB
patch
obsolete
>From 0f4fa5dc864f5e3c49e651dc1e7b3cb51abb6a89 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 >--- > 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 bf76995c87..1f2de5d44e 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -456,9 +456,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 5ec034192a..00a52eee01 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -143,7 +143,7 @@ function searchToHold(){ > [% 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 283f4acc25..fca11b98ac 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -97,8 +97,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 d076470864..d15f3f1cb9 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -110,8 +110,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 c2060aac08..5f55448b8b 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -115,10 +115,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 d48fa40fdd..3536e22d12 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -86,8 +86,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 e63fefee4b..fefa036cc4 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -114,8 +114,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 f057bcd4a4..3c24ead4bd 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -188,8 +188,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 fd1223db2d..6884a14de5 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -102,8 +102,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 3beca9f944..6a3ebd05ff 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 535dcb71cb..eb353c3a43 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -75,7 +75,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 4446fc2865..4cdbbd7150 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -115,8 +115,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 34e93b0197..49582f3d5f 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -115,8 +115,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 1fb8b00f67..7c7f008631 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -100,7 +100,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 9605c3771a..a9f819dafe 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -73,8 +73,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