Bugzilla – Attachment 64216 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 2017-06-12 16:59:38 UTC
(
hide
)
Description:
Bug 18789: Use Koha::Patron->is_adult where needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-06-12 16:59:38 UTC
Size:
10.60 KB
patch
obsolete
>From 9ea8595a9239f97eaa24b92bdff23421c46e16ca 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 | 1 - > 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(+), 32 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index d01c9c3001..6caf1304b7 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -454,9 +454,6 @@ if ($borrowernumber) { > 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 91c8d2a6a5..a2d817f607 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 c647940317..616982a52c 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -93,8 +93,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 9a2350d95d..3d97201670 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, > RoutingSerials => C4::Context->preference('RoutingSerials'), >diff --git a/members/files.pl b/members/files.pl >index cd937a254d..d8ece8d62a 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -117,7 +117,6 @@ else { > ); > } > >- $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' || $data->{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 72acf52ba3..d976d83933 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -82,8 +82,6 @@ if ($add){ > $template->param( 'catcode' => $patron_categories->next ) 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 7de26e7198..9f035751f9 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -109,8 +109,6 @@ if ($add){ > $template->param( 'catcode' => $patron_categories->next ) 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 cf90f03ce8..0aca1b08a0 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -182,8 +182,6 @@ if ($input->param('newflags')) { > $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; > $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; > } >- >-$template->param( adultborrower => 1 ) if ( $category_type =~ /^(A|I)$/ ); > > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); >diff --git a/members/member-password.pl b/members/member-password.pl >index 3565906995..c1ac16ca15 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -107,8 +107,6 @@ if ( $category_type eq 'C') { > $template->param( 'catcode' => $patron_categories->next ) 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 33acf8ca28..7b21983189 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -194,8 +194,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 eec0f88250..9b7ec2403d 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -71,7 +71,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 5c1ba72f43..7b897cdcc3 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 f9a2bdc2c5..fecca42437 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 e495542b8c..cbf4878662 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 ) 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 a366c55621..ed0215e86d 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 b63406e320..37994cbf1d 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