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

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

Return to bug 18403