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 › Cataloging › 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/cataloguing/cataloging-home.pl">Cataloging</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" class="page-section">
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>
75 <div class="page-section">
76 <table id="labels-table">
77 [% FOREACH table_loo IN table_loop %]
78 [% IF ( table_loo.header_fields ) %]
81 [% FOREACH header_field IN table_loo.header_fields %]
82 [% SWITCH header_field.field_label %]
83 [% CASE 'Layout ID' %]<th>Layout ID</th>
84 [% CASE 'Layout' %]<th>Layout</th>
85 [% CASE 'Barcode Type' %]<th>Barcode type</th>
86 [% CASE 'Print Type' %]<th>Print type</th>
87 [% CASE 'Template ID' %]<th>Template ID</th>
88 [% CASE 'Template Name' %]<th>Template name</th>
89 [% CASE 'Description' %]<th>Description</th>
90 [% CASE 'Actions' %]<th class="noExport">Actions</th>
91 [% CASE 'Profile ID' %]<th>Profile ID</th>
92 [% CASE 'Printer Name' %]<th>Printer name</th>
93 [% CASE 'Paper Bin' %]<th>Paper bin</th>
94 [% CASE 'Batch ID' %]<th>Batch ID</th>
95 [% CASE 'Item Count' %]<th>Item count</th>
96 [% CASE 'Fields to Print' %]<th>Fields to print</th>
97 [% CASE %]<th>[% header_field.field_label | html %]</th>
104 [% FOREACH text_field IN table_loo.text_fields %]
105 [% IF ( text_field.select_field ) %]
107 <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>
108 <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>
110 [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
111 [% ELSIF ( text_field.field_value ) %]
112 <td>[% text_field.field_value | html %]</td>
121 </div> <!-- /.page-section -->
122 [% IF ( print ) %]<button type="button" class="btn btn-default" id="print">Export selected</button>[% END %]
126 <div class="dialog message">
128 [% PROCESS translate_label_element element=label_element_title %]
129 currently available.</h4>
130 <p>Use the toolbar above to create a new
131 [% PROCESS translate_label_element element=label_element %].</p></div>
135 </div> <!-- /.col-sm-10.col-sm-push-2 -->
137 <div class="col-sm-2 col-sm-pull-10">
139 [% INCLUDE 'cat-menu.inc' %]
141 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
142 </div> <!-- /.row -->
144 [% MACRO jsinclude BLOCK %]
145 [% INCLUDE 'greybox.inc' %]
146 [% INCLUDE 'datatables.inc' %]
150 if(document.layouts.action.length > 0) {
151 for (var i=0; i < document.layouts.action.length; i++) {
152 if (document.layouts.action[i].checked) {
153 batches.push("batch_id=" + document.layouts.action[i].value);
156 if (batches.length < 1) {
157 alert(_("Please select at least one batch to export."));
158 return; // no batch selected
160 getstr = batches.join("&");
162 else if (document.layouts.action.checked) {
163 getstr = "batch_id="+document.layouts.action.value;
166 alert(_("Please select at least one batch to export."));
167 return; // no batch selected
169 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
171 function selected_layout(op) {
172 var selected = new Array;
173 if (document.layouts.action.length) {
174 for (i=0;i<document.layouts.action.length;i++){
175 if (document.layouts.action[i].checked){
179 if (selected.length == 1) {
180 return(document.layouts.action[selected[0]].value);
183 alert(_("Please select only one %s to %s.").format("[% label_element | html %]", op));
188 if (document.layouts.action.checked){
189 return(document.layouts.action.value);
192 alert(_("Please select a %s.").format("[% label_element | html %]"));
195 $(document).ready(function(){
196 $('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
197 $("#print").click(function(e){
201 $(".delete").on("click", function(){
202 return confirmDelete( _("Are you sure you want to delete this?") );
204 $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
205 "sPaginationType": "full",
206 "aaSorting": [[ 1, "asc" ]],
208 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
215 [% INCLUDE 'intranet-bottom.inc' %]