Owen Leonard
3fc7ea191c
This patch modifies the template for the label manage pages to use the new DataTables include. This simplifies the inclusion of assets and updates to the latest DataTables version. To test, view the following pages and confirm that table sorting is working correctly: Manage layouts (/cgi-bin/koha/labels/label-manage.pl?label_element=layout) Manage templates (/cgi-bin/koha/labels/label-manage.pl?label_element=template) Manage profiles (/cgi-bin/koha/labels/label-manage.pl?label_element=profile) Manage batches (/cgi-bin/koha/labels/label-manage.pl?label_element=batch) Signed-off-by: wajasu <matted-34813@mypacks.net> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
168 lines
8 KiB
Text
168 lines
8 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Tools › Labels › Manage label elements</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'greybox.inc' %]
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
function DeleteConfirm() {
|
|
var element_id = selected_layout("delete");
|
|
if (element_id>-1) {
|
|
var msg = "Are you sure you want to delete [% label_element %] " + element_id + "?"
|
|
var answer = confirm(msg);
|
|
if (answer) {
|
|
window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=[% label_element %]&element_id=" + element_id;
|
|
}
|
|
else {
|
|
return; // abort delete
|
|
}
|
|
}
|
|
else {
|
|
return; // no layout selected
|
|
};
|
|
};
|
|
function Edit() {
|
|
var element_id = selected_layout("edit");
|
|
if (element_id>-1) {
|
|
window.location = "/cgi-bin/koha/labels/label-edit-[% label_element %].pl?op=edit&element_id=" + element_id;
|
|
}
|
|
else {
|
|
return; // no layout selected
|
|
};
|
|
};
|
|
function Xport() {
|
|
batches= new Array;
|
|
if(document.layouts.action.length > 0) {
|
|
for (var i=0; i < document.layouts.action.length; i++) {
|
|
if (document.layouts.action[i].checked) {
|
|
batches.push("batch_id=" + document.layouts.action[i].value);
|
|
}
|
|
}
|
|
if (batches.length < 1) {
|
|
alert(_("Please select at least one batch to export."));
|
|
return; // no batch selected
|
|
}
|
|
getstr = batches.join("&");
|
|
}
|
|
else if (document.layouts.action.checked) {
|
|
getstr = "batch_id="+document.layouts.action.value;
|
|
}
|
|
else {
|
|
alert(_("Please select at least one batch to export."));
|
|
return; // no batch selected
|
|
}
|
|
return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 700, 800);
|
|
};
|
|
function selected_layout(op) {
|
|
var selected = new Array;
|
|
if (document.layouts.action.length) {
|
|
for (i=0;i<document.layouts.action.length;i++){
|
|
if (document.layouts.action[i].checked){
|
|
selected.push(i);
|
|
}
|
|
};
|
|
if (selected.length == 1) {
|
|
return(document.layouts.action[selected[0]].value);
|
|
}
|
|
else {
|
|
alert(_("Please select only one ")+"[% label_element %]"+_(" to")+op+".");
|
|
return (-1);
|
|
}
|
|
}
|
|
else {
|
|
if (document.layouts.action.checked){
|
|
return(document.layouts.action.value);
|
|
}
|
|
};
|
|
alert(_("Please select a ")+"[% label_element %].");
|
|
return (-1);
|
|
};
|
|
//]]>
|
|
</script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script type="text/javascript" id="js">
|
|
$(document).ready(function() {
|
|
$("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"sPaginationType": "four_button",
|
|
"aaSorting": [[ 1, "asc" ]],
|
|
"aoColumnDefs": [
|
|
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
|
|
]
|
|
}));
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
<body id="labels_label-manage" class="tools labels">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
|
|
<a href="/cgi-bin/koha/labels/label-home.pl">Labels home</a> ›
|
|
Manage label [% label_element_title %]
|
|
</div>
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% INCLUDE 'labels-toolbar.inc' %]
|
|
<div class="yui-gc">
|
|
<div class="yui-u first" id="manage-label-layouts">
|
|
<div class="hint">Current library: [% LoginBranchname %]</div>
|
|
[% IF ( table_loop ) %]
|
|
<form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element %]">
|
|
<h2>Currently Available [% label_element_title %]</h2>
|
|
<table id="labels-table">
|
|
[% FOREACH table_loo IN table_loop %]
|
|
[% IF ( table_loo.header_fields ) %]
|
|
<thead>
|
|
<tr>
|
|
[% FOREACH header_field IN table_loo.header_fields %]
|
|
<th>[% header_field.field_label %]</th>
|
|
[% END %]
|
|
</tr>
|
|
</thead>
|
|
[% ELSE %]
|
|
<tr>
|
|
[% FOREACH text_field IN table_loo.text_fields %]
|
|
[% IF ( text_field.select_field ) %]
|
|
<td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
|
|
[% ELSIF ( text_field.field_value ) %]
|
|
<td>[% text_field.field_value %]</td>
|
|
[% ELSE %]
|
|
<td> </td>
|
|
[% END %]
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</table>
|
|
<fieldset class="action">
|
|
<input type="button" id="edit" onclick="Edit()" value="Edit" />
|
|
<input type="button" id="delete" onclick="DeleteConfirm()" value="Delete" />
|
|
[% IF ( print ) %]<input type="button" id="print" onclick="Xport()" value="Export" />[% END %]
|
|
</fieldset>
|
|
</form>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<h4>There are no [% label_element_title %] currently available.</h4>
|
|
<p>Use the toolbar above to create a new [% label_element %].</p></div>
|
|
[% END %]
|
|
</div>
|
|
[% IF ( error ) %]
|
|
<div class="yui-u">
|
|
<div class="dialog alert">
|
|
<strong>WARNING:</strong> An error was encountered and the [% op %] operation for [% label_element %] [% element_id %] was not completed. Please have your system administrator check the error log for details.
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'labels-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|