3 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Serials [% biblionumber | html %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") | $raw %]
12 <style type="text/css">input.dt-filter { width : 100%; font-size : 85%; }</style>
15 <body id="ser_serials-home" class="ser">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'serials-search.inc' %]
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div>
22 [% FOREACH param IN CGI.params.pairs %]
23 [% escaped_value = BLOCK %][% param.value | uri %][% END %]
24 [% url_params.push(param.key _ '=' _ escaped_value) | html %]
26 [% SET referrer = '/cgi-bin/koha/serials/serials-search.pl?' %]
27 [% referrer = BLOCK %][% referrer | url %][% url_params.join("&") |uri %][% END %]
28 [% SET edit_action_link = '/cgi-bin/koha/serials/subscription-batchedit.pl?referrer=' _ referrer %]
30 [% BLOCK subscriptions_table %]
34 [% SET tab = 'closed' %]
36 [% SET tab = 'opened' %]
38 [% IF CAN_user_serials_edit_subscription %]
40 <a class="select-all" href="#" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a>
42 <a class="clear-all" href="#" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
43 <span class="itemselection_actions">
45 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Edit selected serials</a>
54 <th class="anti-the">Title</th>
60 <th class="title-string">Expiration date</th>
62 [% FOR field IN additional_fields_for_subscription %]
63 <th>[% field.name | html %]</th>
65 <th class="NoSort">Actions</th>
71 <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td>
72 <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td>
73 <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td>
74 <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td>
75 <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td>
76 <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td>
78 <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td>
80 [% FOR field IN additional_fields_for_subscription %]
81 <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 | html %]" placeholder="Search [% field.name | html %]" /></td>
87 [% FOREACH subscription IN subscriptions %]
88 [% UNLESS subscription.cannotdisplay %]
91 [% UNLESS subscription.cannotedit %]
92 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
94 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" disabled="disabled" title="You cannot edit this subscription" />
98 [% IF ( subscription.issn ) %][% subscription.issn | html %]
101 <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]" class="button" title="subscription detail">[% subscription.title | html %]</a>
103 <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes | html %][% END %]
104 [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes | html %])[% END %]
107 [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) | html %][% END %]
110 [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) | html %][% END %]
113 [% IF ( subscription.callnumber ) %][% subscription.callnumber | html %][% END %]
117 [% IF ( subscription.enddate ) %]
118 <span title="[% subscription.enddate | html %]">[% subscription.enddate | $KohaDates %]</span>
120 <span title="0000-00-00"></span>
125 [% FOR field IN additional_fields_for_subscription %]
126 [% IF field.authorised_value_category %]
127 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) | html %]</td>
129 <td>[% subscription.additional_fields.${field.name} | html %]</td>
134 <div class="dropdown">
136 <a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid | html %]" role="button" data-toggle="dropdown" href="#">
137 Actions <b class="caret"></b>
139 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid | html %]">
141 [% IF ( routing && CAN_user_serials_routing ) %]
142 [% UNLESS ( subscription.cannotedit ) %]
144 <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid | uri %]&op=reopen&routing=[% subscription.routing | uri %]&searched=1&title_filter=[% title_filter | uri %]&ISSN_filter=[% ISSN_filter | uri %]&EAN_filter=[% EAN_filter | uri %]&published_filter=[% publisher_filter | uri %]&bookseller_filter=[% bookseller_filter | uri %]&branch_filter=[% branch_filter | uri %]" id="reopensub"> <i class="fa fa-repeat"></i> Reopen</a>
147 [% END # IF ( routing && CAN_user_serials_routing ) %]
150 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
155 <div class="btn-group">
156 [% IF ( CAN_user_serials_receive_serials ) %]
157 [%# There should be no space between these two buttons, it would render badly %]
158 <a class="btn btn-default btn-xs" role="button"
159 href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid | html %]&serstatus=1,3,7"><i
160 class="fa fa-inbox"></i> Serial receive</a><a
161 class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid | html %]" role="button"
162 data-toggle="dropdown" href="#"><b class="caret"></b></a>
164 <a class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid | html %]" role="button" data-toggle="dropdown" href="#">Actions <b class="caret"></b></a>
166 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid | html %]">
168 [% IF ( routing && CAN_user_serials_routing ) %]
169 [% IF ( subscription.cannotedit ) %]
171 [% IF ( subscription.routingedit ) %]
173 <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit | html %])</a>
177 <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | uri %]&op=new"> <i class="fa fa-plus"></i> New routing list</a>
181 [% END # IF ( routing && CAN_user_serials_routing ) %]
184 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
200 <div class="main container-fluid">
202 <div class="col-sm-10 col-sm-push-2">
205 [% INCLUDE 'serials-toolbar.inc' %]
207 [% IF ( done_searched ) %]
208 <h2>Serials subscriptions ([% total | html %] found)</h2>
210 <h2>Serials subscriptions search</h2>
213 [% UNLESS ( done_searched ) %]
214 <div id="advsearch" style="padding-bottom:3em;">
215 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
216 <fieldset class="rows">
217 <legend>Search subscriptions</legend>
220 <label for="issn">ISSN:</label>
221 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
224 <label for="title">Title:</label>
225 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
227 [% IF ( marcflavour == "UNIMARC" ) %]
229 <label for="ean">EAN:</label>
230 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
234 <label for="callnumber">Call number:</label>
235 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
238 <label for="publisher">Publisher:</label>
239 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
242 <label for="bookseller">Vendor:</label>
243 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
246 <label for="branch">Library:</label>
247 <select id="branch" name="branch_filter">
248 <option value="">All</option>
249 [%# FIXME Should not we filter the libraries? %]
250 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
254 <label for="location">Location:</label>
255 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
258 <label for="to">Expires before:</label>
259 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
261 [% FOR field IN additional_fields_for_subscription %]
263 <label for="additional_field_[% field.id | html %]"> [% field.name | html %]: </label>
264 [% IF field.authorised_value_choices %]
265 <select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]_filter">
266 <option value="">All</option>
267 [% FOREACH av IN field.authorised_value_choices %]
268 <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
272 <input id="additional_field_[% field.id | html %]" type="text" value="[% additional_fields.${field.name} | html %]" name="additional_field_[% field.id | html %]_filter" />
277 <input type="hidden" name="searched" value="1" />
278 <fieldset class="action">
279 <input type="submit" value="Search" />
285 [% IF ( done_searched ) %]
287 <div id="serialstabs" class="toptabs" style="clear:both;">
288 <ul class="ui-tabs-nav">
289 <li><a href="#opened">Open ([% openedsubscriptions.size || 0 | html %])</a></li>
290 <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 | html %])</a></li>
293 [% IF openedsubscriptions %]
294 [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
296 <div class="dialog message">
297 <p>Your search returned no open subscriptions.</p>
302 [% IF closedsubscriptions %]
303 [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %]
305 <div class="dialog message">
306 <p>Your search returned no closed subscriptions.</p>
312 <div class="dialog message">
313 <p>Your search returned no results.</p>
319 </div> <!-- /.col-sm-10.col-sm-push-2 -->
321 <div class="col-sm-2 col-sm-pull-10">
324 [% INCLUDE 'serials-menu.inc' %]
325 [% IF ( done_searched ) %]
327 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
328 <fieldset class="brief">
329 <h4>Search subscriptions</h4>
332 <label for="issn">ISSN:</label>
333 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
336 <label for="title">Title:</label>
337 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
339 [% IF ( marcflavour == "UNIMARC" ) %]
341 <label for="ean">EAN:</label>
342 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
346 <label for="callnumber">Call number:</label>
347 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
350 <label for="publisher">Publisher:</label>
351 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
354 <label for="bookseller">Vendor:</label>
355 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
358 <label for="branch">Library:</label>
359 <select id="branch" name="branch_filter">
360 <option value="">All</option>
361 [%# FIXME Should not we filter the libraries? %]
362 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
366 <label for="location">Location:</label>
367 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
370 <label for="to">Expires before:</label>
371 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
374 [% FOR field IN additional_fields_for_subscription %]
376 <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
377 [% IF field.authorised_value_choices %]
378 <select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]_filter">
379 <option value="">All</option>
380 [% FOREACH av IN field.authorised_value_choices %]
381 [% IF av.authorised_value == additional_field_filters.${field.name}.value %]
382 <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
384 <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
389 <input id="additional_field_[% field.id | html %]" type="text" value="[% additional_field_filters.${field.name}.value | html %]" name="additional_field_[% field.id | html %]_filter" />
394 <input type="hidden" name="searched" value="1" />
395 <fieldset class="action">
396 <input type="submit" value="Search" />
404 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
405 </div> <!-- /.row -->
408 [% MACRO jsinclude BLOCK %]
409 [% INCLUDE 'calendar.inc' %]
410 [% INCLUDE 'datatables.inc' %]
412 var subscriptionid = "[% subscriptionid | html %]";
413 var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
414 var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
415 var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
417 [% Asset.js("js/serials-toolbar.js") | $raw %]
420 function itemSelectionBuildEditLink(div) {
421 var subscription_ids = new Array();
422 $("input[name='subscriptionid'][type='checkbox']:checked", div).each(function() {
423 subscription_ids.push($(this).val());
425 if (subscription_ids.length > 0) {
426 var url = "[% edit_action_link | html %]";
427 url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
428 $('a.itemselection_action_modify').attr('href', url);
435 function itemSelectionBuildActionLinks(tab) {
436 var div = $("#" + tab);
437 var modify_link_ok = itemSelectionBuildEditLink(div);
438 if (modify_link_ok) {
439 $('.itemselection_actions', div).show();
441 $('.itemselection_actions', div).hide();
445 $(document).ready(function() {
446 var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, {
447 "sPaginationType": "four_button",
449 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
450 { "sType": "title-string", "aTargets" : [ "title-string" ] },
451 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
455 var csrlt = $("#closed table").dataTable($.extend(true, {}, dataTablesDefaults, {
456 // FIXME sort function of additional_fields!
457 "sPaginationType": "four_button",
459 { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
460 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
464 osrlt.fnAddFilters("dt-filter", 750);
465 csrlt.fnAddFilters("dt-filter", 750);
467 $('#serialstabs').tabs();
468 $("#reopensub").click(function(){
469 return confirm(_("Are you sure you want to reopen this subscription?"));
472 $('.select-all, .clear-all').on('click', function(e) {
474 var checkboxes = $(this).parents('form').find('input[type="checkbox"]');
475 checkboxes.prop('checked', $(this).hasClass('select-all'));
476 var tab = $(this).data("tab");
477 itemSelectionBuildActionLinks(tab);
480 itemSelectionBuildActionLinks("opened");
481 itemSelectionBuildActionLinks("closed");
482 $("input[name='subscriptionid'][type='checkbox']").change(function() {
483 var div = $(this).parents('form').parent().attr("id");
484 itemSelectionBuildActionLinks(div);
491 [% INCLUDE 'intranet-bottom.inc' %]