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