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