Bug 33945: (follow-up) Avoid breaking checkouts table when pref is empty
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / transfers_to_send.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% SET footerjs = 1 %]
8 [% PROCESS 'transfer_reasons.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Transfers to send &rsaquo; Circulation &rsaquo; Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="circ_transferstosend" class="circ">
15 [% WRAPPER 'header.inc' %]
16     [% INCLUDE 'circ-search.inc' %]
17 [% END %]
18
19 [% WRAPPER 'sub-header.inc' %]
20     [% WRAPPER breadcrumbs %]
21         [% WRAPPER breadcrumb_item %]
22             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
23         [% END %]
24         [% WRAPPER breadcrumb_item bc_active= 1 %]
25             <span>Transfers to send</span>
26         [% END %]
27     [% END #/ WRAPPER breadcrumbs %]
28 [% END #/ WRAPPER sub-header.inc %]
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-sm-12">
33             <main>
34                 <div class="row">
35
36                     [% IF Koha.Preference('CircSidebar') %]
37                     <div class="col-sm-10 col-sm-push-2">
38                     [% ELSE %]
39                     <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
40                     [% END %]
41
42                         <h1>Transfers requested of your library as of [% show_date | $KohaDates %]</h1>
43
44                         [% IF libraries.count %]
45                         <p>Your library is the origin for the following transfer(s)</p>
46                         <div id="resultlist">
47                             [% FOREACH library IN libraries %]
48                                 [% IF ( library.branchcode ) %]
49                                     <div class="page-section">
50                                         <table style="width: 100%" id="transferst[% library.branchcode | html %]">
51                                             <caption>Sending to [% library.branchname | html %]</caption>
52                                             <thead>
53                                                 <tr>
54                                                     <th>Date of request</th>
55                                                     <th class="anti-the">Title</th>
56                                                     <th>Reason</th>
57                                                     <th>On loan</th>
58                                                     <th>Home library</th>
59                                                     <th>Call number</th>
60                                                     <th>Actions</th>
61                                                 </tr>
62                                             </thead>
63                                             <tbody>
64                                                 [% FOREACH transfer IN library.inbound_transfers %]
65                                                     [% UNLESS transfer.datesent %]
66                                                     <tr>
67                                                         <td data-order="[% transfer.daterequested | html %]">
68                                                             [% transfer.daterequested | $KohaDates %]
69                                                         </td>
70                                                         <td>
71                                                             [% INCLUDE 'biblio-title.inc' biblio = transfer.item.biblio link = 1 %][% IF ( transfer.item.biblio.author ) %] by [% transfer.item.biblio.author | html %][% END %]
72                                                             [% IF ( transfer.item.effective_itemtype ) %] (<b>[% ItemTypes.GetDescription( transfer.item.effective_itemtype ) | html %]</b>)[% END %]
73                                                             <br />Barcode: [% transfer.item.barcode | html %]
74                                                         </td>
75                                                         <td><p>[% PROCESS transfer_reason transfer=transfer %]</p></td>
76                                                         <td>[% IF transfer.item.onloan %]Due [% transfer.item.onloan | $KohaDates %][% ELSE %]On shelf[% END %]</td>
77                                                         <td>[% Branches.GetName( transfer.item.homebranch ) | html %]</td>
78                                                         <td>[% transfer.item.itemcallnumber | html %]</td>
79                                                         <td class="actions">
80                                                             [% IF transfer.reason == 'StockrotationAdvance' %]
81                                                             <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber | uri %]&biblionumber=[% transfer.item.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>
82                                                             [% END %]
83                                                         </td>
84                                                     </tr>
85                                                     [% END %]
86                                                 [% END %]
87                                             </tbody>
88                                         </table>
89                                     </div> <!-- /.page-section -->
90                                 [% END %]
91                             [% END %]
92                         </div>
93                         [% ELSE %]
94                         <p>No transfers to send</p>
95                         [% END %]
96
97                     </div> <!-- /.col-sm-10.col-sm-push-2 OR /.col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2-->
98
99                     [% IF Koha.Preference('CircSidebar') %]
100                     <div class="col-sm-2 col-sm-pull-10">
101                         <aside>
102                             [% INCLUDE 'circ-nav.inc' %]
103                         </aside>
104                     </div> <!-- /.col-sm-2.col-sm-pull-10 -->
105                     [% END %]
106
107                 </div> <!-- /.row -->
108             </main>
109         </div> <!-- /.col-sm-12 -->
110     </div> <!-- /.row -->
111
112 [% MACRO jsinclude BLOCK %]
113     [% INCLUDE 'datatables.inc' %]
114     <script>
115         $(document).ready(function() {
116             [% FOREACH library IN libraries %]
117             $("#transferst[% library.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, {
118                 "aoColumnDefs": [
119                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
120                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
121                 ],
122                 "sDom": 't',
123                 "bPaginate": false
124             }));
125             [% END %]
126         });
127     </script>
128 [% END %]
129
130 [% INCLUDE 'intranet-bottom.inc' %]