Bug 34010: Template corrections to recall pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / recalls / recalls_waiting.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE Asset %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Recalls awaiting pickup &rsaquo; Circulation &rsaquo; Koha</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10 <body id="circ_recalls_awaiting_pickup" class="circ">
11 [% WRAPPER 'header.inc' %]
12     [% INCLUDE 'cat-search.inc' %]
13 [% END %]
14
15 [% WRAPPER 'sub-header.inc' %]
16     [% WRAPPER breadcrumbs %]
17         [% WRAPPER breadcrumb_item %]
18             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
19         [% END %]
20         [% WRAPPER breadcrumb_item bc_active= 1 %]
21             <span>Recalls awaiting pickup</span>
22         [% END %]
23     [% END #/ WRAPPER breadcrumbs %]
24 [% END #/ WRAPPER sub-header.inc %]
25
26 <div class="main container-fluid">
27     <div class="row">
28         [% IF Koha.Preference('CircSidebar') %]
29             <div class="col-sm-10 col-sm-push-2">
30         [% ELSE %]
31             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
32         [% END %]
33         <main>
34                 <h1>Recalls awaiting pickup</h1>
35
36                 [% IF Koha.Preference('UseRecalls') %]
37
38                 <div id="results" class="toptabs">
39
40                     <ul class="nav nav-tabs" role="tablist">
41                         <li role="presentation" class="active">
42                             <a href="#recallswaiting" aria-controls="recallswaiting" role="tab" data-toggle="tab">Recalls waiting: [% recalls.count | html %]</a>
43                         </li>
44                         <li role="presentation">
45                             <a href="#recallsover" aria-controls="recallsover" role="tab" data-toggle="tab">Recalls waiting over [% Koha.Preference('RecallsMaxPickUpDelay') | html %] days: [% over.count | html %]</a>
46                         </li>
47                     </ul>
48
49                     <div class="tab-content">
50                         <div id="recallswaiting" role="tabpanel" class="tab-pane active">
51                             [% IF ( recalls ) %]
52                                 <table id="recallswaiting-table">
53                                     <thead><tr>
54                                         <th class="recall-waitingdate title-string">Available since</th>
55                                         <th class="recall-title anti-the">Title</th>
56                                         <th class="recall-patron">Requested by</th>
57                                         <th class="recall-library">Pickup location</th>
58                                         <th class="recall-action nosort">&nbsp;</th>
59                                     </tr></thead>
60                                     <tbody>
61                                         [% FOREACH recall IN recalls %]<tr>
62                                             <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
63                                             <td class="recall-title">
64                                                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | uri %]">
65                                                     [% recall.biblio.title | html %]
66                                                     [% FOREACH s IN recall.biblio.subtitle %]
67                                                         [% s | html %]
68                                                     [% END %]
69                                                 </a>
70                                                 [% recall.biblio.author | html %]
71                                                 <br><i>Barcode: [% recall.item.barcode | html %]</i>
72                                             </td>
73                                             <td class="recall-patron">
74                                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
75                                                 [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
76                                                 [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email | uri %]?subject=Recall waiting: [% recall.biblio.title | uri %]">[% recall.patron.email | html %]</a>[% END %]
77                                             </td>
78                                             <td class="recall-library">[% recall.library.branchname | html %]</td>
79                                             <td class="recall-action actions">
80                                                 <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
81                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
82                                                     <input type="hidden" name="op" value="modify">
83                                                     <fieldset class="action">
84                                                         <button type="submit" name="revert" value="revert" class="btn btn-default btn-sm revert_recall"><i class="fa fa-undo"></i> Revert waiting status</button>
85                                                         <button type="submit" name="expire" value="expire" class="btn btn-default btn-sm expire_recall"><i class="fa fa-undo"></i> Expire recall</button>
86                                                     </fieldset>
87                                                 </form>
88                                             </td>
89                                         </tr>[% END %]
90                                     </tbody>
91                                 </table>
92                             [% ELSE %]
93                                 <div class="dialog message">There are no recalls to show.</div>
94                             [% END %]
95                         </div> <!-- recallswaiting -->
96
97                         <div id="recallsover" role="tabpanel" class="tab-pane">
98                             [% IF ( over.size ) %]
99                                 [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') | html %] days.</p>[% END %]
100                                 <table id="recallsover-table">
101                                     <thead><tr>
102                                         <th class="recall-waitingdate title-string">Available since</th>
103                                         <th class="recall-title anti-the">Title</th>
104                                         <th class="recall-patron">Requested by</th>
105                                         <th class="recall-library">Pickup location</th>
106                                         <th class="recall-action nosort">&nbsp;</th>
107                                     </tr></thead>
108                                     <tbody>
109                                         [% FOREACH recall IN over %]<tr>
110                                             <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
111                                             <td class="recall-title">
112                                                 [% INCLUDE 'biblio-title.inc' biblio=recall.biblio link = 1 %]
113                                                 [% IF recall.biblio.author %] by [% recall.biblio.author | html %][% END %]
114                                                 [% recall.item.enumchron | html %]
115                                                 [% IF ( recall.item.barcode ) %]<br><em>Barcode: [% recall.item.barcode | html %]</em>[% END %]
116                                             </td>
117                                             <td class="recall-patron">
118                                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
119                                                 [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
120                                                 [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email | uri %]?subject=Recall waiting: [% recall.biblio.title | uri %]">[% recall.patron.email | html %]</a>[% END %]
121                                             </td>
122                                             <td class="recall-library">[% recall.library.branchname | html %]</td>
123                                             <td class="recall-action actions">
124                                                 <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
125                                                     <input type="hidden" name="recall_id" value="[% recall.id | html %]">
126                                                     <input type="hidden" name="op" value="modify">
127                                                     <fieldset class="action">
128                                                         <button type="submit" name="revert" value="revert" class="btn btn-default btn-sm revert_recall"><i class="fa fa-undo"></i> Revert waiting status</button>
129                                                         <button type="submit" name="expire" value="expire" class="btn btn-default btn-sm expire_recall"><i class="fa fa-undo"></i> Expire recall</button>
130                                                     </fieldset>
131                                                 </form>
132                                             </td>
133                                         </tr>[% END %]
134                                     </tbody>
135                                 </table>
136                             [% ELSE %]
137                                 <div class="dialog message">There are no recalls to show.</div>
138                             [% END %]
139                         </div> <!-- recallsover -->
140                     </div> <!-- /.tab-content -->
141                 </div> <!-- results-->
142
143                 [% ELSE %]
144                     <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div>
145                 [% END %] <!-- Koha.Preference('UseRecalls') -->
146
147         </main>
148         </div> <!-- /.col-etc -->
149
150         [% IF Koha.Preference('CircSidebar') %]
151             <div class="col-sm-2 col-sm-pull-10">
152                 <aside>
153                     [% INCLUDE 'circ-nav.inc' %]
154                 </aside>
155             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
156         [% END %]
157
158     </div> <!-- /.row -->
159
160 [% MACRO jsinclude BLOCK %]
161     [% INCLUDE 'datatables.inc' %]
162     [% INCLUDE 'columns_settings.inc' %]
163     <script>
164         $(document).ready(function() {
165             $("#recallswaiting-table, #recallsover-table").dataTable($.extend(true, {}, dataTablesDefaults, {
166                 "autoWidth": false,
167                 "aoColumnDefs": [
168                     { 'bSortable': false, 'aTargets': [ 'nosort' ] },
169                 ],
170                 "sPaginationType": "full_numbers"
171             }));
172
173             $(".revert_recall").click(function(e) {
174                 return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?"));
175             });
176
177             $(".expire_recall").click(function(e) {
178                 return confirmDelete(_("Are you sure you want to remove this recall?"));
179             });
180         });
181     </script>
182 [% END %]
183
184 [% INCLUDE 'intranet-bottom.inc' %]