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