Owen Leonard
93866a2320
This patch makes two categories of changes: 1. CSS changes to accommodate changes in DataTables default CSS and markup structure. I've tried to make sure all of our Koha-specific styles are still applying. This change necessitates a rebuild of staff interface CSS. 2. DataTables option names: In this version of DataTables you can't override a default which uses CamelCase (e.g. "pagingType") with one in "Hungarian" notation, e.g. "sPaginationType." Since we define many default options in prog/js/datatables.js in camel case, any template which previously used a Hungarian notation option to override the default has now been updated to use the CamelCase version. See https://datatables.net/upgrade/1.10-convert#Options for a summary of the different option name changes. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
204 lines
10 KiB
Text
204 lines
10 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% PROCESS 'i18n.inc' %]
|
|
[% SET footerjs = 1 %]
|
|
[% BLOCK translate_label_element %]
|
|
[%- SWITCH element -%]
|
|
[%- CASE 'layout' -%][% t('layout') | html %]
|
|
[%- CASE 'Layouts' -%][% t('Label layouts') | html %]
|
|
[%- CASE 'template' -%][% t('template') | html %]
|
|
[%- CASE 'Templates' -%][% t('Label templates') | html %]
|
|
[%- CASE 'profile' -%][% t('profile') | html %]
|
|
[%- CASE 'Profiles' -%][% t('Printer profiles') | html %]
|
|
[%- CASE 'batch' -%][% t('batch') | html %]
|
|
[%- CASE 'Batches' -%][% t('Label batches') | html %]
|
|
[%- END -%]
|
|
[% END %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>[% FILTER collapse %]
|
|
[% PROCESS translate_label_element element=label_element_title %] ›
|
|
[% t("Label creator") | html %] ›
|
|
[% t("Cataloging") | html %] ›
|
|
[% t("Koha") | html %]
|
|
[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="labels_label-manage" class="tools labels">
|
|
[% WRAPPER 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
[% END %]
|
|
|
|
[% WRAPPER 'sub-header.inc' %]
|
|
[% WRAPPER breadcrumbs %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
|
[% PROCESS translate_label_element element=label_element_title %]
|
|
[% END %]
|
|
[% END #/ WRAPPER breadcrumbs %]
|
|
[% END #/ WRAPPER sub-header.inc %]
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
|
|
[% INCLUDE 'labels-toolbar.inc' %]
|
|
<h2>[% PROCESS translate_label_element element=label_element_title %]</h2>
|
|
|
|
[% IF ( error ) %]
|
|
<div class="dialog alert">
|
|
<strong>WARNING:</strong> An error was encountered and the [% op | html %] operation for [% label_element | html %] [% element_id | html %] was not completed. Please have your system administrator check the error log for details.
|
|
</div>
|
|
[% END %]
|
|
|
|
<div id="manage-label-layouts" class="page-section">
|
|
[% IF ( table_loop ) %]
|
|
<form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]">
|
|
|
|
<div class="page-section">
|
|
<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 %]
|
|
[% SWITCH header_field.field_label %]
|
|
[% CASE 'Layout ID' %]<th>Layout ID</th>
|
|
[% CASE 'Layout' %]<th>Layout</th>
|
|
[% CASE 'Barcode Type' %]<th>Barcode type</th>
|
|
[% CASE 'Print Type' %]<th>Print type</th>
|
|
[% CASE 'Template ID' %]<th>Template ID</th>
|
|
[% CASE 'Template Name' %]<th>Template name</th>
|
|
[% CASE 'Description' %]<th>Description</th>
|
|
[% CASE 'Actions' %]<th class="noExport">Actions</th>
|
|
[% CASE 'Profile ID' %]<th>Profile ID</th>
|
|
[% CASE 'Printer Name' %]<th>Printer name</th>
|
|
[% CASE 'Paper Bin' %]<th>Paper bin</th>
|
|
[% CASE 'Batch ID' %]<th>Batch ID</th>
|
|
[% CASE 'Item Count' %]<th>Item count</th>
|
|
[% CASE 'Fields to Print' %]<th>Fields to print</th>
|
|
[% CASE %]<th>[% header_field.field_label | html %]</th>
|
|
[% END %]
|
|
[% END %]
|
|
</tr>
|
|
</thead>
|
|
[% ELSE %]
|
|
<tr>
|
|
[% FOREACH text_field IN table_loo.text_fields %]
|
|
[% IF ( text_field.select_field ) %]
|
|
<td class="actions">
|
|
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/labels/label-edit-[% label_element |url %].pl?op=edit&element_id=[% text_field.field_value |url %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
|
|
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=[% label_element | html %]&element_id=[% text_field.field_value |url %]"><i class="fa fa-trash-can"></i> Delete</a>
|
|
</td>
|
|
[% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
|
|
[% ELSIF ( text_field.field_value ) %]
|
|
<td>[% text_field.field_value | html %]</td>
|
|
[% ELSE %]
|
|
<td> </td>
|
|
[% END %]
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</table>
|
|
</div> <!-- /.page-section -->
|
|
[% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
|
|
</fieldset>
|
|
</form>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<h4>There are no
|
|
[% PROCESS translate_label_element element=label_element_title %]
|
|
currently available.</h4>
|
|
<p>Use the toolbar above to create a new
|
|
[% PROCESS translate_label_element element=label_element %].</p></div>
|
|
[% END %]
|
|
</div>
|
|
</main>
|
|
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
|
|
|
<div class="col-sm-2 col-sm-pull-10">
|
|
<aside>
|
|
[% INCLUDE 'cat-menu.inc' %]
|
|
</aside>
|
|
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
|
</div> <!-- /.row -->
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% INCLUDE 'greybox.inc' %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script>
|
|
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, 400, 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 %s to %s.").format("[% label_element | html %]", op));
|
|
return (-1);
|
|
}
|
|
}
|
|
else {
|
|
if (document.layouts.action.checked){
|
|
return(document.layouts.action.value);
|
|
}
|
|
};
|
|
alert(_("Please select a %s.").format("[% label_element | html %]"));
|
|
return (-1);
|
|
}
|
|
$(document).ready(function(){
|
|
$('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
|
|
$("#print").click(function(e){
|
|
e.preventDefault();
|
|
Xport();
|
|
});
|
|
$(".delete").on("click", function(){
|
|
return confirmDelete( _("Are you sure you want to delete this?") );
|
|
});
|
|
$("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"pagingType": "full",
|
|
"order": [[ 1, "asc" ]],
|
|
"columnDefs": [
|
|
{ "targets": [ -1 ], "orderable": false, "searchable": false },
|
|
]
|
|
}));
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|