Owen Leonard
666a1b2760
This patch modifies even more staff client serials templates so that JavaScript is included in the footer instead of the header. This patch adds a new JavaScript include, serials-toolbar.js, which is required on pages which include serials-toolbar.inc. To test, apply the patch and test the JavaScript-driven features of the modified templates: All button controls, DataTables functionality, tabs, etc. - Serials - Search for a subscription - Tabs, datatables, date pickers - Open a subscription for viewing - Tabs, toolbar buttons for delete, renew, and close. - Serial collection (in the sidebar menu) - Select all / clear all - Datatable - Print slip - Generate next Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
459 lines
24 KiB
Text
459 lines
24 KiB
Text
[% USE AuthorisedValues %]
|
|
[% USE Branches %]
|
|
[% USE KohaDates %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Serials [% biblionumber %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
|
|
<style type="text/css">input.dt-filter { width : 100%; font-size : 85%; }</style>
|
|
</head>
|
|
|
|
<body id="ser_serials-home" class="ser">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'serials-search.inc' %]
|
|
|
|
<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>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% INCLUDE 'serials-toolbar.inc' %]
|
|
|
|
[% IF ( done_searched ) %]
|
|
<h2>Serials subscriptions ([% total %] found)</h2>
|
|
[% ELSE %]
|
|
<h2>Serials subscriptions search</h2>
|
|
[% END %]
|
|
|
|
[% UNLESS ( done_searched ) %]
|
|
<div id="advsearch" style="padding-bottom:3em;">
|
|
<form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
|
|
<fieldset class="rows">
|
|
<legend>Search subscriptions</legend>
|
|
<ol>
|
|
<li>
|
|
<label for="issn">ISSN:</label>
|
|
<input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="title">Title:</label>
|
|
<input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
|
|
</li>
|
|
[% IF ( marcflavour == "UNIMARC" ) %]
|
|
<li>
|
|
<label for="ean">EAN:</label>
|
|
<input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
|
|
</li>
|
|
[% END %]
|
|
<li>
|
|
<label for="callnumber">Call number:</label>
|
|
<input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="publisher">Publisher:</label>
|
|
<input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="bookseller">Vendor:</label>
|
|
<input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="branch">Library:</label>
|
|
<select id="branch" name="branch_filter">
|
|
<option value="">All</option>
|
|
[%# FIXME Should not we filter the libraries? %]
|
|
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label for="location">Location:</label>
|
|
[% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
|
|
</li>
|
|
<li>
|
|
<label for="to">Expires before:</label>
|
|
<input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
|
|
</li>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<li>
|
|
<label for="additional_field_[% field.id %]"> [% field.name %]: </label>
|
|
[% IF field.authorised_value_choices %]
|
|
<select id="additional_field_[% field.id %]" name="additional_field_[% field.id %]_filter">
|
|
<option value="">All</option>
|
|
[% FOREACH av IN field.authorised_value_choices %]
|
|
<option value="[% av.authorised_value %]">[% av.lib %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
<input id="additional_field_[% field.id %]" type="text" value="[% additional_fields.${field.name} %]" name="additional_field_[% field.id %]_filter" />
|
|
[% END %]
|
|
</li>
|
|
[% END %]
|
|
</ol>
|
|
<input type="hidden" name="searched" value="1" />
|
|
<fieldset class="action">
|
|
<input type="submit" value="Search" />
|
|
</fieldset>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
[% END %]
|
|
[% IF ( done_searched ) %]
|
|
[% IF ( total ) %]
|
|
<div id="serialstabs" class="toptabs" style="clear:both;">
|
|
<ul class="ui-tabs-nav">
|
|
<li><a href="#opened">Open ([% openedsubscriptions.size || 0 %])</a></li>
|
|
<li><a href="#closed">Closed ([% closedsubscriptions.size || 0 %])</a></li>
|
|
</ul>
|
|
<div id="opened">
|
|
[% IF openedsubscriptions %]
|
|
<table id="osrlt">
|
|
<thead>
|
|
<tr>
|
|
<th>ISSN</th>
|
|
<th class="anti-the">Title</th>
|
|
<th>Notes</th>
|
|
<th>Library</th>
|
|
<th>Location</th>
|
|
<th>Call number</th>
|
|
<th class="title-string">Expiration date</th>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<th>[% field.name %]</th>
|
|
[% END %]
|
|
<th class="NoSort">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot>
|
|
<tr>
|
|
<td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td>
|
|
[% END %]
|
|
<td></td>
|
|
</tr>
|
|
</tfoot>
|
|
<tbody>
|
|
[% FOREACH subscription IN openedsubscriptions %]
|
|
[% UNLESS subscription.cannotdisplay %]
|
|
<tr>
|
|
<td>
|
|
[% IF ( subscription.issn ) %][% subscription.issn %]
|
|
[% END %]
|
|
</td>
|
|
<td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
|
|
</td>
|
|
<td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %]
|
|
[% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.enddate ) %]
|
|
<span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span>
|
|
[% ELSE %]
|
|
<span title="0000-00-00"></span>
|
|
[% END %]
|
|
</td>
|
|
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
[% IF field.authorised_value_category %]
|
|
<td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td>
|
|
[% ELSE %]
|
|
<td>[% subscription.additional_fields.${field.name} %]</td>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
<td>
|
|
<div class="dropdown">
|
|
<div class="btn-group">
|
|
[% IF ( CAN_user_serials_receive_serials ) %]
|
|
[%# There should be no space between these two buttons, it would render badly %]
|
|
<a class="btn btn-default btn-xs" role="button"
|
|
href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7"><i
|
|
class="fa fa-inbox"></i> Serial receive</a><a
|
|
class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button"
|
|
data-toggle="dropdown" href="#"><b class="caret"></b></a>
|
|
[% ELSE %]
|
|
<a class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#">Actions <b class="caret"></b></a>
|
|
[% END %]
|
|
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid %]">
|
|
|
|
[% IF ( routing && CAN_user_serials_routing ) %]
|
|
[% IF ( subscription.cannotedit ) %]
|
|
[% ELSE %]
|
|
[% IF ( subscription.routingedit ) %]
|
|
<li>
|
|
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit %])</a>
|
|
</li>
|
|
[% ELSE %]
|
|
<li>
|
|
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new"> <i class="fa fa-plus"></i> New routing list</a>
|
|
</li>
|
|
[% END %]
|
|
[% END %]
|
|
[% END # IF ( routing && CAN_user_serials_routing ) %]
|
|
|
|
<li>
|
|
<a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<p>Your search returned no open subscriptions.</p>
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
<div id="closed">
|
|
[% IF closedsubscriptions %]
|
|
<table id="csrlt">
|
|
<!-- FIXME add additional_fields for closed subs -->
|
|
<thead>
|
|
<tr>
|
|
<th>ISSN</th>
|
|
<th class="anti-the">Title</th>
|
|
<th>Notes</th>
|
|
<th>Library</th>
|
|
<th>Location</th>
|
|
<th>Call number</th>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<th>[% field.name %]</th>
|
|
[% END %]
|
|
<th class="NoSort">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot>
|
|
<tr>
|
|
<td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td>
|
|
<td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<td><input type="text" class="dt-filter" data-column_num="[% loop.count + 5 %]" placeholder="Search [% field.name %]" /></td>
|
|
[% END %]
|
|
<td></td>
|
|
</tr>
|
|
</tfoot>
|
|
<tbody>
|
|
[% FOREACH subscription IN closedsubscriptions %]
|
|
[% UNLESS subscription.cannotdisplay %]
|
|
<tr>
|
|
<td>
|
|
[% IF ( subscription.issn ) %]
|
|
[% subscription.issn %]
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
|
|
[% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
|
|
</td>
|
|
<td>
|
|
[% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
|
|
</td>
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
[% IF field.authorised_value_category %]
|
|
<td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td>
|
|
[% ELSE %]
|
|
<td>[% subscription.additional_fields.${field.name} %]</td>
|
|
[% END %]
|
|
[% END %]
|
|
<td>
|
|
<div class="dropdown">
|
|
<a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#">
|
|
Actions <b class="caret"></b>
|
|
</a>
|
|
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid %]">
|
|
|
|
[% IF ( routing && CAN_user_serials_routing ) %]
|
|
[% UNLESS ( subscription.cannotedit ) %]
|
|
<li>
|
|
<a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&op=reopen&routing=[% subscription.routing %]&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>
|
|
</li>
|
|
[% END %]
|
|
[% END # IF ( routing && CAN_user_serials_routing ) %]
|
|
|
|
<li>
|
|
<a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<p>Your search returned no closed subscriptions.</p>
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<p>Your search returned no results.</p>
|
|
</div>
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
|
|
<div class="yui-b">
|
|
[% INCLUDE 'serials-menu.inc' %]
|
|
[% IF ( done_searched ) %]
|
|
<div id="advsearch">
|
|
<form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
|
|
<fieldset class="brief">
|
|
<h4>Search subscriptions</h4>
|
|
<ol>
|
|
<li>
|
|
<label for="issn">ISSN:</label>
|
|
<input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="title">Title:</label>
|
|
<input type="text" id="title" name="title_filter" value="[% title_filter | html %]" />
|
|
</li>
|
|
[% IF ( marcflavour == "UNIMARC" ) %]
|
|
<li>
|
|
<label for="ean">EAN:</label>
|
|
<input type="text" id="ean" name="EAN_filter" value="[% EAN_filter | html %]" />
|
|
</li>
|
|
[% END %]
|
|
<li>
|
|
<label for="callnumber">Call number:</label>
|
|
<input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="publisher">Publisher:</label>
|
|
<input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="bookseller">Vendor:</label>
|
|
<input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter | html %]" />
|
|
</li>
|
|
<li>
|
|
<label for="branch">Library:</label>
|
|
<select id="branch" name="branch_filter">
|
|
<option value="">All</option>
|
|
[%# FIXME Should not we filter the libraries? %]
|
|
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch_filter, unfiltered => 1 ) %]
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label for="location">Location:</label>
|
|
[% PROCESS 'av-build-dropbox.inc' name="location_filter", category="LOC", default=location_filter, all=1 %]
|
|
</li>
|
|
<li>
|
|
<label for="to">Expires before:</label>
|
|
<input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
|
|
</li>
|
|
|
|
[% FOR field IN additional_fields_for_subscription %]
|
|
<li>
|
|
<label for="additional_field_[% field.id %]ID"> [% field.name %]: </label>
|
|
[% IF field.authorised_value_choices %]
|
|
<select id="additional_field_[% field.id %]" name="additional_field_[% field.id %]_filter">
|
|
<option value="">All</option>
|
|
[% FOREACH av IN field.authorised_value_choices %]
|
|
[% IF av.authorised_value == additional_field_filters.${field.name}.value %]
|
|
<option value="[% av.authorised_value %]" selected="selected">[% av.lib %]</option>
|
|
[% ELSE %]
|
|
<option value="[% av.authorised_value %]">[% av.lib %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
<input id="additional_field_[% field.id %]" type="text" value="[% additional_field_filters.${field.name}.value %]" name="additional_field_[% field.id %]_filter" />
|
|
[% END %]
|
|
</li>
|
|
[% END %]
|
|
</ol>
|
|
<input type="hidden" name="searched" value="1" />
|
|
<fieldset class="action">
|
|
<input type="submit" value="Search" />
|
|
</fieldset>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script type="text/javascript">
|
|
var subscriptionid = "[% subscriptionid %]";
|
|
var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
|
|
var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
|
|
var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
|
|
</script>
|
|
<script type="text/javascript" src="[% interface %]/[% theme %]/js/serials-toolbar.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"sPaginationType": "four_button",
|
|
"aoColumnDefs": [
|
|
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
|
|
{ "sType": "title-string", "aTargets" : [ "title-string" ] },
|
|
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
|
|
]
|
|
}));
|
|
|
|
var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
// FIXME sort function of additional_fields!
|
|
"sPaginationType": "four_button",
|
|
"aoColumnDefs": [
|
|
{ 'bSortable': false, 'aTargets': [ 'NoSort' ] },
|
|
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
|
|
]
|
|
}));
|
|
|
|
osrlt.fnAddFilters("dt-filter", 750);
|
|
csrlt.fnAddFilters("dt-filter", 750);
|
|
|
|
$('#serialstabs').tabs();
|
|
$("#reopensub").click(function(){
|
|
return confirm(_("Are you sure you want to reopen this subscription?"));
|
|
});
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|