Bug 34434: Terminology: Biblio should be bibliographic
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / overdue.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE KohaDates %]
5 [% USE Koha %]
6 [%- USE Branches -%]
7 [%- USE Price -%]
8 [%- USE ItemTypes -%]
9 [%- USE Categories -%]
10 [%- USE TablesSettings -%]
11 [% SET footerjs = 1 %]
12 [% INCLUDE 'doc-head-open.inc' %]
13 [% PROCESS 'modal-claims.inc' %]
14 <title>Items overdue as of [% todaysdate | $KohaDates %] &rsaquo; Circulation &rsaquo; Koha</title>
15 [% INCLUDE 'doc-head-close.inc' %]
16 [% FILTER collapse %]
17     <style>
18         .sql {display:none;}
19         .select2-container--open .select2-dropdown--below,
20         .select2-search.select2-search--dropdown {
21             border: 1px solid #AAA;
22         }
23         .select2-container--open .select2-dropdown--below,
24         .select2-search.select2-search--dropdown,
25         .select2-results {
26             background-color: #FFF;
27             width: 20em !important;
28         }
29     </style>
30 [% END %]
31 </head>
32
33 <body id="circ_overdue" class="circ">
34 [% WRAPPER 'header.inc' %]
35     [% INCLUDE 'circ-search.inc' %]
36 [% END %]
37
38 [% WRAPPER 'sub-header.inc' %]
39     [% WRAPPER breadcrumbs %]
40         [% WRAPPER breadcrumb_item %]
41             <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
42         [% END %]
43         [% WRAPPER breadcrumb_item bc_active= 1 %]
44             <span>Overdues as of [% todaysdate | $KohaDates %]</span>
45         [% END %]
46     [% END #/ WRAPPER breadcrumbs %]
47 [% END #/ WRAPPER sub-header.inc %]
48
49 <div class="main container-fluid">
50     <div class="row">
51         <div class="col-sm-10 col-sm-push-2">
52             <main>
53
54 [% IF ( noreport ) %]
55   <h1>Overdue report</h1>
56   <p>Please choose one or more filters to proceed.</p>
57 [% ELSE %]
58
59 [% IF ( overdueloop ) %]
60
61   <h2>[% nnoverdue | html %] [% IF ( noverdue_is_plural ) %]Items[% ELSE %]Item[% END %] overdue as of [% todaysdate | $KohaDates %][% IF ( isfiltered ) %] <span style="font-size:70%;">(Filtered. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a>)</span>[% END %]</h2>
62
63   <p>
64     [% IF ( isfiltered ) %]
65         [% SET url_params = '' %]
66         [% FOR var IN filters.keys %]
67             [% url_params = BLOCK %][% url_params | $raw %]&amp;[% var | uri %]=[% filters.$var | uri %][% END %]
68         [% END %]
69       <a href="overdue.pl?op=csv[% url_params | $raw %]">Download file of displayed overdues</a>
70     [% ELSE %]
71       <a href="overdue.pl?op=csv">Download file of all overdues</a>
72     [% END %]
73   </p>
74
75   <div class="sql"><pre>[% sql | html %]</pre></div>
76   <div class="page-section searchresults">
77     <table id="overduest">
78       <thead>
79         <tr>
80           <th>Due date</th>
81           <th>Patron</th>
82           <th>Patron category</th>
83           <th>Patron library</th>
84           <th class="anti-the">Title</th>
85           <th>Home library</th>
86           <th>Holding library</th>
87           <th>Shelving location</th>
88           <th>Barcode</th>
89           <th>Call number</th>
90           <th>Item type</th>
91           <th>Price</th>
92           <th>Non-public note</th>
93           [% IF Koha.Preference('ClaimReturnedLostValue') %]
94             <th>Return claims</th>
95           [% END %]
96         </tr>
97       </thead>
98       [%- BLOCK subject -%]Overdue:[%- END -%]
99       <tbody>
100       [% FOREACH overdueloo IN overdueloop %]
101         <tr>
102           <td data-order="[% overdueloo.duedate | html %]"><span class='overdue'>[% overdueloo.duedate | $KohaDates %]</span></td>
103           <td>
104             [% INCLUDE 'patron-title.inc' patron=overdueloo.patron hide_patron_infos_if_needed=1 %]
105             [% IF logged_in_user.can_see_patron_infos( overdueloo.patron ) %]
106                 [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email | uri %]?subject=[% INCLUDE subject %] [% overdueloo.title | uri %]">email</a>][% END %]
107                 [% IF ( overdueloo.phone ) %]([% overdueloo.phone | html %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile | html %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro | html %])[% END %]
108             [% END %]
109           </td>
110             <td>[% Categories.GetName( overdueloo.patron.categorycode ) | html %]</td>
111             <td>[% Branches.GetName( overdueloo.patron.branchcode ) | html %]</td>
112           <td>[% INCLUDE 'biblio-title.inc' biblio=overdueloo link = 1 %] [% IF ( overdueloo.author ) %], by [% overdueloo.author | html %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron | html %][% END %]</td>
113             <td>[% Branches.GetName( overdueloo.homebranchcode ) | html %]</td>
114             <td>[% Branches.GetName( overdueloo.holdingbranchcode ) | html %]</td>
115             <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => overdueloo.location ) | html %]</td>
116           <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>
117           <td>[% overdueloo.itemcallnumber | html %]</td>
118             <td>[% ItemTypes.GetDescription( overdueloo.itemtype ) | html %]</td>
119           <td>[% overdueloo.replacementprice | $Price %]</td>
120           <td>[% overdueloo.itemnotes_nonpublic | html %]</td>
121           [% IF Koha.Preference('ClaimReturnedLostValue') %]
122             <td>
123               [% IF ( overdueloo.return_claim_created_on ) %]
124                 <span class="badge">[% overdueloo.return_claim_created_on | $KohaDates with_hours => 1 %]</span>
125               [% ELSE %]
126                 <a class="btn btn-default btn-xs claim-returned-btn" data-itemnumber=[% overdueloo.itemnum | html %]>
127                     <i class="fa fa-exclamation-circle"></i> Claim returned
128                 </a>
129               [% END %]
130             </td>
131           [% END %]
132         </tr>
133       [% END %]
134       </tbody>
135     </table>
136   </div>
137
138  <!-- Claims Returned Modal -->
139  [% PROCESS 'modal-claims-display' %]
140
141 [% ELSE %]
142
143   <h1>Overdue report</h1>
144   [% IF ( isfiltered ) %]
145     <p>There are no overdues matching your search. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a></p>
146   [% ELSE %]
147     <p>There are no overdues.</p>
148   [% END %]
149
150 [% END %]  <!-- overdueloop -->
151 [% END %]  <!-- noreport -->
152
153             </main>
154         </div> <!-- /.col-sm-10.col-sm-push-2 -->
155
156         <div class="col-sm-2 col-sm-pull-10">
157             <aside>
158
159 <form method="post" action="/cgi-bin/koha/circ/overdue.pl">
160   <fieldset class="brief">
161 <h4>Filter on:</h4>
162     <fieldset><legend>Date due:</legend>
163         <ol>
164             <li class="radio">
165                 <label for="showall">Show any items currently checked out:</label>
166                 [% IF ( showall ) %]
167                         <input type="checkbox" id="showall" name="showall" value="show" checked="checked" />
168                 [% ELSE %]
169                     <input type="checkbox" id="showall" name="showall" value="show" />
170                 [% END %]
171             </li>
172
173             <li class="date_due_filter">
174                 <label for="from">From:</label>
175                 <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | html %]" class="flatpickr" data-date_to="to" />
176             </li>
177             <li class="date_due_filter">
178                 <label for="to">To:</label>
179                 <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | html %]" class="flatpickr" />
180             </li>
181         </ol>
182     </fieldset>
183     <ol>
184     <li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% filters.borname | html %]" /></li>
185     <li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
186       [% FOREACH borcatloo IN borcatloop %]
187         [% 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 %]
188       [% END %]
189       </select>
190     </li>
191
192     <li><label>Patron flags:</label>
193         <select name="borflag" id="borflag">
194             <option value="">None</option>
195             [% IF ( borflag_gonenoaddress ) %]<option value="gonenoaddress" selected="selected">Address in question</option>
196             [% ELSE %]<option value="gonenoaddress">Address in question</option>[% END %]
197             [% IF ( borflag_debarred ) %]<option value="debarred" selected="selected">Restricted</option>
198             [% ELSE %]<option value="debarred">Restricted</option>[% END %]
199             [% IF ( borflag_lost ) %]<option value="lost" selected="selected">Lost card</option>
200             [% ELSE %]<option value="lost">Lost card</option>[% END %]
201         </select>
202     </li>
203         [% FOREACH patron_attr_filter_loo IN patron_attr_filter_loop %]
204                 <!-- domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category -->
205                 <li>
206                         <label>[% patron_attr_filter_loo.description | html %]:</label>
207             [% IF ( patron_attr_filter_loo.authorised_value_category ) %]
208                 [% SET authvals = AuthorisedValues.GetAuthValueDropbox( patron_attr_filter_loo.authorised_value_category ) %]
209                 <select id="pattrodue-input-[% patron_attr_filter_loo.domid | html %]" name="patron_attr_filter_[% patron_attr_filter_loo.code | html %]" class="pattrodue-input">
210                     <option></option>
211                     [% FOREACH authval IN authvals %]
212                         [% IF ( patron_attr_filter_loo.cgivalue == authval.authorised_value ) -%]
213                             <option value="[% authval.authorised_value | html %]" selected="selected">[% authval.lib | html %]</option>
214                         [% ELSE -%]
215                             <option value="[% authval.authorised_value | html %]">[% authval.lib | html %]</option>
216                         [% END %]
217                     [% END %]
218                 </select>
219                         [% ELSE %]
220                 <input type="text" name="patron_attr_filter_[% patron_attr_filter_loo.code | html %]" value="[% patron_attr_filter_loo.cgivalue | html %]"/>
221                         [% END %]
222                         [% IF ( patron_attr_filter_loo.repeatable ) %]
223                 <a href="#" class="btn btn-link clone-attribute" data-original-id="pattrodue-input-[% patron_attr_filter_loo.domid | html %]"><i class="fa fa-plus"></i> Add</a>
224                 [% IF ( patron_attr_filter_loo.isclone ) %]
225                     <a href="#" class="btn btn-link delete_clone"><i class="fa fa-times"></i> Delete</a>
226                 [% ELSIF ( patron_attr_filter_loo.ismany ) %]
227                     <a href="#" class="btn btn-link delete_clone"><i class="fa fa-times"></i> Delete</a>
228                 [% ELSE %]
229                     <a href="#" class="btn btn-link delete_clone" style="display:none"><i class="fa fa-times"></i> Delete</a>
230                 [% END %]
231                         [% END %]
232                 </li>
233         [% END %]
234
235     <li><label>Item type:</label><select name="itemtype" id="itemtype"><option value="">Any</option>
236       [% FOREACH itemtypeloo IN itemtypeloop %][% IF ( itemtypeloo.selected ) %]
237         <option value="[% itemtypeloo.value | html %]" selected="selected">[% itemtypeloo.itemtypename | html %]</option>[% ELSE %]
238         <option value="[% itemtypeloo.value | html %]">[% itemtypeloo.itemtypename | html %]</option>[% END %]
239       [% END %]
240       </select>
241     </li>
242
243     <li>
244         <label>Item home library:</label>
245         <select name="homebranch" id="homebranch">
246             <option value="">Any</option>
247             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
248         </select>
249     </li>
250
251     <li>
252         <label>Item holding library:</label>
253         <select name="holdingbranch" id="holdingbranch">
254             <option value="">Any</option>
255             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
256         </select>
257     </li>
258
259     <li>
260         <label>Library of the patron:</label>
261         <select name="branch" id="branch">
262             <option value="">Any</option>
263             [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
264         </select>
265     </li>
266
267 </ol>
268    </fieldset>
269     <fieldset class="action">
270         <input type="submit" class="btn btn-primary" value="Apply filter" />
271         <input type="hidden" name="op" value="apply filter" />
272     </fieldset>
273   </form>
274
275             </aside>
276         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
277      </div> <!-- /.row -->
278
279 [% MACRO jsinclude BLOCK %]
280     [% INCLUDE 'calendar.inc' %]
281     [% INCLUDE 'datatables.inc' %]
282     [% INCLUDE 'columns_settings.inc' %]
283     [% INCLUDE 'select2.inc' %]
284     [% INCLUDE 'js-date-format.inc' %]
285     [% PROCESS 'modal-claims-js' %]
286     <script>
287         function clone_input( node, original_id ) {
288             var original = node;
289             var clone = original.clone();
290             var appendid = original_id + "-" + Math.floor(Math.random()*1000+1);
291             clone.find(".delete_clone").show();
292             if( clone.find("select").length ){
293                 /* <select> element is present */
294                 clone.find("select").removeClass("select2-hidden-accessible").removeAttr("data-select2-id").attr("id", appendid );
295                 clone.find(".select2").remove();
296                 original.after( clone );
297                 $("#" + appendid ).select2();
298             } else {
299                 clone.attr("id", appendid );
300                 original.after( clone );
301             }
302         }
303
304         function update_date_due_filters_visibility(){
305             if( $("#showall").is(":checked")) {
306                 $(".date_due_filter").hide();
307                 $("#from").prop("disabled", true);
308                 $("#to").prop("disabled", true);
309             } else {
310                 $(".date_due_filter").show();
311                 $("#from").prop("disabled", false);
312                 $("#to").prop("disabled", false);
313             }
314         }
315
316         $(document).ready(function(){
317             var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'overdues', 'circ-overdues', 'json' ) | $raw %];
318
319             [% IF !Koha.Preference('ClaimReturnedLostValue') %]
320                 table_settings['columns'].splice(13, 1);
321             [% END %]
322
323             KohaTable("overduest", {
324                 "sPaginationType": "full",
325                 "autoWidth": false,
326                 "stateSave": true
327             }, table_settings);
328
329             $("#showall").on("change", function(){
330                 update_date_due_filters_visibility();
331             });
332             update_date_due_filters_visibility();
333
334             $(".pattrodue-input").each(function(){
335                 $(this).select2();
336             });
337
338             $("body").on("click", ".delete_clone", function(e){
339                 e.preventDefault();
340                 $(this).parent().remove();
341             });
342
343             $("body").on("click", ".clone-attribute", function(e){
344                 e.preventDefault();
345                 clone_input( $(this).parent(), $(this).data("original-id") );
346             })
347         });
348   </script>
349 [% END %]
350
351 [% INCLUDE 'intranet-bottom.inc' %]