Bug 20798: Client side validation for for fund selection prevents adding only some...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / edit-template.tt
1 [% USE Asset %]
2 [% SET footerjs = 1 %]
3     [% INCLUDE 'doc-head-open.inc' %]
4     <title>Koha &rsaquo; Tools &rsaquo; Patron card creator &rsaquo; Templates &rsaquo; [% IF (template_id) %]Edit ([% template_id %])[% ELSE %]New[% END %]</title>
5     [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="pcard_edit-template" class="tools pcard">
9     [% INCLUDE 'header.inc' %]
10     [% INCLUDE 'cat-search.inc' %]
11     <div id="breadcrumbs">
12         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
13         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
14         <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> &rsaquo;
15         <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=template">Templates</a> &rsaquo;
16         [% IF (template_id) %]Edit ([% template_id %])[% ELSE %]New[% END %]
17     </div>
18     <div id="doc3" class="yui-t2">
19         <div id="bd">
20             <div id="yui-main">
21                 <div class="yui-b">
22                     <div class="yui-g">
23                     [% INCLUDE 'patroncards-toolbar.inc' %]
24                         <div class="yui-u first">
25
26                         </div>
27                     </div>
28                     <form name="input" action="/cgi-bin/koha/patroncards/edit-template.pl" method="get">
29                     <div class="yui-g">
30                         <h3>[% IF (template_id) %]Edit[% ELSE %]Create[% END %] patron card template[% IF (template_id) %] ([% template_id %])[% END %]</h3>
31                         <div class="yui-u first">
32                             <fieldset class="rows">
33                                 <ol>
34                                     <li>
35                                         <span class="label">Template ID:</span>[% IF ( template_id ) %][% template_id %][% ELSE %]N/A[% END %]
36                                     </li>
37                                     <li>
38                                         <label for="template_code">Template code:</label>
39                                         <input type="text" size="30" maxlength="43" name="template_code" id="template_code" value="[% template_code %]" />
40                                     </li>
41                                     <li>
42                                         <label for="template_desc">Template description:</label>
43                                         <textarea cols="30" rows="3" id="template_desc" name="template_desc">[% template_desc %]</textarea>
44                                     </li>
45                                     <li>
46                                         <label for="units">Units:</label>
47                                         <select id="units" name="units">
48                                         [% FOREACH unit IN units %]
49
50                                             [% IF ( unit.selected ) %]
51                                             <option value="[% unit.type %]" selected="selected">
52                                             [% ELSE %]
53                                             <option value="[% unit.type %]">
54                                             [% END %]
55
56                                             [% SWITCH unit.type %]
57                                             [%   CASE 'POINT' %]
58                                             <span>PostScript Points</span>
59                                             [%   CASE 'AGATE' %]
60                                             <span>Adobe Agates</span>
61                                             [%   CASE 'INCH' %]
62                                             <span>US Inches</span>
63                                             [%   CASE 'MM' %]
64                                             <span>SI Millimeters</span>
65                                             [%   CASE 'CM' %]
66                                             <span>SI Centimeters</span>
67                                             [% END %]
68
69                                             </option>
70                                         [% END %]
71                                         </select>
72                                     </li>
73                                     <li>
74                                         <label for="page_height">Page height:</label>
75                                         <input type="text" size="4" name="page_height" id="page_height" value="[% page_height %]" />
76                                     </li>
77                                     <li>
78                                         <label for="page_width">Page width:</label>
79                                         <input type="text" size="4" name="page_width" id="page_width" value="[% page_width %]" />
80                                     </li>
81                                     <li>
82                                         <label for="card_height">Card height:</label>
83                                         <input type="text" size="4" name="card_height" id="card_height" value="[% card_height %]" />
84                                     </li>
85                                     <li>
86                                         <label for="card_width">Card width:</label>
87                                         <input type="text" size="4" name="card_width" id="card_width" value="[% card_width %]" />
88                                     </li>
89
90
91                                 </ol>
92                             </fieldset>
93                         </div>
94                         <div class="yui-u">
95                             <fieldset class="rows">
96                                 <ol><li>
97                                     <label for="top_margin">Top page margin:</label>
98                                     <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin %]" />
99                                 </li>
100                                 <li>
101                                     <label for="left_margin">Left page margin:</label>
102                                     <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin %]" />
103                                 </li>
104                                     <li>
105                                         <label for="cols">Number of columns:</label>
106                                         <input type="text" size="4" name="cols" id="cols" value="[% cols %]" />
107                                     </li>
108                                     <li>
109                                         <label for="rows">Number of rows:</label>
110                                         <input type="text" size="4" name="rows" id="rows" value="[% rows %]" />
111                                     </li>
112                                     <li>
113                                         <label for="col_gap">Gap between columns:</label>
114                                         <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap %]" />
115                                     </li>
116                                     <li>
117                                         <label for="row_gap">Gap between rows:</label>
118                                         <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap %]" />
119                                     </li>
120
121                                     <li>
122                                         <label for="profile_id">Profile:</label>
123                                         [% IF ( profile_list ) %]
124                                         <select id="profile_id" name="profile_id">
125                                         [% FOREACH profile_lis IN profile_list %]
126                                         [% IF ( profile_lis.selected ) %]
127                                         <option value="[% profile_lis.profile_id %]" selected="selected">
128                                         [% ELSE %]
129                                         <option value="[% profile_lis.profile_id %]">
130                                         [% END %]
131                                         [% profile_lis.printer_name %]/[% profile_lis.paper_bin %]
132                                         </option>
133                                         [% END %]
134                                         </select>
135                                         [% ELSE %]
136                                         <a href="/cgi-bin/koha/patroncards/edit-profile.pl?op=new">Click here to define a printer profile.</a>
137                                         [% END %]
138                                     </li>
139                                 </ol>
140                             </fieldset>
141                         </div>
142                     </div>
143                     <div class="yui-g">
144                         <fieldset class="action">
145                             <input type="submit" class="submit" value="Save" />
146                             <a class="cancel" href="/cgi-bin/koha/patroncards/manage.pl?card_element=template">Cancel</a>
147                             <input type="hidden" name="op" value="save" />
148                             [% IF ( template_id ) %]
149                             <input type="hidden" name="template_id" value="[% template_id %]" />
150                             [% END %]
151                         </fieldset>
152                     </div>
153                 </form>
154             </div>
155         </div>
156         <div class="yui-b">
157           [% INCLUDE 'tools-menu.inc' %]
158         </div>
159     </div>
160
161 [% MACRO jsinclude BLOCK %]
162     [% Asset.js("js/tools-menu.js") %]
163     <script>
164         $(document).ready(function(){
165             var selectedUnit = $("#units option:selected").attr("value");
166             var unitfields = $("#page_height,#page_width,#card_width,#card_height,#top_margin,#left_margin,#col_gap,#row_gap");
167             $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
168             $("#units").change(function(){
169                 $(".unit").html(getUnit($(this).val()));
170             });
171         function getUnit(unit){
172             switch(unit){
173                 case "POINT":
174                     var unit = " pt";
175                     break;
176                 case "AGATE":
177                     var unit = " ag";
178                     break;
179                 case "INCH":
180                     var unit = " in";
181                     break;
182                 case "MM":
183                     var unit = " mm";
184                     break;
185                 case "CM":
186                     var unit = " cm";
187                     break;
188                 default:
189                     var unit = "";
190             }
191             return unit;
192         }
193         });
194     </script>
195 [% END %]
196
197 [% INCLUDE 'intranet-bottom.inc' %]