2 [% BLOCK translate_card_element %]
4 [%- CASE 'layout' -%]layout
5 [%- CASE 'Layouts' -%]Layouts
6 [%- CASE 'template' -%]template
7 [%- CASE 'Templates' -%]Templates
8 [%- CASE 'profile' -%]profile
9 [%- CASE 'Profiles' -%]Profiles
10 [%- CASE 'batch' -%]batch
11 [%- CASE 'Batches' -%]Batches
12 [%- CASE 'Actions' -%]Actions
15 [% BLOCK translate_card_elements %]
16 [%- SWITCH element -%]
17 [%- CASE 'layout' -%]layouts
18 [%- CASE 'template' -%]templates
19 [%- CASE 'profile' -%]profiles
20 [%- CASE 'batch' -%]batches
24 [% INCLUDE 'doc-head-open.inc' %]
25 <title>Koha › Tools › Patron card creator › [% PROCESS translate_card_element element=card_element_title %]</title>
26 [% INCLUDE 'doc-head-close.inc' %]
27 [% INCLUDE 'greybox.inc' %]
28 <script type="text/javascript">
30 function DeleteConfirm() {
31 var element_ids = selected_layouts("delete");
34 if (element_ids.length > 1) {
35 msg = _("Are you sure you want to delete %s %s?").format(element_ids.length, "[% PROCESS translate_card_elements element=card_element %]");
36 } else if (element_ids.length == 1) {
37 msg = _("Are you sure you want to delete %s %s?").format("[% PROCESS translate_card_element element=card_element %]", element_ids[0]);
40 if (msg && confirm(msg)) {
42 for (var i = 0; i < element_ids.length; i++) {
43 if (element_ids[i] > -1) {
44 elements += element_ids[i] + ","
47 return; // no layout selected
51 window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=[% card_element %]&element_id=" + elements;
54 return; // abort delete
60 var element_id = selected_layouts("edit");
62 window.location = "/cgi-bin/koha/patroncards/edit-[% card_element %].pl?op=edit&element_id=" + element_id;
65 return; // no layout selected
70 if(document.layouts.action.length > 0) {
71 for (var i=0; i < document.layouts.action.length; i++) {
72 if (document.layouts.action[i].checked) {
73 batches.push("batch_id=" + document.layouts.action[i].value);
76 if (batches.length < 1) {
77 alert(_("Please select at least one batch to export."));
78 return; // no batch selected
80 getstr = batches.join("&");
82 else if (document.layouts.action.checked) {
83 getstr = "batch_id="+document.layouts.action.value;
86 alert(_("Please select at least one batch to export."));
87 return; // no batch selected
89 return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 400, 800);
92 function XportPatronlist() {
93 if ( patron_list_id.value.length < 1 ) {
94 alert(_("Please select a patron list."));
95 return; // no patron list selected
97 getstr = 'patronlist_id='+patron_list_id.value;
98 return GB_showCenter(_("Export patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 700, 800);
101 function selected_layout(op) {
102 if (document.layouts.action.length) {
103 var selected = new Array();
104 for (i=0;i<document.layouts.action.length;i++){
105 if (document.layouts.action[i].checked){
109 if (selected.length == 1 || (op == "delete" && selected.length >= 1)) {
110 if (op == "delete") {
111 var selectedDelete = new Array;
112 for (i = 0; i < selected.length; i++) {
113 selectedDelete.push(document.layouts.action[selected[i]].value);
115 return(selectedDelete);
117 // op == 'edit' returns only the object and not list
118 return(document.layouts.action[selected[0]].value);
121 else if (selected.length < 1) {
123 alert(_("Please select one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
125 alert(_("Please select at least one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
130 alert(_("Please select only one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
135 if (document.layouts.action.checked){
136 return([document.layouts.action.value]);
139 alert(_("Please select a %s.").format("[% PROCESS translate_card_element element=card_element %]"));
143 $(document).ready(function() {
144 $("#edit").click(function(){
148 $("#delete").click(function(){
152 $("#print").click(function(){
156 $("#printlist").click(function(){
160 $(".delete").on("click", function(){
161 return confirmDelete( _("Are you sure you want to delete this?") );
163 $(".export").on("click", function(e){
165 var batch_id = $(this).data("batch-id");
166 GB_showCenter( _("Export single batch"),'/cgi-bin/koha/patroncards/print.pl?batch_id='+batch_id, 400, 800);
172 <body id="pcard_manage" class="tools pcard">
173 [% INCLUDE 'header.inc' %]
174 [% INCLUDE 'cat-search.inc' %]
175 <div id="breadcrumbs">
176 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
177 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
178 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
179 [% PROCESS translate_card_element element=card_element_title %]
181 <div id="doc3" class="yui-t2">
185 [% INCLUDE 'patroncards-toolbar.inc' %]
186 [% INCLUDE 'patroncards-errors.inc' %]
188 <div class="yui-u first" id="manage-patroncards-layouts">
189 <div class="hint">Current library: [% LoginBranchname %]</div>
190 [% IF ( table_loop ) %]
191 <form name="layouts" action="/cgi-bin/koha/manage.pl?card_element=[% card_element %]">
192 <h2>Currently available [% PROCESS translate_card_element element=card_element_title FILTER lower %]</h2>
194 [% FOREACH table_loo IN table_loop %]
195 [% IF ( table_loo.header_fields ) %]
197 [% FOREACH header_field IN table_loo.header_fields %]
198 [% SWITCH header_field.field_label -%]
199 [%- CASE 'Layout ID' -%]<th>Layout ID</th>
200 [%- CASE 'Layout' -%]<th>Layout</th>
201 [%- CASE 'Action' -%]<th>Action</th>
202 [%- CASE 'Select' -%][% IF ( print ) %]<th>Select</th>[% END %]
203 [%- CASE 'Template ID' -%]<th>Template ID</th>
204 [%- CASE 'Template Name' -%]<th>Template name</th>
205 [%- CASE 'Description' -%]<th>Description</th>
206 [%- CASE 'Profile ID' -%]<th>Profile ID</th>
207 [%- CASE 'Printer Name' -%]<th>Printer name</th>
208 [%- CASE 'Paper Bin' -%]<th>Paper bin</th>
209 [%- CASE 'Batch ID' -%]<th>Batch ID</th>
210 [%- CASE 'Patron Count' -%]<th>Patron Count</th>
216 [% FOREACH text_field IN table_loo.text_fields %]
217 [% IF ( text_field.select_field ) %]
219 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/patroncards/edit-[% card_element %].pl?op=edit&element_id=[% text_field.field_value %]"><i class="fa fa-edit"></i> Edit</a>
220 [% IF ( print ) %]<a class="btn btn-default btn-xs export" data-batch-id="[% text_field.field_value |url %]" href="/cgi-bin/koha/patroncards/print.pl?batch_id=[% text_field.field_value |url %]"><i class="fa fa-share-square-o"></i> Export</a>[% END %]
221 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=[% card_element %]&element_id=[% text_field.field_value %]"><i class="fa fa-trash"></i> Delete</a>
223 [% IF ( print ) %]<td><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>[% END %]
224 [% ELSIF ( text_field.field_value ) %]
225 <td>[% text_field.field_value %]</td>
234 <fieldset class="action">
235 [% IF ( print ) %]<input type="button" id="print" value="Export selected batches" />[% END %]
237 [% IF patron_lists %]
238 <fieldset class="rows">
239 <legend>Or use a patron list</legend>
242 <label for="patron_list_id">Patron list: </label>
243 <select id="patron_list_id" name="patron_list_id">
244 <option value=""></option>
245 [% FOREACH pl IN patron_lists %]
246 <option value="[% pl.patron_list_id %]">[% pl.name %]</option>
252 <fieldset class="action">
253 <input type="button" id="printlist" value="Export from patron list" />
259 <div class="dialog message">
260 <h4>There are no [% PROCESS translate_card_element element=card_element_title %] currently available.</h4>
261 <p>Use the toolbar above to create a new [% PROCESS translate_card_element element=card_element %].</p></div>
268 [% INCLUDE 'tools-menu.inc' %]
271 [% INCLUDE 'intranet-bottom.inc' %]