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