Bug 19532: (follow-up) Fixing OPAC display and staff client errors
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / recalls / recalls_to_pull.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% USE AuthorisedValues %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE Asset %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Recalls to pull &rsaquo; Circulation &rsaquo; Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13 <body id="circ_recalls_to_pull" class="circ">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'cat-search.inc' %]
16
17 <div id="breadcrumbs">
18     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19     &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
20     &rsaquo; <a href="/cgi-bin/koha/recalls/recalls_to_pull.pl">Recalls to pull</a>
21 </div>
22
23 <div class="main container-fluid">
24     <div class="row">
25         [% IF Koha.Preference('CircSidebar') %]
26             <div class="col-sm-10 col-sm-push-2">
27         [% ELSE %]
28             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
29         [% END %]
30         <main>
31
32         <h1>Recalls to pull</h1>
33         The following recalls could be fulfilled by available items.
34
35         [% IF Koha.Preference('UseRecalls') %]
36             <div id="recalls">
37                 [% IF recalls %]
38                 <table id="recalls-table">
39                     <thead>
40                         <tr>
41                             <th class="recall-topull">Pull this many items</th>
42                             <th class="recall-items">Items available</th>
43                             <th class="recall-patrons">Patrons with recalls</th>
44                             <th class="recall-firstpatron">First patron</th>
45                             <th class="recall-title anti-the">Title</th>
46                             <th class="recall-libraries">Libraries</th>
47                             <th class="recall-callnumbers">Available call numbers</th>
48                             <th class="recall-copynumbers">Available copy numbers</th>
49                             <th class="recall-enumeration">Available enumeration</th>
50                             <th class="recall-itemtypes">Available item types</th>
51                             <th class="recall-locations">Available locations</th>
52                             <th class="recall-date title-string">Earliest recall date</th>
53                             <th class="recall-action nosort">&nbsp;</th>
54                         </tr>
55                     </thead>
56                     <tbody>
57                         [% FOREACH recall IN recalls %]
58                         <tr>
59                             <td class="recall-topull"><b>[% recall.pull_count | html %]</b></td>
60                             <td class="recall-items">[% recall.items_count | html %]</td>
61                             <td class="recall-patrons">[% recall.patrons_count | html %]</td>
62                             <td class="recall-firstpatron"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.first_recall.borrowernumber | uri %]">[% recall.first_recall.patron.firstname | html %] [% recall.first_recall.patron.surname | html %]</a></td>
63                             <td class="recall-title">
64                                 [% INCLUDE 'biblio-title.inc' biblio=recall.first_recall.biblio link=1 %]
65                                 [% IF recall.first_recall.biblio.author %] by [% recall.first_recall.biblio.author | html %][% END %]
66                             </td>
67                             <td class="recall-libraries">
68                                 <ul>
69                                     [% FOREACH library IN recall.libraries %]
70                                         <li>[% Branches.GetName( library ) | html %]</li>
71                                     [% END %]
72                                 </ul>
73                             </td>
74                             <td class="recall-callnumbers">
75                                 <ul>
76                                     [% FOREACH callnumber IN recall.callnumbers %]
77                                         <li>[% callnumber | html %]</li>
78                                     [% END %]
79                                 </ul>
80                             </td>
81                             <td class="recall-copynumbers">
82                                 <ul>
83                                     [% FOREACH copyno IN recall.copynumbers %]
84                                         <li>[% copyno | html %]</li>
85                                     [% END %]
86                                 </ul>
87                             </td>
88                             <td class="recall-enumeration">
89                                 <ul>
90                                     [% FOREACH enumchron IN recall.enumchrons %]
91                                         <li>[% enumchron | html %]</li>
92                                     [% END %]
93                                 </ul>
94                             </td>
95                             <td class="recall-itemtypes">
96                                 <ul>
97                                     [% FOREACH itemtype IN recall.itemtypes %]
98                                         <li>[% ItemTypes.GetDescription( itemtype ) | html %]</li>
99                                     [% END %]
100                                 </ul>
101                             </td>
102                             <td class="recall-locations">
103                                 <ul>
104                                     [% FOREACH loc IN recall.locations %]
105                                         <li>[% AuthorisedValues.GetByCode('LOC', loc) | html %]</li>
106                                     [% END %]
107                                 </ul>
108                             </td>
109                             <td class="recall-date">
110                                 <span title="[% recall.first_recall.recalldate | html %]">[% recall.first_recall.recalldate | $KohaDates %] in [% recall.first_recall.library.branchname | html %]</span>
111                             </td>
112                             <td class="recall-action">
113                                 <form action="/cgi-bin/koha/recalls/recalls_to_pull.pl" method="post">
114                                     <input type="hidden" name="recall_id" value="[% recall.first_recall.recall_id | html %]">
115                                     <input type="hidden" name="op" value="cancel">
116                                     [% IF recall.first_recall.in_transit %]
117                                         <button type="submit" class="btn btn-default cancelreturn"><i class="fa fa-times"></i> Cancel recall and return to: [% Branches.GetName(recall.first_recall.item.homebranch) | html %]</button>
118                                     [% ELSE %]
119                                         <button type="submit" class="btn btn-default cancel"><i class="fa fa-times"></i> Cancel recall</button>
120                                     [% END %]
121                                 </form>
122                             </td>
123                         </tr>
124                         [% END %]
125                     </tbody>
126                 </table>
127                 [% ELSE %]
128                     <div class="dialog message">There are no recalls to pull.</div>
129                 [% END %]
130             </div>
131         [% ELSE %]
132             <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>
133         [% END %]
134
135         </main>
136         </div> <!-- /.col-etc -->
137
138         [% IF Koha.Preference('CircSidebar') %]
139             <div class="col-sm-2 col-sm-pull-10">
140                 <aside>
141                     [% INCLUDE 'circ-nav.inc' %]
142                 </aside>
143             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
144         [% END %]
145
146     </div> <!-- /.row -->
147 </div>
148
149 [% MACRO jsinclude BLOCK %]
150     [% INCLUDE 'datatables.inc' %]
151     [% INCLUDE 'columns_settings.inc' %]
152     <script>
153         $(document).ready(function(){
154             $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, {
155                 "aoColumnDefs": [
156                     { 'bSortable': false, 'aTargets': [ 'nosort' ] },
157                     { "sType": "title-string", "aTargets" : [ "title-string" ] },
158                     { "sType": "anti-the", "aTargets": [ "anti-the" ] }
159                 ],
160                 "sPaginationType": "full_numbers"
161             }));
162
163             $(".cancelreturn").click(function(){
164                 return confirmDelete(_("Are you sure you want to remove this recall and return the item to it's home library?"));
165             });
166
167             $(".cancel").click(function(){
168                 return confirmDelete(_("Are you sure you want to remove this recall?"));
169             });
170         });
171     </script>
172 [% END %]
173
174 [% INCLUDE 'intranet-bottom.inc' %]