@@ -, +, @@ [SPECIFIC for issuehistory] --- catalogue/issuehistory.pl | 17 ++++++------ .../prog/en/modules/catalogue/issuehistory.tt | 31 +++++++++++----------- 2 files changed, 25 insertions(+), 23 deletions(-) --- a/catalogue/issuehistory.pl +++ a/catalogue/issuehistory.pl @@ -23,9 +23,9 @@ use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; -use C4::Circulation; # GetBiblioIssues use C4::Biblio; # GetBiblio GetBiblioFromItemNumber use C4::Search; # enabled_staff_search_views +use Koha::Checkouts; my $query = new CGI; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( @@ -43,17 +43,18 @@ my $params = $query->Vars; my $biblionumber = $params->{'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 = GetBiblio($biblionumber); $template->param(%$biblio); $template->param( - total => scalar @$issues, - issues => $issues, + checkouts => $checkouts, issuehistoryview => 1, C4::Search::enabled_staff_search_views, ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt @@ -35,8 +35,8 @@ $(document).ready(function() { [% IF ( author ) %]

by [% author %]

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

Checked out [% total %] times

+ [% IF checkouts.count %] +

Checked out [% checkouts.count %] times

[% IF Koha.Preference('intranetreadinghistory') @@ -51,40 +51,41 @@ $(document).ready(function() { - [% FOREACH issue IN issues %] + [% FOREACH checkout IN checkouts %] [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %] [% END %] - - - - - - --
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 %]