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