1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Patron card creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</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 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this patron from the card batch?");
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/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id %]";
17 return; // abort delete
24 if(document.items.action.length > 0) {
25 for (var i=0; i < document.items.action.length; i++) {
26 if (document.items.action[i].checked) {
27 items.push("label_id=" + document.items.action[i].value);
31 getstr = items.join("&");
32 item_msg = item_num.join(", ");
33 var msg = _("Are you sure you want to remove card number(s): %s from this batch?").format(item_msg);
34 } else if (document.items.action.checked) {
35 alert(_("Deletion of patron from a batch with only one patron will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar"));
36 return; // no deletion for single item batch
39 alert(_("Please select at least one patron to delete."));
40 return; // no item selected
42 var answer = confirm(msg);
44 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr;
47 return; // abort delete
51 var bor_nums = document.getElementById("bor_num_list");
52 if (bor_nums.value == '') {
53 window.open("/cgi-bin/koha/patroncards/add_user_search.pl",
55 'width=740,height=450,location=yes,toolbar=no,'
56 + 'scrollbars=yes,resize=yes');
59 document.forms["add_by_bor_num"].submit();
63 function add_user(borrowernumber) {
64 $("#bor_num_list").val($("#bor_num_list").val()+borrowernumber+"\r\n");
67 function DeDuplicate() {
68 window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]";
70 function Xport(mode) {
71 if (mode == 'label') {
72 patroncards= new Array;
73 if(document.items.action.length > 0) {
74 for (var i=0; i < document.items.action.length; i++) {
75 if (document.items.action[i].checked) {
76 patroncards.push("label_id=" + document.items.action[i].value);
79 if (patroncards.length < 1) {
80 alert(_("Please select at least one card to export."));
81 return; // no batch selected
83 getstr = patroncards.join("&");
85 else if (document.items.action.checked) {
86 getstr = document.items.action.value;
89 alert(_("Please select at least one card to export."));
90 return; // no batch selected
92 return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800);
94 else if (mode == 'batch') {
95 return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 400, 800);
98 // some pass-thru error trapping just in case...
101 function selected_layout() {
102 if (document.items.action.length) {
103 for (i=0;i<document.items.action.length;i++){
104 if (document.items.action[i].checked==true){
105 return(document.items.action[i].value);
110 if (document.items.action.checked){
111 return(document.items.action.value);
114 alert(_("Please select at least one item."));
118 $(document).ready(function() {
119 $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, {
121 { "aTargets": [ -2, -1 ], "bSortable": false, "bSearchable": false }
123 "aaSorting": [[ 0, "asc" ]],
124 "sPaginationType": "four_button",
127 $("#additems").click(function(){
131 $("#removeitems").click(function(){
135 $("#deletebatch").click(function(){
139 $("#deduplicate").click(function(){
143 $("#exportitems").click(function(){
147 $("#exportbatch").click(function(){
155 <body id="pcard_edit-batch" class="tools pcard">
156 [% INCLUDE 'header.inc' %]
157 [% INCLUDE 'cat-search.inc' %]
158 <div id="breadcrumbs">
159 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
160 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
161 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
162 <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=batch">Batches</a> ›
164 Edit ([% batch_id %])
169 <div id="doc3" class="yui-t2">
174 [% INCLUDE 'patroncards-toolbar.inc' %]
175 <div class="yui-u first">
180 [% IF ( duplicate_message ) %]
181 <div class="dialog message">
182 <strong>[% duplicate_count %] duplicate patron(s) found</strong> and removed from batch [% batch_id %].
186 [% INCLUDE 'patroncards-errors.inc' %]
187 <div id="manage-patroncard-batches">
188 <div class="hint">Current library: [% LoginBranchname %]</div>
189 <form name="add_by_bor_num" action="/cgi-bin/koha/patroncards/edit-batch.pl" method="post">
191 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
193 <input type="hidden" name="op" value="add" />
194 <input type="hidden" name="batch_id" value="[% batch_id %]" />
195 <label for="bor_num_list">Add by borrowernumber(s):
196 <br /> <span class="hint">One borrowernumber per line.</span>
198 <textarea rows="5" id="bor_num_list" name="bor_num_list" tabindex="1" class="focus"></textarea>
203 <div id="batch-manage" class="action">
204 <a class="btn btn-small" id="additems" href="#"><icon class="fa fa-plus"></icon> Add patron(s)</a>[% IF ( table_loop ) %]
205 <a class="btn btn-small" id="removeitems" href="#"><icon class="fa fa-trash"></icon> Remove selected patrons</a>
206 <a class="btn btn-small" id="deletebatch" href="#"><icon class="fa fa-minus-square"></icon> Delete batch</a>
207 <a class="btn btn-small" id="deduplicate" href="#"><icon class="fa fa-minus"></icon> Remove duplicates</a>
208 <a class="btn btn-small" id="exportitems" href="#"><icon class="fa fa-share-square-o"></icon> Export selected card(s)</a>
209 <a class="btn btn-small" id="exportbatch" href="#"><icon class="fa fa-share-square-o"></icon> Export card batch</a>[% END %]
211 [% IF ( table_loop ) %]
212 <form name="items" class="checkboxed">
213 <h2>Patrons in batch number [% batch_id %]</h2>
215 [% FOREACH table_loo IN table_loop %]
216 [% IF ( table_loo.header_fields ) %]
219 [% FOREACH header_field IN table_loo.header_fields %]
220 [% SWITCH header_field.field_label -%]
221 [% CASE "Summary" -%]
222 <th>Borrower name</th>
223 [% CASE "Borrower Number" %]
224 <th>Borrower number</th>
225 [% CASE "Actions " %]
230 <th>[% header_field.field_label %]</th>
238 [% FOREACH text_field IN table_loo.text_fields %]
239 [% IF ( text_field.select_field ) %]
241 <a class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);" href="/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&label_id=[% text_field.field_value %]"><icon class="fa fa-trash"></icon> Delete</a>
242 <a class="btn btn-mini" href="#" onclick="GB_showCenter('Export single card','/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&label_id=[% text_field.field_value %]')"><icon class="fa fa-share-square-o"></icon> Export</a>
244 <td><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
246 <td>[% text_field.field_value %]</td>
256 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
258 <div class="dialog message">
259 <h4>There are no patrons in this batch yet</h4>
260 <p>Add patrons by borrowernumber using the text area above or leave empty to add via patron search.</p>
269 [% INCLUDE 'intranet-bottom.inc' %]