3 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Serials [% biblionumber | html %] › Koha</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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
24 [% IF ( done_searched ) %]
26 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
29 <a href="#" aria-current="page">
35 <a href="#" aria-current="page">
44 [% FOREACH param IN CGI.params.pairs %]
45 [% escaped_value = BLOCK %][% param.value | uri %][% END %]
46 [% url_params.push(param.key _ '=' _ escaped_value) %]
49 [% SET referrer = '/cgi-bin/koha/serials/serials-search.pl?' %]
50 [% referrer = BLOCK %][% referrer | url %][% url_params.join("&") |uri %][% END %]
51 [% SET edit_action_link = '/cgi-bin/koha/serials/subscription-batchedit.pl?referrer=' _ referrer %]
53 [% BLOCK subscriptions_table %]
56 [% SET tab = 'closed' %]
58 [% SET tab = 'opened' %]
60 [% IF CAN_user_serials_edit_subscription %]
62 <a class="select-all" href="#" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a>
64 <a class="clear-all" href="#" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
65 <span class="itemselection_actions">
67 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Edit selected serials</a>
76 <th class="anti-the">Title</th>
82 <th>Expiration date</th>
84 [% FOR field IN additional_fields_for_subscription %]
85 <th>[% field.name | html %]</th>
87 <th class="NoSort noExport">Actions</th>
91 [% FOREACH subscription IN subscriptions %]
92 [% UNLESS subscription.cannotdisplay %]
95 [% UNLESS subscription.cannotedit %]
96 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" />
98 <input type="checkbox" name="subscriptionid" value="[% subscription.subscriptionid | html %]" disabled="disabled" title="You cannot edit this subscription" />
102 [% IF ( subscription.issn ) %]
103 [% subscription.issn | html %]
107 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]" class="button" title="subscription detail">[% subscription.title | html %]</a>
110 [% IF ( subscription.publicnotes ) %][% subscription.publicnotes | html %][% END %]
111 [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes | html %])[% END %]
114 [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) | html %][% END %]
117 [% IF ( subscription.location ) %]
118 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]
122 [% IF ( subscription.callnumber ) %][% subscription.callnumber | html %][% END %]
125 <td data-order="[% subscription.enddate | html %]">
126 [% subscription.enddate | $KohaDates %]
130 [% FOR field IN additional_fields_for_subscription %]
131 [% IF field.authorised_value_category %]
132 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) | html %]</td>
134 <td>[% subscription.additional_fields.${field.name} | html %]</td>
139 <div class="btn-group dropup">
141 <a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid | html %]" role="button" data-toggle="dropdown" href="#">
142 Actions <b class="caret"></b>
144 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid | html %]">
146 [% IF ( routing && CAN_user_serials_routing ) %]
147 [% UNLESS ( subscription.cannotedit ) %]
149 <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>
152 [% END # IF ( routing && CAN_user_serials_routing ) %]
155 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
160 <div class="btn-group">
161 [% IF ( CAN_user_serials_receive_serials ) %]
162 [%# There should be no space between these two buttons, it would render badly %]
163 <a class="btn btn-default btn-xs" role="button"
164 href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid | html %]&serstatus=1,3,7"><i
165 class="fa fa-inbox"></i> Serial receive</a><a
166 class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid | html %]" role="button"
167 data-toggle="dropdown" href="#"><b class="caret"></b></a>
169 <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>
171 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid | html %]">
173 [% IF ( routing && CAN_user_serials_routing ) %]
174 [% IF ( subscription.cannotedit ) %]
176 [% IF ( subscription.routingedit ) %]
178 <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>
182 <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | uri %]&op=new"> <i class="fa fa-plus"></i> New routing list</a>
186 [% END # IF ( routing && CAN_user_serials_routing ) %]
189 <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list-alt"></i> Issue history</a>
193 [% END # IF closed %]
194 </div> <!-- /.btn-group -->
198 [% END # /UNLESS subscription.cannotdisplay %]
199 [% END # /FOREACH subscription %]
204 <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search ISSN" /></td>
205 <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search title" /></td>
206 <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search notes" /></td>
207 <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search library" /></td>
208 <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search location" /></td>
209 <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search callnumber" /></td>
210 [% SET column_num = 6 %]
212 <td><input type="text" class="dt-filter" data-column_num="7" placeholder="Search expiration date" /></td>
213 [% SET column_num = column_num + 1 %]
215 [% FOR field IN additional_fields_for_subscription %]
216 <td><input type="text" class="dt-filter" data-column_num="[% loop.count + column_num | html %]" placeholder="Search [% field.name | html %]" /></td>
223 [% END # /BLOCK subscriptions_table %]
225 <div class="main container-fluid">
227 <div class="col-sm-10 col-sm-push-2">
230 [% INCLUDE 'serials-toolbar.inc' %]
232 [% IF ( done_searched ) %]
233 <h2>Serials subscriptions ([% total | html %] found)</h2>
235 <h2>Serials subscriptions search</h2>
238 [% UNLESS ( done_searched ) %]
239 <div id="advsearch" style="padding-bottom:3em;">
240 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
241 <fieldset class="rows">
242 <legend>Search subscriptions</legend>
245 <label for="issn">ISSN:</label>
246 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
249 <label for="title">Title:</label>
250 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
252 [% IF ( marcflavour == "UNIMARC" ) %]
254 <label for="ean">EAN:</label>
255 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
259 <label for="callnumber">Call number:</label>
260 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
263 <label for="publisher">Publisher:</label>
264 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
267 <label for="bookseller">Vendor:</label>
268 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
271 <label for="branch">Library:</label>
272 <select id="branch" name="branch_filter">
273 <option value="">All</option>
274 [%# FIXME Should not we filter the libraries? %]
275 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
279 <label for="location">Location:</label>
280 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
283 <label for="to">Expires before:</label>
284 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
286 [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
288 <input type="hidden" name="searched" value="1" />
290 <input type="hidden" name="mana" value="1" />
292 <fieldset class="action">
293 <input type="submit" value="Search" />
295 </fieldset> <!-- /.rows -->
297 </div> <!-- /#advsearch -->
298 [% END # /UNLESS ( done_searched )%]
300 [% IF ( done_searched ) %]
302 <div id="serialstabs" class="toptabs" style="clear:both;">
303 <ul class="ui-tabs-nav">
305 <li><a href="#mana">Mana ([% total || 0 | html %])</a></li>
307 <li><a href="#opened">Open ([% openedsubscriptions.size || 0 | html %])</a></li>
308 <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 | html %])</a></li>
313 [% INCLUDE 'mana/mana-subscription-search-result.inc' %]
317 [% IF openedsubscriptions %]
318 [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
320 <div class="dialog message">
321 <p>Your search returned no open subscriptions.</p>
326 [% IF closedsubscriptions %]
327 [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %]
329 <div class="dialog message">
330 <p>Your search returned no closed subscriptions.</p>
335 </div> <!-- /#serialstabs -->
337 <div class="dialog message">
338 <p>Your search returned no results.</p>
340 [% END # IF ( total ) %]
341 [% END # /IF done_searched %]
344 </div> <!-- /.col-sm-10.col-sm-push-2 -->
346 <div class="col-sm-2 col-sm-pull-10">
349 [% INCLUDE 'serials-menu.inc' %]
350 [% IF ( done_searched ) %]
351 [% UNLESS ( mana ) %]
353 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
354 <fieldset class="brief">
355 <h4>Search subscriptions</h4>
358 <label for="issn">ISSN:</label>
359 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
362 <label for="title">Title:</label>
363 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
365 [% IF ( marcflavour == "UNIMARC" ) %]
367 <label for="ean">EAN:</label>
368 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
372 <label for="callnumber">Call number:</label>
373 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
376 <label for="publisher">Publisher:</label>
377 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
380 <label for="bookseller">Vendor:</label>
381 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
384 <label for="branch">Library:</label>
385 <select id="branch" name="branch_filter">
386 <option value="">All</option>
387 [%# FIXME Should not we filter the libraries? %]
388 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
392 <label for="location">Location:</label>
393 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
396 <label for="to">Expires before:</label>
397 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
400 [% FOR field IN additional_fields_for_subscription %]
402 <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
403 [% IF field.authorised_value_category %]
404 <select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]">
405 <option value="">All</option>
406 [% FOREACH av IN AuthorisedValues.GetAuthValueDropbox(field.authorised_value_category) %]
407 [% IF av.authorised_value == additional_field_filters.${field.id} %]
408 <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
410 <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
415 <input id="additional_field_[% field.id | html %]" type="text" value="[% additional_field_filters.${field.id} | html %]" name="additional_field_[% field.id | html %]" />
420 <input type="hidden" name="searched" value="1" />
421 <fieldset class="action">
422 <input type="submit" value="Search" />
425 </fieldset> <!-- /.brief -->
427 </div> <!-- /#advsearch -->
428 [% END # / UNLESS ( mana ) %]
429 [% END # / IF ( done_searched ) %]
431 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
432 </div> <!-- /.row -->
434 [% MACRO jsinclude BLOCK %]
435 [% INCLUDE 'calendar.inc' %]
436 [% INCLUDE 'datatables.inc' %]
438 var subscriptionid = "[% subscriptionid | html %]";
440 [% Asset.js("js/serials-toolbar.js") | $raw %]
443 function itemSelectionBuildEditLink(div) {
444 var subscription_ids = new Array();
445 $("input[name='subscriptionid'][type='checkbox']:checked", div).each(function() {
446 subscription_ids.push($(this).val());
448 if (subscription_ids.length > 0) {
449 var url = "[% edit_action_link | html %]";
450 url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
451 $('a.itemselection_action_modify').attr('href', url);
458 function itemSelectionBuildActionLinks(tab) {
459 var div = $("#" + tab);
460 var modify_link_ok = itemSelectionBuildEditLink(div);
461 if (modify_link_ok) {
462 $('.itemselection_actions', div).show();
464 $('.itemselection_actions', div).hide();
468 $(document).ready(function() {
469 var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, {
470 "sPaginationType": "full",
471 "order": [[ 2, "asc" ]],
473 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
474 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
478 var csrlt = $("#closed table").dataTable($.extend(true, {}, dataTablesDefaults, {
479 // FIXME sort function of additional_fields!
480 "order": [[ 2, "asc" ]],
481 "sPaginationType": "full",
483 { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
484 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
488 var manarlt = $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
489 "sPaginationType": "full",
491 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
492 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
496 osrlt.fnAddFilters("dt-filter", 750);
497 csrlt.fnAddFilters("dt-filter", 750);
498 manarlt.fnAddFilters("dt-filter", 750);
500 $('#serialstabs').tabs();
501 $("#reopensub").click(function(){
502 return confirm(_("Are you sure you want to reopen this subscription?"));
505 $('.select-all, .clear-all').on('click', function(e) {
507 var checkboxes = $(this).parents('form').find('input[type="checkbox"]');
508 checkboxes.prop('checked', $(this).hasClass('select-all'));
509 var tab = $(this).data("tab");
510 itemSelectionBuildActionLinks(tab);
513 itemSelectionBuildActionLinks("opened");
514 itemSelectionBuildActionLinks("closed");
515 $("input[name='subscriptionid'][type='checkbox']").change(function() {
516 var div = $(this).parents('form').parent().attr("id");
517 itemSelectionBuildActionLinks(div);
521 $("label[for=callnumber], input#callnumber").hide();
522 $("label[for=bookseller], input#bookseller").hide();
523 $("label[for=branch], select#branch").hide();
524 $("label[for=to], input#to").hide();
525 $("label[for=location], select#location_filter").hide();
526 [% FOR field IN additional_fields_for_subscription %]
527 $("label[for=additional_field_[% field.id | $raw %]], input#additional_field_[% field.id | $raw %]").hide();
534 [% INCLUDE 'intranet-bottom.inc' %]