]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt
Bug 34012: Use template wrapper for tabs: Recalls awaiting pickup
[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                     [% WRAPPER tabs id= "results" %]
39                         [% WRAPPER tabs_nav %]
40                             [% WRAPPER tab_item tabname= "recallswaiting" bt_active= 1 %] <span>Recalls waiting: [% recalls.count | html %]</span> [% END %]
41                             [% WRAPPER tab_item tabname= "recallsover" %] <span>Recalls waiting over [% Koha.Preference('RecallsMaxPickUpDelay') | html %] days: [% over.count | html %]</span> [% END %]
42                         [% END # /WRAPPER tabs_nav %]
43
44                         [% WRAPPER tab_panels %]
45                             [% WRAPPER tab_panel tabname="recallswaiting" bt_active= 1 %]
46                                 [% IF ( recalls ) %]
47                                     <table id="recallswaiting-table">
48                                         <thead><tr>
49                                             <th class="recall-waitingdate title-string">Available since</th>
50                                             <th class="recall-title anti-the">Title</th>
51                                             <th class="recall-patron">Requested by</th>
52                                             <th class="recall-library">Pickup location</th>
53                                             <th class="recall-action nosort">&nbsp;</th>
54                                         </tr></thead>
55                                         <tbody>
56                                             [% FOREACH recall IN recalls %]<tr>
57                                                 <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
58                                                 <td class="recall-title">
59                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | uri %]">
60                                                         [% recall.biblio.title | html %]
61                                                         [% FOREACH s IN recall.biblio.subtitle %]
62                                                             [% s | html %]
63                                                         [% END %]
64                                                     </a>
65                                                     [% recall.biblio.author | html %]
66                                                     <br><i>Barcode: [% recall.item.barcode | html %]</i>
67                                                 </td>
68                                                 <td class="recall-patron">
69                                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
70                                                     [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
71                                                     [% 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 %]
72                                                 </td>
73                                                 <td class="recall-library">[% recall.library.branchname | html %]</td>
74                                                 <td class="recall-action actions">
75                                                     <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
76                                                         <input type="hidden" name="recall_id" value="[% recall.id | html %]">
77                                                         <input type="hidden" name="op" value="modify">
78                                                         <fieldset class="action">
79                                                             <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>
80                                                             <button type="submit" name="expire" value="expire" class="btn btn-default btn-sm expire_recall"><i class="fa fa-undo"></i> Expire recall</button>
81                                                         </fieldset>
82                                                     </form>
83                                                 </td>
84                                             </tr>[% END %]
85                                         </tbody>
86                                     </table>
87                                 [% ELSE %]
88                                     <div class="dialog message">There are no recalls to show.</div>
89                                 [% END %]
90                             [% END # /tab_panel# %]
91                             [% WRAPPER tab_panel tabname="recallsover" %]
92                                 <div id="recallsover" role="tabpanel" class="tab-pane">
93                                     [% IF ( over.size ) %]
94                                         [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') | html %] days.</p>[% END %]
95                                         <table id="recallsover-table">
96                                             <thead><tr>
97                                                 <th class="recall-waitingdate title-string">Available since</th>
98                                                 <th class="recall-title anti-the">Title</th>
99                                                 <th class="recall-patron">Requested by</th>
100                                                 <th class="recall-library">Pickup location</th>
101                                                 <th class="recall-action nosort">&nbsp;</th>
102                                             </tr></thead>
103                                             <tbody>
104                                                 [% FOREACH recall IN over %]<tr>
105                                                     <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td>
106                                                     <td class="recall-title">
107                                                         [% INCLUDE 'biblio-title.inc' biblio=recall.biblio link = 1 %]
108                                                         [% IF recall.biblio.author %] by [% recall.biblio.author | html %][% END %]
109                                                         [% recall.item.enumchron | html %]
110                                                         [% IF ( recall.item.barcode ) %]<br><em>Barcode: [% recall.item.barcode | html %]</em>[% END %]
111                                                     </td>
112                                                     <td class="recall-patron">
113                                                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %]</a>
114                                                         [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone | html %][% END %]
115                                                         [% 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 %]
116                                                     </td>
117                                                     <td class="recall-library">[% recall.library.branchname | html %]</td>
118                                                     <td class="recall-action actions">
119                                                         <form action="/cgi-bin/koha/recalls/recalls_waiting.pl" method="post">
120                                                             <input type="hidden" name="recall_id" value="[% recall.id | html %]">
121                                                             <input type="hidden" name="op" value="modify">
122                                                             <fieldset class="action">
123                                                                 <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>
124                                                                 <button type="submit" name="expire" value="expire" class="btn btn-default btn-sm expire_recall"><i class="fa fa-undo"></i> Expire recall</button>
125                                                             </fieldset>
126                                                         </form>
127                                                     </td>
128                                                 </tr>[% END %]
129                                             </tbody>
130                                         </table>
131                                     [% ELSE %]
132                                         <div class="dialog message">There are no recalls to show.</div>
133                                     [% END %]
134                                 </div> <!-- recallsover -->
135                             [% END # /tab_panel# %]
136                         [% END # /WRAPPER tab_panels %]
137                     [% END # /WRAPPER tabs %]
138
139                 [% ELSE %]
140                     <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>
141                 [% END %] <!-- Koha.Preference('UseRecalls') -->
142
143         </main>
144         </div> <!-- /.col-etc -->
145
146         [% IF Koha.Preference('CircSidebar') %]
147             <div class="col-sm-2 col-sm-pull-10">
148                 <aside>
149                     [% INCLUDE 'circ-nav.inc' %]
150                 </aside>
151             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
152         [% END %]
153
154     </div> <!-- /.row -->
155
156 [% MACRO jsinclude BLOCK %]
157     [% INCLUDE 'datatables.inc' %]
158     [% INCLUDE 'columns_settings.inc' %]
159     <script>
160         $(document).ready(function() {
161             $("#recallswaiting-table, #recallsover-table").dataTable($.extend(true, {}, dataTablesDefaults, {
162                 "autoWidth": false,
163                 "aoColumnDefs": [
164                     { 'bSortable': false, 'aTargets': [ 'nosort' ] },
165                 ],
166                 "sPaginationType": "full_numbers"
167             }));
168
169             $(".revert_recall").click(function(e) {
170                 return confirmDelete(_("Are you sure you want to revert this recall's status from Waiting?"));
171             });
172
173             $(".expire_recall").click(function(e) {
174                 return confirmDelete(_("Are you sure you want to remove this recall?"));
175             });
176         });
177     </script>
178 [% END %]
179
180 [% INCLUDE 'intranet-bottom.inc' %]