2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( layout_id ) %]Edit ([% layout_id | html %])[% ELSE %]New[% END %] › Layout › Patron card creator › Tools › Koha</title>
4 [% INCLUDE 'doc-head-close.inc' %]
7 <body id="pcard_edit-layout" class="tools pcard">
8 [% WRAPPER 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
12 [% WRAPPER 'sub-header.inc' %]
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
19 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
22 <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a>
25 <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=layout">Layouts</a>
28 <a href="#" aria-current="page">
29 [% IF ( layout_id ) %]
30 Edit ([% layout_id | html %])
40 <div class="main container-fluid">
42 <div class="col-sm-10 col-sm-push-2">
45 [% INCLUDE 'patroncards-toolbar.inc' %]
47 <h1>[% IF ( layout_id ) %]<span>Edit patron card layout</span> [% layout_id | html %]
48 [% ELSE %]<span>Create patron card layout</span>[% END %]
51 <!-- NOTE: The order of the elements on this form is crictical to correct processing. You've been warned... -->
52 <form name="input" action="/cgi-bin/koha/patroncards/edit-layout.pl" method="get">
54 <div class="col-sm-6">
55 <fieldset class="rows">
56 <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] patron card text layout</legend>
60 <legend>General settings</legend>
63 <label for="layout_name">Layout name: </label>
64 <input type="text" name="layout_name" id="layout_name" size="20" value="[% layout_name | html %]" />
67 <label for="units">Units: </label>
68 <select id="units" name="units">
69 [% FOREACH unit IN units %]
70 [% IF ( unit.selected ) %]
71 <option value="[% unit.type | html %]" selected="selected">
73 <option value="[% unit.type | html %]">
75 [% unit.desc | html %]
81 <label for="page_side">Page side: </label>
82 [% IF ( page_side ) %]
83 <input type="radio" name="page_side" id="page_side" value="F" />Front
84 <input type="radio" name="page_side" id="page_side" value="B" checked="checked" />Back
86 <input type="radio" name="page_side" id="page_side" value="F" checked="checked" />Front
87 <input type="radio" name="page_side" id="page_side" value="B" />Back
91 <label for="guide_box">Guide box:</label>
92 [% IF ( guide_box ) %]
93 <input type="radio" name="guide_box" id="guide_box" value="1" checked="checked" />On
94 <input type="radio" name="guide_box" id="guide_box" value="0" />Off
96 <input type="radio" name="guide_box" id="guide_box" value="1" />On
97 <input type="radio" name="guide_box" id="guide_box" value="0" checked="checked" />Off
101 <label for="guide_grid">Guide grid:</label>
102 [% IF ( guide_grid ) %]
103 <input type="radio" name="guide_grid" id="guide_grid" value="1" checked="checked" />On
104 <input type="radio" name="guide_grid" id="guide_grid" value="0" />Off
106 <input type="radio" name="guide_grid" id="guide_grid" value="1" />On
107 <input type="radio" name="guide_grid" id="guide_grid" value="0" checked="checked" />Off
115 <legend>Text fields</legend>
120 <legend><input type="checkbox" name="field_1_enable" id="field_1_enable" value="1" checked="checked" /> Field 1</legend>
122 <legend><input type="checkbox" name="field_1_enable" id="field_1_enable" value="1" /> Field 1</legend>
124 <div id="field_1_select" style="display: none;">
127 <label for="field_1_text">Text: </label>
128 <input type="text" name="field_1_text" id="field_1_text" size="60" value="[% field_1_text | html %]" />
131 <label for="field_1_font">Font: </label>
132 <select name="field_1_font" id="field_1_font">
133 [% FOREACH field_1_fon IN field_1_font %]
134 [% IF ( field_1_fon.selected ) %]
135 <option value="[% field_1_fon.type | html %]" selected="selected">[% field_1_fon.name | html %]</option>
137 <option value="[% field_1_fon.type | html %]">[% field_1_fon.name | html %]</option>
143 <label for="field_1_font_size">Font size: </label>
144 <input type="text" name="field_1_font_size" id="field_1_font_size" size="2" value="[% field_1_font_size | html %]" />
145 <span class="font_unit"> pt</span>
148 <label for="field_1_text_alignment">Text alignment: </label>
149 <select name="field_1_text_alignment" id="field_1_text_alignment">
150 [% FOREACH field_1_text_alignmen IN field_1_text_alignment %]
151 [% IF ( field_1_text_alignmen.selected ) %]
152 <option value="[% field_1_text_alignmen.type | html %]" selected="selected">[% field_1_text_alignmen.name | html %]</option>
154 <option value="[% field_1_text_alignmen.type | html %]">[% field_1_text_alignmen.name | html %]</option>
160 <label for="field_1_llx">Lower left X coordinate: </label>
161 <input type="text" name="field_1_llx" id="field_1_llx" size="2" value="[% field_1_llx | html %]" />
164 <label for="field_1_lly">Lower left Y coordinate: </label>
165 <input type="text" name="field_1_lly" id="field_1_lly" size="2" value="[% field_1_lly | html %]" />
174 <legend><input type="checkbox" name="field_2_enable" id="field_2_enable" value="1" checked="checked"/> Field 2</legend>
176 <legend><input type="checkbox" name="field_2_enable" id="field_2_enable" value="1" /> Field 2</legend>
178 <div id="field_2_select" style="display: none;">
181 <label for="field_2_text">Text: </label>
182 <input type="text" name="field_2_text" id="field_2_text" size="60" value="[% field_2_text | html %]" />
185 <label for="field_2_font">Font: </label>
186 <select name="field_2_font" id="field_2_font">
187 [% FOREACH field_2_fon IN field_2_font %]
188 [% IF ( field_2_fon.selected ) %]
189 <option value="[% field_2_fon.type | html %]" selected="selected">[% field_2_fon.name | html %]</option>
191 <option value="[% field_2_fon.type | html %]">[% field_2_fon.name | html %]</option>
197 <label for="field_2_font_size">Font size: </label>
198 <input type="text" name="field_2_font_size" id="field_2_font_size" size="2" value="[% field_2_font_size | html %]" />
199 <span class="font_unit"> pt</span>
202 <label for="field_2_text_alignment">Text alignment: </label>
203 <select name="field_2_text_alignment" id="field_2_text_alignment">
204 [% FOREACH field_2_text_alignmen IN field_2_text_alignment %]
205 [% IF ( field_2_text_alignmen.selected ) %]
206 <option value="[% field_2_text_alignmen.type | html %]" selected="selected">[% field_2_text_alignmen.name | html %]</option>
208 <option value="[% field_2_text_alignmen.type | html %]">[% field_2_text_alignmen.name | html %]</option>
214 <label for="field_2_llx">Lower left X coordinate: </label>
215 <input type="text" name="field_2_llx" id="field_2_llx" size="2" value="[% field_2_llx | html %]" />
218 <label for="field_2_lly">Lower left Y coordinate: </label>
219 <input type="text" name="field_2_lly" id="field_2_lly" size="2" value="[% field_2_lly | html %]" />
228 <legend><input type="checkbox" name="field_3_enable" id="field_3_enable" value="1" checked="checked"/> Field 3</legend>
230 <legend><input type="checkbox" name="field_3_enable" id="field_3_enable" value="0" /> Field 3</legend>
232 <div id="field_3_select" style="display: none;">
235 <label for="field_3_text">Text: </label>
236 <input type="text" name="field_3_text" id="field_3_text" size="60" value="[% field_3_text | html %]" />
239 <label for="field_3_font">Font: </label>
240 <select name="field_3_font" id="field_3_font">
241 [% FOREACH field_3_fon IN field_3_font %]
242 [% IF ( field_3_fon.selected ) %]
243 <option value="[% field_3_fon.type | html %]" selected="selected">[% field_3_fon.name | html %]</option>
245 <option value="[% field_3_fon.type | html %]">[% field_3_fon.name | html %]</option>
251 <label for="field_3_font_size">Font size: </label>
252 <input type="text" name="field_3_font_size" id="field_3_font_size" size="2" value="[% field_3_font_size | html %]" />
253 <span class="font_unit"> pt</span>
256 <label for="field_3_text_alignment">Text alignment: </label>
257 <select name="field_3_text_alignment" id="field_3_text_alignment">
258 [% FOREACH field_3_text_alignmen IN field_3_text_alignment %]
259 [% IF ( field_3_text_alignmen.selected ) %]
260 <option value="[% field_3_text_alignmen.type | html %]" selected="selected">[% field_3_text_alignmen.name | html %]</option>
262 <option value="[% field_3_text_alignmen.type | html %]">[% field_3_text_alignmen.name | html %]</option>
268 <label for="field_3_llx">Lower left X coordinate: </label>
269 <input type="text" name="field_3_llx" id="field_3_llx" size="2" value="[% field_3_llx | html %]" />
272 <label for="field_3_lly">Lower left Y coordinate: </label>
273 <input type="text" name="field_3_lly" id="field_3_lly" size="2" value="[% field_3_lly | html %]" />
285 <div class="col-sm-6">
286 <fieldset class="rows">
287 <legend>[% IF ( layout_id ) %]<span>Edit patron card graphic layout</span>
288 [% ELSE %]<span>Create patron card graphic layout</span>[% END %]
294 <label for="guidebox">Draw guide boxes: </label>
295 [% IF ( guidebox ) %]
296 <input type="checkbox" name="guidebox" id="guidebox" value="1" checked="checked" />
298 <input type="checkbox" name="guidebox" id="guidebox" value="1" />
305 <legend>Barcode</legend>
308 <label for="barcode_print">Print card number as barcode: </label>
309 [% IF ( barcode_print ) %]
310 <input type="checkbox" name="barcode_print" id="barcode_print" value="1" checked="checked" />
312 <input type="checkbox" name="barcode_print" id="barcode_print" value="1" />
316 <div id="barcode_param" style="display: none;">
319 <label for="barcode_llx">Lower left X coordinate: </label>
320 <input type="text" name="barcode_llx" id="barcode_llx" size="2" value="[% barcode_llx | html %]" />
323 <label for="barcode_lly">Lower left Y coordinate: </label>
324 <input type="text" name="barcode_lly" id="barcode_lly" size="2" value="[% barcode_lly | html %]" />
327 <label for="barcode_height_scale">Scale height (relative to card): </label>
328 <input type="text" name="barcode_height_scale" id="barcode_height_scale" size="2" value="[% barcode_height_scale | html %]" />
331 <label for="barcode_width_scale">Scale width (relative to card): </label>
332 <input type="text" name="barcode_width_scale" id="barcode_width_scale" size="2" value="[% barcode_width_scale | html %]" />
335 <label for="barcode_type">Barcode type: </label>
336 <select name="barcode_type" id="barcode_type">
337 [% FOREACH barcode_typ IN barcode_type %]
338 [% IF ( barcode_typ.selected ) %]
339 <option value="[% barcode_typ.type | html %]" selected="selected">[% barcode_typ.name | html %]</option>
341 <option value="[% barcode_typ.type | html %]">[% barcode_typ.name | html %]</option>
347 <label for="barcode_text_print">Print card number as text under barcode: </label>
348 [% IF ( barcode_text_print ) %]
349 <input type="checkbox" name="barcode_text_print" id="barcode_text_print" value="1" checked="checked" />
351 <input type="checkbox" name="barcode_text_print" id="barcode_text_print" value="1" />
360 <legend>Images</legend>
364 <legend>Image 1</legend>
367 <label for="image_1_image_source">Image source: </label>
368 <select name="image_1_image_source" id="image_1_image_source">
369 [% FOREACH image_1_image_sourc IN image_1_image_source %]
370 [% IF ( image_1_image_sourc.selected ) %]
371 <option value="[% image_1_image_sourc.type | html %]" selected="selected">[% image_1_image_sourc.name | html %]</option>
373 <option value="[% image_1_image_sourc.type | html %]">[% image_1_image_sourc.name | html %]</option>
379 <div id="image_1_image_name" style="display: none;">
382 <label for="image_1_image_name">Image: </label>
383 <select name="image_1_image_name" id="image_1_image_name">
384 [% FOREACH image_1_image_nam IN image_1_image_name %]
385 [% IF ( image_1_image_nam.selected ) %]
386 <option value="[% image_1_image_nam.type | html %]" selected="selected">[% image_1_image_nam.name | html %]</option>
388 <option value="[% image_1_image_nam.type | html %]">[% image_1_image_nam.name | html %]</option>
395 <div id="image_1_image_metrics" style="display: none;">
398 <label for="image_1_Dx">Display height: </label>
399 <input type="text" name="image_1_Dx" id="image_1_Dx" size="2" value="[% image_1_Dx | html %]" />
402 <label for="image_1_Tx">Lower left X coordinate: </label>
403 <input type="text" name="image_1_Tx" id="image_1_Tx" size="2" value="[% image_1_Tx | html %]" />
406 <label for="image_1_Ty">Lower left Y coordinate: </label>
407 <input type="text" name="image_1_Ty" id="image_1_Ty" size="2" value="[% image_1_Ty | html %]" />
411 <!-- These pdf image parameters are currently unused, but implemented and need to default to zero -->
412 <input type="hidden" name="image_1_Ox" value="0" /><!-- Ox,Oy should be set to 0 unless you want special effects see http://www.adobe.com/devnet/pdf/pdf_reference.html ISO 32000-1 -->
413 <input type="hidden" name="image_1_Oy" value="0" />
414 <input type="hidden" name="image_1_Sx" value="0" /><!-- Sx,Sy allow scaling of the image -->
415 <input type="hidden" name="image_1_Sy" value="0" />
420 <legend>Image 2</legend>
423 <label for="image_2_image_source">Image source: </label>
424 <select name="image_2_image_source" id="image_2_image_source">
425 [% FOREACH image_2_image_sourc IN image_2_image_source %]
426 [% IF ( image_2_image_sourc.selected ) %]
427 <option value="[% image_2_image_sourc.type | html %]" selected="selected">[% image_2_image_sourc.name | html %]</option>
429 <option value="[% image_2_image_sourc.type | html %]">[% image_2_image_sourc.name | html %]</option>
435 <div id="image_2_image_name" style="display: none;">
438 <label for="image_2_image_name">Image: </label>
439 <select name="image_2_image_name" id="image_2_image_name">
440 [% FOREACH image_2_image_nam IN image_2_image_name %]
441 [% IF ( image_2_image_nam.selected ) %]
442 <option value="[% image_2_image_nam.type | html %]" selected="selected">[% image_2_image_nam.name | html %]</option>
444 <option value="[% image_2_image_nam.type | html %]">[% image_2_image_nam.name | html %]</option>
451 <div id="image_2_image_metrics" style="display: none;">
454 <label for="image_2_Dx">Display height: </label>
455 <input type="text" name="image_2_Dx" id="image_2_Dx" size="2" value="[% image_2_Dx | html %]" />
458 <label for="image_2_Tx">Lower left X coordinate: </label>
459 <input type="text" name="image_2_Tx" id="image_2_Tx" size="2" value="[% image_2_Tx | html %]" />
462 <label for="image_2_Ty">Lower left Y coordinate: </label>
463 <input type="text" name="image_2_Ty" id="image_2_Ty" size="2" value="[% image_2_Ty | html %]" />
467 <!-- These pdf image parameters are currently unused, but implemented and need to default to zero -->
468 <input type="hidden" name="image_2_Ox" value="0" /><!-- Ox,Oy should be set to 0 unless you want special effects see http://www.adobe.com/devnet/pdf/pdf_reference.html ISO 32000-1 -->
469 <input type="hidden" name="image_2_Oy" value="0" /><!-- Sx,Sy allow scaling of the image -->
470 <input type="hidden" name="image_2_Sx" value="0" />
471 <input type="hidden" name="image_2_Sy" value="0" />
481 <fieldset class="action">
482 <input class="btn btn-default btn-default" type="submit" value="Save" />
483 <a class="cancel" href="/cgi-bin/koha/patroncards/manage.pl?card_element=layout">Cancel</a>
484 <input type="hidden" name="op" value="save" />
485 <input type="hidden" name="layout_id" value="[% layout_id | html %]" />
490 </div> <!-- /.col-sm-10.col-sm-push-2 -->
492 <div class="col-sm-2 col-sm-pull-10">
494 [% INCLUDE 'tools-menu.inc' %]
496 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
497 </div> <!-- /.row -->
499 [% MACRO jsinclude BLOCK %]
501 $(document).ready(function() {
502 var selectedUnit = $("#units option:selected").attr("value");
503 var unitfields = $("#font_size,#field_1_llx,#field_1_lly,#field_2_llx,#field_2_lly,#field_3_llx,#field_3_lly,#barcode_Tx,#barcode_Ty,#image_1_Dx,#image_1_Tx,#image_1_Ty,#image_2_Dx,#image_2_Tx,#image_2_Ty");
504 $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
505 $("#units").change(function(){
506 $(".unit").html(getUnit($(this).val()));
508 Go($("#image_1_image_source").val(), 'image_1_image_name');
509 Go($("#image_1_image_source").val(), 'image_1_image_metrics');
510 $("#image_1_image_source").change(function(){
511 $(".image_1_image_source").html(Go($(this).val(), 'image_1_image_name'));
512 $(".image_1_image_source").html(Go($(this).val(), 'image_1_image_metrics'));
514 Go($("#image_2_image_source").val(), 'image_2_image_name');
515 Go($("#image_2_image_source").val(), 'image_2_image_metrics');
516 $("#image_2_image_source").change(function(){
517 $(".image_2_image_source").html(Go($(this).val(), 'image_2_image_name'));
518 $(".image_2_image_source").html(Go($(this).val(), 'image_2_image_metrics'));
520 var selectFieldNames = ["field_1","field_2","field_3"];
521 for (var i=0; i < selectFieldNames.length; i++) {
522 Go($("#"+selectFieldNames[i]+"_enable").prop("checked"), selectFieldNames[i]+"_select");
524 $("#field_1_enable").change(function(){
525 $(".field_1_enable").html(Go($(this).prop("checked"), 'field_1_select'));
527 $("#field_2_enable").change(function(){
528 $(".field_2_enable").html(Go($(this).prop("checked"), 'field_2_select'));
530 $("#field_3_enable").change(function(){
531 $(".field_3_enable").html(Go($(this).prop("checked"), 'field_3_select'));
533 $("#barcode_print").load(barcode_text('barcode_param'));
534 $("#barcode_print").change(function(){
535 barcode_text('barcode_param');
537 function barcode_text(division) {
538 var eBarcode = document.getElementById(division);
539 if( $("input[name=barcode_print]:checked").prop("checked") ) {
540 eBarcode.style.display = 'block';
542 eBarcode.style.display = 'none';
543 $('input[name=barcode_text_print]').prop('checked', false);
546 function getUnit(unit){
568 function Go(oSelect, oElement){
569 var element = document.getElementById(oElement);
571 case /^.*_name/.test(oElement):
572 if ((oSelect == 'patronimages') || (oSelect == 'none')) {
573 element.style.display = 'none';
575 element.style.display = 'block';
578 case /^.*_metrics/.test(oElement):
579 if ((oSelect == 'none') || (oSelect == '')) {
580 element.style.display = 'none';
582 element.style.display = 'block';
585 case /^.*_select/.test(oElement):
587 element.style.display = 'none';
589 element.style.display = 'block';
601 [% INCLUDE 'intranet-bottom.inc' %]