Bug 11719 - Use new DataTables include in serials templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-search.tt
1 [% USE Branches %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 [% USE KohaDates %]
4 [% USE AuthorisedValues %]
5 <title>Koha &rsaquo; Serials [% biblionumber %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript">
11 //<![CDATA[
12  $(document).ready(function() {
13     [% IF (dateformat == 'metric') %]
14         dt_add_type_uk_date();
15     [% END %]
16     var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
17         [% IF ( routing && CAN_user_serials_routing ) %]
18             "aoColumnDefs": [
19                 { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
20             ],
21         [% ELSE %]
22             "aoColumnDefs": [
23                 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
24             ],
25         [% END %]
26         "aoColumns": [
27             null,{ "sType": "anti-the" },null,null,null,{ "sType": "title-string" },
28             [% IF ( routing && CAN_user_serials_routing ) %],null[% END %],null,null
29         ],
30         "sPaginationType": "four_button"
31     } ) );
32
33     var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
34         "aoColumnDefs": [
35             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
36         ],
37         "aoColumns": [
38             null,{ "sType": "anti-the" },null,null,null,null,null,null
39         ],
40         "sPaginationType": "four_button"
41     } ) );
42
43     osrlt.fnAddFilters("filter", 750);
44     csrlt.fnAddFilters("filter", 750);
45
46     $('#serialstabs').tabs();
47     $("#reopensub").click(function(){
48       return confirm(_("Are you sure you want to reopen this subscription?"));
49     });
50  });
51  //]]>
52 </script>
53 </head>
54 <body id="ser_serials-home" class="ser">
55 [% INCLUDE 'header.inc' %]
56 [% INCLUDE 'serials-search.inc' %]
57
58 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Search results[% ELSE %]Serials [% END %] </div>
59
60 <div id="doc3" class="yui-t2">
61   <div id="bd">
62     <div id="yui-main">
63       <div class="yui-b">
64       [% INCLUDE 'serials-toolbar.inc' %]
65
66       <h2>Serials subscriptions ([% total %] found)</h2>
67       [% UNLESS ( done_searched ) %]
68       <div id="advsearch" style="padding-bottom:3em;">
69         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
70           <fieldset class="rows">
71           <legend>Search subscriptions</legend>
72               <ol>
73                 <li>
74                   <label for="issn">ISSN:</label>
75                   <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
76                 </li>
77                 <li>
78                   <label for="title">Title:</label>
79                   <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
80                 </li>
81                 [% IF ( marcflavour == "UNIMARC" ) %]
82                 <li>
83                   <label for="ean">EAN:</label>
84                   <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
85                 </li>
86                 [% END %]
87                 <li>
88                   <label for="callnumber">Call number:</label>
89                   <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
90                 </li>
91                 <li>
92                   <label for="publisher">Publisher:</label>
93                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
94                 </li>
95                 <li>
96                   <label for="bookseller">Vendor:</label>
97                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
98                 </li>
99                 <li>
100                   <label for="branch">Library:</label>
101                   <select id="branch" name="branch_filter">
102                     <option value="">All</option>
103                     [% FOREACH branch IN branches_loop %]
104                       [% IF ( branch.selected ) %]
105                         <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
106                       [% ELSE %]
107                         <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
108                       [% END %]
109                     [% END %]
110                   </select>
111                 </li>
112                 [% IF locations %]
113                   <li>
114                     <label for="location">Location:</label>
115                     <select name="location_filter">
116                       <option value="">All</option>
117                       [% FOR loc IN locations %]
118                         [% IF loc.selected %]
119                           <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
120                         [% ELSE %]
121                           <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
122                         [% END %]
123                       [% END %]
124                     </select>
125                   </li>
126                 [% END %]
127                 <li>
128                   <label for="to">Expires before:</label>
129                   <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
130                 </li>
131               </ol>
132               <input type="hidden" name="searched" value="1" />
133               <fieldset class="action">
134                 <input type="submit" value="Search" />
135               </fieldset>
136           </fieldset>
137         </form>
138       </div>
139       [% END %]
140       [% IF ( done_searched ) %]
141         [% IF ( total ) %]
142           <div id="serialstabs" class="toptabs" style="clear:both;">
143             <ul class="ui-tabs-nav">
144               <li><a href="#opened">Open ([% openedsubscriptions.size || 0 %])</a></li>
145               <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 %])</a></li>
146             </ul>
147             <div id="opened">
148               [% IF openedsubscriptions %]
149                 <table id="osrlt">
150                   <thead>
151                     <tr>
152                         <th>ISSN</th>
153                         <th>Title</th>
154                         <th> Notes </th>
155                         <th>Library</th>
156                         <th>Location</th>
157                         <th>Call number</th>
158                         <th>Expiration date</th>
159                         [% IF ( routing && CAN_user_serials_routing ) %]
160                           <th>Routing list</th>
161                         [% END %]
162                         <th>&nbsp;</th>
163                         <th>&nbsp;</th>
164                     </tr>
165                   </thead>
166                   <tfoot>
167                     <tr>
168                       <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
169                       <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
170                       <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
171                       <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
172                       <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
173                       <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
174                       <td><input type="text" class="filter" data-column_num="6" placeholder="Search expiration date" /></td>
175                       [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
176                       <td></td>
177                       <td></td>
178                     </tr>
179                   </tfoot>
180                   <tbody>
181                     [% FOREACH subscription IN openedsubscriptions %]
182                     [% UNLESS subscription.cannotdisplay %]
183                       <tr>
184                         <td>
185                         [% IF ( subscription.issn ) %][% subscription.issn %]
186                         [% END %]
187                         </td>
188                         <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
189                         </td>
190                         <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %]
191                         [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
192                         </td>
193                         <td>
194                           [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
195                         </td>
196                         <td>
197                           [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
198                         </td>
199                         <td>
200                           [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
201                         </td>
202                         <td>
203                             [% IF ( subscription.enddate ) %]
204                                 <span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span>
205                             [% ELSE %]
206                                 <span title="0000-00-00"></span>
207                             [% END %]
208                         </td>
209                         [% IF ( routing && CAN_user_serials_routing ) %]
210                         <td>
211                           [% IF ( subscription.cannotedit ) %]
212                             &nbsp;
213                           [% ELSE %]
214                             [% IF ( subscription.routingedit ) %]
215                               <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
216                               ([% subscription.routingedit %])
217                             [% ELSE %]
218                               <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
219                             [% END %]
220                           [% END %]
221                         </td>
222                         [% END %]
223                         <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
224                         </td>
225                         <td>
226                         [% IF ( CAN_user_serials_receive_serials ) %]
227                           <a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>
228                         [% END %]
229                         </td>
230                       </tr>
231                       [% END %]
232                     [% END %]
233                   </tbody>
234                 </table>
235               [% ELSE %]
236                 <div class="dialog message">
237                   <p>Your search returned no open subscriptions.</p>
238                 </div>
239               [% END %]
240             </div>
241             <div id="closed">
242               [% IF closedsubscriptions %]
243                 <table id="csrlt">
244                   <thead>
245                     <tr>
246                         <th>ISSN</th>
247                         <th>Title</th>
248                         <th> Notes </th>
249                         <th>Library</th>
250                         <th>Location</th>
251                         <th>Call number</th>
252                         <th>&nbsp;</th>
253                         <th>&nbsp;</th>
254                     </tr>
255                   </thead>
256                   <tfoot>
257                     <tr>
258                       <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
259                       <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
260                       <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
261                       <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
262                       <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
263                       <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
264                       <td></td>
265                       <td></td>
266                     </tr>
267                   </tfoot>
268                   <tbody>
269                     [% FOREACH subscription IN closedsubscriptions %]
270                     [% UNLESS subscription.cannotdisplay %]
271                       <tr>
272                         <td>
273                           [% IF ( subscription.issn ) %]
274                             [% subscription.issn %]
275                           [% END %]
276                         </td>
277                         <td>
278                           <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
279                         </td>
280                         <td>
281                           [% IF ( subscription.notes ) %][% subscription.notes %][% END %]
282                           [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
283                         </td>
284                         <td>
285                           [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
286                         </td>
287                         <td>
288                           [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
289                         </td>
290                         <td>
291                           [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
292                         </td>
293                         <td>
294                           [% UNLESS subscription.cannotedit %]
295                             <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=reopen&amp;routing=[% subscription.routing %]&amp;searched=1&amp;title_filter=[% title_filter %]&amp;ISSN_filter=[% ISSN_filter %]&amp;EAN_filter=[% EAN_filter %]&amp;published_filter=[% publisher_filter %]&amp;bookseller_filter=[% bookseller_filter %]&amp;branch_filter=[% branch_filter %]" id="reopensub">Reopen</a>
296                           [% ELSE %]
297                             Cannot edit
298                           [% END %]
299                         </td>
300                         <td>
301                           <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
302                         </td>
303                       </tr>
304                     [% END %]
305                     [% END %]
306                   </tbody>
307                 </table>
308               [% ELSE %]
309                 <div class="dialog message">
310                   <p>Your search returned no closed subscriptions.</p>
311                 </div>
312               [% END %]
313             </div>
314           </div>
315         [% ELSE %]
316             <div class="dialog message">
317               <p>Your search returned no results.</p>
318             </div>
319         [% END %]
320       [% END %]
321     </div>
322   </div>
323
324   <div class="yui-b">
325     [% INCLUDE 'serials-menu.inc' %]
326     [% IF ( done_searched ) %]
327     <div id="advsearch">
328         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
329           <fieldset class="brief">
330             <h4>Search subscriptions</h4>
331               <ol>
332                 <li>
333                   <label for="issn">ISSN:</label>
334                   <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
335                 </li>
336                 <li>
337                   <label for="title">Title:</label>
338                   <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
339                 </li>
340                 [% IF ( marcflavour == "UNIMARC" ) %]
341                 <li>
342                   <label for="ean">EAN:</label>
343                   <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
344                 </li>
345                 [% END %]
346                 <li>
347                   <label for="callnumber">Call number:</label>
348                   <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
349                 </li>
350                 <li>
351                   <label for="publisher">Publisher:</label>
352                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
353                 </li>
354                 <li>
355                   <label for="bookseller">Vendor:</label>
356                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
357                 </li>
358                 <li>
359                   <label for="branch">Library:</label>
360                   <select id="branch" name="branch_filter">
361                     <option value="">All</option>
362                     [% FOREACH branch IN branches_loop %]
363                       [% IF ( branch.selected ) %]
364                         <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
365                       [% ELSE %]
366                         <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
367                       [% END %]
368                     [% END %]
369                   </select>
370                 </li>
371                 [% IF locations %]
372                   <li>
373                     <label for="location">Location:</label>
374                     <select name="location_filter">
375                       <option value="">All</option>
376                       [% FOR loc IN locations %]
377                         [% IF loc.selected %]
378                           <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
379                         [% ELSE %]
380                           <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
381                         [% END %]
382                       [% END %]
383                     </select>
384                   </li>
385                 [% END %]
386                 <li>
387                   <label for="to">Expires before:</label>
388                   <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
389                 </li>
390
391               </ol>
392               <input type="hidden" name="searched" value="1" />
393               <fieldset class="action">
394                 <input type="submit" value="Search" />
395               </fieldset>
396             </div>
397           </fieldset>
398         </form>
399       [% END %]
400   </div>
401 </div>
402 [% INCLUDE 'intranet-bottom.inc' %]