3 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha › Serials [% biblionumber | html %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 <style>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) %]
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="1" placeholder="Search ISSN" /></td>
72 <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search title" /></td>
73 <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search notes" /></td>
74 <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search library" /></td>
75 <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search location" /></td>
76 <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search callnumber" /></td>
77 [% SET column_num = 6 %]
79 <td><input type="text" class="dt-filter" data-column_num="7" placeholder="Search expiration date" /></td>
80 [% SET column_num = column_num + 1 %]
82 [% FOR field IN additional_fields_for_subscription %]
83 <td><input type="text" class="dt-filter" data-column_num="[% loop.count + column_num | html %]" placeholder="Search [% field.name | html %]" /></td>
89 [% FOREACH subscription IN subscriptions %]
90 [% UNLESS subscription.cannotdisplay %]
93 [% UNLESS subscription.cannotedit %]
94 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
96 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" disabled="disabled" title="You cannot edit this subscription" />
100 [% IF ( subscription.issn ) %][% subscription.issn | html %]
103 <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]" class="button" title="subscription detail">[% subscription.title | html %]</a>
105 <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes | html %][% END %]
106 [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes | html %])[% END %]
109 [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) | html %][% END %]
112 [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) | html %][% END %]
115 [% IF ( subscription.callnumber ) %][% subscription.callnumber | html %][% END %]
119 [% IF ( subscription.enddate ) %]
120 <span title="[% subscription.enddate | html %]">[% subscription.enddate | $KohaDates %]</span>
122 <span title="0000-00-00"></span>
127 [% FOR field IN additional_fields_for_subscription %]
128 [% IF field.authorised_value_category %]
129 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) | html %]</td>
131 <td>[% subscription.additional_fields.${field.name} | html %]</td>
136 <div class="btn-group dropup">
138 <a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid | html %]" role="button" data-toggle="dropdown" href="#">
139 Actions <b class="caret"></b>
141 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid | html %]">
143 [% IF ( routing && CAN_user_serials_routing ) %]
144 [% UNLESS ( subscription.cannotedit ) %]
146 <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>
149 [% END # IF ( routing && CAN_user_serials_routing ) %]
152 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
157 <div class="btn-group">
158 [% IF ( CAN_user_serials_receive_serials ) %]
159 [%# There should be no space between these two buttons, it would render badly %]
160 <a class="btn btn-default btn-xs" role="button"
161 href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid | html %]&serstatus=1,3,7"><i
162 class="fa fa-inbox"></i> Serial receive</a><a
163 class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid | html %]" role="button"
164 data-toggle="dropdown" href="#"><b class="caret"></b></a>
166 <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>
168 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid | html %]">
170 [% IF ( routing && CAN_user_serials_routing ) %]
171 [% IF ( subscription.cannotedit ) %]
173 [% IF ( subscription.routingedit ) %]
175 <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>
179 <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | uri %]&op=new"> <i class="fa fa-plus"></i> New routing list</a>
183 [% END # IF ( routing && CAN_user_serials_routing ) %]
186 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
202 <div class="main container-fluid">
204 <div class="col-sm-10 col-sm-push-2">
207 [% INCLUDE 'serials-toolbar.inc' %]
209 [% IF ( done_searched ) %]
210 <h2>Serials subscriptions ([% total | html %] found)</h2>
212 <h2>Serials subscriptions search</h2>
215 [% UNLESS ( done_searched ) %]
216 <div id="advsearch" style="padding-bottom:3em;">
217 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
218 <fieldset class="rows">
219 <legend>Search subscriptions</legend>
222 <label for="issn">ISSN:</label>
223 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
226 <label for="title">Title:</label>
227 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
229 [% IF ( marcflavour == "UNIMARC" ) %]
231 <label for="ean">EAN:</label>
232 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
236 <label for="callnumber">Call number:</label>
237 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
240 <label for="publisher">Publisher:</label>
241 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
244 <label for="bookseller">Vendor:</label>
245 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
248 <label for="branch">Library:</label>
249 <select id="branch" name="branch_filter">
250 <option value="">All</option>
251 [%# FIXME Should not we filter the libraries? %]
252 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
256 <label for="location">Location:</label>
257 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
260 <label for="to">Expires before:</label>
261 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
263 [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
265 <input type="hidden" name="searched" value="1" />
266 [% IF ( mana ) %]<input type="hidden" name="mana" value="1" />[% END %]
267 <fieldset class="action">
268 <input type="submit" value="Search" />
274 [% IF ( done_searched ) %]
276 <div id="serialstabs" class="toptabs" style="clear:both;">
277 <ul class="ui-tabs-nav">
279 <li><a href="#mana">Mana ([% total || 0 | html %])</a></li>
281 <li><a href="#opened">Open ([% openedsubscriptions.size || 0 | html %])</a></li>
282 <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 | html %])</a></li>
287 [% INCLUDE 'mana/mana-subscription-search-result.inc' %]
291 [% IF openedsubscriptions %]
292 [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
294 <div class="dialog message">
295 <p>Your search returned no open subscriptions.</p>
300 [% IF closedsubscriptions %]
301 [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %]
303 <div class="dialog message">
304 <p>Your search returned no closed subscriptions.</p>
311 <div class="dialog message">
312 <p>Your search returned no results.</p>
318 </div> <!-- /.col-sm-10.col-sm-push-2 -->
320 <div class="col-sm-2 col-sm-pull-10">
323 [% INCLUDE 'serials-menu.inc' %]
324 [% IF ( done_searched ) %]
325 [% UNLESS ( mana ) %]
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_category %]
378 <select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]">
379 <option value="">All</option>
380 [% FOREACH av IN AuthorisedValues.GetAuthValueDropbox(field.authorised_value_category) %]
381 [% IF av.authorised_value == additional_field_filters.${field.id} %]
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.id} | html %]" name="additional_field_[% field.id | html %]" />
394 <input type="hidden" name="searched" value="1" />
395 <fieldset class="action">
396 <input type="submit" value="Search" />
405 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
406 </div> <!-- /.row -->
408 [% MACRO jsinclude BLOCK %]
409 [% INCLUDE 'calendar.inc' %]
410 [% INCLUDE 'datatables.inc' %]
412 var subscriptionid = "[% subscriptionid | html %]";
414 [% Asset.js("js/serials-toolbar.js") | $raw %]
417 function itemSelectionBuildEditLink(div) {
418 var subscription_ids = new Array();
419 $("input[name='subscriptionid'][type='checkbox']:checked", div).each(function() {
420 subscription_ids.push($(this).val());
422 if (subscription_ids.length > 0) {
423 var url = "[% edit_action_link | html %]";
424 url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
425 $('a.itemselection_action_modify').attr('href', url);
432 function itemSelectionBuildActionLinks(tab) {
433 var div = $("#" + tab);
434 var modify_link_ok = itemSelectionBuildEditLink(div);
435 if (modify_link_ok) {
436 $('.itemselection_actions', div).show();
438 $('.itemselection_actions', div).hide();
442 $(document).ready(function() {
443 var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, {
444 "sPaginationType": "full",
445 "order": [[ 2, "asc" ]],
447 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
448 { "sType": "title-string", "aTargets" : [ "title-string" ] },
449 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
453 var csrlt = $("#closed table").dataTable($.extend(true, {}, dataTablesDefaults, {
454 // FIXME sort function of additional_fields!
455 "order": [[ 2, "asc" ]],
456 "sPaginationType": "full",
458 { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
459 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
463 var manarlt = $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
464 "sPaginationType": "full",
466 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
467 { "sType": "title-string", "aTargets" : [ "title-string" ] },
468 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
472 osrlt.fnAddFilters("dt-filter", 750);
473 csrlt.fnAddFilters("dt-filter", 750);
474 manarlt.fnAddFilters("dt-filter", 750);
476 $('#serialstabs').tabs();
477 $("#reopensub").click(function(){
478 return confirm(_("Are you sure you want to reopen this subscription?"));
481 $('.select-all, .clear-all').on('click', function(e) {
483 var checkboxes = $(this).parents('form').find('input[type="checkbox"]');
484 checkboxes.prop('checked', $(this).hasClass('select-all'));
485 var tab = $(this).data("tab");
486 itemSelectionBuildActionLinks(tab);
489 itemSelectionBuildActionLinks("opened");
490 itemSelectionBuildActionLinks("closed");
491 $("input[name='subscriptionid'][type='checkbox']").change(function() {
492 var div = $(this).parents('form').parent().attr("id");
493 itemSelectionBuildActionLinks(div);
497 $("label[for=callnumber], input#callnumber").hide();
498 $("label[for=bookseller], input#bookseller").hide();
499 $("label[for=branch], select#branch").hide();
500 $("label[for=to], input#to").hide();
501 $(".ui-datepicker-trigger").hide();
502 $("label[for=location], select#location_filter").hide();
503 [% FOR field IN additional_fields_for_subscription %]
504 $("label[for=additional_field_[% field.id | $raw %]], input#additional_field_[% field.id | $raw %]").hide();
511 [% INCLUDE 'intranet-bottom.inc' %]