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_[% KOHA_VERSION %].css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript">
10 function DeleteConfirm() {
11 var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]");
12 var answer = confirm(msg);
14 window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&label_element=batch&element_id=[% batch_id %]";
17 return; // abort delete
20 function dofocus() { // named function req'd for body onload event by some FF and IE7 security models
21 $(".focus:last").select();
23 function verifyBarcodes(barcodes) {
24 if (barcodes.value == '') {
25 alert(_("Please add barcodes using either the direct entry text area or the item search."));
26 return false; // not ok
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 getstr = items.join("&");
43 item_msg = item_num.join(", ");
44 var msg = _("Are you sure you want to remove label number(s): %s from this batch?").format(item_msg);
45 } 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"));
47 return; // no deletion for single item batch
50 alert(_("Please select at least one label to delete."));
51 return; // no item selected
53 var answer = confirm(msg);
55 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
58 return; // abort delete
62 var number_list = document.getElementById("number_list");
63 if (number_list.value == '') {
64 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');
67 document.forms["add_by_number"].submit();
71 function add_item(item_number) {
72 $("#itemnum_enter").prop("checked",true);
73 $("#number_list").val($("#number_list").val()+item_number+"\r\n");
76 function DeDuplicate() {
77 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
79 function Xport(mode) {
80 if (mode == 'label') {
82 if(document.items.action.length > 0) {
83 for (var i=0; i < document.items.action.length; i++) {
84 if (document.items.action[i].checked) {
85 labels.push("label_id=" + document.items.action[i].value);
88 if (labels.length < 1) {
89 alert(_("Please select at least one label to export."));
90 return; // no batch selected
92 getstr = labels.join("&");
94 else if (document.items.action.checked) {
95 getstr = document.items.action.value;
98 alert(_("Please select at least one label to export."));
99 return; // no batch selected
101 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800);
103 else if (mode == 'batch') {
104 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id %]", 400, 800);
107 // some pass-thru error trapping just in case...
110 function selected_layout() {
111 if (document.items.action.length) {
112 for (i=0;i<document.items.action.length;i++){
113 if (document.items.action[i].checked==true){
114 return(document.items.action[i].value);
119 if (document.items.action.checked){
120 return(document.items.action.value);
123 alert(_("Please select at least one item."));
127 $(document).ready(function() {
128 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
131 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
132 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
134 "aaSorting": [[ 0, "asc" ]],
135 "sPaginationType": "four_button"
137 $("#additems").click(function(){
141 $("#removeitems").click(function(){
145 $("#deletebatch").click(function(){
149 $("#deduplicate").click(function(){
153 $("#exportitems").click(function(){
157 $("#exportbatch").click(function(){
161 $(".delete").on("click", function(){
162 return confirmDelete( _("Are you sure you want to delete this?") );
164 $(".export").on("click", function(e){
166 var label_id = $(this).data("label-id");
167 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);
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> ›
183 Edit ([% batch_id %])
188 <div id="doc3" class="yui-t2">
192 [% INCLUDE 'labels-toolbar.inc' %]
194 [% BLOCK xlate_errtype %]
196 [% CASE 'ITEM_NOT_REMOVED' %]
197 <span>Item(s) not removed from batch [% batch_id %].</span>
198 [% CASE 'BATCH_NOT_DELETED' %]
199 <span>Batch [% batch_id %] was not deleted.</span>
200 [% CASE 'ITEM_NOT_ADDED' %]
201 <span>Item(s) not added to batch [% batch_id %].</span>
202 [% CASE 'BRANCH_NOT_SET' %]
203 <span>Library is not set, please set your library before adding items to a batch.</span>
204 [% CASE 'BATCH_NOT_DEDUP' %]
205 <span>Batch [% batch_id %] not fully de-duplicated.</span>
207 <span>Unknown error type [% errtype %].</span>
210 <div class="dialog alert">
211 <strong>WARNING:</strong> An error was encountered: [% PROCESS xlate_errtype %] Please have your system administrator check the error log for details.
213 [% ELSIF ( duplicate_message ) %]
214 <div class="dialog message">
215 <strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong>
219 <div id="manage-label-batches">
220 <div class="hint">Current library: [% LoginBranchname %]</div>
221 <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
223 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
225 <input type="hidden" name="op" value="add" />
226 <input type="hidden" name="batch_id" value="[% batch_id %]" />
229 <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
230 <label for="barcode_enter">Enter by barcode:</label><br/>
231 <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" />
232 <label for="itemnum_enter">Enter by itemnumber:</label>
235 <label for="number_list">Add by barcode(s) or itemnumbers(s):
236 <br /> <span class="hint">One number per line.</span>
237 <br /> <span class="hint">Leave empty to add via item search (itemnumber).</span>
239 <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea>
244 <div id="batch-manage" class="btn-toolbar">
245 <a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %]
246 <a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a>
247 <a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a>
248 <a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a>
249 <a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a>
250 <a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %]
252 [% IF ( table_loop ) %]
253 <form name="items" class="checkboxed">
254 <h2>Items in batch number [% batch_id %]</h2>
256 [% FOREACH table_loo IN table_loop %]
257 [% IF ( table_loo.header_fields ) %]
260 [% FOREACH header_field IN table_loo.header_fields %]
261 [% SWITCH header_field.field_label -%]
262 [% CASE "Label number" -%]
263 <th>Label number</th>
264 [% CASE "Summary" -%]
265 <th class="anti-the">Summary</th>
266 [% CASE "Item type" %]
268 [% CASE "Call number" %]
275 <th>[% header_field.field_label %]</th>
283 [% FOREACH text_field IN table_loo.text_fields %]
284 [% IF ( text_field.select_field ) %]
286 <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>
287 <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>
289 <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
292 [% IF ( text_field.field_name == '_item_type_tbl' ) %]
293 [% ItemTypes.GetDescription( text_field.field_value ) %]
295 [% text_field.field_value %]
307 <div class="dialog message">
308 <h4>There are no items in this batch yet</h4>
309 <p>Add items by using the text area above or leave empty to add via item search.</p>
316 [% INCLUDE 'tools-menu.inc' %]
319 [% INCLUDE 'intranet-bottom.inc' %]