Bug 16683: Help links to fields 59X in cataloguing form are broken
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / templates-add-modify.tt
1 [% USE Branches %]
2 [% USE AuthorisedValues %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Patron clubs &rsaquo;
6     [% IF club_template %]
7         Modify club template [% club_template.name | html %]
8     [% ELSE %]
9         Create a new club template
10     [% END %]
11 </title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 <style>
14     .club-field,
15     .enrollment-field {
16         border-top: 1px solid #DDD;
17     }
18 </style>
19 </head>
20
21 <body id="clubs_templates_add_modify" class="clubs">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'cat-search.inc' %]
24 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="clubs.pl">Patron clubs</a> &rsaquo;
25     [% IF club_template %]
26         Modify club template <i>[% club_template.name | html %]</i>
27     [% ELSE %]
28         Create a new club template
29     [% END %]
30 </div>
31
32 <div class="main container-fluid">
33     <div class="row">
34         <div class="col-md-8 col-md-offset-2">
35
36             <form method="post" class="validated">
37                 <input type="hidden" name="id" value="[% club_template.id | html %]" />
38
39                 <h2>
40                     [% IF club_template %]
41                         Modify club template <i>[% club_template.name | html %]</i>
42                     [% ELSE %]
43                         Create a new club template
44                     [% END %]
45                 </h2>
46
47
48                 <fieldset class="rows">
49                     <ol>
50                         <li>
51                             <label class="required" for="name">Name:</label>
52                             <input id="club-template-name" name="name" type="text" value="[% club_template.name | html %]" required="required"/>
53                             <span class="required">Required</span>
54                         </li>
55
56                         <li>
57                             <label for="club-template-description">Description:</label>
58                             <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
59                         </li>
60
61                         <li>
62                             <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
63                             [% IF club_template.is_enrollable_from_opac %]
64                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
65                             [% ELSE %]
66                                 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
67                             [% END %]
68                             <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
69                         </li>
70
71                         <li>
72                             <label for="club-template-is-email-required">Require valid email address:</label>
73                             [% IF club_template.is_email_required %]
74                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
75                             [% ELSE %]
76                                 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
77                             [% END %]
78                             <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
79                         </li>
80
81                         <li>
82                             <label for="club-template-branchcode">Library:</label>
83                             <select name="branchcode" id="club-template-branchcode">
84                                 <option value=""></option>
85                                 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
86                             </select>
87                             <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
88                         </li>
89
90                     </ol>
91                 </fieldset>
92
93                 <fieldset class="rows">
94                     <legend>Club fields:</legend>
95                     <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
96                     <div id="club-template-fields">
97                         [% FOREACH f IN club_template.club_template_fields %]
98                             <div class="club-field">
99                                 <ol class="clearfix">
100                                     <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
101                                     <li>
102                                         <label for="field-name-[% f.id | html %]">Name:</label>
103                                         <input type="text" name="club_template_field_name" id="field-name-[% f.id | html %]" value="[% f.name | html %]" />
104                                     </li>
105
106                                     <li>
107                                         <label for="field-description-[% f.id | html %]">Description:</label>
108                                         <input type="text" name="club_template_field_description" id="field-description-[% f.id | html %]" value="[% f.description | html %]" />
109                                     </li>
110
111                                     <li>
112                                         <label for="field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
113                                         <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id | html %]">
114                                             <option value=""></option>
115                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
116                                         </select>
117                                     </li>
118
119                                     <li>
120                                         <label for="field-delete-[% f.id | html %]">Delete field:</label>
121                                         <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id | html %]" value="[% f.id | html %]" />
122                                     </li>
123                                 </ol>
124                             </div>
125                         [% END %]
126                     </div>
127                     <fieldset class="action">
128                         <a href="#" class="add_club_field">
129                             <i class="fa fa-plus"></i> Add new field
130                         </a>
131                     </fieldset>
132                 </fieldset>
133
134                 <fieldset class="rows">
135                     <legend>Enrollment fields</legend>
136                     <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
137                     <div id="club-template-enrollment-fields">
138                         [% FOREACH f IN club_template.club_template_enrollment_fields %]
139                             <div class="enrollment-field">
140                                 <ol class="clearfix">
141                                     <li>
142                                         <span class="label">&nbsp;</span>
143                                         <strong>Enrollment field</strong>
144                                     </li>
145                                     <li>
146                                         <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id | html %]" />
147                                         <label for="enrollment-field-name-[% f.id | html %]">Name:</label>
148                                         <input type="text" name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id | html %]" value="[% f.name | html %]" size="40" />
149                                     </li>
150
151                                     <li>
152                                         <label for="enrollment-field-description-[% f.id | html %]">Description:</label>
153                                         <input type="text" name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id | html %]" value="[% f.description | html %]" size="40" />
154                                     </li>
155
156                                     <li>
157                                         <label for="enrollment-field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
158                                         <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id | html %]">
159                                             <option value=""></option>
160                                             [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
161                                         </select>
162                                     </li>
163
164                                     <li>
165                                         <label for="enrollment-field-delete-[% f.id | html %]">Delete field:</label>
166                                         <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id | html %]" value="[% f.id | html %]" />
167                                     </li>
168                                 </ol>
169                             </div>
170                         [% END %]
171                     </div>
172                     <fieldset class="action">
173                         <a href="#" class="add_enrollment_field">
174                             <i class="fa fa-plus"></i> Add new field
175                         </a>
176                     </fieldset>
177                 </fieldset>
178
179                 <fieldset class="action">
180                     <input type="hidden" name="id" value="[% club_template.id | html %]" />
181                     <input type="submit" value="Save" />
182                     <a href="clubs.pl" class="cancel">Cancel</a>
183                 </fieldset>
184             </form>
185
186         </div> <!-- /.col-md-8 .col-md-offset-2 -->
187     </div> <!-- /.row -->
188
189
190 <div id="new-field-template" class="club-field" style="display:none">
191     <h4 style="margin-left:1em;">New club field</h4>
192     <input type="hidden" name="club_template_field_id" value="" />
193     <ol class="clearfix">
194
195         <li>
196             <label for="club_template_field_name">Name:</label>
197             <input type="text" name="club_template_field_name" />
198         </li>
199
200         <li>
201             <label for="club_template_field_description">Description:</label>
202             <input type="text" name="club_template_field_description" />
203         </li>
204
205         <li>
206             <label for="club_template_field_authorised_value_category">Authorised value category:</label>
207             <select name="club_template_field_authorised_value_category">
208                 <option value=""></option>
209                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
210             </select>
211         </li>
212     </ol>
213     <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
214     <hr/>
215 </div>
216
217 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
218     <h4 style="margin-left:1em;">New enrollment field</h4>
219     <input type="hidden" name="club_template_enrollment_field_id" value="" />
220     <ol class="clearfix">
221
222         <li>
223             <label for="club_template_enrollment_field_name">Name:</label>
224             <input type="text" name="club_template_enrollment_field_name" />
225         </li>
226
227         <li>
228             <label for="club_template_enrollment_field_description">Description:</label>
229             <input type="text" name="club_template_enrollment_field_description" />
230         </li>
231
232         <li>
233             <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
234             <select name="club_template_enrollment_field_authorised_value_category">
235                 <option value=""></option>
236                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
237             </select>
238         </li>
239     </ol>
240     <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
241 </div>
242
243
244 [% MACRO jsinclude BLOCK %]
245     <script>
246         $("body").on("click", ".add_club_field", function(e){
247             e.preventDefault();
248             $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
249         });
250
251         $("body").on("click", ".delete_club_field", function(e){
252             e.preventDefault();
253             $(this).parent().parent().remove();
254         });
255
256         $("body").on("click", ".delete_enrollment_field", function(e){
257             e.preventDefault();
258             $(this).parent().parent().remove();
259         });
260
261         $("body").on("click", ".add_enrollment_field", function(e){
262             e.preventDefault();
263             $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
264         });
265     </script>
266 [% END %]
267
268 [% INCLUDE 'intranet-bottom.inc' %]