Bugzilla – Attachment 71305 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_child where needed
Bug-18789-Use-KohaPatron-ischild-where-needed.patch (text/plain), 7.55 KB, created by
Jonathan Druart
on 2018-02-07 18:36:37 UTC
(
hide
)
Description:
Bug 18789: Use Koha::Patron->is_child where needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-07 18:36:37 UTC
Size:
7.55 KB
patch
obsolete
>From c83a06849ac3e7424000421943625eafbcc16127 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 1 Jun 2017 13:52:30 -0300 >Subject: [PATCH] Bug 18789: Use Koha::Patron->is_child where needed > >Test plan: >When you are on a page related to a child you should see the "Update >child to adult patron" button >--- > circ/circulation.pl | 1 - > koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 6 +++--- > members/boraccount.pl | 1 - > members/mancredit.pl | 1 - > members/maninvoice.pl | 1 - > members/member-flags.pl | 1 - > members/member-password.pl | 1 - > members/moremember.pl | 1 - > members/printfeercpt.pl | 1 - > members/printinvoice.pl | 1 - > members/readingrec.pl | 1 - > 11 files changed, 3 insertions(+), 13 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 98928a20ee..bf76995c87 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -608,7 +608,6 @@ if ( $patron ) { > patron => $patron, > categoryname => $patron->category->description, > expiry => $patron->dateexpiry, >- is_child => ( $patron->category->category_type eq 'C' ), > ); > } > >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 5a69ab277e..5ec034192a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -34,7 +34,7 @@ $(document).ready(function(){ > $(".btn-group").removeClass("open"); > return false; > }); >- [% IF ( is_child ) %]$("#updatechild").click(function(){ >+ [% IF ( patron.is_child ) %]$("#updatechild").click(function(){ > update_child(); > $(".btn-group").removeClass("open"); > });[% END %] >@@ -92,7 +92,7 @@ function confirm_both_deletion() { > } > } > >-[% IF ( is_child ) %]function confirm_updatechild() { >+[% IF ( patron.is_child ) %]function confirm_updatechild() { > var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone.")); > if (is_confirmed) { > window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% patron.borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]'; >@@ -197,7 +197,7 @@ function searchToHold(){ > [% ELSE %] > <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li> > [% END %] >- [% IF ( is_child ) %] >+ [% IF ( patron.is_child ) %] > <li><a id="updatechild" href="#">Update child to adult patron</a></li> > [% ELSE %] > <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li> >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 40b2591548..283f4acc25 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -112,7 +112,6 @@ $template->param( > finesview => 1, > total => sprintf("%.2f",$total), > totalcredit => $totalcredit, >- is_child => ($patron->category->category_type eq 'C'), > reverse_col => $reverse_col, > accounts => $accts, > ); >diff --git a/members/mancredit.pl b/members/mancredit.pl >index c5434b0599..d48fa40fdd 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -100,7 +100,6 @@ if ($add){ > > $template->param( > finesview => 1, >- is_child => ($patron->category->category_type eq 'C'), # FIXME is_child should be a Koha::Patron method > ); > output_html_with_http_headers $input, $cookie, $template->output; > } >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 6b1a59bdab..e63fefee4b 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -127,7 +127,6 @@ if ($add){ > $template->param( > patron => $patron, > finesview => 1, >- is_child => ($patron->category->category_type eq 'C'), > ); > output_html_with_http_headers $input, $cookie, $template->output; > } >diff --git a/members/member-flags.pl b/members/member-flags.pl >index 20a48e4b02..f057bcd4a4 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -201,7 +201,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > $template->param( > patron => $patron, > loop => \@loop, >- is_child => ( $category_type eq 'C' ), > csrf_token => > Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), > ); >diff --git a/members/member-password.pl b/members/member-password.pl >index 0cb63ad270..fd1223db2d 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -115,7 +115,6 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) { > $template->param( > patron => $patron, > destination => $destination, >- is_child => ( $category_type eq 'C' ), > csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }), > ); > >diff --git a/members/moremember.pl b/members/moremember.pl >index cf996fdba3..3beca9f944 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -341,7 +341,6 @@ $template->param( > totaldue_raw => $total, > overdues_exist => $overdues_exist, > StaffMember => $category_type eq 'S', >- is_child => $category_type eq 'C', > $category_type => 1, # [% IF ( I ) %] = institutional/organisation > samebranch => $samebranch, > quickslip => $quickslip, >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 15c39d60f4..4446fc2865 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -122,7 +122,6 @@ $template->param( > finesview => 1, > total => sprintf("%.2f",$total), > totalcredit => $totalcredit, >- is_child => ($category->category_type eq 'C'), > accounts => \@accountrows ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index dc7f347a02..34e93b0197 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -122,7 +122,6 @@ $template->param( > finesview => 1, > total => sprintf( "%.2f", $total ), > totalcredit => $totalcredit, >- is_child => ( $category->category_type eq 'C' ), > accounts => \@accountrows > ); > >diff --git a/members/readingrec.pl b/members/readingrec.pl >index 6894796826..1fb8b00f67 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -116,7 +116,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > $template->param( > patron => $patron, > readingrecordview => 1, >- is_child => ( $category->category_type eq 'C' ), > loop_reading => $issues, > ); > output_html_with_http_headers $input, $cookie, $template->output; >-- >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