2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Labels › Manage label batches</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'greybox.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/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 dofocus() { // named function req'd for body onload event by some FF and IE7 security models
12 $(".focus:last").select();
14 function verifyBarcodes(barcodes) {
15 if (barcodes.value == '') {
16 alert(_("Please add barcodes using either the direct entry text area or the item search."));
17 return false; // not ok
26 if(document.items.action.length > 0) {
27 for (var i=0; i < document.items.action.length; i++) {
28 if (document.items.action[i].checked) {
29 items.push("label_id=" + document.items.action[i].value);
33 if (items.length < 1) {
34 alert(_("Please select at least one item to delete."));
35 return; // no item selected
37 getstr = items.join("&");
38 item_msg = item_num.join(", ");
39 var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?"
42 alert(_("Please select at least label to delete."));
43 return; // no item selected
45 var answer = confirm(msg);
47 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
50 return; // abort delete
54 var number_list = document.getElementById("number_list");
55 if (number_list.value == '') {
56 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');
59 document.forms["add_by_number"].submit();
63 function add_item(item_number) {
64 $("#itemnum_enter").prop("checked",true);
65 $("#number_list").val($("#number_list").val()+item_number+"\r\n");
68 function DeDuplicate() {
69 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
71 function Xport(mode) {
72 if (mode == 'label') {
74 if(document.items.action.length > 0) {
75 for (var i=0; i < document.items.action.length; i++) {
76 if (document.items.action[i].checked) {
77 labels.push("label_id=" + document.items.action[i].value);
80 if (labels.length < 1) {
81 alert(_("Please select at least one label to export."));
82 return; // no batch selected
84 getstr = labels.join("&");
86 else if (document.items.action.checked) {
87 getstr = document.items.action.value;
90 alert(_("Please select at least one label to export."));
91 return; // no batch selected
93 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
95 else if (mode == 'batch') {
96 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 700, 800);
99 // some pass-thru error trapping just in case...
102 function selected_layout() {
103 if (document.items.action.length) {
104 for (i=0;i<document.items.action.length;i++){
105 if (document.items.action[i].checked==true){
106 return(document.items.action[i].value);
111 if (document.items.action.checked){
112 return(document.items.action.value);
115 alert(_("Please select at least one item."));
119 $(document).ready(function() {
120 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
122 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
123 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
125 "aaSorting": [[ 0, "asc" ]],
126 "sPaginationType": "four_button"
128 $("#additems").click(function(){
132 $("#removeitems").click(function(){
136 $("#deletebatch").click(function(){
140 $("#deduplicate").click(function(){
144 $("#exportitems").click(function(){
148 $("#exportbatch").click(function(){
156 <body id="labels_label-edit-batch" class="tools labels" onload="dofocus();">
157 [% INCLUDE 'header.inc' %]
158 [% INCLUDE 'cat-search.inc' %]
159 <div id="breadcrumbs">
160 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
161 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
162 <a href="/cgi-bin/koha/labels/label-home.pl">Labels home</a> ›
163 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Manage label batches</a> ›
165 Manage batch number [% batch_id %]
170 <div id="doc3" class="yui-t2">
174 [% INCLUDE 'labels-toolbar.inc' %]
176 <div class="dialog alert">
177 <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details.
179 [% ELSIF ( duplicate_message ) %]
180 <div class="dialog message">
181 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
185 <div id="manage-label-batches">
186 <div class="hint">Current library: [% LoginBranchname %]</div>
187 <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
189 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
191 <input type="hidden" name="op" value="add" />
192 <input type="hidden" name="batch_id" value="[% batch_id %]" />
195 <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
196 <label for="barcode_enter">Enter by barcode</label><br/>
197 <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" />
198 <label for="itemnum_enter">Enter by itemnumber</label>
201 <label for="number_list">Add by barcode(s) or itemnumbers(s):
202 <br /> <span class="hint">One number per line.</span>
203 <br /> <span class="hint">Leave empty to add via item search (itemnunber).</span>
205 <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea>
210 <div id="batch-manage" class="btn-toolbar">
211 <a class="btn btn-small" id="additems" href="#"><icon class="icon-plus"></icon> Add item(s)</a>[% IF ( table_loop ) %]
212 <a class="btn btn-small" id="removeitems" href="#"><icon class="icon-trash"></icon> Remove selected items</a>
213 <a class="btn btn-small" id="deduplicate" href="#"><icon class="icon-minus"></icon> Remove duplicates</a>
214 <a class="btn btn-small" id="exportitems" href="#"><icon class="icon-share"></icon> Export selected items</a>
215 <a class="btn btn-small" id="exportbatch" href="#"><icon class="icon-share"></icon> Export full batch</a>[% END %]
217 [% IF ( table_loop ) %]
218 <form name="items" class="checkboxed">
219 <h2>Items in batch number [% batch_id %]</h2>
221 [% FOREACH table_loo IN table_loop %]
222 [% IF ( table_loo.header_fields ) %]
225 [% FOREACH header_field IN table_loo.header_fields %]
226 [% SWITCH header_field.field_label -%]
227 [% CASE "Label Number" -%]
228 <th>Label number</th>
229 [% CASE "Summary" -%]
230 <th class="anti-the">Summary</th>
231 [% CASE "Item Type" %]
238 <th>[% header_field.field_label %]</th>
246 [% FOREACH text_field IN table_loo.text_fields %]
247 [% IF ( text_field.select_field ) %]
248 <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="icon-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 %]')"><icon class="icon-share"></icon> Export</a></td>
249 <td><center><input type="checkbox" name="action" value="[% text_field.field_value %]"></center></td>
252 [% IF ( text_field.field_name == '_item_type_tbl' ) %]
253 [% ItemTypes.GetDescription( text_field.field_value ) %]
255 [% text_field.field_value %]
267 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
269 <div class="dialog message">
270 <h4>There are no items in this batch yet</h4>
271 <p>Add items by using the text area above or leave empty to add via item search.</p>
280 [% INCLUDE 'labels-menu.inc' %]
283 [% INCLUDE 'intranet-bottom.inc' %]