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 43-55 Link Here
43
[% INCLUDE 'members-toolbar.inc' %]
43
[% INCLUDE 'members-toolbar.inc' %]
44
<h1>Circulation history</h1>
44
<h1>Circulation history</h1>
45
45
46
[% SET all_checkouts = checkouts.merge(old_checkouts) %]
46
[% UNLESS Koha.Preference('intranetreadinghistory') %]
47
[% UNLESS Koha.Preference('intranetreadinghistory') %]
47
    <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
48
    <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
48
[% ELSIF is_anonymous %]
49
[% ELSIF is_anonymous %]
49
    <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>
50
    <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>
50
[% ELSIF ( patron.privacy == 2)  %]
51
[% ELSIF ( patron.privacy == 2)  %]
51
    <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
52
    <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
52
[% ELSIF ( !loop_reading ) %]
53
[% ELSIF ( !all_checkouts.size ) %]
53
    <div class="dialog message">This patron has no circulation history.</div>
54
    <div class="dialog message">This patron has no circulation history.</div>
54
[% ELSE %]
55
[% ELSE %]
55
    <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
56
    <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" /></form>
Lines 76-132 Link Here
76
                    </tr>
77
                    </tr>
77
                </thead>
78
                </thead>
78
                <tbody>
79
                <tbody>
79
                    [% FOREACH issue IN loop_reading %]
80
                    [% FOREACH checkout IN all_checkouts %]
80
                        [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
81
                        [% SET item = checkout.item %]
82
                        [% SET biblio = item.biblio %]
83
                        [% IF checkout.returndate %]<tr>[% ELSE %]<tr class="onissue">[% END %]
81
                            <td style="display:none;">
84
                            <td style="display:none;">
82
                                [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
85
                                [% IF checkout.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
83
                                [% ELSE %][% issuetype = 'standard_checkout' | html %]
86
                                [% ELSE %][% issuetype = 'standard_checkout' | html %]
84
                                [% END %]
87
                                [% END %]
85
                                [% issuetype | html %]
88
                                [% issuetype | html %]
86
                            </td>
89
                            </td>
87
                            <td data-order="[% issue.issuestimestamp | html %]">
90
                            <td data-order="[% checkout.timestamp | html %]">
88
                                [% issue.issuestimestamp | $KohaDates  with_hours => 1 %]
91
                                [% checkout.timestamp | $KohaDates with_hours => 1 %]
89
                            </td>
92
                            </td>
90
                            <td>
93
                            <td>
91
                                [% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
94
                                [% INCLUDE 'biblio-title.inc' biblio=biblio link = 1 %]
92
                            </td>
95
                            </td>
93
96
94
                            <td>[% issue.author | html %]</td>
97
                            <td>[% biblio.author | html %]</td>
95
98
96
                            <td>
99
                            <td>
97
                                [% IF issue.classification %]
100
                                [% item.itemcallnumber | html %]
98
                                    [% issue.classification | html %]
99
                                [% ELSE %]
100
                                    [% issue.itemcallnumber | html %]
101
                                [% END %]
102
                            </td>
101
                            </td>
103
102
104
                            <td>
103
                            <td>
105
                                [% IF issue.enumchron %]
104
                                [% IF item.enumchron %]
106
                                    [% issue.enumchron | html %]
105
                                    [% item.enumchron | html %]
107
                                [% END %]
106
                                [% END %]
108
                            </td>
107
                            </td>
109
108
110
                            <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>
109
                            <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>
111
                            <td>
110
                            <td>
112
                                [% issue.renewals_count | html %]
111
                                [% checkout.renewals_count | html %]
113
                                [% IF issue.renewals_count > 0 %]
112
                                [% IF checkout.renewals_count > 0 %]
114
                                    [ <a class="checkout_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id | html %]" href="#">View</a> ]
113
                                    [ <a class="checkout_renewals_view" data-renewals="[% checkout.renewals_count | html %]" data-issueid="[% checkout.issue_id | html %]" href="#">View</a> ]
115
                                [% END %]
114
                                [% END %]
116
                            </td>
115
                            </td>
117
                            <td data-order="[% issue.issuedate | html %]">
116
                            <td data-order="[% checkout.issuedate | html %]">
118
                                [% issue.issuedate |$KohaDates with_hours => 1 %]
117
                                [% checkout.issuedate | $KohaDates with_hours => 1 %]
119
                            </td>
118
                            </td>
120
                            <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
119
                            <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
121
                            [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
120
                            [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
122
                                <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer_id | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
121
                                [% SET issuer = checkout.issuer %]
122
                                <td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issuer.issuer_id | uri %]">[% issuer.firstname | html %] [% issuer.surname | html %]</a></td>
123
                            [% END %]
123
                            [% END %]
124
                            <td data-order="[% issue.date_due | html %]">
124
                            <td data-order="[% checkout.date_due | html %]">
125
                                [% issue.date_due | $KohaDates as_due_date => 1 %]
125
                                [% checkout.date_due | $KohaDates as_due_date => 1 %]
126
                            </td>
126
                            </td>
127
                            [% IF  issue.returndate %]
127
                            [% IF checkout.returndate %]
128
                                <td data-order="[% issue.returndate | html %]">
128
                                <td data-order="[% checkout.returndate | html %]">
129
                                [% issue.returndate |$KohaDates with_hours => 1 %]
129
                                [% checkout.returndate | $KohaDates with_hours => 1 %]
130
                            [% ELSE %]
130
                            [% ELSE %]
131
                                <td data-order="checked out">
131
                                <td data-order="checked out">
132
                                <small>Checked out</small>
132
                                <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