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