Bug 33945: (follow-up) Avoid breaking checkouts table when pref is empty
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / on-site_checkouts.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE AuthorisedValues %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Pending on-site checkouts &rsaquo; Circulation &rsaquo; Koha</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="circ_stats" class="circ">
14 [% WRAPPER 'header.inc' %]
15     [% INCLUDE 'circ-search.inc' %]
16 [% END %]
17
18 [% WRAPPER 'sub-header.inc' %]
19     [% WRAPPER breadcrumbs %]
20         [% WRAPPER breadcrumb_item %]
21             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
22         [% END %]
23         [% WRAPPER breadcrumb_item bc_active= 1 %]
24             <span>Pending on-site checkouts</span>
25         [% END %]
26     [% END #/ WRAPPER breadcrumbs %]
27 [% END #/ WRAPPER sub-header.inc %]
28
29 <div class="main container-fluid">
30     <div class="row">
31         <div class="col-sm-12">
32             <main>
33                 <div class="row">
34
35                 [% IF Koha.Preference('CircSidebar') %]
36                     <div class="col-sm-10 col-sm-push-2">
37                 [% ELSE %]
38                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
39                 [% END %]
40
41         <h1>Pending on-site checkouts</h1>
42         [% IF pending_onsite_checkouts %]
43             <div class="page-section">
44                 <table id="pending_onsite_checkout">
45                     <thead>
46                         <tr>
47                             <th>Date</th><th>Patron</th><th>Title</th><th>Call number</th><th>Barcode</th><th>Library</th><th>Location</th>
48                         </tr>
49                     </thead>
50                     <tbody>
51                         [% FOREACH item IN pending_onsite_checkouts %]
52                             <tr>
53                                 <td data-order="[% item.date_due | html %]">
54                                     [% IF item.is_overdue %]<span class="overdue">[% END %]
55                                     [% item.date_due | $KohaDates as_due_date => 1 %]
56                                     [% IF item.is_overdue %]</span>[% END %]
57                                 </td>
58                                 <td>
59                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber | uri %]">[% item.firstname | html %] [% item.surname | html %]</a>
60                                 </td>
61                                 <td>
62                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | uri %]"><strong>[% item.title | html %]</strong></a>[% IF ( item.author ) %], by [% item.author | html %][% END %][% IF ( item.itemnotes ) %]- <span class="circ-hlt">[% item.itemnotes | $raw %]</span>[% END %]
63                                 </td>
64                                 <td>[% item.itemcallnumber | html %]</td>
65                                 <td>
66                                     <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a>
67                                 </td>
68                                 <td>[% Branches.GetName(item.branchcode) | html %]</td>
69                                 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</td>
70                             </tr>
71                         [% END %]
72                     </tbody>
73                 </table>
74             </div> <!-- /.page-section -->
75         [% ELSE %]
76           <h3>No pending on-site checkout.</h3>
77         [% END %]
78
79                     [% IF Koha.Preference('CircSidebar') %]
80                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
81                             <div class="col-sm-2 col-sm-pull-10">
82                                 <aside>
83                                     [% INCLUDE 'circ-nav.inc' %]
84                                 </aside>
85                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
86                         </div> <!-- /.row -->
87                     [% END %]
88
89             </main>
90         </div> <!-- /.col-sm-12 -->
91     </div> <!-- /.row -->
92
93 [% MACRO jsinclude BLOCK %]
94     [% INCLUDE 'datatables.inc' %]
95     <script>
96         $(document).ready(function(){
97             if ( $("#pending_onsite_checkout").length ) {
98                 $("#pending_onsite_checkout").dataTable($.extend(true, {}, dataTablesDefaults));
99             }
100         });
101     </script>
102 [% END %]
103
104 [% INCLUDE 'intranet-bottom.inc' %]