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' %]
233 [% IF ( done_searched ) %]
234 <h1>Mana subscriptions ([% total | html %] found)</h1>
236 <h1>Mana subscriptions search</h1>
239 [% IF ( done_searched ) %]
240 <h1>Serials subscriptions ([% total | html %] found)</h1>
242 <h1>Serials subscriptions search</h1>
246 [% UNLESS ( done_searched ) %]
247 <div id="advsearch" style="padding-bottom:3em;">
248 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
249 <fieldset class="rows">
250 <legend>Search subscriptions</legend>
253 <label for="issn">ISSN:</label>
254 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
257 <label for="title">Title:</label>
258 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
260 [% IF ( marcflavour == "UNIMARC" ) %]
262 <label for="ean">EAN:</label>
263 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
267 <label for="callnumber">Call number:</label>
268 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
271 <label for="publisher">Publisher:</label>
272 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
275 <label for="bookseller">Vendor:</label>
276 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
279 <label for="branch">Library:</label>
280 <select id="branch" name="branch_filter">
281 <option value="">All</option>
282 [%# FIXME Should not we filter the libraries? %]
283 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
287 <label for="location">Location:</label>
288 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
291 <label for="to">Expires before:</label>
292 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
294 [% INCLUDE 'additional-fields-entry.inc' available=additional_fields_for_subscription values=additional_field_filters wrap_fieldset=0 %]
296 <input type="hidden" name="searched" value="1" />
298 <input type="hidden" name="mana" value="1" />
300 <fieldset class="action">
301 <input type="submit" value="Search" />
303 </fieldset> <!-- /.rows -->
305 </div> <!-- /#advsearch -->
306 [% END # /UNLESS ( done_searched )%]
308 [% IF ( done_searched ) %]
310 <div id="serialstabs" class="toptabs" style="clear:both;">
311 <ul class="ui-tabs-nav">
313 <li><a href="#mana">Mana ([% total || 0 | html %])</a></li>
315 <li><a href="#opened">Open ([% openedsubscriptions.size || 0 | html %])</a></li>
316 <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 | html %])</a></li>
321 [% INCLUDE 'mana/mana-subscription-search-result.inc' %]
325 [% IF openedsubscriptions %]
326 [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %]
328 <div class="dialog message">
329 <p>Your search returned no open subscriptions.</p>
334 [% IF closedsubscriptions %]
335 [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %]
337 <div class="dialog message">
338 <p>Your search returned no closed subscriptions.</p>
343 </div> <!-- /#serialstabs -->
345 <div class="dialog message">
346 <p>Your search returned no results.</p>
348 [% END # IF ( total ) %]
349 [% END # /IF done_searched %]
352 </div> <!-- /.col-sm-10.col-sm-push-2 -->
354 <div class="col-sm-2 col-sm-pull-10">
357 [% INCLUDE 'serials-menu.inc' %]
358 [% IF ( done_searched ) %]
359 [% UNLESS ( mana ) %]
361 <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
362 <fieldset class="brief">
363 <h4>Search subscriptions</h4>
366 <label for="issn">ISSN:</label>
367 <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
370 <label for="title">Title:</label>
371 <input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
373 [% IF ( marcflavour == "UNIMARC" ) %]
375 <label for="ean">EAN:</label>
376 <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
380 <label for="callnumber">Call number:</label>
381 <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
384 <label for="publisher">Publisher:</label>
385 <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
388 <label for="bookseller">Vendor:</label>
389 <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
392 <label for="branch">Library:</label>
393 <select id="branch" name="branch_filter">
394 <option value="">All</option>
395 [%# FIXME Should not we filter the libraries? %]
396 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
400 <label for="location">Location:</label>
401 [% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
404 <label for="to">Expires before:</label>
405 <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="flatpickr" />
408 [% FOR field IN additional_fields_for_subscription %]
410 <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
411 [% IF field.authorised_value_category %]
412 <select id="additional_field_[% field.id | html %]" name="additional_field_[% field.id | html %]">
413 <option value="">All</option>
414 [% FOREACH av IN AuthorisedValues.GetAuthValueDropbox(field.authorised_value_category) %]
415 [% IF av.authorised_value == additional_field_filters.${field.id} %]
416 <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
418 <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
423 <input id="additional_field_[% field.id | html %]" type="text" value="[% additional_field_filters.${field.id} | html %]" name="additional_field_[% field.id | html %]" />
428 <input type="hidden" name="searched" value="1" />
429 <fieldset class="action">
430 <input type="submit" value="Search" />
433 </fieldset> <!-- /.brief -->
435 </div> <!-- /#advsearch -->
436 [% END # / UNLESS ( mana ) %]
437 [% END # / IF ( done_searched ) %]
439 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
440 </div> <!-- /.row -->
442 [% MACRO jsinclude BLOCK %]
443 [% INCLUDE 'calendar.inc' %]
444 [% INCLUDE 'datatables.inc' %]
446 var subscriptionid = "[% subscriptionid | html %]";
448 [% Asset.js("js/serials-toolbar.js") | $raw %]
451 function itemSelectionBuildEditLink(div) {
452 var subscription_ids = new Array();
453 $("input[name='subscriptionid'][type='checkbox']:checked", div).each(function() {
454 subscription_ids.push($(this).val());
456 if (subscription_ids.length > 0) {
457 var url = "[% edit_action_link | html %]";
458 url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
459 $('a.itemselection_action_modify').attr('href', url);
466 function itemSelectionBuildActionLinks(tab) {
467 var div = $("#" + tab);
468 var modify_link_ok = itemSelectionBuildEditLink(div);
469 if (modify_link_ok) {
470 $('.itemselection_actions', div).show();
472 $('.itemselection_actions', div).hide();
476 $(document).ready(function() {
477 var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, {
478 "sPaginationType": "full",
479 "order": [[ 2, "asc" ]],
481 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
482 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
486 var csrlt = $("#closed table").dataTable($.extend(true, {}, dataTablesDefaults, {
487 // FIXME sort function of additional_fields!
488 "order": [[ 2, "asc" ]],
489 "sPaginationType": "full",
491 { 'bSortable': false, 'aTargets': [ 'NoSort' ] },
492 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
496 var manarlt = $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults, {
497 "sPaginationType": "full",
499 { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
500 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
504 osrlt.fnAddFilters("dt-filter", 750);
505 csrlt.fnAddFilters("dt-filter", 750);
506 manarlt.fnAddFilters("dt-filter", 750);
508 $('#serialstabs').tabs();
509 $("#reopensub").click(function(){
510 return confirm(_("Are you sure you want to reopen this subscription?"));
513 $('.select-all, .clear-all').on('click', function(e) {
515 var checkboxes = $(this).parents('form').find('input[type="checkbox"]');
516 checkboxes.prop('checked', $(this).hasClass('select-all'));
517 var tab = $(this).data("tab");
518 itemSelectionBuildActionLinks(tab);
521 itemSelectionBuildActionLinks("opened");
522 itemSelectionBuildActionLinks("closed");
523 $("input[name='subscriptionid'][type='checkbox']").change(function() {
524 var div = $(this).parents('form').parent().attr("id");
525 itemSelectionBuildActionLinks(div);
530 [% FOR field IN additional_fields_for_subscription %]
531 $("label[for=additional_field_[% field.id | $raw %]], input#additional_field_[% field.id | $raw %]").hide();
538 [% INCLUDE 'intranet-bottom.inc' %]