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 <div class="dialog alert">
195 <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details.
197 [% ELSIF ( duplicate_message ) %]
198 <div class="dialog message">
199 <strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong>
203 <div id="manage-label-batches">
204 <div class="hint">Current library: [% LoginBranchname %]</div>
205 <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
207 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
209 <input type="hidden" name="op" value="add" />
210 <input type="hidden" name="batch_id" value="[% batch_id %]" />
213 <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked />
214 <label for="barcode_enter">Enter by barcode:</label><br/>
215 <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" />
216 <label for="itemnum_enter">Enter by itemnumber:</label>
219 <label for="number_list">Add by barcode(s) or itemnumbers(s):
220 <br /> <span class="hint">One number per line.</span>
221 <br /> <span class="hint">Leave empty to add via item search (itemnumber).</span>
223 <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea>
228 <div id="batch-manage" class="btn-toolbar">
229 <a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %]
230 <a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a>
231 <a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a>
232 <a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a>
233 <a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a>
234 <a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %]
236 [% IF ( table_loop ) %]
237 <form name="items" class="checkboxed">
238 <h2>Items in batch number [% batch_id %]</h2>
240 [% FOREACH table_loo IN table_loop %]
241 [% IF ( table_loo.header_fields ) %]
244 [% FOREACH header_field IN table_loo.header_fields %]
245 [% SWITCH header_field.field_label -%]
246 [% CASE "Label number" -%]
247 <th>Label number</th>
248 [% CASE "Summary" -%]
249 <th class="anti-the">Summary</th>
250 [% CASE "Item type" %]
252 [% CASE "Call number" %]
259 <th>[% header_field.field_label %]</th>
267 [% FOREACH text_field IN table_loo.text_fields %]
268 [% IF ( text_field.select_field ) %]
270 <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>
271 <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>
273 <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
276 [% IF ( text_field.field_name == '_item_type_tbl' ) %]
277 [% ItemTypes.GetDescription( text_field.field_value ) %]
279 [% text_field.field_value %]
291 <div class="dialog message">
292 <h4>There are no items in this batch yet</h4>
293 <p>Add items by using the text area above or leave empty to add via item search.</p>
300 [% INCLUDE 'tools-menu.inc' %]
303 [% INCLUDE 'intranet-bottom.inc' %]