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