2 [% USE AuthorisedValues %]
4 [% INCLUDE 'doc-head-open.inc' %]
7 Modify club template [% club_template.name | html %]
9 Create a new club template
10 [% END %] › Patron clubs › Tools › Koha
12 [% INCLUDE 'doc-head-close.inc' %]
16 border-top: 1px solid #DDD;
21 <body id="clubs_templates_add_modify" class="clubs">
22 [% WRAPPER 'header.inc' %]
23 [% INCLUDE 'cat-search.inc' %]
26 [% WRAPPER 'sub-header.inc' %]
27 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
30 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
33 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
36 <a href="clubs.pl">Patron clubs</a>
39 <a href="#" aria-current="page">
40 [% IF club_template %]
41 Modify club template <em>[% club_template.name | html %]</em>
43 Create a new club template
51 <div class="main container-fluid">
53 <div class="col-md-8 col-md-offset-2">
55 <form method="post" class="validated">
56 <input type="hidden" name="id" value="[% club_template.id | html %]" />
59 [% IF club_template %]
60 Modify club template <em>[% club_template.name | html %]</em>
62 Create a new club template
67 <fieldset class="rows">
70 <label class="required" for="name">Name:</label>
71 <input id="club-template-name" name="name" type="text" value="[% club_template.name | html %]" required="required"/>
72 <span class="required">Required</span>
76 <label for="club-template-description">Description:</label>
77 <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
81 <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
82 [% IF club_template.is_enrollable_from_opac %]
83 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
85 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
87 <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
91 <label for="club-template-is-email-required">Require valid email address:</label>
92 [% IF club_template.is_email_required %]
93 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
95 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
97 <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
101 <label for="club-template-branchcode">Library:</label>
102 <select name="branchcode" id="club-template-branchcode">
103 <option value=""></option>
104 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
106 <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
112 <fieldset class="rows">
113 <legend>Club fields:</legend>
114 <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
115 <div id="club-template-fields">
116 [% FOREACH f IN club_template.club_template_fields %]
117 <div class="club-field">
118 <ol class="clearfix">
119 <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
121 <label for="field-name-[% f.id | html %]">Name:</label>
122 <input type="text" name="club_template_field_name" id="field-name-[% f.id | html %]" value="[% f.name | html %]" />
126 <label for="field-description-[% f.id | html %]">Description:</label>
127 <input type="text" name="club_template_field_description" id="field-description-[% f.id | html %]" value="[% f.description | html %]" />
131 <label for="field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
132 <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id | html %]">
133 <option value=""></option>
134 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
139 <label for="field-delete-[% f.id | html %]">Delete field:</label>
140 <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id | html %]" value="[% f.id | html %]" />
146 <fieldset class="action">
147 <a href="#" class="add_club_field">
148 <i class="fa fa-plus"></i> Add new field
153 <fieldset class="rows">
154 <legend>Enrollment fields</legend>
155 <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
156 <div id="club-template-enrollment-fields">
157 [% FOREACH f IN club_template.club_template_enrollment_fields %]
158 <div class="enrollment-field">
159 <ol class="clearfix">
161 <span class="label"> </span>
162 <strong>Enrollment field</strong>
165 <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id | html %]" />
166 <label for="enrollment-field-name-[% f.id | html %]">Name:</label>
167 <input type="text" name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id | html %]" value="[% f.name | html %]" size="40" />
171 <label for="enrollment-field-description-[% f.id | html %]">Description:</label>
172 <input type="text" name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id | html %]" value="[% f.description | html %]" size="40" />
176 <label for="enrollment-field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
177 <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id | html %]">
178 <option value=""></option>
179 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
184 <label for="enrollment-field-delete-[% f.id | html %]">Delete field:</label>
185 <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id | html %]" value="[% f.id | html %]" />
191 <fieldset class="action">
192 <a href="#" class="add_enrollment_field">
193 <i class="fa fa-plus"></i> Add new field
198 <fieldset class="action">
199 <input type="hidden" name="id" value="[% club_template.id | html %]" />
200 <input type="submit" value="Save" />
201 <a href="clubs.pl" class="cancel">Cancel</a>
205 </div> <!-- /.col-md-8 .col-md-offset-2 -->
206 </div> <!-- /.row -->
209 <div id="new-field-template" class="club-field" style="display:none">
210 <h4 style="margin-left:1em;">New club field</h4>
211 <input type="hidden" name="club_template_field_id" value="" />
212 <ol class="clearfix">
215 <label for="club_template_field_name">Name:</label>
216 <input type="text" name="club_template_field_name" />
220 <label for="club_template_field_description">Description:</label>
221 <input type="text" name="club_template_field_description" />
225 <label for="club_template_field_authorised_value_category">Authorised value category:</label>
226 <select name="club_template_field_authorised_value_category">
227 <option value=""></option>
228 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
232 <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
236 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
237 <h4 style="margin-left:1em;">New enrollment field</h4>
238 <input type="hidden" name="club_template_enrollment_field_id" value="" />
239 <ol class="clearfix">
242 <label for="club_template_enrollment_field_name">Name:</label>
243 <input type="text" name="club_template_enrollment_field_name" />
247 <label for="club_template_enrollment_field_description">Description:</label>
248 <input type="text" name="club_template_enrollment_field_description" />
252 <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
253 <select name="club_template_enrollment_field_authorised_value_category">
254 <option value=""></option>
255 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
259 <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
263 [% MACRO jsinclude BLOCK %]
265 $("body").on("click", ".add_club_field", function(e){
267 $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
270 $("body").on("click", ".delete_club_field", function(e){
272 $(this).parent().parent().remove();
275 $("body").on("click", ".delete_enrollment_field", function(e){
277 $(this).parent().parent().remove();
280 $("body").on("click", ".add_enrollment_field", function(e){
282 $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
287 [% INCLUDE 'intranet-bottom.inc' %]