Bugzilla – Attachment 71510 Details for
Bug 18403
Hide patron information if not part of the logged in user library group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18403: Use patron-title.inc when hidepatronname is used [SPECIFIC for issuehistory]
Bug-18403-Use-patron-titleinc-when-hidepatronname-.patch (text/plain), 6.36 KB, created by
Jonathan Druart
on 2018-02-12 19:34:11 UTC
(
hide
)
Description:
Bug 18403: Use patron-title.inc when hidepatronname is used [SPECIFIC for issuehistory]
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-02-12 19:34:11 UTC
Size:
6.36 KB
patch
obsolete
>From fa54100dffe092e606f79b15692eedaf78f42e45 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Apr 2017 17:04:36 -0300 >Subject: [PATCH] Bug 18403: Use patron-title.inc when hidepatronname is used > [SPECIFIC for issuehistory] > >On this page we do not have the patron object sent to the template, >let's pass it! > >Test plan: >Go on the checkout history of a bibliographic record >(catalogue/issuehistory.pl) >You should not see patron's information that are not part of your group >if you >are not allowed to see them. > >Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > catalogue/issuehistory.pl | 20 +++++++------- > .../prog/en/modules/catalogue/issuehistory.tt | 31 +++++++++++----------- > 2 files changed, 26 insertions(+), 25 deletions(-) > >diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl >index 5cf04058e9..6a7f623336 100755 >--- a/catalogue/issuehistory.pl >+++ b/catalogue/issuehistory.pl >@@ -22,9 +22,9 @@ use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Output; > >-use C4::Circulation; # GetBiblioIssues > use C4::Biblio; # GetBiblio > use C4::Search; # enabled_staff_search_views >+use Koha::Checkouts; > > use Koha::Biblios; > >@@ -41,18 +41,18 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $biblionumber = $query->param('biblionumber'); > >-if (C4::Context->preference("HidePatronName")) { >- $template->param(HidePatronName => 1); >-} >- >-my $issues = GetBiblioIssues($biblionumber); >+my $checkouts = Koha::Checkouts->search( >+ { biblionumber => $biblionumber }, >+ { >+ join => 'item', >+ order_by => 'timestamp', >+ } >+); > my $biblio = Koha::Biblios->find( $biblionumber ); > > $template->param( >- biblionumber => $biblionumber, # required for left-side navigation >- biblio => $biblio, >- total => scalar @$issues, >- issues => $issues, >+ checkouts => $checkouts, >+ biblio => $biblio, > issuehistoryview => 1, > C4::Search::enabled_staff_search_views, > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >index 83c60ccc93..7ee061c452 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >@@ -25,8 +25,8 @@ > [% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %] > > <div class="searchresults"> >- [% IF ( issues ) %] >- <h4>Checked out [% total %] times</h4> >+ [% IF checkouts.count %] >+ <h4>Checked out [% checkouts.count %] times</h4> > <table id="table_issues"> > <thead><tr> > [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %] >@@ -40,39 +40,40 @@ > <th class='title-string'>Checkin on</th> > </tr></thead> > <tbody> >- [% FOREACH issue IN issues %] >+ [% FOREACH checkout IN checkouts %] > <tr> > [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %] > <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issue.borrowernumber %]">[% IF HidePatronName %][% issue.cardnumber %][% ELSE %][% issue.surname %][% IF ( issue.firstname ) %], [% issue.firstname %][% END %][% END %]</a></td> > [% END %] >- <td>[% IF ( issue.barcode ) %] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% issue.biblionumber %]&itemnumber=[% issue.itemnumber %]">[% issue.barcode %]</a> >+ <td> >+ [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber %]&itemnumber=[% checkout.item.itemnumber %]">[% checkout.item.barcode %]</a> > [% ELSE %] > > [% END %]</td> >- <td>[% IF ( issue.branchcode ) %] >- [% Branches.GetName( issue.branchcode ) %] >+ <td>[% IF checkout.branchcode %] >+ [% Branches.GetName( checkout.branchcode ) %] > [% ELSE %] > > [% END %]</td> >- <td>[% IF ( issue.renewals ) %] >- Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate |$KohaDates with_hours => 1 %]</small> >+ <td>[% IF checkout.renewals %] >+ Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates with_hours => 1 %]</small> > [% END %] > [% ELSE %] > No > [% END %]</td> >- <td>[% IF ( issue.issuedate ) %] >- <span title="[% issue.issuedate %]">[% issue.issuedate |$KohaDates with_hours => 1 %]</span> >+ <td>[% IF checkout.issuedate %] >+ <span title="[% checkout.issuedate %]">[% checkout.issuedate |$KohaDates with_hours => 1 %]</span> > [% ELSE %] > <span title="0000-00-00"></span> > [% END %]</td> >- <td>[% IF ( issue.date_due ) %] >- <span title="[% issue.date_due %]">[% issue.date_due |$KohaDates with_hours => 1 %]</span> >+ <td>[% IF checkout.date_due %] >+ <span title="[% checkout.date_due %]">[% checkout.date_due |$KohaDates with_hours => 1 %]</span> > [% ELSE %] > <span title="0000-00-00"></span> > [% END %]</td> >- <td>[% IF ( issue.returndate ) %] >- <span title="[% issue.returndate %]">[% issue.returndate |$KohaDates with_hours => 1 %]</span> >+ <td>[% IF checkout.returndate %] >+ <span title="[% checkout.returndate %]">[% checkout.returndate |$KohaDates with_hours => 1 %]</span> > [% ELSE %] > <span title="Checked out"><small>Checked out</small></span> > [% END %]</td> >-- >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 18403
:
62010
|
62011
|
62012
|
62013
|
62014
|
62015
|
62016
|
62017
|
62018
|
62019
|
62020
|
62021
|
62022
|
62023
|
62024
|
62025
|
62026
|
62027
|
62028
|
62029
|
62030
|
62031
|
62032
|
62033
|
62302
|
62303
|
62830
|
62831
|
62832
|
62833
|
62834
|
62835
|
62836
|
62837
|
62838
|
62839
|
62840
|
62841
|
62842
|
62843
|
62844
|
62845
|
62846
|
62847
|
62848
|
62849
|
62850
|
62851
|
62852
|
62853
|
62854
|
62855
|
71392
|
71394
|
71500
|
71501
|
71502
|
71503
|
71504
|
71505
|
71506
|
71507
|
71508
|
71509
| 71510 |
71511
|
71512
|
71513
|
71514
|
71515
|
71516
|
71517
|
71518
|
71519
|
71520
|
71521
|
71522
|
71523
|
71524
|
71525
|
71526
|
71527
|
71528
|
71529
|
71530
|
71767