Bug 12461 - Add patron clubs feature
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / clubs / templates-add-modify.tt
1 [% USE Branches %]
2 [% USE AuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Tools &rsaquo; Patron clubs &rsaquo; Club template</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="clubs_templates_add_modify" class="clubs">
9 [% INCLUDE 'header.inc' %]
10 [% INCLUDE 'cat-search.inc' %]
11 <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; Add / modify club template</div>
12
13 <div class="yui-t7">
14     <div class="yui-main">
15         <form method="post" class="validated">
16             <input type="hidden" name="id" value="[% club_template.id %]" />
17
18             <fieldset class="rows">
19
20                 <legend>
21                     [% IF club_template %]
22                         Modify club template <i>[% club_template.name %]</i>
23                     [% ELSE %]
24                         Create a new club template
25                     [% END %]
26                 </legend>
27
28                 <ol>
29                     <li>
30                         <label class="required" for="name">Name:</label>
31                         <input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/>
32                         <span class="required">Required</span>
33                     </li>
34
35                     <li>
36                         <label for="description">Description:</label>
37                         <input id="club-template-description" name="description" type="text" value="[% club_template.description %]" />
38                     </li>
39
40                     <li>
41                         <label for="is_enrollable_from_opac">Allow public enrollment:</label>
42                         [% IF club_template.is_enrollable_from_opac %]
43                             <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
44                         [% ELSE %]
45                             <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
46                         [% END %]
47                         <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
48                     </li>
49
50                     <li>
51                         <label for="is_email_required">Require valid email address:</label>
52                         [% IF club_template.is_email_required %]
53                             <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
54                         [% ELSE %]
55                             <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
56                         [% END %]
57                         <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
58                     </li>
59
60                     <li>
61                         <label for="branchcode">Library:</label>
62                         <select name="branchcode" id="club-template-branchcode">
63                             <option value="">&nbsp</option>
64                             [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
65                         </select>
66                         <span class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</span>
67                     </li>
68
69                 </ol>
70
71                 <h2>Club fields:</h2>
72                 <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
73                 <span id="club-template-fields">
74                     [% FOREACH f IN club_template.club_template_fields %]
75                         <ul>
76                             <input type="hidden" name="club_template_field_id" value="[% f.id %]" />
77                             <li>
78                                 <label for="field-name-[% f.id %]">Name:</label>
79                                 <input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" />
80                             </li>
81
82                             <li>
83                                 <label for="field-description-[% f.id %]">Description:</label>
84                                 <input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" />
85                             </li>
86
87                             <li>
88                                 <label for="field-description-[% f.id %]">Authorised value category:</label>
89                                 <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]">
90                                     <option value="">&nbsp;</option>
91                                     [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
92                                 </select>
93                             </li>
94
95                             <li>
96                                 <label for="field-delete-[% f.id %]">Delete field:</label>
97                                 <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" />
98                             </li>
99
100                             <hr/>
101                         </ul>
102                     [% END %]
103                 </span>
104                 <div class="btn-toolbar">
105                     <a href="#" class="btn btn-default" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;">
106                         <i class="fa fa-plus"></i> Add new field
107                     </a>
108                 </div>
109
110                 <h2>Enrollment fields:</h2>
111                 <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
112                 <span id="club-template-enrollment-fields">
113                     [% FOREACH f IN club_template.club_template_enrollment_fields %]
114                         <ul>
115                             <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" />
116                             <li>
117                                 <label for="enrollment-field-name-[% f.id %]">Name:</label>
118                                 <input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" />
119                             </li>
120
121                             <li>
122                                 <label for="enrollment-field-description-[% f.id %]">Description:</label>
123                                 <input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" />
124                             </li>
125
126                             <li>
127                                 <label for="enrollment-field-description-[% f.id %]">Authorised value category:</label>
128                                 <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]">
129                                     <option value="">&nbsp;</option>
130                                     [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
131                                 </select>
132                             </li>
133
134                             <li>
135                                 <label for="enrollment-field-delete-[% f.id %]">Delete field:</label>
136                                 <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" />
137                             </li>
138
139                             <hr/>
140                         </ul>
141                     [% END %]
142                 </span>
143                 <div class="btn-toolbar">
144                     <a href="#" class="btn btn-default" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;">
145                         <i class="fa fa-plus"></i> Add new field
146                     </a>
147                 </div>
148
149             </fieldset>
150
151             <fieldset class="action">
152                 <input type="hidden" name="id" value="[% club_template.id %]" />
153                 <input type="submit" class="btn btn-default" value="Save" />
154                 <a href="clubs.pl" class="cancel">Cancel</a>
155             </fieldset>
156         </form>
157     </div>
158 </div>
159
160 <span id="new-field-template" style="display:none">
161     <ul>
162         <input type="hidden" name="club_template_field_id" value="" />
163
164         <li>
165             <label for="club_template_field_name">Name:</label>
166             <input name="club_template_field_name" />
167         </li>
168
169         <li>
170             <label for="club_template_field_description">Description:</label>
171             <input name="club_template_field_description" />
172         </li>
173
174         <li>
175             <label for="club_template_field_authorised_value_category">Authorised value category:</label>
176             <select name="club_template_field_authorised_value_category">
177                 <option value="">&nbsp;</option>
178                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
179             </select>
180         </li>
181
182         <a href="#" onclick="$(this).parent().remove(); return false;">Cancel</a>
183
184         <hr/>
185     </ul>
186 </span>
187
188 <span id="new-enrollment-field-template" style="display:none">
189     <ul>
190         <input type="hidden" name="club_template_enrollment_field_id" value="" />
191
192         <li>
193             <label for="club_template_enrollment_field_name">Name:</label>
194             <input name="club_template_enrollment_field_name" />
195         </li>
196
197         <li>
198             <label for="club_template_enrollment_field_description">Description:</label>
199             <input name="club_template_enrollment_field_description" />
200         </li>
201
202         <li>
203             <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
204             <select name="club_template_enrollment_field_authorised_value_category">
205                 <option value="">&nbsp;</option>
206                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
207             </select>
208         </li>
209
210         <a href="#" onclick="$(this).parent().remove(); return false;">Cancel</a>
211
212         <hr/>
213     </ul>
214 </span>
215
216 [% INCLUDE 'intranet-bottom.inc' %]