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' %]
24 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="clubs.pl">Patron clubs</a> ›
25 [% IF club_template %]
26 Modify club template <em>[% club_template.name | html %]</em>
28 Create a new club template
32 <div class="main container-fluid">
34 <div class="col-md-8 col-md-offset-2">
36 <form method="post" class="validated">
37 <input type="hidden" name="id" value="[% club_template.id | html %]" />
40 [% IF club_template %]
41 Modify club template <em>[% club_template.name | html %]</em>
43 Create a new club template
48 <fieldset class="rows">
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>
57 <label for="club-template-description">Description:</label>
58 <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
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" />
66 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
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>
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" />
76 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
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>
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 ) %]
87 <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
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">
100 <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
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 %]" />
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 %]" />
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) %]
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 %]" />
127 <fieldset class="action">
128 <a href="#" class="add_club_field">
129 <i class="fa fa-plus"></i> Add new field
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">
142 <span class="label"> </span>
143 <strong>Enrollment field</strong>
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" />
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" />
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) %]
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 %]" />
172 <fieldset class="action">
173 <a href="#" class="add_enrollment_field">
174 <i class="fa fa-plus"></i> Add new field
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>
186 </div> <!-- /.col-md-8 .col-md-offset-2 -->
187 </div> <!-- /.row -->
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">
196 <label for="club_template_field_name">Name:</label>
197 <input type="text" name="club_template_field_name" />
201 <label for="club_template_field_description">Description:</label>
202 <input type="text" name="club_template_field_description" />
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() %]
213 <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
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">
223 <label for="club_template_enrollment_field_name">Name:</label>
224 <input type="text" name="club_template_enrollment_field_name" />
228 <label for="club_template_enrollment_field_description">Description:</label>
229 <input type="text" name="club_template_enrollment_field_description" />
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() %]
240 <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash"></i> Delete field</a></fieldset>
244 [% MACRO jsinclude BLOCK %]
246 $("body").on("click", ".add_club_field", function(e){
248 $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
251 $("body").on("click", ".delete_club_field", function(e){
253 $(this).parent().parent().remove();
256 $("body").on("click", ".delete_enrollment_field", function(e){
258 $(this).parent().parent().remove();
261 $("body").on("click", ".add_enrollment_field", function(e){
263 $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
268 [% INCLUDE 'intranet-bottom.inc' %]