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