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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-28 / +28 lines)
Lines 38-50 Link Here
38
[% INCLUDE 'members-toolbar.inc' %]
38
[% INCLUDE 'members-toolbar.inc' %]
39
<h1>Circulation history</h1>
39
<h1>Circulation history</h1>
40
40
41
[% SET all_checkouts = checkouts.merge(old_checkouts) %]
41
[% UNLESS Koha.Preference('intranetreadinghistory') %]
42
[% UNLESS Koha.Preference('intranetreadinghistory') %]
42
    <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
43
    <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
43
[% ELSIF is_anonymous %]
44
[% ELSIF is_anonymous %]
44
    <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div>
45
    <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div>
45
[% ELSIF ( patron.privacy == 2)  %]
46
[% ELSIF ( patron.privacy == 2)  %]
46
    <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
47
    <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
47
[% ELSIF ( !loop_reading ) %]
48
[% ELSIF ( !all_checkouts.size ) %]
48
    <div class="dialog message">This patron has no circulation history.</div>
49
    <div class="dialog message">This patron has no circulation history.</div>
49
[% ELSE %]
50
[% ELSE %]
50
    <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
51
    <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
Lines 71-127 Link Here
71
                    </tr>
72
                    </tr>
72
                </thead>
73
                </thead>
73
                <tbody>
74
                <tbody>
74
                    [% FOREACH issue IN loop_reading %]
75
                    [% FOREACH checkout IN all_checkouts %]
75
                        [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
76
                        [% SET item = checkout.item %]
77
                        [% SET biblio = item.biblio %]
78
                        [% IF checkout.returndate %]<tr>[% ELSE %]<tr class="onissue">[% END %]
76
                            <td style="display:none;">
79
                            <td style="display:none;">
77
                                [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
80
                                [% IF checkout.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
78
                                [% ELSE %][% issuetype = 'standard_checkout' | html %]
81
                                [% ELSE %][% issuetype = 'standard_checkout' | html %]
79
                                [% END %]
82
                                [% END %]
80
                                [% issuetype | html %]
83
                                [% issuetype | html %]
81
                            </td>
84
                            </td>
82
                            <td data-order="[% issue.issuestimestamp | html %]">
85
                            <td data-order="[% checkout.timestamp | html %]">
83
                                [% issue.issuestimestamp | $KohaDates  with_hours => 1 %]
86
                                [% checkout.timestamp | $KohaDates with_hours => 1 %]
84
                            </td>
87
                            </td>
85
                            <td>
88
                            <td>
86
                                [% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
89
                                [% INCLUDE 'biblio-title.inc' biblio=biblio link = 1 %]
87
                            </td>
90
                            </td>
88
91
89
                            <td>[% issue.author | html %]</td>
92
                            <td>[% biblio.author | html %]</td>
90
93
91
                            <td>
94
                            <td>
92
                                [% IF issue.classification %]
95
                                [% item.itemcallnumber | html %]
93
                                    [% issue.classification | html %]
94
                                [% ELSE %]
95
                                    [% issue.itemcallnumber | html %]
96
                                [% END %]
97
                            </td>
96
                            </td>
98
97
99
                            <td>
98
                            <td>
100
                                [% IF issue.enumchron %]
99
                                [% IF item.enumchron %]
101
                                    [% issue.enumchron | html %]
100
                                    [% item.enumchron | html %]
102
                                [% END %]
101
                                [% END %]
103
                            </td>
102
                            </td>
104
103
105
                            <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]#item[% issue.itemnumber | uri %]">[% issue.barcode | html %]</a></td>
104
                            <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
106
                            <td>
105
                            <td>
107
                                [% issue.renewals_count | html %]
106
                                [% checkout.renewals_count | html %]
108
                                [% IF issue.renewals_count > 0 %]
107
                                [% IF checkout.renewals_count > 0 %]
109
                                    [ <a class="checkout_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id | html %]" href="#">View</a> ]
108
                                    [ <a class="checkout_renewals_view" data-renewals="[% checkout.renewals_count | html %]" data-issueid="[% checkout.issue_id | html %]" href="#">View</a> ]
110
                                [% END %]
109
                                [% END %]
111
                            </td>
110
                            </td>
112
                            <td data-order="[% issue.issuedate | html %]">
111
                            <td data-order="[% checkout.issuedate | html %]">
113
                                [% issue.issuedate |$KohaDates with_hours => 1 %]
112
                                [% checkout.issuedate | $KohaDates with_hours => 1 %]
114
                            </td>
113
                            </td>
115
                            <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
114
                            <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
116
                            [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
115
                            [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
117
                                <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer_id | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
116
                                [% SET issuer = checkout.issuer %]
117
                                <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issuer.issuer_id | uri %]">[% issuer.firstname | html %] [% issuer.surname | html %]</a></td>
118
                            [% END %]
118
                            [% END %]
119
                            <td data-order="[% issue.date_due | html %]">
119
                            <td data-order="[% checkout.date_due | html %]">
120
                                [% issue.date_due | $KohaDates as_due_date => 1 %]
120
                                [% checkout.date_due | $KohaDates as_due_date => 1 %]
121
                            </td>
121
                            </td>
122
                            [% IF  issue.returndate %]
122
                            [% IF checkout.returndate %]
123
                                <td data-order="[% issue.returndate | html %]">
123
                                <td data-order="[% checkout.returndate | html %]">
124
                                [% issue.returndate |$KohaDates with_hours => 1 %]
124
                                [% checkout.returndate |$KohaDates with_hours => 1 %]
125
                            [% ELSE %]
125
                            [% ELSE %]
126
                                <td data-order="checked out">
126
                                <td data-order="checked out">
127
                                <small>Checked out</small>
127
                                <small>Checked out</small>
(-)a/members/readingrec.pl (-11 / +22 lines)
Lines 26-32 use CGI qw ( -utf8 ); Link Here
26
26
27
use C4::Auth qw( get_template_and_user );
27
use C4::Auth qw( get_template_and_user );
28
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
28
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
29
use C4::Members qw( GetAllIssues );
30
use List::MoreUtils qw( any uniq );
29
use List::MoreUtils qw( any uniq );
31
use Koha::DateUtils qw( dt_from_string );
30
use Koha::DateUtils qw( dt_from_string );
32
use Koha::ActionLogs;
31
use Koha::ActionLogs;
Lines 79-104 if ( $op eq 'export_barcodes' ) { Link Here
79
    }
78
    }
80
}
79
}
81
80
82
my $order = 'date_due desc';
83
my $limit = 0;
84
my $issues = ();
85
# Do not request the old issues of anonymous patron
81
# Do not request the old issues of anonymous patron
86
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){
82
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){
87
    # use of 'eq' in the above comparison is intentional -- the
83
    # use of 'eq' in the above comparison is intentional -- the
88
    # system preference value could be blank
84
    # system preference value could be blank
89
    $template->param( is_anonymous => 1 );
85
    $template->param( is_anonymous => 1 );
90
} else {
86
} else {
91
    $issues = GetAllIssues($patron->borrowernumber,$order,$limit);
87
    $template->param(
92
}
88
        checkouts => [
93
89
            $patron->checkouts(
94
if (! $limit){
90
                {},
95
	$limit = 'full';
91
                {
92
                    order_by => 'date_due desc',
93
                    prefetch => { item => { biblio => 'biblioitems' } },
94
                }
95
            )->as_list
96
        ]
97
    );
98
    $template->param(
99
        old_checkouts => [
100
            $patron->old_checkouts(
101
                {},
102
                {
103
                    order_by => 'date_due desc',
104
                    prefetch => { item => { biblio => 'biblioitems' } },
105
                }
106
            )->as_list
107
        ]
108
    );
96
}
109
}
97
110
98
$template->param(
111
$template->param(
99
    patron            => $patron,
112
    patron            => $patron,
100
    readingrecordview => 1,
113
    readingrecordview => 1,
101
    loop_reading      => $issues
102
);
114
);
103
output_html_with_http_headers $input, $cookie, $template->output;
115
output_html_with_http_headers $input, $cookie, $template->output;
104
116
105
- 

Return to bug 33948