3 [% PROCESS 'i18n.inc' %]
5 [% BLOCK translate_card_element %]
7 [%- CASE 'layout' -%][% t('layout') | html %]
8 [%- CASE 'Layouts' -%][% t('Patron card layouts') | html %]
9 [%- CASE 'template' -%][% t('template') | html %]
10 [%- CASE 'Templates' -%][% t('Patron card templates') | html %]
11 [%- CASE 'profile' -%][% t('profile') | html %]
12 [%- CASE 'Profiles' -%][% t('Patron card printer profiles') | html %]
13 [%- CASE 'batch' -%][% t('batch') | html %]
14 [%- CASE 'Batches' -%][% t('Patron card batches') | html %]
15 [%- CASE 'Actions' -%][% t('Actions') | html %]
18 [% BLOCK translate_card_elements %]
19 [%- SWITCH element -%]
20 [%- CASE 'layout' -%]<span>layouts</span>
21 [%- CASE 'template' -%]<span>templates</span>
22 [%- CASE 'profile' -%]<span>profiles</span>
23 [%- CASE 'batch' -%]<span>batches</span>
27 [% INCLUDE 'doc-head-open.inc' %]
28 <title>[% FILTER collapse %]
29 [% PROCESS translate_card_element element=card_element_title %] ›
30 [% t("Patron card creator") | html %] ›
31 [% t("Tools") | html %] ›
32 [% t("Koha") | html %]
34 [% INCLUDE 'doc-head-close.inc' %]
37 <body id="pcard_manage" class="tools pcard">
38 [% WRAPPER 'header.inc' %]
39 [% INCLUDE 'cat-search.inc' %]
42 [% WRAPPER 'sub-header.inc' %]
43 [% WRAPPER breadcrumbs %]
44 [% WRAPPER breadcrumb_item %]
45 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
47 [% WRAPPER breadcrumb_item %]
48 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
50 [% WRAPPER breadcrumb_item bc_active= 1 %]
51 [% PROCESS translate_card_element element=card_element_title %]
53 [% END #/ WRAPPER breadcrumbs %]
54 [% END #/ WRAPPER sub-header.inc %]
56 <div class="main container-fluid">
58 <div class="col-sm-10 col-sm-push-2">
61 [% INCLUDE 'patroncards-toolbar.inc' %]
63 <h1>[% PROCESS translate_card_element element=card_element_title %]</h1>
65 [% INCLUDE 'patroncards-errors.inc' %]
66 <div id="manage-patroncards-layouts">
67 [% IF ( table_loop ) %]
68 <form name="layouts" action="/cgi-bin/koha/manage.pl?card_element=[% card_element | html %]">
69 <div class="page-section">
71 [% FOREACH table_loo IN table_loop %]
72 [% IF ( table_loo.header_fields ) %]
74 [% FOREACH header_field IN table_loo.header_fields %]
75 [% SWITCH header_field.field_label -%]
76 [%- CASE 'Layout ID' -%]<th>Layout ID</th>
77 [%- CASE 'Layout' -%]<th>Layout</th>
78 [%- CASE 'Action' -%]<th>Action</th>
79 [%- CASE 'Actions' -%]<th class="noExport">Actions</th>
80 [%- CASE 'Select' -%][% IF ( print ) %]<th>Select</th>[% END %]
81 [%- CASE 'Template ID' -%]<th>Template ID</th>
82 [%- CASE 'Template Name' -%]<th>Template name</th>
83 [%- CASE 'Description' -%]<th>Description</th>
84 [%- CASE 'Profile ID' -%]<th>Profile ID</th>
85 [%- CASE 'Printer Name' -%]<th>Printer name</th>
86 [%- CASE 'Paper Bin' -%]<th>Paper bin</th>
87 [%- CASE 'Batch ID' -%]<th>Batch ID</th>
88 [%- CASE 'Patron Count' -%]<th>Patron count</th>
89 [%- CASE -%]<th>[% header_field.field_label | html %]</th>
95 [% FOREACH text_field IN table_loo.text_fields %]
96 [% IF ( text_field.select_field ) %]
98 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/patroncards/edit-[% card_element | html %].pl?op=edit&element_id=[% text_field.field_value | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
99 [% 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-solid fa-share-from-square"></i> Export</a>[% END %]
100 <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=[% card_element | html %]&element_id=[% text_field.field_value | html %]"><i class="fa fa-trash-can"></i> Delete</a>
102 [% IF ( print ) %]<td><input type="checkbox" name="action" value="[% text_field.field_value | html %]" /></td>[% END %]
103 [% ELSIF ( text_field.field_value ) %]
104 <td>[% text_field.field_value | html %]</td>
113 </div> <!-- /.page-section -->
115 <fieldset class="action">
116 <input class="btn btn-primary" type="button" id="print" value="Export selected batches" />
120 [% IF patron_lists %]
121 <fieldset class="rows">
122 <legend>Export by patron list</legend>
125 <label for="patron_list_id">Patron list: </label>
126 <select id="patron_list_id" name="patron_list_id">
127 <option value=""></option>
128 [% FOREACH pl IN patron_lists %]
129 <option value="[% pl.patron_list_id | html %]">[% pl.name | html %]</option>
135 <fieldset class="action">
136 <input class="btn btn-primary" type="button" id="printlist" value="Export from patron list" />
142 <div class="dialog message">
143 <h4>There are no [% PROCESS translate_card_element element=card_element_title %] currently available.</h4>
144 <p>Use the toolbar above to create a new [% PROCESS translate_card_element element=card_element %].</p></div>
149 </div> <!-- /.col-sm-10.col-sm-push-2 -->
151 <div class="col-sm-2 col-sm-pull-10">
153 [% INCLUDE 'tools-menu.inc' %]
155 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
156 </div> <!-- /.row -->
158 [% MACRO jsinclude BLOCK %]
159 [% INCLUDE 'greybox.inc' %]
161 function DeleteConfirm() {
162 var element_ids = selected_layouts("delete");
165 if (element_ids.length > 1) {
166 msg = _("Are you sure you want to delete %s %s?").format(element_ids.length, "[% PROCESS translate_card_elements element=card_element %]");
167 } else if (element_ids.length == 1) {
168 msg = _("Are you sure you want to delete %s %s?").format("[% PROCESS translate_card_element element=card_element %]", element_ids[0]);
171 if (msg && confirm(msg)) {
173 for (var i = 0; i < element_ids.length; i++) {
174 if (element_ids[i] > -1) {
175 elements += element_ids[i] + ","
178 return; // no layout selected
182 window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=[% card_element | html %]&element_id=" + elements;
185 return; // abort delete
191 var element_id = selected_layouts("edit");
193 window.location = "/cgi-bin/koha/patroncards/edit-[% card_element | html %].pl?op=edit&element_id=" + element_id;
196 return; // no layout selected
201 if(document.layouts.action.length > 0) {
202 for (var i=0; i < document.layouts.action.length; i++) {
203 if (document.layouts.action[i].checked) {
204 batches.push("batch_id=" + document.layouts.action[i].value);
207 if (batches.length < 1) {
208 alert(_("Please select at least one batch to export."));
209 return; // no batch selected
211 getstr = batches.join("&");
213 else if (document.layouts.action.checked) {
214 getstr = "batch_id="+document.layouts.action.value;
217 alert(_("Please select at least one batch to export."));
218 return; // no batch selected
220 return GB_showCenter(_("Export patron cards"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 400, 800);
223 function XportPatronlist() {
224 if ( patron_list_id.value.length < 1 ) {
225 alert(_("Please select a patron list."));
226 return; // no patron list selected
228 getstr = 'patronlist_id='+patron_list_id.value;
229 return GB_showCenter(_("Export patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?" + getstr, 700, 800);
232 function selected_layout(op) {
233 if (document.layouts.action.length) {
234 var selected = new Array();
235 for (i=0;i<document.layouts.action.length;i++){
236 if (document.layouts.action[i].checked){
240 if (selected.length == 1 || (op == "delete" && selected.length >= 1)) {
241 if (op == "delete") {
242 var selectedDelete = new Array;
243 for (i = 0; i < selected.length; i++) {
244 selectedDelete.push(document.layouts.action[selected[i]].value);
246 return(selectedDelete);
248 // op == 'edit' returns only the object and not list
249 return(document.layouts.action[selected[0]].value);
252 else if (selected.length < 1) {
254 alert(_("Please select one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
256 alert(_("Please select at least one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
261 alert(_("Please select only one %s to %s.").format("[% PROCESS translate_card_element element=card_element %]", op));
266 if (document.layouts.action.checked){
267 return([document.layouts.action.value]);
270 alert(_("Please select a %s.").format("[% PROCESS translate_card_element element=card_element %]"));
274 $(document).ready(function() {
275 $("#edit").click(function(){
279 $("#delete").click(function(){
283 $("#print").click(function(){
287 $("#printlist").click(function(){
291 $(".delete").on("click", function(){
292 return confirmDelete( _("Are you sure you want to delete this?") );
294 $(".export").on("click", function(e){
296 var batch_id = $(this).data("batch-id");
297 GB_showCenter( _("Export single batch"),'/cgi-bin/koha/patroncards/print.pl?batch_id='+batch_id, 400, 800);
303 [% INCLUDE 'intranet-bottom.inc' %]