From fa54100dffe092e606f79b15692eedaf78f42e45 Mon Sep 17 00:00:00 2001 From: Jonathan Druart 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 Signed-off-by: Jonathan Druart --- 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 %]

by [% biblio.author %]

[% END %]
- [% IF ( issues ) %] -

Checked out [% total %] times

+ [% IF checkouts.count %] +

Checked out [% checkouts.count %] times

[% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %] @@ -40,39 +40,40 @@ - [% FOREACH issue IN issues %] + [% FOREACH checkout IN checkouts %] [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %] [% END %] - - - - - - -- 2.39.5
Checkin on
[% IF HidePatronName %][% issue.cardnumber %][% ELSE %][% issue.surname %][% IF ( issue.firstname ) %], [% issue.firstname %][% END %][% END %][% IF ( issue.barcode ) %] - [% issue.barcode %] + + [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %] + [% checkout.item.barcode %] [% ELSE %]   [% END %][% IF ( issue.branchcode ) %] - [% Branches.GetName( issue.branchcode ) %] + [% IF checkout.branchcode %] + [% Branches.GetName( checkout.branchcode ) %] [% ELSE %]   [% END %][% IF ( issue.renewals ) %] - Yes[% IF ( issue.lastreneweddate ) %], last on: [% issue.lastreneweddate |$KohaDates with_hours => 1 %] + [% IF checkout.renewals %] + Yes[% IF checkout.lastreneweddate %], last on: [% checkout.lastreneweddate |$KohaDates with_hours => 1 %] [% END %] [% ELSE %] No [% END %][% IF ( issue.issuedate ) %] - [% issue.issuedate |$KohaDates with_hours => 1 %] + [% IF checkout.issuedate %] + [% checkout.issuedate |$KohaDates with_hours => 1 %] [% ELSE %] [% END %][% IF ( issue.date_due ) %] - [% issue.date_due |$KohaDates with_hours => 1 %] + [% IF checkout.date_due %] + [% checkout.date_due |$KohaDates with_hours => 1 %] [% ELSE %] [% END %][% IF ( issue.returndate ) %] - [% issue.returndate |$KohaDates with_hours => 1 %] + [% IF checkout.returndate %] + [% checkout.returndate |$KohaDates with_hours => 1 %] [% ELSE %] Checked out [% END %]