View | Details | Raw Unified | Return to bug 18403
Collapse All | Expand All

(-)a/catalogue/issuehistory.pl (-10 / +10 lines)
Lines 22-30 use CGI qw ( -utf8 ); Link Here
22
use C4::Auth;
22
use C4::Auth;
23
use C4::Output;
23
use C4::Output;
24
24
25
use C4::Circulation;    # GetBiblioIssues
26
use C4::Biblio;    # GetBiblio
25
use C4::Biblio;    # GetBiblio
27
use C4::Search;		# enabled_staff_search_views
26
use C4::Search;		# enabled_staff_search_views
27
use Koha::Checkouts;
28
28
29
use Koha::Biblios;
29
use Koha::Biblios;
30
30
Lines 41-58 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
41
41
42
my $biblionumber = $query->param('biblionumber');
42
my $biblionumber = $query->param('biblionumber');
43
43
44
if (C4::Context->preference("HidePatronName")) {
44
my $checkouts = Koha::Checkouts->search(
45
   $template->param(HidePatronName => 1);
45
    { biblionumber => $biblionumber },
46
}
46
    {
47
47
        join       => 'item',
48
my $issues = GetBiblioIssues($biblionumber);
48
        order_by   => 'timestamp',
49
    }
50
);
49
my $biblio = Koha::Biblios->find( $biblionumber );
51
my $biblio = Koha::Biblios->find( $biblionumber );
50
52
51
$template->param(
53
$template->param(
52
    biblionumber => $biblionumber, # required for left-side navigation
54
    checkouts => $checkouts,
53
    biblio       => $biblio,
55
    biblio    => $biblio,
54
    total        => scalar @$issues,
55
    issues       => $issues,
56
	issuehistoryview => 1,
56
	issuehistoryview => 1,
57
	C4::Search::enabled_staff_search_views,
57
	C4::Search::enabled_staff_search_views,
58
);
58
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (-16 / +16 lines)
Lines 25-32 Link Here
25
[% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
25
[% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
26
26
27
<div class="searchresults">
27
<div class="searchresults">
28
    [% IF ( issues ) %]
28
    [% IF checkouts.count %]
29
        <h4>Checked out [% total %] times</h4>
29
        <h4>Checked out [% checkouts.count %] times</h4>
30
        <table id="table_issues">
30
        <table id="table_issues">
31
            <thead><tr>
31
            <thead><tr>
32
            [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
32
            [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
Lines 40-78 Link Here
40
            <th class='title-string'>Checkin on</th>
40
            <th class='title-string'>Checkin on</th>
41
            </tr></thead>
41
            </tr></thead>
42
            <tbody>
42
            <tbody>
43
        [% FOREACH issue IN issues %]
43
        [% FOREACH checkout IN checkouts %]
44
            <tr>
44
            <tr>
45
                [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
45
                [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
46
                <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>
46
                <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>
47
                [% END %]
47
                [% END %]
48
                <td>[% IF ( issue.barcode ) %]
48
                <td>
49
                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% issue.biblionumber %]&amp;itemnumber=[% issue.itemnumber %]">[% issue.barcode %]</a>
49
                    [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %]
50
                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber %]&amp;itemnumber=[% checkout.item.itemnumber %]">[% checkout.item.barcode %]</a>
50
                    [% ELSE %]
51
                    [% ELSE %]
51
                        &nbsp;
52
                        &nbsp;
52
                    [% END %]</td>
53
                    [% END %]</td>
53
                <td>[% IF ( issue.branchcode ) %]
54
                <td>[% IF checkout.branchcode %]
54
                        [% Branches.GetName( issue.branchcode ) %]
55
                        [% Branches.GetName( checkout.branchcode ) %]
55
                    [% ELSE %]
56
                    [% ELSE %]
56
                        &nbsp;
57
                        &nbsp;
57
                    [% END %]</td>
58
                    [% END %]</td>
58
                <td>[% IF ( issue.renewals ) %]
59
                <td>[% IF checkout.renewals %]
59
                        Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate |$KohaDates with_hours => 1  %]</small>
60
                        Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates with_hours => 1  %]</small>
60
                            [% END %]
61
                            [% END %]
61
                    [% ELSE %]
62
                    [% ELSE %]
62
                        No
63
                        No
63
                    [% END %]</td>
64
                    [% END %]</td>
64
                <td>[% IF ( issue.issuedate ) %]
65
                <td>[% IF checkout.issuedate %]
65
                        <span title="[% issue.issuedate %]">[% issue.issuedate |$KohaDates with_hours => 1  %]</span>
66
                        <span title="[% checkout.issuedate %]">[% checkout.issuedate |$KohaDates with_hours => 1  %]</span>
66
                    [% ELSE %]
67
                    [% ELSE %]
67
                        <span title="0000-00-00"></span>
68
                        <span title="0000-00-00"></span>
68
                    [% END %]</td>
69
                    [% END %]</td>
69
                <td>[% IF ( issue.date_due ) %]
70
                <td>[% IF checkout.date_due %]
70
                        <span title="[% issue.date_due %]">[% issue.date_due |$KohaDates with_hours => 1  %]</span>
71
                        <span title="[% checkout.date_due %]">[% checkout.date_due |$KohaDates with_hours => 1  %]</span>
71
                    [% ELSE %]
72
                    [% ELSE %]
72
                        <span title="0000-00-00"></span>
73
                        <span title="0000-00-00"></span>
73
                    [% END %]</td>
74
                    [% END %]</td>
74
                <td>[% IF ( issue.returndate ) %]
75
                <td>[% IF checkout.returndate %]
75
                        <span title="[% issue.returndate %]">[% issue.returndate |$KohaDates with_hours => 1  %]</span>
76
                        <span title="[% checkout.returndate %]">[% checkout.returndate |$KohaDates with_hours => 1  %]</span>
76
                    [% ELSE %]
77
                    [% ELSE %]
77
                        <span title="Checked out"><small>Checked out</small></span>
78
                        <span title="Checked out"><small>Checked out</small></span>
78
                    [% END %]</td>
79
                    [% END %]</td>
79
- 

Return to bug 18403