3 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
9 Modify club template [% club_template.name | html %]
11 Create a new club template
12 [% END %] › Patron clubs › Tools › Koha
14 [% INCLUDE 'doc-head-close.inc' %]
18 border-top: 1px solid #DDD;
23 <body id="clubs_templates_add_modify" class="clubs">
24 [% WRAPPER 'header.inc' %]
25 [% INCLUDE 'cat-search.inc' %]
28 [% WRAPPER 'sub-header.inc' %]
29 [% WRAPPER breadcrumbs %]
30 [% WRAPPER breadcrumb_item %]
31 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
33 [% WRAPPER breadcrumb_item %]
34 <a href="clubs.pl">Patron clubs</a>
36 [% WRAPPER breadcrumb_item bc_active= 1 %]
37 [% IF club_template %]
38 <span>Modify club template [% club_template.name | html | $HtmlTags tag="em" %]</span>
40 <span>Create a new club template</span>
43 [% END #/ WRAPPER breadcrumbs %]
44 [% END #/ WRAPPER sub-header.inc %]
46 <div class="main container-fluid">
48 <div class="col-md-8 col-md-offset-2">
50 <form method="post" class="validated">
51 <input type="hidden" name="id" value="[% club_template.id | html %]" />
54 [% IF club_template %]
55 <span>Modify club template [% club_template.name | html | $HtmlTags tag="em" %]</span>
57 <span>Create a new club template</span>
62 <fieldset class="rows">
65 <label class="required" for="name">Name:</label>
66 <input id="club-template-name" name="name" type="text" value="[% club_template.name | html %]" required="required"/>
67 <span class="required">Required</span>
71 <label for="club-template-description">Description:</label>
72 <input id="club-template-description" name="description" type="text" value="[% club_template.description | html %]" />
76 <label for="club-template-is-enrollable-from-opac">Allow public enrollment:</label>
77 [% IF club_template.is_enrollable_from_opac %]
78 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" />
80 <input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" />
82 <span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span>
86 <label for="club-template-is-email-required">Require valid email address:</label>
87 [% IF club_template.is_email_required %]
88 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" />
90 <input type="checkbox" id="club-template-is-email-required" name="is_email_required" />
92 <span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span>
96 <label for="club-template-branchcode">Library:</label>
97 <select name="branchcode" id="club-template-branchcode">
98 <option value=""></option>
99 [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
101 <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
107 <fieldset class="rows">
108 <legend>Club fields:</legend>
109 <p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p>
110 <div id="club-template-fields">
111 [% FOREACH f IN club_template.club_template_fields %]
112 <div class="club-field">
113 <ol class="clearfix">
114 <input type="hidden" name="club_template_field_id" value="[% f.id | html %]" />
116 <label for="field-name-[% f.id | html %]">Name:</label>
117 <input type="text" name="club_template_field_name" id="field-name-[% f.id | html %]" value="[% f.name | html %]" />
121 <label for="field-description-[% f.id | html %]">Description:</label>
122 <input type="text" name="club_template_field_description" id="field-description-[% f.id | html %]" value="[% f.description | html %]" />
126 <label for="field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
127 <select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id | html %]">
128 <option value=""></option>
129 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
134 <label for="field-delete-[% f.id | html %]">Delete field:</label>
135 <input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id | html %]" value="[% f.id | html %]" />
141 <fieldset class="action">
142 <a href="#" class="add_club_field">
143 <i class="fa fa-plus"></i> Add new field
148 <fieldset class="rows">
149 <legend>Enrollment fields</legend>
150 <p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p>
151 <div id="club-template-enrollment-fields">
152 [% FOREACH f IN club_template.club_template_enrollment_fields %]
153 <div class="enrollment-field">
154 <ol class="clearfix">
156 <span class="label"> </span>
157 <strong>Enrollment field</strong>
160 <input type="hidden" name="club_template_enrollment_field_id" value="[% f.id | html %]" />
161 <label for="enrollment-field-name-[% f.id | html %]">Name:</label>
162 <input type="text" name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id | html %]" value="[% f.name | html %]" size="40" />
166 <label for="enrollment-field-description-[% f.id | html %]">Description:</label>
167 <input type="text" name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id | html %]" value="[% f.description | html %]" size="40" />
171 <label for="enrollment-field-authorised-value-category-[% f.id | html %]">Authorised value category:</label>
172 <select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id | html %]">
173 <option value=""></option>
174 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %]
179 <label for="enrollment-field-delete-[% f.id | html %]">Delete field:</label>
180 <input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id | html %]" value="[% f.id | html %]" />
186 <fieldset class="action">
187 <a href="#" class="add_enrollment_field">
188 <i class="fa fa-plus"></i> Add new field
193 <fieldset class="action">
194 <input type="hidden" name="id" value="[% club_template.id | html %]" />
195 <input type="submit" class="btn btn-primary" value="Save" />
196 <a href="clubs.pl" class="cancel">Cancel</a>
200 </div> <!-- /.col-md-8 .col-md-offset-2 -->
201 </div> <!-- /.row -->
204 <div id="new-field-template" class="club-field" style="display:none">
205 <h4 style="margin-left:1em;">New club field</h4>
206 <input type="hidden" name="club_template_field_id" value="" />
207 <ol class="clearfix">
210 <label for="club_template_field_name">Name:</label>
211 <input type="text" name="club_template_field_name" />
215 <label for="club_template_field_description">Description:</label>
216 <input type="text" name="club_template_field_description" />
220 <label for="club_template_field_authorised_value_category">Authorised value category:</label>
221 <select name="club_template_field_authorised_value_category">
222 <option value=""></option>
223 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
227 <fieldset class="action"><a href="#" class="delete_club_field"><i class="fa fa-trash-can"></i> Delete field</a></fieldset>
231 <div id="new-enrollment-field-template" class="enrollment-field" style="display:none">
232 <h4 style="margin-left:1em;">New enrollment field</h4>
233 <input type="hidden" name="club_template_enrollment_field_id" value="" />
234 <ol class="clearfix">
237 <label for="club_template_enrollment_field_name">Name:</label>
238 <input type="text" name="club_template_enrollment_field_name" />
242 <label for="club_template_enrollment_field_description">Description:</label>
243 <input type="text" name="club_template_enrollment_field_description" />
247 <label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label>
248 <select name="club_template_enrollment_field_authorised_value_category">
249 <option value=""></option>
250 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %]
254 <fieldset class="action"><a href="#" class="delete_enrollment_field"><i class="fa fa-trash-can"></i> Delete field</a></fieldset>
258 [% MACRO jsinclude BLOCK %]
260 $("body").on("click", ".add_club_field", function(e){
262 $("#new-field-template").clone().attr("id","").show().appendTo("#club-template-fields");
265 $("body").on("click", ".delete_club_field", function(e){
267 $(this).parent().parent().remove();
270 $("body").on("click", ".delete_enrollment_field", function(e){
272 $(this).parent().parent().remove();
275 $("body").on("click", ".add_enrollment_field", function(e){
277 $('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields');
282 [% INCLUDE 'intranet-bottom.inc' %]