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