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 <script type="text/javascript">
7 function DeleteConfirm() {
8 var msg = _("Are you sure you want to delete batch") + " [% batch_id %]?";
9 var answer = confirm(msg);
11 window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id %]";
14 return; // abort delete
20 if(document.items.action.length > 0) {
21 for (var i=0; i < document.items.action.length; i++) {
22 if (document.items.action[i].checked) {
23 items.push("label_id=" + document.items.action[i].value);
27 if (items.length < 1) {
28 alert(_("Please select at least one item to delete."));
29 return; // no item selected
31 getstr = items.join("&");
32 item_msg = item_num.join(", ");
33 var msg = "Are you sure you want to remove card number(s): " + item_msg + " from this batch?"
36 alert(_("Please select at least label to delete."));
37 return; // no item selected
39 var answer = confirm(msg);
41 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
44 return; // abort delete
48 window.open("/cgi-bin/koha/patroncards/members-search.pl?batch_id=[% batch_id %]",'FindABibIndex','width=875,height=400,toolbar=no,scrollbars=yes');
50 function DeDuplicate() {
51 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
53 function Xport(mode) {
54 if (mode == 'label') {
55 patroncards= new Array;
56 if(document.items.action.length > 0) {
57 for (var i=0; i < document.items.action.length; i++) {
58 if (document.items.action[i].checked) {
59 patroncards.push("label_id=" + document.items.action[i].value);
62 if (patroncards.length < 1) {
63 alert(_("Please select at least one card to export."));
64 return; // no batch selected
66 getstr = patroncards.join("&");
68 else if (document.items.action.checked) {
69 getstr = document.items.action.value;
72 alert(_("Please select at least one card to export."));
73 return; // no batch selected
75 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 700, 800);
77 else if (mode == 'batch') {
78 return GB_showCenter(_("Export labels"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 700, 800);
81 // some pass-thru error trapping just in case...
84 function selected_layout() {
85 if (document.items.action.length) {
86 for (i=0;i<document.items.action.length;i++){
87 if (document.items.action[i].checked==true){
88 return(document.items.action[i].value);
93 if (document.items.action.checked){
94 return(document.items.action.value);
97 alert(_("Please select at least one item."));
101 $(document).ready(function() {
102 $("#additems").click(function(){
106 $("#removeitems").click(function(){
110 $("#deletebatch").click(function(){
114 $("#deduplicate").click(function(){
118 $("#exportitems").click(function(){
122 $("#exportbatch").click(function(){
130 <body id="pcard_edit-batch" class="tools pcard">
131 [% INCLUDE 'header.inc' %]
132 [% INCLUDE 'cat-search.inc' %]
133 <div id="breadcrumbs">
134 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
135 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
136 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
137 <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=batch">Manage patron card batches</a> ›
138 Manage batch number [% batch_id %]
140 <div id="doc3" class="yui-t2">
145 <div id="toolbar" class="btn-toolbar">
146 <a class="btn btn-small" id="additems" href="#">Add item(s)</a>[% IF ( table_loop ) %]
147 <a class="btn btn-small" id="removeitems" href="#">Remove item(s)</a>
148 <a class="btn btn-small" id="deletebatch" href="#">Delete batch</a>
149 <a class="btn btn-small" id="deduplicate" href="#">Remove duplicates</a>
150 <a class="btn btn-small" id="exportitems" href="#">Export item(s)</a>
151 <a class="btn btn-small" id="exportbatch" href="#">Export batch</a>[% END %]
155 [% INCLUDE 'error-messages.inc' %]
157 <div class="yui-u first" id="manage-patroncard-batches">
158 <div class="hint">Current library: [% LoginBranchname %]</div>
159 [% IF ( table_loop ) %]
160 <form name="items" class="checkboxed">
161 <h2>Items in batch number [% batch_id %]</h2>
163 [% FOREACH table_loo IN table_loop %]
164 [% IF ( table_loo.header_fields ) %]
166 [% FOREACH header_field IN table_loo.header_fields %]
167 <th>[% header_field.field_label %]</th>
172 [% FOREACH text_field IN table_loo.text_fields %]
173 [% IF ( text_field.select_field ) %]
174 <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]"></td>
176 <td>[% text_field.field_value %]</td>
185 <div class="dialog message"><h4>There are no items in batch [% batch_id %] yet</h4>
186 <p>Use the toolbar above to add items.</p></div>
189 [% IF ( duplicate_message ) %]
191 <div class="dialog message">
192 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
200 [% INCLUDE 'patroncards-menu.inc' %]
204 [% INCLUDE 'intranet-bottom.inc' %]