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