Bug 9850: Fix patron routing lists link
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 [% USE KohaDates %]
3 <title>Koha &rsaquo; Serials [% biblionumber %]</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11  $(document).ready(function() {
12     [% IF (dateformat == 'metric') %]
13         dt_add_type_uk_date();
14     [% END %]
15     var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
16
17         "aoColumnDefs": [
18             { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
19         ],
20         "sPaginationType": "four_button"
21     } ) );
22
23     var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
24         "aoColumnDefs": [
25             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
26         ],
27         "sPaginationType": "four_button"
28     } ) );
29
30     osrlt.fnAddFilters("filter", 750);
31     csrlt.fnAddFilters("filter", 750);
32
33     $('#serialstabs').tabs();
34     $("#reopensub").click(function(){
35       return confirm(_("Are you sure you want to reopen this subscription?"));
36     });
37  });
38  //]]>
39 </script>
40 </head>
41 <body id="ser_serials-home" class="ser">
42 [% INCLUDE 'header.inc' %]
43 [% INCLUDE 'serials-search.inc' %]
44
45 <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>
46
47 <div id="doc3" class="yui-t2">
48   <div id="bd">
49     <div id="yui-main">
50       <div class="yui-b">
51       [% INCLUDE 'serials-toolbar.inc' %]
52
53       <h2>Serials subscriptions ([% total %] found)</h2>
54       [% UNLESS ( done_searched ) %]
55       <div id="advsearch" style="padding-bottom:3em;">
56         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
57           <fieldset class="rows">
58           <legend>Search subscriptions</legend>
59               <ol>
60                 <li>
61                   <label for="issn">ISSN:</label>
62                   <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
63                 </li>
64                 <li>
65                   <label for="title">Title:</label>
66                   <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
67                 </li>
68                 [% IF ( marcflavour == "UNIMARC" ) %]
69                 <li>
70                   <label for="ean">EAN:</label>
71                   <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
72                 </li>
73                 [% END %]
74                 <li>
75                   <label for="publisher">Publisher:</label>
76                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
77                 </li>
78                 <li>
79                   <label for="bookseller">Vendor:</label>
80                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
81                 </li>
82                 <li>
83                   <label for="branch">Library:</label>
84                   <select id="branch" name="branch_filter">
85                     <option value="">All</option>
86                     [% FOREACH branch IN branches_loop %]
87                       [% IF ( branch.selected ) %]
88                         <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
89                       [% ELSE %]
90                         <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
91                       [% END %]
92                     [% END %]
93                   </select>
94                 </li>
95               </ol>
96               <input type="hidden" name="searched" value="1" />
97               <fieldset class="action">
98                 <input type="submit" value="Search" />
99               </fieldset>
100           </fieldset>
101         </form>
102       </div>
103       [% END %]
104       [% IF ( done_searched ) %]
105         [% IF ( total ) %]
106           <div id="serialstabs" class="toptabs" style="clear:both;">
107             <ul class="ui-tabs-nav">
108               <li><a href="#opened">Opened ([% openedsubscriptions.size || 0 %])</a></li>
109               <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 %])</a></li>
110             </ul>
111             <div id="opened">
112               [% IF openedsubscriptions %]
113                 <table id="osrlt">
114                   <thead>
115                     <tr>
116                         <th>ISSN</th>
117                         <th>Title</th>
118                         <th> Notes </th>
119                         <th>Library</th>
120                         <th>Call number</th>
121                         <th>Expiration date</th>
122                         [% IF ( routing && CAN_user_serials_routing ) %]
123                           <th>Routing list</th>
124                         [% END %]
125                         <th>&nbsp;</th>
126                         <th>&nbsp;</th>
127                     </tr>
128                   </thead>
129                   <tfoot>
130                     <tr>
131                       <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
132                       <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
133                       <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
134                       <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
135                       <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
136                       <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
137                       [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
138                       <td></td>
139                       <td></td>
140                     </tr>
141                   </tfoot>
142                   <tbody>
143                     [% FOREACH subscription IN openedsubscriptions %]
144                       <tr>
145                         <td>
146                         [% IF ( subscription.issn ) %][% subscription.issn %]
147                         [% END %]
148                         </td>
149                         <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
150                         </td>
151                         <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
152                         [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
153                         </td>
154                         <td>
155                           [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
156                         </td>
157                         <td>
158                           [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
159                         </td>
160                         <td>
161                           [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
162                         </td>
163                         [% IF ( routing && CAN_user_serials_routing ) %]
164                         <td>
165                           [% IF ( subscription.cannotedit ) %]
166                             &nbsp;
167                           [% ELSE %]
168                             [% IF ( subscription.routingedit ) %]
169                               <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
170                               ([% subscription.routingedit %])
171                             [% ELSE %]
172                               <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
173                             [% END %]
174                           [% END %]
175                         </td>
176                         [% END %]
177                         <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
178                         </td>
179                         <td>
180                         [% IF ( subscription.cannotedit ) %]
181                           &nbsp;
182                         [% ELSE %]
183                           [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
184                         [% END %]
185                         </td>
186                       </tr>
187                     [% END %]
188                   </tbody>
189                 </table>
190               [% ELSE %]
191                 There is no opened subscription for your search.
192               [% END %]
193             </div>
194             <div id="closed">
195               [% IF closedsubscriptions %]
196                 <table id="csrlt">
197                   <thead>
198                     <tr>
199                         <th>ISSN</th>
200                         <th>Title</th>
201                         <th> Notes </th>
202                         <th>Library</th>
203                         <th>Call number</th>
204                         <th>&nbsp;</th>
205                         <th>&nbsp;</th>
206                     </tr>
207                   </thead>
208                   <tfoot>
209                     <tr>
210                       <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
211                       <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
212                       <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
213                       <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
214                       <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
215                       <td></td>
216                       <td></td>
217                     </tr>
218                   </tfoot>
219                   <tbody>
220                     [% FOREACH subscription IN closedsubscriptions %]
221                       <tr>
222                         <td>
223                           [% IF ( subscription.issn ) %]
224                             [% subscription.issn %]
225                           [% END %]
226                         </td>
227                         <td>
228                           <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
229                         </td>
230                         <td>
231                           [% IF ( subscription.notes ) %][% subscription.notes %][% END %]
232                           [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
233                         </td>
234                         <td>
235                           [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
236                         </td>
237                         <td>
238                           [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
239                         </td>
240                         <td>
241                           [% UNLESS subscription.cannotedit %]
242                             <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>
243                           [% ELSE %]
244                             Cannot edit
245                           [% END %]
246                         </td>
247                         <td>
248                           <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
249                         </td>
250                       </tr>
251                     [% END %]
252                   </tbody>
253                 </table>
254               [% ELSE %]
255                 There is no closed subscription for your search.
256               [% END %]
257             </div>
258           </div>
259         [% END %]
260       [% END %]
261     </div>
262   </div>
263
264   <div class="yui-b">
265     [% INCLUDE 'serials-menu.inc' %]
266     [% IF ( done_searched ) %]
267     <div id="advsearch">
268         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
269           <fieldset class="brief">
270             <h4>Search subscriptions</h4>
271               <ol>
272                 <li>
273                   <label for="issn">ISSN:</label>
274                   <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
275                 </li>
276                 <li>
277                   <label for="title">Title:</label>
278                   <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
279                 </li>
280                 [% IF ( marcflavour == "UNIMARC" ) %]
281                 <li>
282                   <label for="ean">EAN:</label>
283                   <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
284                 </li>
285                 [% END %]
286                 <li>
287                   <label for="publisher">Publisher:</label>
288                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
289                 </li>
290                 <li>
291                   <label for="bookseller">Vendor:</label>
292                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
293                 </li>
294                 <li>
295                   <label for="branch">Library:</label>
296                   <select id="branch" name="branch_filter">
297                     <option value="">All</option>
298                     [% FOREACH branch IN branches_loop %]
299                       [% IF ( branch.selected ) %]
300                         <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
301                       [% ELSE %]
302                         <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
303                       [% END %]
304                     [% END %]
305                   </select>
306                 </li>
307               </ol>
308               <input type="hidden" name="searched" value="1" />
309               <fieldset class="action">
310                 <input type="submit" value="Search" />
311               </fieldset>
312             </div>
313           </fieldset>
314         </form>
315       [% END %]
316   </div>
317 </div>
318 [% INCLUDE 'intranet-bottom.inc' %]