Bug 20798: Client side validation for for fund selection prevents adding only some...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patroncards / edit-profile.tt
1 [% SET footerjs = 1 %]
2     [% INCLUDE 'doc-head-open.inc' %]
3     <title>Koha &rsaquo; Tools &rsaquo; Patron card creator &rsaquo; Profiles &rsaquo; [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%]</title>
4     [% INCLUDE 'doc-head-close.inc' %]
5 </head>
6
7 <body id="pcard_edit-profile" class="tools pcard">
8     [% INCLUDE 'header.inc' %]
9     [% INCLUDE 'cat-search.inc' %]
10     <div id="breadcrumbs">
11         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
12         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
13         <a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> &rsaquo;
14         <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=profile">Profiles</a> &rsaquo;
15         [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%]
16     </div>
17     <div id="doc3" class="yui-t2">
18         <div id="bd">
19         <div id="yui-main">
20             <div class="yui-b">
21                     <div class="yui-g">
22                     [% INCLUDE 'patroncards-toolbar.inc' %]
23                         <div class="yui-u first">
24
25                         </div>
26                     </div>
27                         <div class="yui-g">
28                             <h3>[% IF (profile_id) %]Edit[% ELSE %]Create[% END%] printer profile[% IF (profile_id) %] ([% profile_id %])[% END %]</h3>
29                                 <div class="yui-g first">
30                                     <form name="input" action="/cgi-bin/koha/patroncards/edit-profile.pl" method="get">
31                                     <fieldset class="rows"><legend>Profile settings</legend>
32                                         <ol>
33                                             <li>
34                                                 [% IF ( profile_id ) %]
35                                                  <span class="label">Printer name:</span>[% printer_name %]
36                                                 <input type="hidden" name="printer_name" value="[% printer_name %]" />
37                                                 [% ELSE %]
38                                                 <label for="printer_name">Printer name:</label><input type="text"  size="20" name="printer_name" id="printer_name" />
39                                                 [% END %]
40                                             </li>
41                                             <li>
42                                                 [% IF ( profile_id ) %]
43                                                 <span class="label">Paper bin:</span> [% paper_bin %]
44                                                 <input type="hidden" name="paper_bin" value="[% paper_bin %]" />
45                                                 [% ELSE %]
46                                                 <label for="paper_bin">Paper bin:</label><input type="text"  size="20" name="paper_bin" id="paper_bin" />
47                                                 [% END %]
48                                             </li>
49                                             <li>
50                                                 [% IF ( label_template ) %]
51                                                  <label for="template_name">Template name:</label> [% label_template %]
52                                                 [% ELSE %]
53                                                  <span class="label">Template name:</span> Profile unassigned
54                                                 [% END %]
55                                             </li>
56                                             <li>
57                                                 <label for="units">Units: </label>
58                                                 <select id="units" name="units">
59                                                     [% FOREACH unit IN units %]
60                                                     [% IF ( unit.selected ) %]
61                                                     <option value="[% unit.type %]" selected="selected">
62                                                     [% ELSE %]
63                                                     <option value="[% unit.type %]">
64                                                     [% END %]
65                                                     [% unit.desc %]
66                                                     </option>
67                                                     [% END %]
68                                                 </select>
69                                             </li>
70                                          </ol>
71                                         </fieldset>
72
73                                         <fieldset class="rows"><legend>Offset:</legend>
74                                         <ol>
75                                             <li>
76                                                 <label for="offset_horz">Horizontal: </label><input type="text"  size="4" name="offset_horz" id="offset_horz" value="[% offset_horz %]" />
77                                             </li>
78                                             <li>
79                                                 <label for="offset_vert">Vertical: </label><input type="text" size="4" name="offset_vert" id="offset_vert" value="[% offset_vert %]" />
80                                             </li>
81                                          </ol>
82                                         </fieldset>
83
84                                         <fieldset class="rows"><legend>Creep:</legend>
85                                         <ol>
86                                             <li>
87                                                 <label for="creep_horz">Horizontal: </label><input type="text"  size="4" name="creep_horz" id="creep_horz" value="[% creep_horz %]" />
88                                             </li>
89                                             <li>
90                                                 <label for="creep_vert">Vertical: </label><input type="text" size="4" name="creep_vert" id="creep_vert" value="[% creep_vert %]" />
91                                             </li>
92                                         </ol>
93                                     </fieldset>
94                                     <fieldset class="action">
95                                         <input type="submit" value="Save" />
96                                         <a href="/cgi-bin/koha/patroncards/manage.pl?card_element=profile" class="cancel">Cancel</a>
97                                         <input type="hidden" name="op" value="save" />
98                                         <input type="hidden" name="profile_id" value="[% profile_id %]" />
99                                     </fieldset>
100                     </form>
101                                 </div>
102                             </div>
103                         </div>
104                 </div>
105                 <div class="yui-b">
106                   [% INCLUDE 'tools-menu.inc' %]
107                 </div>
108             </div>
109
110 [% MACRO jsinclude BLOCK %]
111     <script>
112         $(document).ready(function(){
113             var selectedUnit = $("#units option:selected").attr("value");
114             var unitfields = $("#offset_horz,#offset_vert,#creep_horz,#creep_vert");
115             $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
116             $("#units").change(function(){
117                 $(".unit").html(getUnit($(this).val()));
118             });
119             function getUnit(unit){
120                 switch(unit){
121                     case "POINT":
122                         var unit = " pt";
123                         break;
124                     case "AGATE":
125                         var unit = " ag";
126                         break;
127                     case "INCH":
128                         var unit = " in";
129                         break;
130                     case "MM":
131                         var unit = " mm";
132                         break;
133                     case "CM":
134                         var unit = " cm";
135                         break;
136                     default:
137                         var unit = "";
138                 }
139                 return unit;
140             }
141         });
142     </script>
143 [% END %]
144
145 [% INCLUDE 'intranet-bottom.inc' %]