Bug 26602: [20.05.x] Don't export "actions" column
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / overdue.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [%- USE Branches -%]
5 [%- USE Price -%]
6 [%- USE ItemTypes -%]
7 [%- USE Categories -%]
8 [%- USE ColumnsSettings -%]
9 [% SET footerjs = 1 %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha &rsaquo; Circulation &rsaquo; Items overdue as of [% todaysdate | html %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 <style>
14     .sql {display:none;}
15 </style>
16 </head>
17
18 <body id="circ_overdue" class="circ">
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'circ-search.inc' %]
21
22 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Overdues as of [% todaysdate | html %]</div>
23
24 <div class="main container-fluid">
25     <div class="row">
26         <div class="col-sm-10 col-sm-push-2">
27             <main>
28
29 [% IF ( noreport ) %]
30   <h2>Overdue report</h2>
31   <p>Please choose one or more filters to proceed.</p>
32 [% ELSE %]
33
34 [% IF ( overdueloop ) %]
35
36   <h2>[% nnoverdue | html %] [% IF ( noverdue_is_plural ) %]Items[% ELSE %]Item[% END %] overdue as of [% todaysdate | html %][% IF ( isfiltered ) %] <span style="font-size:70%;">(Filtered. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a>)</span>[% END %]</h2>
37
38   <p>
39     [% IF ( isfiltered ) %]
40         [% SET url_params = '' %]
41         [% FOR var IN filters.keys %]
42             [% url_params = BLOCK %][% url_params | $raw %]&amp;[% var | uri %]=[% filters.$var | uri %][% END %]
43         [% END %]
44       <a href="overdue.pl?op=csv[% url_params | $raw %]">Download file of displayed overdues</a>
45     [% ELSE %]
46       <a href="overdue.pl?op=csv">Download file of all overdues</a>
47     [% END %]
48   </p>
49
50   <div class="sql"><pre>[% sql | html %]</pre></div>
51   <div class="searchresults">
52     <table id="overduest">
53       <thead>
54         <tr>
55           <th class="title-string">Due date</th>
56           <th>Patron</th>
57           <th>Patron category</th>
58           <th>Patron library</th>
59           <th class="anti-the">Title</th>
60           <th>Home library</th>
61           <th>Holding library</th>
62           <th>Barcode</th>
63           <th>Call number</th>
64           <th>Item type</th>
65           <th>Price</th>
66           <th>Non-public note</th>
67         </tr>
68       </thead>
69       [%- BLOCK subject -%]Overdue:[%- END -%]
70       <tbody>
71       [% FOREACH overdueloo IN overdueloop %]
72         <tr>
73           <td><span title="[% overdueloo.duedate | html %]">[% overdueloo.duedate | $KohaDates %]</span></td>
74           <td>
75             [% INCLUDE 'patron-title.inc' patron=overdueloo.patron hide_patron_infos_if_needed=1 %]
76             [% IF logged_in_user.can_see_patron_infos( overdueloo.patron ) %]
77                 [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
78                 [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]</td>
79             [% END %]
80             <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
81             <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
82           <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=overdueloo %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
83             <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
84             <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
85           <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber | uri %]&amp;itemnumber=[% overdueloo.itemnum | uri %]#item[% overdueloo.itemnum | uri %]">[% overdueloo.barcode | html %]</a></td>
86           <td>[% overdueloo.itemcallnumber | html %]</td>
87             <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
88           <td>[% overdueloo.replacementprice | $Price %]</td>
89           <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
90         </tr>
91       [% END %]
92       </tbody>
93     </table>
94   </div>
95
96 [% ELSE %]
97
98   <h2>Overdue report</h2>
99   [% IF ( isfiltered ) %]
100     <p>There are no overdues matching your search. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a></p>
101   [% ELSE %]
102     <p>There are no overdues.</p>
103   [% END %]
104
105 [% END %]  <!-- overdueloop -->
106 [% END %]  <!-- noreport -->
107
108             </main>
109         </div> <!-- /.col-sm-10.col-sm-push-2 -->
110
111         <div class="col-sm-2 col-sm-pull-10">
112             <aside>
113
114 <form method="post" action="/cgi-bin/koha/circ/overdue.pl">
115   <fieldset class="brief">
116 <h4>Filter on:</h4>
117     <fieldset><legend>Date due:</legend>
118         <ol>
119             <li class="radio">
120                 <label for="showall">Show any items currently checked out:</label>
121                 [% IF ( showall ) %]
122                         <input type="checkbox" id="showall" name="showall" value="show" checked="checked" />
123                 [% ELSE %]
124                     <input type="checkbox" id="showall" name="showall" value="show" />
125                 [% END %]
126             </li>
127
128             <li class="date_due_filter">
129                 <label for="from">From:</label>
130                 <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="datepickerfrom" />
131             </li>
132             <li class="date_due_filter">
133                 <label for="to">To:</label>
134                 <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="datepickerto" />
135             </li>
136         </ol>
137     </fieldset>
138     <ol>
139     <li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% filters.borname | html %]" /></li>
140     <li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
141       [% FOREACH borcatloo IN borcatloop %]
142         [% IF ( borcatloo.selected ) %]<option value="[% borcatloo.value | html %]" selected="selected">[% borcatloo.catname | html %]</option>[% ELSE %]<option value="[% borcatloo.value | html %]">[% borcatloo.catname | html %]</option>[% END %]
143       [% END %]
144       </select>
145     </li>
146
147     <li><label>Patron flags:</label>
148         <select name="borflag" size="1" id="borflag">
149             <option value="">None</option>
150             [% IF ( borflag_gonenoaddress ) %]<option value="gonenoaddress" selected="selected">Address in question</option>
151             [% ELSE %]<option value="gonenoaddress">Address in question</option>[% END %]
152             [% IF ( borflag_debarred ) %]<option value="debarred" selected="selected">Restricted</option>
153             [% ELSE %]<option value="debarred">Restricted</option>[% END %]
154             [% IF ( borflag_lost ) %]<option value="lost" selected="selected">Lost card</option>
155             [% ELSE %]<option value="lost">Lost card</option>[% END %]
156         </select>
157     </li>
158         [% FOREACH patron_attr_filter_loo IN patron_attr_filter_loop %]
159                 <!-- domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category -->
160                 <li>
161                         <label>[% patron_attr_filter_loo.description | html %]:</label>
162             [% IF ( patron_attr_filter_loo.authorised_value_category ) %]
163                 <script type="text/javascript" x-code="[% patron_attr_filter_loo.code | html %]">create_auto_completion_responder([% patron_attr_filter_loo.domid | html %],"[% patron_attr_filter_loo.code | html %]");</script>
164                                 <span id="pattrodue-getready-[% patron_attr_filter_loo.domid | html %]">
165                                                 <div class="pattrodue-autocomplete">
166                             <input autocomplete="off" id="pattrodue-input-[% patron_attr_filter_loo.domid | html %]" name="patron_attr_filter_[% patron_attr_filter_loo.code | html %]" value="[% patron_attr_filter_loo.cgivalue | html %]"  class="pattrodue-input" type="text" />
167                                                 </div>
168                                 </span>
169                         [% ELSE %]
170                 <input type="text" name="patron_attr_filter_[% patron_attr_filter_loo.code | html %]" value="[% patron_attr_filter_loo.cgivalue | html %]"/>
171                         [% END %]
172                         [% IF ( patron_attr_filter_loo.repeatable ) %]
173                 <a href="#" onclick="clone_parent(this); return false;">Add</a>
174                 [% IF ( patron_attr_filter_loo.isclone ) %]
175                                     <a href="#" onclick="delete_parent(this); return false;" style="visibility: visible">Delete</a>
176                 [% ELSIF ( patron_attr_filter_loo.ismany ) %]
177                                     <a href="#" onclick="delete_parent(this); return false;" style="visibility: visible">Delete</a>
178                 [% ELSE %]
179                                     <a href="#" onclick="delete_parent(this); return false;" style="visibility: hidden">Delete</a>
180                 [% END %]
181                         [% END %]
182                 </li>
183         [% END %]
184
185     <li><label>Item type:</label><select name="itemtype" id="itemtype"><option value="">Any</option>
186       [% FOREACH itemtypeloo IN itemtypeloop %][% IF ( itemtypeloo.selected ) %]
187         <option value="[% itemtypeloo.value | html %]" selected="selected">[% itemtypeloo.itemtypename | html %]</option>[% ELSE %]
188         <option value="[% itemtypeloo.value | html %]">[% itemtypeloo.itemtypename | html %]</option>[% END %]
189       [% END %]
190       </select>
191     </li>
192
193     <li>
194         <label>Item home library:</label>
195         <select name="homebranch" id="homebranch">
196             <option value="">Any</option>
197             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
198         </select>
199     </li>
200
201     <li>
202         <label>Item holding library:</label>
203         <select name="holdingbranch" id="holdingbranch">
204             <option value="">Any</option>
205             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
206         </select>
207     </li>
208
209     <li>
210         <label>Library of the patron:</label>
211         <select name="branch" id="branch">
212             <option value="">Any</option>
213             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
214         </select>
215     </li>
216
217 </ol>
218    <fieldset class="action">
219       <input type="submit" value="Apply filter" class="submit" />
220       <input type="hidden" name="op" value="apply filter" />
221    </fieldset>
222    </fieldset>
223   </form>
224
225             </aside>
226         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
227      </div> <!-- /.row -->
228
229 [% MACRO jsinclude BLOCK %]
230     [% INCLUDE 'calendar.inc' %]
231     [% INCLUDE 'datatables.inc' %]
232     [% INCLUDE 'columns_settings.inc' %]
233     <script>
234         function clone_parent(node) {
235             var parent = node.parentNode;
236             var clone = parent.cloneNode(true);
237             parent.parentNode.insertBefore(clone, parent.nextSibling);
238             $("a", clone).attr("style", "visibility: visible");
239             $("input", clone).attr("value", "");
240
241             var theid = $("span", clone).attr("id") || "";
242             var theid = $("span", clone).attr("id") || "";
243             var parts = theid.match(/^pattrodue-getready-(.*)$/);
244             if (parts && parts.length > 1){
245                 var appendid = "-" + Math.floor(Math.random()*1000+1);
246                 $("span", clone).attr("id",theid+appendid);
247
248                 theid = $("input", clone).attr("id");
249                 $("input", clone).attr("id",theid+appendid);
250
251                 theid = $("div[id]", clone).attr("id");
252                 $("div[id]", clone).attr("id",theid+appendid);
253
254                 var attrcode = $("script", clone).attr("x-code");
255                 var newsuffix = parts[1] + appendid;
256                 create_auto_completion_responder(newsuffix,attrcode);
257             }
258         }
259
260
261         function delete_parent(node) {
262             var parent = node.parentNode;
263             parent.parentNode.removeChild(parent);
264         }
265
266         function create_auto_completion_responder(uniqueid,attrcode) {
267             $("#pattrodue-getready-" + uniqueid).ready(function(){
268                 $( "#pattrodue-input-" + uniqueid ).autocomplete({
269                     source: "/cgi-bin/koha/circ/ypattrodue-attr-search-authvalue.pl/"+attrcode,
270                     select: function( event, ui ) {
271                         $( "#pattrodue-input-"+uniqueid ).val( ui.item.description );
272                         return false;
273                     }
274                 })
275                 .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
276                     return $( "<li></li>" )
277                     .data( "ui-autocomplete-item", item )
278                     .append( "<a>" + item.description + " (" + item.authorised_value + ")</a>" )
279                     .appendTo( ul )
280                     .css("font-size","90%").css("width","13em");
281                 };
282             });
283         }
284
285         function update_date_due_filters_visibility(){
286             if( $("#showall").is(":checked")) {
287                 $(".date_due_filter").hide();
288                 $("#from").prop("disabled", true);
289                 $("#to").prop("disabled", true);
290             } else {
291                 $(".date_due_filter").show();
292                 $("#from").prop("disabled", false);
293                 $("#to").prop("disabled", false);
294             }
295         }
296
297         $(document).ready(function(){
298             var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
299             KohaTable("overduest", {
300                 "sPaginationType": "full",
301                 "aaSorting": [[0, 'asc']],
302                 "aoColumnDefs": [
303                     { "sType": "title-string", "aTargets": [ "title-string" ] },
304                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
305                 ],
306                 "autoWidth": false,
307                 "stateSave": true
308             }, columns_settings);
309
310             $("#showall").on("change", function(){
311                 update_date_due_filters_visibility();
312             });
313             update_date_due_filters_visibility();
314         });
315   </script>
316 [% END %]
317
318 [% INCLUDE 'intranet-bottom.inc' %]