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 [% WRAPPER 'header.inc' %]
24 [% INCLUDE 'cat-search.inc' %]
27 [% WRAPPER 'sub-header.inc' %]
28 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
31 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
34 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
37 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
40 <a href="#" aria-current="page">
41 [% PROCESS translate_label_element element=label_element_title %]
48 <div class="main container-fluid">
50 <div class="col-sm-10 col-sm-push-2">
53 [% INCLUDE 'labels-toolbar.inc' %]
54 <h1>Manage labels</h1>
57 <div class="dialog alert">
58 <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.
62 <div id="manage-label-layouts">
63 [% IF ( table_loop ) %]
64 <form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]">
65 [% IF ( label_element == 'layout' ) %]
66 <h2>Currently available layouts</h2>
67 [% ELSIF ( label_element == 'template' ) %]
68 <h2>Currently available templates</h2>
69 [% ELSIF ( label_element == 'profile' ) %]
70 <h2>Currently available profiles</h2>
71 [% ELSIF ( label_element == 'batch' ) %]
72 <h2>Currently available batches</h2>
74 <table id="labels-table">
75 [% FOREACH table_loo IN table_loop %]
76 [% IF ( table_loo.header_fields ) %]
79 [% FOREACH header_field IN table_loo.header_fields %]
80 [% SWITCH header_field.field_label %]
81 [% CASE 'Layout ID' %]<th>Layout ID</th>
82 [% CASE 'Layout' %]<th>Layout</th>
83 [% CASE 'Barcode Type' %]<th>Barcode type</th>
84 [% CASE 'Print Type' %]<th>Print type</th>
85 [% CASE 'Template ID' %]<th>Template ID</th>
86 [% CASE 'Template Name' %]<th>Template name</th>
87 [% CASE 'Description' %]<th>Description</th>
88 [% CASE 'Actions' %]<th class="noExport">Actions</th>
89 [% CASE 'Profile ID' %]<th>Profile ID</th>
90 [% CASE 'Printer Name' %]<th>Printer name</th>
91 [% CASE 'Paper Bin' %]<th>Paper bin</th>
92 [% CASE 'Batch ID' %]<th>Batch ID</th>
93 [% CASE 'Item Count' %]<th>Item count</th>
94 [% CASE 'Fields to Print' %]<th>Fields to print</th>
95 [% CASE %]<th>[% header_field.field_label | html %]</th>
102 [% FOREACH text_field IN table_loo.text_fields %]
103 [% IF ( text_field.select_field ) %]
105 <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>
106 <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>
108 [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
109 [% ELSIF ( text_field.field_value ) %]
110 <td>[% text_field.field_value | html %]</td>
119 [% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
123 <div class="dialog message">
125 [% PROCESS translate_label_element element=label_element_title %]
126 currently available.</h4>
127 <p>Use the toolbar above to create a new
128 [% PROCESS translate_label_element element=label_element %].</p></div>
132 </div> <!-- /.col-sm-10.col-sm-push-2 -->
134 <div class="col-sm-2 col-sm-pull-10">
136 [% INCLUDE 'cat-menu.inc' %]
138 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
139 </div> <!-- /.row -->
141 [% MACRO jsinclude BLOCK %]
142 [% INCLUDE 'greybox.inc' %]
143 [% INCLUDE 'datatables.inc' %]
147 if(document.layouts.action.length > 0) {
148 for (var i=0; i < document.layouts.action.length; i++) {
149 if (document.layouts.action[i].checked) {
150 batches.push("batch_id=" + document.layouts.action[i].value);
153 if (batches.length < 1) {
154 alert(_("Please select at least one batch to export."));
155 return; // no batch selected
157 getstr = batches.join("&");
159 else if (document.layouts.action.checked) {
160 getstr = "batch_id="+document.layouts.action.value;
163 alert(_("Please select at least one batch to export."));
164 return; // no batch selected
166 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
168 function selected_layout(op) {
169 var selected = new Array;
170 if (document.layouts.action.length) {
171 for (i=0;i<document.layouts.action.length;i++){
172 if (document.layouts.action[i].checked){
176 if (selected.length == 1) {
177 return(document.layouts.action[selected[0]].value);
180 alert(_("Please select only one %s to %s.").format("[% label_element | html %]", op));
185 if (document.layouts.action.checked){
186 return(document.layouts.action.value);
189 alert(_("Please select a %s.").format("[% label_element | html %]"));
192 $(document).ready(function(){
193 $('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
194 $("#print").click(function(e){
198 $(".delete").on("click", function(){
199 return confirmDelete( _("Are you sure you want to delete this?") );
201 $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
202 "sPaginationType": "full",
203 "aaSorting": [[ 1, "asc" ]],
205 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
212 [% INCLUDE 'intranet-bottom.inc' %]