1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Labels › Manage label batches</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'greybox.inc' %]
5 <script type="text/javascript">
7 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
8 $(".focus:last").select();
10 function verifyBarcodes(barcodes) {
11 if (barcodes.value == '') {
12 alert(_("Please add barcodes using either the direct entry text area or the item search."));
13 return false; // not ok
19 function DeleteConfirm() {
20 var msg = "Are you sure you want to delete batch [% batch_id %]?"
21 var answer = confirm(msg);
23 window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id %]";
26 return; // abort delete
32 if(document.items.action.length > 0) {
33 for (var i=0; i < document.items.action.length; i++) {
34 if (document.items.action[i].checked) {
35 items.push("label_id=" + document.items.action[i].value);
39 if (items.length < 1) {
40 alert(_("Please select at least one item to delete."));
41 return; // no item selected
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?"
47 // else if (document.items.action.checked) {
48 // getstr = "label_id="+document.items.action.value;
49 // var msg = "Are you sure you want to remove selected item from this batch?"
52 alert(_("Please select at least label to delete."));
53 return; // no item selected
55 var answer = confirm(msg);
57 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
60 return; // abort delete
64 var barcodes = document.getElementById("barcode");
65 if (barcodes.value == '') {
66 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');
69 document.forms["add_by_barcode"].submit();
72 function DeDuplicate() {
73 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
75 function Xport(mode) {
76 if (mode == 'label') {
78 if(document.items.action.length > 0) {
79 for (var i=0; i < document.items.action.length; i++) {
80 if (document.items.action[i].checked) {
81 labels.push("label_id=" + document.items.action[i].value);
84 if (labels.length < 1) {
85 alert(_("Please select at least one label to export."));
86 return; // no batch selected
88 getstr = labels.join("&");
90 else if (document.items.action.checked) {
91 getstr = document.items.action.value;
94 alert(_("Please select at least one label to export."));
95 return; // no batch selected
97 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
99 else if (mode == 'batch') {
100 return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 700, 800);
103 // some pass-thru error trapping just in case...
106 function selected_layout() {
107 if (document.items.action.length) {
108 for (i=0;i<document.items.action.length;i++){
109 if (document.items.action[i].checked==true){
110 return(document.items.action[i].value);
115 if (document.items.action.checked){
116 return(document.items.action.value);
119 alert(_("Please select at least one item."));
123 $(document).ready(function() {
124 $("#additems").click(function(){
128 $("#removeitems").click(function(){
132 $("#deletebatch").click(function(){
136 $("#deduplicate").click(function(){
140 $("#exportitems").click(function(){
144 $("#exportbatch").click(function(){
152 <body id="labels_label-edit-batch" class="tools labels" onload="dofocus();">
153 [% INCLUDE 'header.inc' %]
154 [% INCLUDE 'cat-search.inc' %]
155 <div id="breadcrumbs">
156 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
157 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
158 <a href="/cgi-bin/koha/labels/label-home.pl">Labels home</a> ›
159 <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Manage label batches</a> ›
160 Manage batch number [% batch_id %]
162 <div id="doc3" class="yui-t2">
166 <div id="toolbar" class="btn-toolbar">
167 <a class="btn btn-small" id="additems" href="#">Add item(s)</a>[% IF ( table_loop ) %]
168 <a class="btn btn-small" id="removeitems" href="#">Remove item(s)</a>
169 <a class="btn btn-small" id="deletebatch" href="#">Delete batch</a>
170 <a class="btn btn-small" id="deduplicate" href="#">Remove duplicates</a>
171 <a class="btn btn-small" id="exportitems" href="#">Export item(s)</a>
172 <a class="btn btn-small" id="exportbatch" href="#">Export batch</a>[% END %]
175 <div class="yui-u first" id="manage-label-batches">
176 <div class="hint">Current library: [% LoginBranchname %]</div>
177 <form name="add_by_barcode" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
179 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
181 <input type="hidden" name="op" value="add" \>
182 <input type="hidden" name="batch_id" value="[% batch_id %]" \>
183 <label for="barcode">Add by barcode(s):
184 <br \> <span class="hint">One barcode per line.</span>
185 <br \> <span class="hint">Leave empty to add via item search.</span>
187 <textarea rows="5" id="barcode" name="barcode" tabindex="1" class="focus"></textarea>
192 [% IF ( table_loop ) %]
193 <form name="items" class="checkboxed">
194 <h2>Items in batch number [% batch_id %]</h2>
196 [% FOREACH table_loo IN table_loop %]
197 [% IF ( table_loo.header_fields ) %]
199 [% FOREACH header_field IN table_loo.header_fields %]
200 <th>[% header_field.field_label %]</th>
205 [% FOREACH text_field IN table_loo.text_fields %]
206 [% IF ( text_field.select_field ) %]
207 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
209 <td>[% text_field.field_value %]</td>
218 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
220 <div class="dialog message">
221 <h4>There are no items in Batch [% batch_id %] yet</h4>
222 <p>Add items by barcode using the text area above or leave empty to add via item search.</p>
230 <div class="dialog alert">
231 <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details.
234 [% ELSIF ( duplicate_message ) %]
236 <div class="dialog message">
237 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
245 [% INCLUDE 'labels-menu.inc' %]
249 [% INCLUDE 'intranet-bottom.inc' %]