Bug 33820: Add hints to warn the librarian that they will be logged out if they chang...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / readingrec.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Koha %]
5 [% USE AuthorisedValues %]
6 [% USE Branches %]
7 [% USE TablesSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Circulation history for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="pat_readingrec" class="pat">
15 [% WRAPPER 'header.inc' %]
16     [% INCLUDE 'patron-search-header.inc' %]
17 [% END %]
18
19 [% WRAPPER 'sub-header.inc' %]
20     [% WRAPPER breadcrumbs %]
21         [% WRAPPER breadcrumb_item %]
22             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
23         [% END %]
24         [% WRAPPER breadcrumb_item %]
25             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
26         [% END %]
27         [% WRAPPER breadcrumb_item bc_active= 1 %]
28             <span>Circulation history</span>
29         [% END %]
30     [% END #/ WRAPPER breadcrumbs %]
31 [% END #/ WRAPPER sub-header.inc %]
32
33 <div class="main container-fluid">
34     <div class="row">
35         <div class="col-sm-10 col-sm-push-2">
36             <main>
37
38 [% INCLUDE 'members-toolbar.inc' %]
39 <h1>Circulation history</h1>
40
41 [% UNLESS Koha.Preference('intranetreadinghistory') %]
42     <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
43 [% 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 [% ELSIF ( patron.privacy == 2)  %]
46     <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
47 [% ELSIF ( !loop_reading ) %]
48     <div class="dialog message">This patron has no circulation history.</div>
49 [% 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
52         [% BLOCK table_readingrec %]
53             <table id="table_readingrec">
54                 <thead>
55                     <tr>
56                         <th style="display:none;">Type</th>
57                         <th>Date</th>
58                         <th class="anti-the">Title</th>
59                         <th>Author</th>
60                         <th>Call number</th>
61                         <th>Vol info</th>
62                         <th>Barcode</th>
63                         <th>Number of renewals</th>
64                         <th>Checked out on</th>
65                         <th>Checked out from</th>
66                         [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
67                             <th>Checked out by</th>
68                         [% END %]
69                         <th>Date due</th>
70                         <th>Return date</th>
71                     </tr>
72                 </thead>
73                 <tbody>
74                     [% FOREACH issue IN loop_reading %]
75                         [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
76                             <td style="display:none;">
77                                 [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' | html %]
78                                 [% ELSE %][% issuetype = 'standard_checkout' | html %]
79                                 [% END %]
80                                 [% issuetype | html %]
81                             </td>
82                             <td data-order="[% issue.issuestimestamp | html %]">
83                                 [% issue.issuestimestamp | $KohaDates  with_hours => 1 %]
84                             </td>
85                             <td>
86                                 [% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
87                             </td>
88
89                             <td>[% issue.author | html %]</td>
90
91                             <td>
92                                 [% IF issue.classification %]
93                                     [% issue.classification | html %]
94                                 [% ELSE %]
95                                     [% issue.itemcallnumber | html %]
96                                 [% END %]
97                             </td>
98
99                             <td>
100                                 [% IF issue.enumchron %]
101                                     [% issue.enumchron | html %]
102                                 [% END %]
103                             </td>
104
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>
106                             <td>
107                                 [% issue.renewals_count | html %]
108                                 [% IF issue.renewals_count > 0 %]
109                                     [ <a class="checkout_renewals_view" data-renewals="[% issue.renewals_count | html %]" data-issueid="[% issue.issue_id | html %]" href="#">View</a> ]
110                                 [% END %]
111                             </td>
112                             <td data-order="[% issue.issuedate | html %]">
113                                 [% issue.issuedate |$KohaDates with_hours => 1 %]
114                             </td>
115                             <td>[% Branches.GetName( issue.branchcode ) | html %]</td>
116                             [% 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>
118                             [% END %]
119                             <td data-order="[% issue.date_due | html %]">
120                                 [% issue.date_due | $KohaDates as_due_date => 1 %]
121                             </td>
122                             [% IF  issue.returndate %]
123                                 <td data-order="[% issue.returndate | html %]">
124                                 [% issue.returndate |$KohaDates with_hours => 1 %]
125                             [% ELSE %]
126                                 <td data-order="checked out">
127                                 <small>Checked out</small>
128                             [% END %]
129                             </td>
130                         </tr>
131                     [% END %]
132                 </tbody>
133             </table>
134         [% END %]
135
136         [% IF Koha.Preference('OnSiteCheckouts') %]
137             [% WRAPPER tabs id= "tabs" %]
138                 [% WRAPPER tabs_nav %]
139                     [% WRAPPER tab_item tabname= "tab_all" bt_active= 1 %] <span>All</span> [% END %]
140                     [% WRAPPER tab_item tabname= "tab_checkout" %] <span>Checkouts</span> [% END %]
141                     [% WRAPPER tab_item tabname= "tab_onsite_checkout" %] <span>On-site checkouts</span> [% END %]
142                 [% END # /WRAPPER tabs_nav %]
143                 [% WRAPPER tab_panels %]
144                     [% WRAPPER tab_panel tabname="readingrec" bt_active= 1 %]
145                         [% INCLUDE table_readingrec %]
146                     [% END # /tab_panel# %]
147                 [% END # /WRAPPER tab_panels %]
148             [% END # /WRAPPER tabs %]
149         [% ELSE %]
150             <div class="page-section">
151                 [% INCLUDE table_readingrec %]
152             </div> <!-- /.page-section -->
153         [% END # /IF Koha.Preference('OnSiteCheckouts') %]
154 [% END %]
155
156             </main>
157         </div> <!-- /.col-sm-10.col-sm-push-2 -->
158
159         <div class="col-sm-2 col-sm-pull-10">
160             <aside>
161                 [% INCLUDE 'circ-menu.inc' %]
162             </aside>
163         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
164      </div> <!-- /.row -->
165
166 [% MACRO jsinclude BLOCK %]
167     [% INCLUDE 'str/members-menu.inc' %]
168     [% Asset.js("js/members-menu.js") | $raw %]
169     [% INCLUDE 'datatables.inc' %]
170     [% INCLUDE 'columns_settings.inc' %]
171     [% INCLUDE 'modals/checkout_renewals.inc' %]
172     [% INCLUDE 'js-date-format.inc' %]
173     [% INCLUDE 'js-patron-format.inc' %]
174     [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
175     <script id="js">
176         $(document).ready(function() {
177             var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
178             var table = KohaTable("table_readingrec", {
179                 "sPaginationType": "full",
180                 "aaSorting": [[10, 'desc']]
181             }, table_settings);
182
183             $("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) {
184                 active_tab = $(this).attr("href");
185                 if( active_tab == "#tab_checkout_panel" ){
186                     table.fnFilter("standard_checkout", 0);
187                 } else if( active_tab == "#tab_onsite_checkout_panel" ){
188                     table.fnFilter("onsite_checkout", 0);
189                 } else {
190                     table.fnFilter('', 0);
191                 }
192             });
193         });
194     </script>
195 [% END %]
196
197 [% INCLUDE 'intranet-bottom.inc' %]