3 [% PROCESS 'i18n.inc' %]
5 [% BLOCK translate_label_element %]
7 [%- CASE 'layout' -%][% t('layout') | html %]
8 [%- CASE 'Layouts' -%][% t('Layouts') | html %]
9 [%- CASE 'template' -%][% t('template') | html %]
10 [%- CASE 'Templates' -%][% t('Templates') | html %]
11 [%- CASE 'profile' -%][% t('profile') | html %]
12 [%- CASE 'Profiles' -%][% t('Profiles') | html %]
13 [%- CASE 'batch' -%][% t('batch') | html %]
14 [%- CASE 'Batches' -%][% t('Batches') | html %]
17 [% INCLUDE 'doc-head-open.inc' %]
18 <title>[% PROCESS translate_label_element element=label_element_title %] › Label creator › Tools › Koha</title>
19 [% INCLUDE 'doc-head-close.inc' %]
22 <body id="labels_label-manage" class="tools labels">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'cat-search.inc' %]
26 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
29 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
35 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
38 <a href="#" aria-current="page">
39 [% PROCESS translate_label_element element=label_element_title %]
45 <div class="main container-fluid">
47 <div class="col-sm-10 col-sm-push-2">
50 [% INCLUDE 'labels-toolbar.inc' %]
51 <h1>Manage labels</h1>
54 <div class="dialog alert">
55 <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.
59 <div id="manage-label-layouts">
60 [% IF ( table_loop ) %]
61 <form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]">
62 [% IF ( label_element == 'layout' ) %]
63 <h2>Currently available layouts</h2>
64 [% ELSIF ( label_element == 'template' ) %]
65 <h2>Currently available templates</h2>
66 [% ELSIF ( label_element == 'profile' ) %]
67 <h2>Currently available profiles</h2>
68 [% ELSIF ( label_element == 'batch' ) %]
69 <h2>Currently available batches</h2>
71 <table id="labels-table">
72 [% FOREACH table_loo IN table_loop %]
73 [% IF ( table_loo.header_fields ) %]
76 [% FOREACH header_field IN table_loo.header_fields %]
77 [% SWITCH header_field.field_label %]
78 [% CASE 'Layout ID' %]<th>Layout ID</th>
79 [% CASE 'Layout' %]<th>Layout</th>
80 [% CASE 'Barcode Type' %]<th>Barcode type</th>
81 [% CASE 'Print Type' %]<th>Print type</th>
82 [% CASE 'Template ID' %]<th>Template ID</th>
83 [% CASE 'Template Name' %]<th>Template name</th>
84 [% CASE 'Description' %]<th>Description</th>
85 [% CASE 'Actions' %]<th class="noExport">Actions</th>
86 [% CASE 'Profile ID' %]<th>Profile ID</th>
87 [% CASE 'Printer Name' %]<th>Printer name</th>
88 [% CASE 'Paper Bin' %]<th>Paper bin</th>
89 [% CASE 'Batch ID' %]<th>Batch ID</th>
90 [% CASE 'Item Count' %]<th>Item count</th>
91 [% CASE 'Fields to Print' %]<th>Fields to print</th>
92 [% CASE %]<th>[% header_field.field_label | html %]</th>
99 [% FOREACH text_field IN table_loo.text_fields %]
100 [% IF ( text_field.select_field ) %]
102 <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 fa-edit"></i> Edit</a>
103 <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"></i> Delete</a>
105 [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
106 [% ELSIF ( text_field.field_value ) %]
107 <td>[% text_field.field_value | html %]</td>
116 [% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
120 <div class="dialog message">
122 [% PROCESS translate_label_element element=label_element_title %]
123 currently available.</h4>
124 <p>Use the toolbar above to create a new
125 [% PROCESS translate_label_element element=label_element %].</p></div>
129 </div> <!-- /.col-sm-10.col-sm-push-2 -->
131 <div class="col-sm-2 col-sm-pull-10">
133 [% INCLUDE 'tools-menu.inc' %]
135 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
136 </div> <!-- /.row -->
138 [% MACRO jsinclude BLOCK %]
139 [% Asset.js("js/tools-menu.js") | $raw %]
140 [% INCLUDE 'greybox.inc' %]
141 [% INCLUDE 'datatables.inc' %]
145 if(document.layouts.action.length > 0) {
146 for (var i=0; i < document.layouts.action.length; i++) {
147 if (document.layouts.action[i].checked) {
148 batches.push("batch_id=" + document.layouts.action[i].value);
151 if (batches.length < 1) {
152 alert(_("Please select at least one batch to export."));
153 return; // no batch selected
155 getstr = batches.join("&");
157 else if (document.layouts.action.checked) {
158 getstr = "batch_id="+document.layouts.action.value;
161 alert(_("Please select at least one batch to export."));
162 return; // no batch selected
164 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
166 function selected_layout(op) {
167 var selected = new Array;
168 if (document.layouts.action.length) {
169 for (i=0;i<document.layouts.action.length;i++){
170 if (document.layouts.action[i].checked){
174 if (selected.length == 1) {
175 return(document.layouts.action[selected[0]].value);
178 alert(_("Please select only one %s to %s.").format("[% label_element | html %]", op));
183 if (document.layouts.action.checked){
184 return(document.layouts.action.value);
187 alert(_("Please select a %s.").format("[% label_element | html %]"));
190 $(document).ready(function(){
191 $("#print").click(function(e){
195 $(".delete").on("click", function(){
196 return confirmDelete( _("Are you sure you want to delete this?") );
198 $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
199 "sPaginationType": "full",
200 "aaSorting": [[ 1, "asc" ]],
202 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
209 [% INCLUDE 'intranet-bottom.inc' %]