Merge remote-tracking branch 'kc/master' into new/bug_5683
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-template.tt
1     [% INCLUDE 'doc-head-open.inc' %]
2     <title>Koha &rsaquo; Tools &rsaquo; Labels &rsaquo; Templates</title>
3     [% INCLUDE 'doc-head-close.inc' %]
4         <script type="text/javascript">
5         //<![CDATA[
6                 $(document).ready(function(){
7                 var selectedUnit = $("#units option:selected").attr("value");
8                 var unitfields = $("#page_height,#page_width,#label_width,#label_height,#top_margin,#left_margin,#top_text_margin,#left_text_margin,#col_gap,#row_gap");
9                 $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
10                 $("#units").change(function(){
11                         $(".unit").html(getUnit($(this).val()));
12                 });
13                 function getUnit(unit){
14                         switch(unit){
15                                 case "POINT":
16                                         var unit = " pt";
17                                         break;
18                                 case "AGATE":
19                                         var unit = " ag";
20                                         break;
21                                 case "INCH":
22                                         var unit = " in";
23                                         break;
24                                 case "MM":
25                                         var unit = " mm";
26                                         break;
27                                 case "CM":
28                                         var unit = " cm";
29                                         break;
30                                 default:
31                                         var unit = "";
32                         }
33                         return unit;
34                 }
35                 });
36         //]]>
37         </script>
38 </head>
39 <body>
40     [% INCLUDE 'header.inc' %]
41     [% INCLUDE 'cat-search.inc' %]
42     <div id="breadcrumbs">
43         <a href="/cgi-bin/koha/mainpage.pl">Home</a>&rsaquo;
44         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>&rsaquo;
45         <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a>&rsaquo;
46         <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Label Templates</a>&rsaquo;
47         Edit Label Template
48     </div>
49     <div id="doc3" class="yui-t2">
50         <div id="bd">
51             <div id="yui-main">
52                 <div class="yui-b">
53                     <form name="input" action="/cgi-bin/koha/labels/label-edit-template.pl" method="get">
54                     <div class="yui-g">
55                         <h3>Edit Label Template</h3>
56                         <div class="yui-u first">
57                             <fieldset class="rows">
58                                 <ol>
59                                     <li>
60                                         <span class="label">Template ID:</span>[% IF ( template_id ) %][% template_id %][% ELSE %]N/A[% END %]
61                                     </li>
62                                     <li>
63                                         <label for="template_code">Template Code:</label>
64                                         <input type="text" size="30" maxlength="43" name="template_code" id="template_code" value="[% template_code %]" />
65                                     </li>
66                                     <li>
67                                         <label for="template_desc">Template Description:</label>
68                                         <textarea cols="30" rows="3" id="template_desc" name="template_desc">[% template_desc %]</textarea>
69                                     </li>
70                                                                         <li>
71                                  <label for="units">Units:</label>
72                                  <select id="units" name="units">
73                                  [% FOREACH unit IN units %]
74
75                                                                         [% IF ( unit.selected ) %]
76                                                                         <option value="[% unit.type %]" selected="selected">
77                                                                         [% ELSE %]
78                                                                         <option value="[% unit.type %]">
79                                                                         [% END %]
80
81                                  [% unit.desc %]
82                                  </option>
83                                  [% END %]
84                                  </select>
85                              </li>
86                                     <li>
87                                         <label for="page_height">Page Height:</label>
88                                         <input type="text" size="4" name="page_height" id="page_height" value="[% page_height %]" />
89                                     </li>
90                                     <li>
91                                         <label for="page_width">Page Width:</label>
92                                         <input type="text" size="4" name="page_width" id="page_width" value="[% page_width %]" />
93                                     </li>
94                                     <li>
95                                         <label for="label_width">Label Width:</label>
96                                         <input type="text" size="4" name="label_width" id="label_width" value="[% label_width %]" />
97                                     </li>
98                                     <li>
99                                         <label for="label_height">Label Height:</label>
100                                         <input type="text" size="4" name="label_height" id="label_height" value="[% label_height %]" />
101                                     </li>
102
103                                 </ol>
104                             </fieldset>
105                         </div>
106                         <div class="yui-u">
107                             <fieldset class="rows">
108                                 <ol><li>
109                                     <label for="top_margin">Top Page Margin:</label>
110                                     <input type="text" size="4" name="top_margin" id="top_margin" value="[% top_margin %]" />
111                                 </li>
112                                 <li>
113                                     <label for="left_margin">Left Page Margin:</label>
114                                     <input type="text" size="4" name="left_margin" id="left_margin" value="[% left_margin %]" />
115                                 </li>
116                                     <li>
117                                         <label for="top_text_margin">Top Text Margin:</label>
118                                         <input type="text" size="4" name="top_text_margin" id="top_text_margin" value="[% top_text_margin %]" />
119                                     </li>
120                                     <li>
121                                         <label for="left_text_margin">Left Text Margin:</label>
122                                         <input type="text" size="4" name="left_text_margin" id="left_text_margin" value="[% left_text_margin %]" />
123                                     </li>
124                                     <li>
125                                         <label for="cols">Number of Columns:</label>
126                                         <input type="text" size="4" name="cols" id="cols" value="[% cols %]" />
127                                     </li>
128                                     <li>
129                                         <label for="rows">Number of Rows:</label>
130                                         <input type="text" size="4" name="rows" id="rows" value="[% rows %]" />
131                                     </li>
132                                     <li>
133                                         <label for="col_gap">Gap between Columns:</label>
134                                         <input type="text" size="4" name="col_gap" id="col_gap" value="[% col_gap %]" />
135                                     </li>
136                                     <li>
137                                         <label for="row_gap">Gap between Rows:</label>
138                                         <input type="text" size="4" name="row_gap" id="row_gap" value="[% row_gap %]" />
139                                     </li>
140
141                                     <li>
142                                         <label for="profile_id">Profile:</label>
143                                         [% IF ( profile_list ) %]
144                                         <select id="profile_id" name="profile_id">
145                                         [% FOREACH profile_lis IN profile_list %]
146 [% IF ( profile_lis.selected ) %]
147 <option value="[% profile_lis.profile_id %]" selected="selected">
148 [% ELSE %]
149 <option value="[% profile_lis.profile_id %]">
150 [% END %]
151                                         [% profile_lis.printer_name %]/[% profile_lis.paper_bin %]
152                                         </option>
153                                         [% END %]
154                                         </select>
155                                         [% ELSE %]
156                                         <a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">Click here to define a printer profile.</a>
157                                         [% END %]
158                                     </li>
159                                 </ol>
160                             </fieldset>
161                         </div>
162                     </div>
163                     <div class="yui-g">
164                         <fieldset class="action">
165                             <input type="submit" class="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Cancel</a>
166                             <input type="hidden" name="op" value="save" />
167                             [% IF ( template_id ) %]
168                             <input type="hidden" name="template_id" value="[% template_id %]" />
169                             [% END %]
170                         </fieldset>
171                     </div>
172                 </form>
173             </div>
174         </div>
175         <div class="yui-b">
176             [% INCLUDE 'labels-menu.inc' %]
177         </div>
178     </div>
179     [% INCLUDE 'intranet-bottom.inc' %]