1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Tools › Patron card creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]Create[% 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
23 if(document.items.action.length > 0) {
24 for (var i=0; i < document.items.action.length; i++) {
25 if (document.items.action[i].checked) {
26 items.push("label_id=" + document.items.action[i].value);
30 if (items.length < 1) {
31 alert(_("Please select at least one item to delete."));
32 return; // no item selected
34 getstr = items.join("&");
35 item_msg = item_num.join(", ");
36 var msg = _("Are you sure you want to remove card number(s): %s from this batch?").format(item_msg);
39 alert(_("Please select at least label 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, 700, 800);
94 else if (mode == 'batch') {
95 return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 700, 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"
126 $("#additems").click(function(){
130 $("#removeitems").click(function(){
134 $("#deletebatch").click(function(){
138 $("#deduplicate").click(function(){
142 $("#exportitems").click(function(){
146 $("#exportbatch").click(function(){
154 <body id="pcard_edit-batch" class="tools pcard">
155 [% INCLUDE 'header.inc' %]
156 [% INCLUDE 'cat-search.inc' %]
157 <div id="breadcrumbs">
158 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
159 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
160 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
161 <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=batch">Batches</a> ›
163 Edit ([% batch_id %])
168 <div id="doc3" class="yui-t2">
173 [% INCLUDE 'patroncards-toolbar.inc' %]
174 <div class="yui-u first">
179 [% IF ( duplicate_message ) %]
180 <div class="dialog message">
181 <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %].
185 [% INCLUDE 'patroncards-errors.inc' %]
186 <div id="manage-patroncard-batches">
187 <div class="hint">Current library: [% LoginBranchname %]</div>
188 <form name="add_by_bor_num" action="/cgi-bin/koha/patroncards/edit-batch.pl" method="post">
190 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
192 <input type="hidden" name="op" value="add" />
193 <input type="hidden" name="batch_id" value="[% batch_id %]" />
194 <label for="bor_num_list">Add by borrowernumber(s):
195 <br /> <span class="hint">One borrowernumber per line.</span>
197 <textarea rows="5" id="bor_num_list" name="bor_num_list" tabindex="1" class="focus"></textarea>
202 <div id="batch-manage" class="action">
203 <a class="btn btn-small" id="additems" href="#"><icon class="fa fa-plus"></icon> Add patron(s)</a>[% IF ( table_loop ) %]
204 <a class="btn btn-small" id="removeitems" href="#"><icon class="fa fa-trash"></icon> Remove selected patrons</a>
205 <a class="btn btn-small" id="deduplicate" href="#"><icon class="fa fa-minus"></icon> Remove duplicates</a>
206 <a class="btn btn-small" id="exportitems" href="#"><icon class="fa fa-share-square-o"></icon> Export selected card(s)</a>
207 <a class="btn btn-small" id="exportbatch" href="#"><icon class="fa fa-share-square-o"></icon> Export card batch</a>[% END %]
209 [% IF ( table_loop ) %]
210 <form name="items" class="checkboxed">
211 <h2>Items in batch number [% batch_id %]</h2>
213 [% FOREACH table_loo IN table_loop %]
214 [% IF ( table_loo.header_fields ) %]
217 [% FOREACH header_field IN table_loo.header_fields %]
218 [% SWITCH header_field.field_label -%]
219 [% CASE "Summary" -%]
220 <th>Borrower name</th>
221 [% CASE "Borrower Number" %]
222 <th>Borrower number</th>
223 [% CASE "Actions " %]
228 <th>[% header_field.field_label %]</th>
236 [% FOREACH text_field IN table_loo.text_fields %]
237 [% IF ( text_field.select_field ) %]
239 <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>
240 <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>
242 <td><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
244 <td>[% text_field.field_value %]</td>
254 <fieldset class="rows" style="border-bottom: 0px; border: 0px;">
256 <div class="dialog message">
257 <h4>There are no items in this batch yet</h4>
258 <p>Add items by borrowernumber using the text area above or leave empty to add via patron search.</p>
267 [% INCLUDE 'intranet-bottom.inc' %]