|
Lines 1-162
Link Here
|
|
|
1 |
[% SET footerjs = 1 %] |
| 1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 2 |
<title>Koha › Tools › Patron card creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</title> |
3 |
<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 'doc-head-close.inc' %] |
| 4 |
[% INCLUDE 'greybox.inc' %] |
5 |
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> |
| 5 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> |
|
|
| 6 |
[% INCLUDE 'datatables.inc' %] |
| 7 |
<script type="text/javascript"> |
| 8 |
//<![CDATA[ |
| 9 |
function DeleteConfirm() { |
| 10 |
var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); |
| 11 |
var answer = confirm(msg); |
| 12 |
if (answer) { |
| 13 |
window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id %]"; |
| 14 |
} |
| 15 |
else { |
| 16 |
return; // abort delete |
| 17 |
} |
| 18 |
}; |
| 19 |
function Remove() { |
| 20 |
items = new Array; |
| 21 |
|
| 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); |
| 26 |
} |
| 27 |
} |
| 28 |
getstr = items.join("&"); |
| 29 |
var msg = _("Are you sure you want to remove the selected patron(s) from this batch?"); |
| 30 |
} else if (document.items.action.checked) { |
| 31 |
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")); |
| 32 |
return; // no deletion for single item batch |
| 33 |
} |
| 34 |
else { |
| 35 |
alert(_("Please select at least one patron to delete.")); |
| 36 |
return; // no item selected |
| 37 |
} |
| 38 |
var answer = confirm(msg); |
| 39 |
if (answer) { |
| 40 |
window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr; |
| 41 |
} |
| 42 |
else { |
| 43 |
return; // abort delete |
| 44 |
} |
| 45 |
}; |
| 46 |
function Add() { |
| 47 |
var bor_nums = document.getElementById("bor_num_list"); |
| 48 |
if (bor_nums.value == '') { |
| 49 |
window.open("/cgi-bin/koha/patroncards/add_user_search.pl", |
| 50 |
'PatronPopup', |
| 51 |
'width=840,height=500,location=yes,toolbar=no,' |
| 52 |
+ 'scrollbars=yes,resize=yes'); |
| 53 |
} |
| 54 |
else { |
| 55 |
document.forms["add_by_bor_num"].submit(); |
| 56 |
} |
| 57 |
}; |
| 58 |
|
| 59 |
function add_user(borrowernumber) { |
| 60 |
$("#bor_num_list").val($("#bor_num_list").val()+borrowernumber+"\r\n"); |
| 61 |
} |
| 62 |
|
| 63 |
function DeDuplicate() { |
| 64 |
window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]"; |
| 65 |
}; |
| 66 |
function Xport(mode) { |
| 67 |
if (mode == 'label') { |
| 68 |
patroncards= new Array; |
| 69 |
if(document.items.action.length > 0) { |
| 70 |
for (var i=0; i < document.items.action.length; i++) { |
| 71 |
if (document.items.action[i].checked) { |
| 72 |
patroncards.push("label_id=" + document.items.action[i].value); |
| 73 |
} |
| 74 |
} |
| 75 |
if (patroncards.length < 1) { |
| 76 |
alert(_("Please select at least one card to export.")); |
| 77 |
return; // no batch selected |
| 78 |
} |
| 79 |
getstr = patroncards.join("&"); |
| 80 |
} |
| 81 |
else if (document.items.action.checked) { |
| 82 |
getstr = document.items.action.value; |
| 83 |
} |
| 84 |
else { |
| 85 |
alert(_("Please select at least one card to export.")); |
| 86 |
return; // no batch selected |
| 87 |
} |
| 88 |
return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800); |
| 89 |
} |
| 90 |
else if (mode == 'batch') { |
| 91 |
return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 400, 800); |
| 92 |
} |
| 93 |
else { |
| 94 |
// some pass-thru error trapping just in case... |
| 95 |
} |
| 96 |
}; |
| 97 |
function selected_layout() { |
| 98 |
if (document.items.action.length) { |
| 99 |
for (i=0;i<document.items.action.length;i++){ |
| 100 |
if (document.items.action[i].checked==true){ |
| 101 |
return(document.items.action[i].value); |
| 102 |
} |
| 103 |
}; |
| 104 |
} |
| 105 |
else { |
| 106 |
if (document.items.action.checked){ |
| 107 |
return(document.items.action.value); |
| 108 |
} |
| 109 |
}; |
| 110 |
alert(_("Please select at least one item.")); |
| 111 |
return (-1); |
| 112 |
}; |
| 113 |
|
| 114 |
$(document).ready(function() { |
| 115 |
$("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 116 |
"aoColumnDefs": [ |
| 117 |
{ "aTargets": [ -2, -1 ], "bSortable": false, "bSearchable": false } |
| 118 |
], |
| 119 |
"aaSorting": [[ 0, "asc" ]], |
| 120 |
"sPaginationType": "four_button", |
| 121 |
"autoWidth": false |
| 122 |
})); |
| 123 |
$("#additems").click(function(){ |
| 124 |
Add(); |
| 125 |
return false; |
| 126 |
}); |
| 127 |
$("#removeitems").click(function(){ |
| 128 |
Remove(); |
| 129 |
return false; |
| 130 |
}); |
| 131 |
$("#deletebatch").click(function(){ |
| 132 |
DeleteConfirm(); |
| 133 |
return false; |
| 134 |
}); |
| 135 |
$("#deduplicate").click(function(){ |
| 136 |
DeDuplicate(); |
| 137 |
return false; |
| 138 |
}); |
| 139 |
$("#exportitems").click(function(){ |
| 140 |
Xport('label'); |
| 141 |
return false; |
| 142 |
}); |
| 143 |
$("#exportbatch").click(function(){ |
| 144 |
Xport('batch'); |
| 145 |
return false; |
| 146 |
}); |
| 147 |
$(".delete").on("click", function(){ |
| 148 |
return confirmDelete( _("Are you sure you want to delete this patron from the card batch?") ); |
| 149 |
}); |
| 150 |
$(".export").on("click", function(e){ |
| 151 |
e.preventDefault(); |
| 152 |
var label_id = $(this).data("label-id"); |
| 153 |
var batch_id = $(this).data("batch-id"); |
| 154 |
GB_showCenter( _("Export single card"),'/cgi-bin/koha/patroncards/print.pl?batch_id='+batch_id+'&label_id='+label_id, 400, 800); |
| 155 |
}); |
| 156 |
}); |
| 157 |
//]]> |
| 158 |
</script> |
| 159 |
</head> |
6 |
</head> |
|
|
7 |
|
| 160 |
<body id="pcard_edit-batch" class="tools pcard"> |
8 |
<body id="pcard_edit-batch" class="tools pcard"> |
| 161 |
[% INCLUDE 'header.inc' %] |
9 |
[% INCLUDE 'header.inc' %] |
| 162 |
[% INCLUDE 'cat-search.inc' %] |
10 |
[% INCLUDE 'cat-search.inc' %] |
|
Lines 274-277
Link Here
|
| 274 |
[% INCLUDE 'tools-menu.inc' %] |
122 |
[% INCLUDE 'tools-menu.inc' %] |
| 275 |
</div> |
123 |
</div> |
| 276 |
</div> |
124 |
</div> |
| 277 |
[% INCLUDE 'intranet-bottom.inc' %] |
125 |
|
|
|
126 |
[% MACRO jsinclude BLOCK %] |
| 127 |
[% INCLUDE 'greybox.inc' %] |
| 128 |
[% INCLUDE 'datatables.inc' %] |
| 129 |
<script> |
| 130 |
function DeleteConfirm() { |
| 131 |
var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); |
| 132 |
var answer = confirm(msg); |
| 133 |
if (answer) { |
| 134 |
window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id %]"; |
| 135 |
} else { |
| 136 |
return; // abort delete |
| 137 |
} |
| 138 |
}; |
| 139 |
function Remove() { |
| 140 |
items = new Array; |
| 141 |
|
| 142 |
if(document.items.action.length > 0) { |
| 143 |
for (var i=0; i < document.items.action.length; i++) { |
| 144 |
if (document.items.action[i].checked) { |
| 145 |
items.push("label_id=" + document.items.action[i].value); |
| 146 |
} |
| 147 |
} |
| 148 |
getstr = items.join("&"); |
| 149 |
var msg = _("Are you sure you want to remove the selected patron(s) from this batch?"); |
| 150 |
} else if (document.items.action.checked) { |
| 151 |
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")); |
| 152 |
return; // no deletion for single item batch |
| 153 |
} else { |
| 154 |
alert(_("Please select at least one patron to delete.")); |
| 155 |
return; // no item selected |
| 156 |
} |
| 157 |
var answer = confirm(msg); |
| 158 |
if (answer) { |
| 159 |
window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=remove&batch_id=[% batch_id %]&" + getstr; |
| 160 |
} else { |
| 161 |
return; // abort delete |
| 162 |
} |
| 163 |
}; |
| 164 |
function Add() { |
| 165 |
var bor_nums = document.getElementById("bor_num_list"); |
| 166 |
if (bor_nums.value == '') { |
| 167 |
window.open("/cgi-bin/koha/patroncards/add_user_search.pl", |
| 168 |
'PatronPopup', |
| 169 |
'width=840,height=500,location=yes,toolbar=no,' |
| 170 |
+ 'scrollbars=yes,resize=yes'); |
| 171 |
} else { |
| 172 |
document.forms["add_by_bor_num"].submit(); |
| 173 |
} |
| 174 |
}; |
| 175 |
|
| 176 |
function add_user(borrowernumber) { |
| 177 |
$("#bor_num_list").val($("#bor_num_list").val()+borrowernumber+"\r\n"); |
| 178 |
} |
| 179 |
|
| 180 |
function DeDuplicate() { |
| 181 |
window.location = "/cgi-bin/koha/patroncards/edit-batch.pl?op=de_duplicate&batch_id=[% batch_id %]"; |
| 182 |
}; |
| 183 |
function Xport(mode) { |
| 184 |
if (mode == 'label') { |
| 185 |
patroncards= new Array; |
| 186 |
if(document.items.action.length > 0) { |
| 187 |
for (var i=0; i < document.items.action.length; i++) { |
| 188 |
if (document.items.action[i].checked) { |
| 189 |
patroncards.push("label_id=" + document.items.action[i].value); |
| 190 |
} |
| 191 |
} |
| 192 |
if (patroncards.length < 1) { |
| 193 |
alert(_("Please select at least one card to export.")); |
| 194 |
return; // no batch selected |
| 195 |
} |
| 196 |
getstr = patroncards.join("&"); |
| 197 |
} else if (document.items.action.checked) { |
| 198 |
getstr = document.items.action.value; |
| 199 |
} else { |
| 200 |
alert(_("Please select at least one card to export.")); |
| 201 |
return; // no batch selected |
| 202 |
} |
| 203 |
return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]&" + getstr, 400, 800); |
| 204 |
} else if (mode == 'batch') { |
| 205 |
return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id %]", 400, 800); |
| 206 |
} else { |
| 207 |
// some pass-thru error trapping just in case... |
| 208 |
} |
| 209 |
}; |
| 210 |
function selected_layout() { |
| 211 |
if (document.items.action.length) { |
| 212 |
for (i=0;i<document.items.action.length;i++){ |
| 213 |
if (document.items.action[i].checked==true){ |
| 214 |
return(document.items.action[i].value); |
| 215 |
} |
| 216 |
}; |
| 217 |
} else { |
| 218 |
if (document.items.action.checked){ |
| 219 |
return(document.items.action.value); |
| 220 |
} |
| 221 |
}; |
| 222 |
alert(_("Please select at least one item.")); |
| 223 |
return (-1); |
| 224 |
}; |
| 225 |
|
| 226 |
$(document).ready(function() { |
| 227 |
$("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 228 |
"aoColumnDefs": [ |
| 229 |
{ "aTargets": [ -2, -1 ], "bSortable": false, "bSearchable": false } |
| 230 |
], |
| 231 |
"aaSorting": [[ 0, "asc" ]], |
| 232 |
"sPaginationType": "four_button", |
| 233 |
"autoWidth": false |
| 234 |
})); |
| 235 |
$("#additems").click(function(){ |
| 236 |
Add(); |
| 237 |
return false; |
| 238 |
}); |
| 239 |
$("#removeitems").click(function(){ |
| 240 |
Remove(); |
| 241 |
return false; |
| 242 |
}); |
| 243 |
$("#deletebatch").click(function(){ |
| 244 |
DeleteConfirm(); |
| 245 |
return false; |
| 246 |
}); |
| 247 |
$("#deduplicate").click(function(){ |
| 248 |
DeDuplicate(); |
| 249 |
return false; |
| 250 |
}); |
| 251 |
$("#exportitems").click(function(){ |
| 252 |
Xport('label'); |
| 253 |
return false; |
| 254 |
}); |
| 255 |
$("#exportbatch").click(function(){ |
| 256 |
Xport('batch'); |
| 257 |
return false; |
| 258 |
}); |
| 259 |
$(".delete").on("click", function(){ |
| 260 |
return confirmDelete( _("Are you sure you want to delete this patron from the card batch?") ); |
| 261 |
}); |
| 262 |
$(".export").on("click", function(e){ |
| 263 |
e.preventDefault(); |
| 264 |
var label_id = $(this).data("label-id"); |
| 265 |
var batch_id = $(this).data("batch-id"); |
| 266 |
GB_showCenter( _("Export single card"),'/cgi-bin/koha/patroncards/print.pl?batch_id='+batch_id+'&label_id='+label_id, 400, 800); |
| 267 |
}); |
| 268 |
}); |
| 269 |
</script> |
| 270 |
[% END %] |
| 271 |
|
| 272 |
[% INCLUDE 'intranet-bottom.inc' %] |