2 [% USE AuthorisedValues %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › Patron clubs ›
7 Modify club template [% club_template.name | html %]
9 Create a new club template
12 [% INCLUDE 'doc-head-close.inc' %]
16 border-top: 1px solid #DDD;
21 <body id="clubs_templates_add_modify" class="clubs">
22 [% INCLUDE 'header.inc' %]
23 [% INCLUDE 'cat-search.inc' %]
25 <nav aria-label="Breadcrumb" class="breadcrumb">
28 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
31 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
34 <a href="clubs.pl">Patron clubs</a>
37 <a href="#" aria-current="page">
38 [% IF club_template %]
39 Modify club template <em>[% club_template.name | html %]</em>
41 Create a new club template
48 <div class="main container-fluid">
50 <div class="col-md-8 col-md-offset-2">
52 <form method="post" class="validated">
53 <input type="hidden" name="id" value="[% club_template.id | html %]" />
56 [% IF club_template %]
57 Modify club template <em>[% club_template.name | html %]</em>
59 Create a new club template
64 <fieldset class="rows">
67 <label class="required" for="name">Name:</label>
68 <input id="club-template-name" name="name" type="text" value="[% club_template.name | html %]" required="required"/>
69 <span class="required">Required</span>
73 <label for="club-template-description">Description:</label>
74 <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
78 <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
79 [% IF club_template.is_enrollable_from_opac %]
80 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
82 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
84 <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
88 <label for="club-template-is-email-required">Require valid email address:</label>
89 [% IF club_template.is_email_required %]
90 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
92 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
94 <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
98 <label for="club-template-branchcode">Library:</label>
99 <select name="branchcode" id="club-template-branchcode">
100 <option value=""></option>
101 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
103 <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
109 <fieldset class="rows">
110 <legend>Club fields:</legend>
111 <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
112 <div id="club-template-fields">
113 [% FOREACH f IN club_template.club_template_fields %]
114 <div class="club-field">
115 <ol class="clearfix">
116 <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
118 <label for="field-name-[% f.id | html %]">Name:</label>
119 <input type="text" name="club_template_field_name" id="field-name-[% f.id | html %]" value="[% f.name | html %]" />
123 <label for="field-description-[% f.id | html %]">Description:</label>
124 <input type="text" name="club_template_field_description" id="field-description-[% f.id | html %]" value="[% f.description | html %]" />
128 <label for="field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
129 <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id | html %]">
130 <option value=""></option>
131 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
136 <label for="field-delete-[% f.id | html %]">Delete field:</label>
137 <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id | html %]" value="[% f.id | html %]" />
143 <fieldset class="action">
144 <a href="#" class="add_club_field">
145 <i class="fa fa-plus"></i> Add new field
150 <fieldset class="rows">
151 <legend>Enrollment fields</legend>
152 <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
153 <div id="club-template-enrollment-fields">
154 [% FOREACH f IN club_template.club_template_enrollment_fields %]
155 <div class="enrollment-field">
156 <ol class="clearfix">
158 <span class="label"> </span>
159 <strong>Enrollment field</strong>
162 <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id | html %]" />
163 <label for="enrollment-field-name-[% f.id | html %]">Name:</label>
164 <input type="text" name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id | html %]" value="[% f.name | html %]" size="40" />
168 <label for="enrollment-field-description-[% f.id | html %]">Description:</label>
169 <input type="text" name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id | html %]" value="[% f.description | html %]" size="40" />
173 <label for="enrollment-field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
174 <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id | html %]">
175 <option value=""></option>
176 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
181 <label for="enrollment-field-delete-[% f.id | html %]">Delete field:</label>
182 <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id | html %]" value="[% f.id | html %]" />
188 <fieldset class="action">
189 <a href="#" class="add_enrollment_field">
190 <i class="fa fa-plus"></i> Add new field
195 <fieldset class="action">
196 <input type="hidden" name="id" value="[% club_template.id | html %]" />
197 <input type="submit" value="Save" />
198 <a href="clubs.pl" class="cancel">Cancel</a>
202 </div> <!-- /.col-md-8 .col-md-offset-2 -->
203 </div> <!-- /.row -->
206 <div id="new-field-template" class="club-field" style="display:none">
207 <h4 style="margin-left:1em;">New club field</h4>
208 <input type="hidden" name="club_template_field_id" value="" />
209 <ol class="clearfix">
212 <label for="club_template_field_name">Name:</label>
213 <input type="text" name="club_template_field_name" />
217 <label for="club_template_field_description">Description:</label>
218 <input type="text" name="club_template_field_description" />
222 <label for="club_template_field_authorised_value_category">Authorised value category:</label>
223 <select name="club_template_field_authorised_value_category">
224 <option value=""></option>
225 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
229 <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
233 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
234 <h4 style="margin-left:1em;">New enrollment field</h4>
235 <input type="hidden" name="club_template_enrollment_field_id" value="" />
236 <ol class="clearfix">
239 <label for="club_template_enrollment_field_name">Name:</label>
240 <input type="text" name="club_template_enrollment_field_name" />
244 <label for="club_template_enrollment_field_description">Description:</label>
245 <input type="text" name="club_template_enrollment_field_description" />
249 <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
250 <select name="club_template_enrollment_field_authorised_value_category">
251 <option value=""></option>
252 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
256 <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
260 [% MACRO jsinclude BLOCK %]
262 $("body").on("click", ".add_club_field", function(e){
264 $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
267 $("body").on("click", ".delete_club_field", function(e){
269 $(this).parent().parent().remove();
272 $("body").on("click", ".delete_enrollment_field", function(e){
274 $(this).parent().parent().remove();
277 $("body").on("click", ".add_enrollment_field", function(e){
279 $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
284 [% INCLUDE 'intranet-bottom.inc' %]