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