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 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
11 $(".focus:last").select();
13 function verifyBarcodes(barcodes) {
14 if (barcodes.value == '') {
15 alert(_("Please add barcodes using either the direct entry text area or the item search."));
16 return false; // not ok
22 function DeleteConfirm() {
23 var msg = "Are you sure you want to delete batch [% batch_id %]?"
24 var answer = confirm(msg);
26 window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id %]";
29 return; // abort delete
35 if(document.items.action.length > 0) {
36 for (var i=0; i < document.items.action.length; i++) {
37 if (document.items.action[i].checked) {
38 items.push("label_id=" + document.items.action[i].value);
42 if (items.length < 1) {
43 alert(_("Please select at least one item to delete."));
44 return; // no item selected
46 getstr = items.join("&");
47 item_msg = item_num.join(", ");
48 var msg = "Are you sure you want to remove label number(s): " + item_msg + " from this batch?"
50 // else if (document.items.action.checked) {
51 // getstr = "label_id="+document.items.action.value;
52 // var msg = "Are you sure you want to remove selected item from this batch?"
55 alert(_("Please select at least label to delete."));
56 return; // no item selected
58 var answer = confirm(msg);
60 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
63 return; // abort delete
67 var barcodes = document.getElementById("barcode");
68 if (barcodes.value == '') {
69 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');
72 document.forms["add_by_barcode"].submit();
75 function DeDuplicate() {
76 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
78 function Xport(mode) {
79 if (mode == 'label') {
81 if(document.items.action.length > 0) {
82 for (var i=0; i < document.items.action.length; i++) {
83 if (document.items.action[i].checked) {
84 labels.push("label_id=" + document.items.action[i].value);
87 if (labels.length < 1) {
88 alert(_("Please select at least one label to export."));
89 return; // no batch selected
91 getstr = labels.join("&");
93 else if (document.items.action.checked) {
94 getstr = document.items.action.value;
97 alert(_("Please select at least one label to export."));
98 return; // no batch selected
100 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
102 else if (mode == 'batch') {
103 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 700, 800);
106 // some pass-thru error trapping just in case...
109 function selected_layout() {
110 if (document.items.action.length) {
111 for (i=0;i<document.items.action.length;i++){
112 if (document.items.action[i].checked==true){
113 return(document.items.action[i].value);
118 if (document.items.action.checked){
119 return(document.items.action.value);
122 alert(_("Please select at least one item."));
126 $(document).ready(function() {
127 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
129 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
130 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
132 "aaSorting": [[ 1, "asc" ]],
133 "sPaginationType": "four_button"
135 $("#additems").click(function(){
139 $("#removeitems").click(function(){
143 $("#deletebatch").click(function(){
147 $("#deduplicate").click(function(){
151 $("#exportitems").click(function(){
155 $("#exportbatch").click(function(){
163 <body id="labels_label-edit-batch" class="tools labels" onload="dofocus();">
164 [% INCLUDE 'header.inc' %]
165 [% INCLUDE 'cat-search.inc' %]
166 <div id="breadcrumbs">
167 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
168 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
169 <a href="/cgi-bin/koha/labels/label-home.pl">Labels home</a> ›
170 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Manage label batches</a> ›
171 Manage batch number [% batch_id %]
173 <div id="doc3" class="yui-t2">
177 <div id="toolbar" class="btn-toolbar">
178 <a class="btn btn-small" id="additems" href="#">Add item(s)</a>[% IF ( table_loop ) %]
179 <a class="btn btn-small" id="removeitems" href="#">Remove item(s)</a>
180 <a class="btn btn-small" id="deletebatch" href="#">Delete batch</a>
181 <a class="btn btn-small" id="deduplicate" href="#">Remove duplicates</a>
182 <a class="btn btn-small" id="exportitems" href="#">Export item(s)</a>
183 <a class="btn btn-small" id="exportbatch" href="#">Export batch</a>[% END %]
187 <div class="dialog alert">
188 <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details.
190 [% ELSIF ( duplicate_message ) %]
191 <div class="dialog message">
192 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
196 <div id="manage-label-batches">
197 <div class="hint">Current library: [% LoginBranchname %]</div>
198 <form name="add_by_barcode" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
200 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
202 <input type="hidden" name="op" value="add" />
203 <input type="hidden" name="batch_id" value="[% batch_id %]" />
204 <label for="barcode">Add by barcode(s):
205 <br /> <span class="hint">One barcode per line.</span>
206 <br /> <span class="hint">Leave empty to add via item search.</span>
208 <textarea rows="5" id="barcode" name="barcode" tabindex="1" class="focus"></textarea>
213 [% IF ( table_loop ) %]
214 <form name="items" class="checkboxed">
215 <h2>Items in batch number [% batch_id %]</h2>
217 [% FOREACH table_loo IN table_loop %]
218 [% IF ( table_loo.header_fields ) %]
221 [% FOREACH header_field IN table_loo.header_fields %]
222 [% SWITCH header_field.field_label -%]
223 [% CASE "Label Number" -%]
224 <th>Label number</th>
225 [% CASE "Summary" -%]
226 <th class="anti-the">Summary</th>
227 [% CASE "Item Type" %]
234 <th>[% header_field.field_label %]</th>
242 [% FOREACH text_field IN table_loo.text_fields %]
243 [% IF ( text_field.select_field ) %]
244 <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
247 [% IF ( text_field.field_name == '_item_type_tbl' ) %]
248 [% ItemTypes.GetDescription( text_field.field_value ) %]
250 [% text_field.field_value %]
262 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
264 <div class="dialog message">
265 <h4>There are no items in Batch [% batch_id %] yet</h4>
266 <p>Add items by barcode using the text area above or leave empty to add via item search.</p>
275 [% INCLUDE 'labels-menu.inc' %]
278 [% INCLUDE 'intranet-bottom.inc' %]