1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Patron card creator › Manage patron card batches</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'greybox.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript">
9 function DeleteConfirm() {
10 var msg = _("Are you sure you want to delete batch") + " [% batch_id %]?";
11 var answer = confirm(msg);
13 window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id %]";
16 return; // abort delete
22 if(document.items.action.length > 0) {
23 for (var i=0; i < document.items.action.length; i++) {
24 if (document.items.action[i].checked) {
25 items.push("label_id=" + document.items.action[i].value);
29 if (items.length < 1) {
30 alert(_("Please select at least one item to delete."));
31 return; // no item selected
33 getstr = items.join("&");
34 item_msg = item_num.join(", ");
35 var msg = "Are you sure you want to remove card number(s): " + item_msg + " from this batch?"
38 alert(_("Please select at least label to delete."));
39 return; // no item selected
41 var answer = confirm(msg);
43 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
46 return; // abort delete
50 window.open("/cgi-bin/koha/patroncards/members-search.pl?batch_id=[% batch_id %]",'FindABibIndex','width=875,height=400,toolbar=no,scrollbars=yes');
52 function DeDuplicate() {
53 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
55 function Xport(mode) {
56 if (mode == 'label') {
57 patroncards= new Array;
58 if(document.items.action.length > 0) {
59 for (var i=0; i < document.items.action.length; i++) {
60 if (document.items.action[i].checked) {
61 patroncards.push("label_id=" + document.items.action[i].value);
64 if (patroncards.length < 1) {
65 alert(_("Please select at least one card to export."));
66 return; // no batch selected
68 getstr = patroncards.join("&");
70 else if (document.items.action.checked) {
71 getstr = document.items.action.value;
74 alert(_("Please select at least one card to export."));
75 return; // no batch selected
77 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
79 else if (mode == 'batch') {
80 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 700, 800);
83 // some pass-thru error trapping just in case...
86 function selected_layout() {
87 if (document.items.action.length) {
88 for (i=0;i<document.items.action.length;i++){
89 if (document.items.action[i].checked==true){
90 return(document.items.action[i].value);
95 if (document.items.action.checked){
96 return(document.items.action.value);
99 alert(_("Please select at least one item."));
103 $(document).ready(function() {
104 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
106 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
108 "aaSorting": [[ 1, "asc" ]],
109 "sPaginationType": "four_button"
111 $("#additems").click(function(){
115 $("#removeitems").click(function(){
119 $("#deletebatch").click(function(){
123 $("#deduplicate").click(function(){
127 $("#exportitems").click(function(){
131 $("#exportbatch").click(function(){
139 <body id="pcard_edit-batch" class="tools pcard">
140 [% INCLUDE 'header.inc' %]
141 [% INCLUDE 'cat-search.inc' %]
142 <div id="breadcrumbs">
143 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
144 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
145 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
146 <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=batch">Manage patron card batches</a> ›
147 Manage batch number [% batch_id %]
149 <div id="doc3" class="yui-t2">
154 <div id="toolbar" class="btn-toolbar">
155 <a class="btn btn-small" id="additems" href="#">Add item(s)</a>[% IF ( table_loop ) %]
156 <a class="btn btn-small" id="removeitems" href="#">Remove item(s)</a>
157 <a class="btn btn-small" id="deletebatch" href="#">Delete batch</a>
158 <a class="btn btn-small" id="deduplicate" href="#">Remove duplicates</a>
159 <a class="btn btn-small" id="exportitems" href="#">Export item(s)</a>
160 <a class="btn btn-small" id="exportbatch" href="#">Export batch</a>[% END %]
163 [% IF ( duplicate_message ) %]
164 <div class="dialog message">
165 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
169 [% INCLUDE 'patroncards-errors.inc' %]
170 <div id="manage-patroncard-batches">
171 <div class="hint">Current library: [% LoginBranchname %]</div>
172 [% IF ( table_loop ) %]
173 <form name="items" class="checkboxed">
174 <h2>Items in batch number [% batch_id %]</h2>
176 [% FOREACH table_loo IN table_loop %]
177 [% IF ( table_loo.header_fields ) %]
180 [% FOREACH header_field IN table_loo.header_fields %]
181 [% SWITCH header_field.field_label -%]
182 [% CASE "Card Number" -%]
184 [% CASE "Summary" -%]
186 [% CASE "Borrower Number" %]
187 <th>Borrower number</th>
191 <th>[% header_field.field_label %]</th>
199 [% FOREACH text_field IN table_loo.text_fields %]
200 [% IF ( text_field.select_field ) %]
201 <td><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
203 <td>[% text_field.field_value %]</td>
213 <div class="dialog message">
214 <h4>There are no items in batch [% batch_id %] yet</h4>
215 <p>Use the toolbar above to add items.</p></div>
221 [% INCLUDE 'patroncards-menu.inc' %]
224 [% INCLUDE 'intranet-bottom.inc' %]