Lines 1-12
Link Here
|
1 |
[% USE ItemTypes %] |
1 |
[% USE ItemTypes %] |
|
|
2 |
[% SET footerjs = 1 %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
<title>Koha › Tools › Label creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</title> |
4 |
<title>Koha › Tools › Label creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</title> |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
5 |
[% INCLUDE 'greybox.inc' %] |
|
|
6 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
6 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
|
|
7 |
</head> |
8 |
|
9 |
<body id="labels_label-edit-batch" class="tools labels" onload="dofocus();"> |
10 |
[% INCLUDE 'header.inc' %] |
11 |
[% INCLUDE 'cat-search.inc' %] |
12 |
<div id="breadcrumbs"> |
13 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
14 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › |
15 |
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> › |
16 |
<a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> › |
17 |
[% IF batch_id %] |
18 |
Edit ([% batch_id %]) |
19 |
[% ELSE %] |
20 |
New |
21 |
[% END %] |
22 |
</div> |
23 |
<div id="doc3" class="yui-t2"> |
24 |
<div id="bd"> |
25 |
<div id="yui-main"> |
26 |
<div class="yui-b"> |
27 |
[% INCLUDE 'labels-toolbar.inc' %] |
28 |
[% IF ( err ) %] |
29 |
<div class="dialog alert"> |
30 |
<strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details. |
31 |
</div> |
32 |
[% ELSIF ( duplicate_message ) %] |
33 |
<div class="dialog message"> |
34 |
<strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong> |
35 |
</div> |
36 |
[% END %] |
37 |
|
38 |
<div id="manage-label-batches"> |
39 |
<div class="hint">Current library: [% LoginBranchname %]</div> |
40 |
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> |
41 |
<div> |
42 |
<fieldset class="rows" style="border-bottom: 0px; border: 0px;"> |
43 |
<ol><li id="description"> |
44 |
<input type="hidden" name="op" value="add" /> |
45 |
<input type="hidden" name="batch_id" value="[% batch_id %]" /> |
46 |
<label for="description">Batch description: </label> |
47 |
<input type="text" name="description" value="[% description %]"> |
48 |
<a href="#" id="savedesc" data-batch_id="[% batch_id %]" class="btn btn-default btn-xs">Save description</a> <span id="change-status"></span> |
49 |
</li> |
50 |
<li> |
51 |
<input type="radio" name="number_type" id="barcode_enter" value="barcode" checked /> |
52 |
<label for="barcode_enter">Enter by barcode:</label><br/> |
53 |
<input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" /> |
54 |
<label for="itemnum_enter">Enter by itemnumber:</label> |
55 |
</li> |
56 |
<li> |
57 |
<label for="number_list">Add by barcode(s) or itemnumbers(s): |
58 |
<br /> <span class="hint">One number per line.</span> |
59 |
<br /> <span class="hint">Leave empty to add via item search (itemnumber).</span> |
60 |
</label> |
61 |
<textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea> |
62 |
</li></ol> |
63 |
</fieldset> |
64 |
</div> |
65 |
</form> |
66 |
<div id="batch-manage" class="btn-toolbar"> |
67 |
<a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %] |
68 |
<a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a> |
69 |
<a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a> |
70 |
<a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a> |
71 |
<a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a> |
72 |
<a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %] |
73 |
</div> |
74 |
[% IF ( table_loop ) %] |
75 |
<form name="items" class="checkboxed"> |
76 |
<h2>Items in batch number [% batch_id %]</h2> |
77 |
<table id="batcht"> |
78 |
[% FOREACH table_loo IN table_loop %] |
79 |
[% IF ( table_loo.header_fields ) %] |
80 |
<thead> |
81 |
<tr> |
82 |
[% FOREACH header_field IN table_loo.header_fields %] |
83 |
[% SWITCH header_field.field_label -%] |
84 |
[% CASE "Label number" -%] |
85 |
<th>Label number</th> |
86 |
[% CASE "Summary" -%] |
87 |
<th class="anti-the">Summary</th> |
88 |
[% CASE "Item type" %] |
89 |
<th>Item type</th> |
90 |
[% CASE "Barcode" %] |
91 |
<th>Barcode</th> |
92 |
[% CASE "Select" -%] |
93 |
<th>Select</th> |
94 |
[% CASE %] |
95 |
<th>[% header_field.field_label %]</th> |
96 |
[% END -%] |
97 |
[% END %] |
98 |
</tr> |
99 |
</thead> |
100 |
<tbody> |
101 |
[% ELSE %] |
102 |
<tr> |
103 |
[% FOREACH text_field IN table_loo.text_fields %] |
104 |
[% IF ( text_field.select_field ) %] |
105 |
<td> |
106 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id |url %]&label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a> |
107 |
<a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id %]" data-label-id="[% text_field.field_value |html %]"><i class="fa fa-share-square-o"></i> Export</a> |
108 |
</td> |
109 |
<td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> |
110 |
[% ELSE %] |
111 |
<td> |
112 |
[% IF ( text_field.field_name == '_item_type_tbl' ) %] |
113 |
[% ItemTypes.GetDescription( text_field.field_value ) %] |
114 |
[% ELSE %] |
115 |
[% text_field.field_value %] |
116 |
[% END %] |
117 |
</td> |
118 |
[% END %] |
119 |
[% END %] |
120 |
</tr> |
121 |
[% END %] |
122 |
[% END %] |
123 |
</tbody> |
124 |
</table> |
125 |
</form> |
126 |
[% ELSE %] |
127 |
<div class="dialog message"> |
128 |
<h4>There are no items in this batch yet</h4> |
129 |
<p>Add items by using the text area above or leave empty to add via item search.</p> |
130 |
</div> |
131 |
[% END %] |
132 |
</div> |
133 |
</div> |
134 |
</div> |
135 |
<div class="yui-b"> |
136 |
[% INCLUDE 'tools-menu.inc' %] |
137 |
</div> |
138 |
</div> |
139 |
|
140 |
[% MACRO jsinclude BLOCK %] |
141 |
[% INCLUDE 'greybox.inc' %] |
7 |
[% INCLUDE 'datatables.inc' %] |
142 |
[% INCLUDE 'datatables.inc' %] |
|
|
143 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> |
8 |
<script type="text/javascript"> |
144 |
<script type="text/javascript"> |
9 |
//<![CDATA[ |
|
|
10 |
function DeleteConfirm() { |
145 |
function DeleteConfirm() { |
11 |
var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); |
146 |
var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); |
12 |
var answer = confirm(msg); |
147 |
var answer = confirm(msg); |
Lines 43-49
Link Here
|
43 |
item_msg = item_num.join(", "); |
178 |
item_msg = item_num.join(", "); |
44 |
var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?" |
179 |
var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?" |
45 |
} else if (document.items.action.checked) { |
180 |
} else if (document.items.action.checked) { |
46 |
alert(_("Deletion of label from a batch with only one label will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar")); |
181 |
alert(_("Deletion of label from a batch with only one label will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar")); |
47 |
return; // no deletion for single item batch |
182 |
return; // no deletion for single item batch |
48 |
} |
183 |
} |
49 |
else { |
184 |
else { |
Lines 167-301
Link Here
|
167 |
var batch_id = $(this).data("batch-id"); |
302 |
var batch_id = $(this).data("batch-id"); |
168 |
GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800); |
303 |
GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800); |
169 |
}); |
304 |
}); |
170 |
}); |
305 |
|
171 |
//]]> |
306 |
$("#savedesc").click(function(event){ |
|
|
307 |
event.preventDefault(); // prevent form submission |
308 |
var newdescription = $(this).siblings('input[name="description"]').val(); |
309 |
var batch_id = $(this).data('batch_id'); |
310 |
var ajaxData = { |
311 |
'newdescription': newdescription, |
312 |
'batch_id': batch_id, |
313 |
'card_element': "batch", |
314 |
'creator': "label", |
315 |
}; |
316 |
|
317 |
$.ajax({ |
318 |
url: '/cgi-bin/koha/svc/creator_batches', |
319 |
type: 'POST', |
320 |
dataType: 'json', |
321 |
data: ajaxData, |
322 |
}) |
323 |
|
324 |
.done(function(data){ |
325 |
if (data.status == 'success') { |
326 |
$("input[name='description']").text(data.newdesc); |
327 |
$("#change-status").text(_("Saved")); |
328 |
} else { |
329 |
$("#change-status").text(_("Unable to save description")); |
330 |
} |
331 |
}); |
332 |
}); |
333 |
}); |
172 |
</script> |
334 |
</script> |
173 |
</head> |
335 |
[% END %] |
174 |
<body id="labels_label-edit-batch" class="tools labels" onload="dofocus();"> |
|
|
175 |
[% INCLUDE 'header.inc' %] |
176 |
[% INCLUDE 'cat-search.inc' %] |
177 |
<div id="breadcrumbs"> |
178 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
179 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › |
180 |
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> › |
181 |
<a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> › |
182 |
[% IF batch_id %] |
183 |
Edit ([% batch_id %]) |
184 |
[% ELSE %] |
185 |
New |
186 |
[% END %] |
187 |
</div> |
188 |
<div id="doc3" class="yui-t2"> |
189 |
<div id="bd"> |
190 |
<div id="yui-main"> |
191 |
<div class="yui-b"> |
192 |
[% INCLUDE 'labels-toolbar.inc' %] |
193 |
[% IF ( err ) %] |
194 |
<div class="dialog alert"> |
195 |
<strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details. |
196 |
</div> |
197 |
[% ELSIF ( duplicate_message ) %] |
198 |
<div class="dialog message"> |
199 |
<strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong> |
200 |
</div> |
201 |
[% END %] |
202 |
|
336 |
|
203 |
<div id="manage-label-batches"> |
337 |
[% INCLUDE 'intranet-bottom.inc' %] |
204 |
<div class="hint">Current library: [% LoginBranchname %]</div> |
|
|
205 |
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> |
206 |
<div> |
207 |
<fieldset class="rows" style="border-bottom: 0px; border: 0px;"> |
208 |
<ol><li> |
209 |
<input type="hidden" name="op" value="add" /> |
210 |
<input type="hidden" name="batch_id" value="[% batch_id %]" /> |
211 |
</li> |
212 |
<li> |
213 |
<input type="radio" name="number_type" id="barcode_enter" value="barcode" checked /> |
214 |
<label for="barcode_enter">Enter by barcode:</label><br/> |
215 |
<input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" /> |
216 |
<label for="itemnum_enter">Enter by itemnumber:</label> |
217 |
</li> |
218 |
<li> |
219 |
<label for="number_list">Add by barcode(s) or itemnumbers(s): |
220 |
<br /> <span class="hint">One number per line.</span> |
221 |
<br /> <span class="hint">Leave empty to add via item search (itemnumber).</span> |
222 |
</label> |
223 |
<textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea> |
224 |
</li></ol> |
225 |
</fieldset> |
226 |
</div> |
227 |
</form> |
228 |
<div id="batch-manage" class="btn-toolbar"> |
229 |
<a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %] |
230 |
<a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a> |
231 |
<a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a> |
232 |
<a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a> |
233 |
<a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a> |
234 |
<a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %] |
235 |
</div> |
236 |
[% IF ( table_loop ) %] |
237 |
<form name="items" class="checkboxed"> |
238 |
<h2>Items in batch number [% batch_id %]</h2> |
239 |
<table id="batcht"> |
240 |
[% FOREACH table_loo IN table_loop %] |
241 |
[% IF ( table_loo.header_fields ) %] |
242 |
<thead> |
243 |
<tr> |
244 |
[% FOREACH header_field IN table_loo.header_fields %] |
245 |
[% SWITCH header_field.field_label -%] |
246 |
[% CASE "Label number" -%] |
247 |
<th>Label number</th> |
248 |
[% CASE "Summary" -%] |
249 |
<th class="anti-the">Summary</th> |
250 |
[% CASE "Item type" %] |
251 |
<th>Item type</th> |
252 |
[% CASE "Barcode" %] |
253 |
<th>Barcode</th> |
254 |
[% CASE "Select" -%] |
255 |
<th>Select</th> |
256 |
[% CASE %] |
257 |
<th>[% header_field.field_label %]</th> |
258 |
[% END -%] |
259 |
[% END %] |
260 |
</tr> |
261 |
</thead> |
262 |
<tbody> |
263 |
[% ELSE %] |
264 |
<tr> |
265 |
[% FOREACH text_field IN table_loo.text_fields %] |
266 |
[% IF ( text_field.select_field ) %] |
267 |
<td> |
268 |
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id |url %]&label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a> |
269 |
<a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id %]" data-label-id="[% text_field.field_value |html %]"><i class="fa fa-share-square-o"></i> Export</a> |
270 |
</td> |
271 |
<td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> |
272 |
[% ELSE %] |
273 |
<td> |
274 |
[% IF ( text_field.field_name == '_item_type_tbl' ) %] |
275 |
[% ItemTypes.GetDescription( text_field.field_value ) %] |
276 |
[% ELSE %] |
277 |
[% text_field.field_value %] |
278 |
[% END %] |
279 |
</td> |
280 |
[% END %] |
281 |
[% END %] |
282 |
</tr> |
283 |
[% END %] |
284 |
[% END %] |
285 |
</tbody> |
286 |
</table> |
287 |
</form> |
288 |
[% ELSE %] |
289 |
<div class="dialog message"> |
290 |
<h4>There are no items in this batch yet</h4> |
291 |
<p>Add items by using the text area above or leave empty to add via item search.</p> |
292 |
</div> |
293 |
[% END %] |
294 |
</div> |
295 |
</div> |
296 |
</div> |
297 |
<div class="yui-b"> |
298 |
[% INCLUDE 'tools-menu.inc' %] |
299 |
</div> |
300 |
</div> |
301 |
[% INCLUDE 'intranet-bottom.inc' %] |