3 [% USE AuthorisedValues %]
5 [% PROCESS 'i18n.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
10 [% tx("Modify club template {club_template}", { club_template = club_template.name }) | html %] ›
12 [% t("New club template") | html %]
14 [% t("Patron clubs") | html %] ›
15 [% t("Tools") | html %] ›
16 [% t("Koha") | html %]
18 [% INCLUDE 'doc-head-close.inc' %]
22 border-top: 1px solid #DDD;
27 <body id="clubs_templates_add_modify" class="clubs">
28 [% WRAPPER 'header.inc' %]
29 [% INCLUDE 'cat-search.inc' %]
32 [% WRAPPER 'sub-header.inc' %]
33 [% WRAPPER breadcrumbs %]
34 [% WRAPPER breadcrumb_item %]
35 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
37 [% WRAPPER breadcrumb_item %]
38 <a href="clubs.pl">Patron clubs</a>
40 [% WRAPPER breadcrumb_item bc_active= 1 %]
41 [% IF club_template %]
42 <span>Modify club template [% club_template.name | html | $HtmlTags tag="em" %]</span>
44 <span>New club template</span>
47 [% END #/ WRAPPER breadcrumbs %]
48 [% END #/ WRAPPER sub-header.inc %]
50 <div class="main container-fluid">
52 <div class="col-md-8 col-md-offset-2">
54 <form method="post" class="validated">
55 <input type="hidden" name="id" value="[% club_template.id | html %]" />
58 [% IF club_template %]
59 <span>Modify club template [% club_template.name | html | $HtmlTags tag="em" %]</span>
61 <span>New club template</span>
66 <fieldset class="rows">
69 <label class="required" for="name">Name:</label>
70 <input id="club-template-name" name="name" type="text" value="[% club_template.name | html %]" required="required"/>
71 <span class="required">Required</span>
75 <label for="club-template-description">Description:</label>
76 <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
80 <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
81 [% IF club_template.is_enrollable_from_opac %]
82 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
84 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
86 <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
90 <label for="club-template-is-email-required">Require valid email address:</label>
91 [% IF club_template.is_email_required %]
92 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
94 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
96 <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
100 <label for="club-template-branchcode">Library:</label>
101 <select name="branchcode" id="club-template-branchcode">
102 <option value=""></option>
103 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
105 <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
111 <fieldset class="rows">
112 <legend>Club fields:</legend>
113 <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
114 <div id="club-template-fields">
115 [% FOREACH f IN club_template.club_template_fields %]
116 <div class="club-field">
117 <ol class="clearfix">
118 <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
120 <label for="field-name-[% f.id | html %]">Name:</label>
121 <input type="text" name="club_template_field_name" id="field-name-[% f.id | html %]" value="[% f.name | html %]" />
125 <label for="field-description-[% f.id | html %]">Description:</label>
126 <input type="text" name="club_template_field_description" id="field-description-[% f.id | html %]" value="[% f.description | html %]" />
130 <label for="field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
131 <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id | html %]">
132 <option value=""></option>
133 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
138 <label for="field-delete-[% f.id | html %]">Delete field:</label>
139 <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id | html %]" value="[% f.id | html %]" />
145 <fieldset class="action">
146 <a href="#" class="add_club_field">
147 <i class="fa fa-plus"></i> Add new field
152 <fieldset class="rows">
153 <legend>Enrollment fields</legend>
154 <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
155 <div id="club-template-enrollment-fields">
156 [% FOREACH f IN club_template.club_template_enrollment_fields %]
157 <div class="enrollment-field">
158 <ol class="clearfix">
160 <span class="label"> </span>
161 <strong>Enrollment field</strong>
164 <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id | html %]" />
165 <label for="enrollment-field-name-[% f.id | html %]">Name:</label>
166 <input type="text" name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id | html %]" value="[% f.name | html %]" size="40" />
170 <label for="enrollment-field-description-[% f.id | html %]">Description:</label>
171 <input type="text" name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id | html %]" value="[% f.description | html %]" size="40" />
175 <label for="enrollment-field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
176 <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id | html %]">
177 <option value=""></option>
178 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
183 <label for="enrollment-field-delete-[% f.id | html %]">Delete field:</label>
184 <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id | html %]" value="[% f.id | html %]" />
190 <fieldset class="action">
191 <a href="#" class="add_enrollment_field">
192 <i class="fa fa-plus"></i> Add new field
197 <fieldset class="action">
198 <input type="hidden" name="id" value="[% club_template.id | html %]" />
199 <input type="submit" class="btn btn-primary" value="Save" />
200 <a href="clubs.pl" class="cancel">Cancel</a>
204 </div> <!-- /.col-md-8 .col-md-offset-2 -->
205 </div> <!-- /.row -->
208 <div id="new-field-template" class="club-field" style="display:none">
209 <h4 style="margin-left:1em;">New club field</h4>
210 <input type="hidden" name="club_template_field_id" value="" />
211 <ol class="clearfix">
214 <label for="club_template_field_name">Name:</label>
215 <input type="text" name="club_template_field_name" />
219 <label for="club_template_field_description">Description:</label>
220 <input type="text" name="club_template_field_description" />
224 <label for="club_template_field_authorised_value_category">Authorised value category:</label>
225 <select name="club_template_field_authorised_value_category">
226 <option value=""></option>
227 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
231 <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash-can"></i> Delete field</a></fieldset>
235 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
236 <h4 style="margin-left:1em;">New enrollment field</h4>
237 <input type="hidden" name="club_template_enrollment_field_id" value="" />
238 <ol class="clearfix">
241 <label for="club_template_enrollment_field_name">Name:</label>
242 <input type="text" name="club_template_enrollment_field_name" />
246 <label for="club_template_enrollment_field_description">Description:</label>
247 <input type="text" name="club_template_enrollment_field_description" />
251 <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
252 <select name="club_template_enrollment_field_authorised_value_category">
253 <option value=""></option>
254 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
258 <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash-can"></i> Delete field</a></fieldset>
262 [% MACRO jsinclude BLOCK %]
264 $("body").on("click", ".add_club_field", function(e){
266 $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
269 $("body").on("click", ".delete_club_field", function(e){
271 $(this).parent().parent().remove();
274 $("body").on("click", ".delete_enrollment_field", function(e){
276 $(this).parent().parent().remove();
279 $("body").on("click", ".add_enrollment_field", function(e){
281 $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
286 [% INCLUDE 'intranet-bottom.inc' %]