2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Label creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'greybox.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript">
10 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this?");
11 function DeleteConfirm() {
12 var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]");
13 var answer = confirm(msg);
15 window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id %]";
18 return; // abort delete
21 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
22 $(".focus:last").select();
24 function verifyBarcodes(barcodes) {
25 if (barcodes.value == '') {
26 alert(_("Please add barcodes using either the direct entry text area or the item search."));
27 return false; // not ok
36 if(document.items.action.length > 0) {
37 for (var i=0; i < document.items.action.length; i++) {
38 if (document.items.action[i].checked) {
39 items.push("label_id=" + document.items.action[i].value);
43 getstr = items.join("&");
44 item_msg = item_num.join(", ");
45 var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?"
46 } else if (document.items.action.checked) {
47 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"));
48 return; // no deletion for single item batch
51 alert(_("Please select at least one label to delete."));
52 return; // no item selected
54 var answer = confirm(msg);
56 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
59 return; // abort delete
63 var number_list = document.getElementById("number_list");
64 if (number_list.value == '') {
65 window.open("/cgi-bin/koha/labels/label-item-search.pl?batch_id=[% batch_id %]&type=labels",'FindABibIndex','width=875,height=400,toolbar=no,scrollbars=yes');
68 document.forms["add_by_number"].submit();
72 function add_item(item_number) {
73 $("#itemnum_enter").prop("checked",true);
74 $("#number_list").val($("#number_list").val()+item_number+"\r\n");
77 function DeDuplicate() {
78 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
80 function Xport(mode) {
81 if (mode == 'label') {
83 if(document.items.action.length > 0) {
84 for (var i=0; i < document.items.action.length; i++) {
85 if (document.items.action[i].checked) {
86 labels.push("label_id=" + document.items.action[i].value);
89 if (labels.length < 1) {
90 alert(_("Please select at least one label to export."));
91 return; // no batch selected
93 getstr = labels.join("&");
95 else if (document.items.action.checked) {
96 getstr = document.items.action.value;
99 alert(_("Please select at least one label to export."));
100 return; // no batch selected
102 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800);
104 else if (mode == 'batch') {
105 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 400, 800);
108 // some pass-thru error trapping just in case...
111 function selected_layout() {
112 if (document.items.action.length) {
113 for (i=0;i<document.items.action.length;i++){
114 if (document.items.action[i].checked==true){
115 return(document.items.action[i].value);
120 if (document.items.action.checked){
121 return(document.items.action.value);
124 alert(_("Please select at least one item."));
128 $(document).ready(function() {
129 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
132 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
133 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
135 "aaSorting": [[ 0, "asc" ]],
136 "sPaginationType": "four_button"
138 $("#additems").click(function(){
142 $("#removeitems").click(function(){
146 $("#deletebatch").click(function(){
150 $("#deduplicate").click(function(){
154 $("#exportitems").click(function(){
158 $("#exportbatch").click(function(){
166 <body id="labels_label-edit-batch" class="tools labels" onload="dofocus();">
167 [% INCLUDE 'header.inc' %]
168 [% INCLUDE 'cat-search.inc' %]
169 <div id="breadcrumbs">
170 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
171 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
172 <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> ›
173 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> ›
175 Edit ([% batch_id %])
180 <div id="doc3" class="yui-t2">
184 [% INCLUDE 'labels-toolbar.inc' %]
186 <div class="dialog alert">
187 <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details.
189 [% ELSIF ( duplicate_message ) %]
190 <div class="dialog message">
191 <strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong>
195 <div id="manage-label-batches">
196 <div class="hint">Current library: [% LoginBranchname %]</div>
197 <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
199 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
201 <input type="hidden" name="op" value="add" />
202 <input type="hidden" name="batch_id" value="[% batch_id %]" />
205 <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
206 <label for="barcode_enter">Enter by barcode:</label><br/>
207 <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" />
208 <label for="itemnum_enter">Enter by itemnumber:</label>
211 <label for="number_list">Add by barcode(s) or itemnumbers(s):
212 <br /> <span class="hint">One number per line.</span>
213 <br /> <span class="hint">Leave empty to add via item search (itemnumber).</span>
215 <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea>
220 <div id="batch-manage" class="btn-toolbar">
221 <a class="btn btn-small" id="additems" href="#"><icon class="fa fa-plus"></icon> Add item(s)</a>[% IF ( table_loop ) %]
222 <a class="btn btn-small" id="removeitems" href="#"><icon class="fa fa-trash"></icon> Remove selected items</a>
223 <a class="btn btn-small" id="deletebatch" href="#"><icon class="fa fa-minus-square"></icon> Delete batch</a>
224 <a class="btn btn-small" id="deduplicate" href="#"><icon class="fa fa-minus"></icon> Remove duplicates</a>
225 <a class="btn btn-small" id="exportitems" href="#"><icon class="fa fa-share-square-o"></icon> Export selected items</a>
226 <a class="btn btn-small" id="exportbatch" href="#"><icon class="fa fa-share-square-o"></icon> Export full batch</a>[% END %]
228 [% IF ( table_loop ) %]
229 <form name="items" class="checkboxed">
230 <h2>Items in batch number [% batch_id %]</h2>
232 [% FOREACH table_loo IN table_loop %]
233 [% IF ( table_loo.header_fields ) %]
236 [% FOREACH header_field IN table_loo.header_fields %]
237 [% SWITCH header_field.field_label -%]
238 [% CASE "Label Number" -%]
239 <th>Label number</th>
240 [% CASE "Summary" -%]
241 <th class="anti-the">Summary</th>
242 [% CASE "Item Type" %]
249 <th>[% header_field.field_label %]</th>
257 [% FOREACH text_field IN table_loo.text_fields %]
258 [% IF ( text_field.select_field ) %]
259 <td><a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id |url %]&label_id=[% text_field.field_value |url %]"><icon class="fa fa-trash"></icon> Delete</a><a class="btn btn-mini" href="#" onclick="GB_showCenter('Export labels','/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&label_id=[% text_field.field_value |url %]', 400, 800)"><icon class="fa fa-share-square-o"></icon> Export</a></td>
260 <td><center><input type="checkbox" name="action" value="[% text_field.field_value %]"></center></td>
263 [% IF ( text_field.field_name == '_item_type_tbl' ) %]
264 [% ItemTypes.GetDescription( text_field.field_value ) %]
266 [% text_field.field_value %]
278 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
280 <div class="dialog message">
281 <h4>There are no items in this batch yet</h4>
282 <p>Add items by using the text area above or leave empty to add via item search.</p>
291 [% INCLUDE 'tools-menu.inc' %]
294 [% INCLUDE 'intranet-bottom.inc' %]