4 [% BLOCK translate_label_element %]
6 [%- CASE 'layout' -%]layout
7 [%- CASE 'Layouts' -%]Layouts
8 [%- CASE 'template' -%]template
9 [%- CASE 'Templates' -%]Templates
10 [%- CASE 'profile' -%]profile
11 [%- CASE 'Profiles' -%]Profiles
12 [%- CASE 'batch' -%]batch
13 [%- CASE 'Batches' -%]Batches
16 [% INCLUDE 'doc-head-open.inc' %]
17 <title>Koha › Tools › Label creator › [% PROCESS translate_label_element element=label_element_title %]</title>
18 [% INCLUDE 'doc-head-close.inc' %]
19 [% Asset.css("css/datatables.css") | $raw %]
22 <body id="labels_label-manage" class="tools labels">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'cat-search.inc' %]
25 <div id="breadcrumbs">
26 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
27 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
28 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> ›
29 [% PROCESS translate_label_element element=label_element_title %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 [% INCLUDE 'labels-toolbar.inc' %]
40 <div class="dialog alert">
41 <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.
45 <div id="manage-label-layouts">
46 <div class="hint">Current library: [% LoginBranchname | html %]</div>
47 [% IF ( table_loop ) %]
48 <form name="layouts" action="/cgi-bin/koha/label-manage.pl?label_element=[% label_element | html %]">
49 [% IF ( label_element == 'layout' ) %]
50 <h2>Currently available layouts</h2>
51 [% ELSIF ( label_element == 'template' ) %]
52 <h2>Currently available templates</h2>
53 [% ELSIF ( label_element == 'profile' ) %]
54 <h2>Currently available profiles</h2>
55 [% ELSIF ( label_element == 'batch' ) %]
56 <h2>Currently available batches</h2>
58 <table id="labels-table">
59 [% FOREACH table_loo IN table_loop %]
60 [% IF ( table_loo.header_fields ) %]
63 [% FOREACH header_field IN table_loo.header_fields %]
64 [% SWITCH header_field.field_label %]
65 [% CASE 'Layout ID' %]<th>Layout ID</th>
66 [% CASE 'Layout' %]<th>Layout</th>
67 [% CASE 'Barcode Type' %]<th>Barcode type</th>
68 [% CASE 'Print Type' %]<th>Print type</th>
69 [% CASE 'Template ID' %]<th>Template ID</th>
70 [% CASE 'Template Name' %]<th>Template name</th>
71 [% CASE 'Description' %]<th>Description</th>
72 [% CASE 'Actions' %]<th>Actions</th>
73 [% CASE 'Profile ID' %]<th>Profile ID</th>
74 [% CASE 'Printer Name' %]<th>Printer name</th>
75 [% CASE 'Paper Bin' %]<th>Paper bin</th>
76 [% CASE 'Batch ID' %]<th>Batch ID</th>
77 [% CASE 'Item Count' %]<th>Item count</th>
78 [% CASE 'Fields to Print' %]<th>Fields to print</th>
79 [% CASE %]<th>[% header_field.field_label | html %]</th>
86 [% FOREACH text_field IN table_loo.text_fields %]
87 [% IF ( text_field.select_field ) %]
89 <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>
90 <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>
92 [% IF label_element == 'batch' %] <td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
93 [% ELSIF ( text_field.field_value ) %]
94 <td>[% text_field.field_value | html %]</td>
103 [% IF ( print ) %]<button type="button" class="btn btn-default btn-sm" id="print">Export selected</button>[% END %]
107 <div class="dialog message">
109 [% PROCESS translate_label_element element=label_element_title %]
110 currently available.</h4>
111 <p>Use the toolbar above to create a new
112 [% PROCESS translate_label_element element=label_element %].</p></div>
116 </div> <!-- /.col-sm-10.col-sm-push-2 -->
118 <div class="col-sm-2 col-sm-pull-10">
120 [% INCLUDE 'tools-menu.inc' %]
122 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
123 </div> <!-- /.row -->
125 [% MACRO jsinclude BLOCK %]
126 [% Asset.js("js/tools-menu.js") | $raw %]
127 [% INCLUDE 'greybox.inc' %]
128 [% INCLUDE 'datatables.inc' %]
132 if(document.layouts.action.length > 0) {
133 for (var i=0; i < document.layouts.action.length; i++) {
134 if (document.layouts.action[i].checked) {
135 batches.push("batch_id=" + document.layouts.action[i].value);
138 if (batches.length < 1) {
139 alert(_("Please select at least one batch to export."));
140 return; // no batch selected
142 getstr = batches.join("&");
144 else if (document.layouts.action.checked) {
145 getstr = "batch_id="+document.layouts.action.value;
148 alert(_("Please select at least one batch to export."));
149 return; // no batch selected
151 return GB_showCenter(_("Export Labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800);
153 function selected_layout(op) {
154 var selected = new Array;
155 if (document.layouts.action.length) {
156 for (i=0;i<document.layouts.action.length;i++){
157 if (document.layouts.action[i].checked){
161 if (selected.length == 1) {
162 return(document.layouts.action[selected[0]].value);
165 alert(_("Please select only one %s to %s.").format("[% label_element | html %]", op));
170 if (document.layouts.action.checked){
171 return(document.layouts.action.value);
174 alert(_("Please select a %s.").format("[% label_element | html %]"));
177 $(document).ready(function(){
178 $("#print").click(function(e){
182 $(".delete").on("click", function(){
183 return confirmDelete( _("Are you sure you want to delete this?") );
185 $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, {
186 "sPaginationType": "four_button",
187 "aaSorting": [[ 1, "asc" ]],
189 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
196 [% INCLUDE 'intranet-bottom.inc' %]