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