@@ -, +, @@ case. $ koha-plack --restart kohadev --- catalogue/issuehistory.pl | 29 +- .../prog/en/modules/catalogue/issuehistory.tt | 277 +++++++++++++----- 2 files changed, 211 insertions(+), 95 deletions(-) --- a/catalogue/issuehistory.pl +++ a/catalogue/issuehistory.pl @@ -24,8 +24,6 @@ use C4::Output qw( output_html_with_http_headers ); use C4::Search qw( enabled_staff_search_views ); use C4::Serials qw( CountSubscriptionFromBiblionumber ); -use Koha::Checkouts; -use Koha::Old::Checkouts; use Koha::Biblios; @@ -40,29 +38,18 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $biblionumber = $query->param('biblionumber'); +my $biblio = Koha::Biblios->find($biblionumber); -my @checkouts = Koha::Checkouts->search( - { biblionumber => $biblionumber }, - { - join => 'item', - order_by => 'timestamp', - } -); -my @old_checkouts = Koha::Old::Checkouts->search( - { biblionumber => $biblionumber }, - { - join => 'item', - order_by => 'timestamp', - } +$template->param( + current_checkouts_count => $biblio->current_checkouts->count, + past_checkouts_count => $biblio->old_checkouts->count, + biblio => $biblio, ); -my $biblio = Koha::Biblios->find( $biblionumber ); - +# variables for biblio-view-menu.inc $template->param( - checkouts => [ @checkouts, @old_checkouts ], - biblio => $biblio, - issuehistoryview => 1, - C4::Search::enabled_staff_search_views, + issuehistoryview => 1, + C4::Search::enabled_staff_search_views, subscriptionsnumber => CountSubscriptionFromBiblionumber($biblionumber), ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt @@ -45,75 +45,64 @@ [% SET show_patron_column = Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
- [% IF checkouts %] -

Checked out [% checkouts.size | html %] times

- - - [% IF show_patron_column %] +[% IF current_checkouts_count + past_checkouts_count > 0 %] +

Checked out [% current_checkouts_count + past_checkouts_count | html %] times

+ +

Current checkouts

+[% IF current_checkouts_count > 0 %] +
+ + [% IF show_patron_column %] - [% END %] + [% END %] - [% IF Koha.Preference('RecordStaffUserOnCheckout') %] + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] - [% END %] + [% END %] - - - - [% FOREACH checkout IN checkouts %] - - [% IF show_patron_column %] - - [% END %] - - - [% IF Koha.Preference('RecordStaffUserOnCheckout') %] - - [% END %] - - - - - + +
PatronBarcode Checked out fromChecked out byRenewed Checkout on Due dateCheckin on
- [% IF checkout.patron %][%# Not set for deleted patron records %] - [% INCLUDE 'patron-title.inc' patron => checkout.patron hide_patron_infos_if_needed=1 %] - [% END %] - - [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %] - [% checkout.item.barcode | html %] - [% ELSE %] -   - [% END %][% IF checkout.branchcode %] - [% Branches.GetName( checkout.branchcode ) | html %] - [% ELSE %] -   - [% END %][% IF checkout.issuer_id %] - - [% INCLUDE 'patron-title.inc' patron=checkout.issuer %] - - [% END %][% IF checkout.renewals %] - Yes[% IF checkout.lastreneweddate %], last on: [% checkout.lastreneweddate |$KohaDates with_hours => 1 %] - [% END %] - [% ELSE %] - No - [% END %] - [% checkout.issuedate |$KohaDates with_hours => 1 %] - - [% checkout.date_due |$KohaDates with_hours => 1 %] - - [% checkout.returndate |$KohaDates with_hours => 1 %] -
+[% ELSE %] +
+

Not currently checked out.

+
+[% END %] + +

Past checkouts

+ +[% IF past_checkouts_count > 0 %] + + + [% IF show_patron_column %] + + [% END %] + + + [% IF Koha.Preference('RecordStaffUserOnCheckout') %] + [% END %] - -
PatronBarcodeChecked out fromChecked out by
- [% ELSE %] -

- [% biblio.title | html %][% IF biblio.author %], by [% biblio.author | html %][% END %] has never been checked out.

+ Renewed + Checkout on + Due date + Checkin on + + +[% ELSE %] +
+

No past checkouts.

+
+[% END %] - [% END %] +[% ELSE %] +
+

+ [% biblio.title | html %][% IF biblio.author %], by [% biblio.author | html %][% END %] has never been checked out. +

+
+[% END %]
@@ -129,22 +118,162 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] +[% INCLUDE 'js-date-format.inc' %] +[% INCLUDE 'js-patron-format.inc' %] [% END %] --