|
Lines 1-165
Link Here
|
| 1 |
[% USE Branches %] |
1 |
[% USE Branches %] |
| 2 |
[% USE AuthorisedValues %] |
2 |
[% USE AuthorisedValues %] |
| 3 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
| 4 |
<title>Koha › Tools › Patron clubs › Club template</title> |
4 |
<title>Koha › Tools › Patron clubs › |
|
|
5 |
[% IF club_template %] |
| 6 |
Modify club template [% club_template.name %] |
| 7 |
[% ELSE %] |
| 8 |
Create a new club template |
| 9 |
[% END %] |
| 10 |
</title> |
| 5 |
[% INCLUDE 'doc-head-close.inc' %] |
11 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
12 |
<style type="text/css"> |
| 13 |
.club-field, |
| 14 |
.enrollment-field { |
| 15 |
border-top: 1px solid #DDD; |
| 16 |
} |
| 17 |
</style> |
| 6 |
</head> |
18 |
</head> |
| 7 |
|
19 |
|
| 8 |
<body id="clubs_templates_add_modify" class="clubs"> |
20 |
<body id="clubs_templates_add_modify" class="clubs"> |
| 9 |
[% INCLUDE 'header.inc' %] |
21 |
[% INCLUDE 'header.inc' %] |
| 10 |
[% INCLUDE 'cat-search.inc' %] |
22 |
[% INCLUDE 'cat-search.inc' %] |
| 11 |
<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> › Add / modify club template</div> |
23 |
<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> › |
| 12 |
|
24 |
[% IF club_template %] |
| 13 |
<div class="yui-t7"> |
25 |
Modify club template <i>[% club_template.name %]</i> |
| 14 |
<div class="yui-main"> |
26 |
[% ELSE %] |
| 15 |
<form method="post" class="validated"> |
27 |
Create a new club template |
| 16 |
<input type="hidden" name="id" value="[% club_template.id %]" /> |
28 |
[% END %] |
|
|
29 |
</div> |
| 17 |
|
30 |
|
| 18 |
<fieldset class="rows"> |
31 |
<div id="doc" class="yui-t7"> |
|
|
32 |
<div id="bd"> |
| 33 |
<div class="yui-main"> |
| 34 |
<form method="post" class="validated"> |
| 35 |
<input type="hidden" name="id" value="[% club_template.id %]" /> |
| 19 |
|
36 |
|
| 20 |
<legend> |
37 |
<h2> |
| 21 |
[% IF club_template %] |
38 |
[% IF club_template %] |
| 22 |
Modify club template <i>[% club_template.name %]</i> |
39 |
Modify club template <i>[% club_template.name %]</i> |
| 23 |
[% ELSE %] |
40 |
[% ELSE %] |
| 24 |
Create a new club template |
41 |
Create a new club template |
| 25 |
[% END %] |
42 |
[% END %] |
| 26 |
</legend> |
43 |
</h2> |
| 27 |
|
44 |
|
| 28 |
<ol> |
45 |
|
| 29 |
<li> |
46 |
<fieldset class="rows"> |
| 30 |
<label class="required" for="name">Name:</label> |
47 |
<ol> |
| 31 |
<input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/> |
48 |
<li> |
| 32 |
<span class="required">Required</span> |
49 |
<label class="required" for="name">Name:</label> |
| 33 |
</li> |
50 |
<input id="club-template-name" name="name" type="text" value="[% club_template.name %]" required="required"/> |
| 34 |
|
51 |
<span class="required">Required</span> |
| 35 |
<li> |
52 |
</li> |
| 36 |
<label for="description">Description:</label> |
53 |
|
| 37 |
<input id="club-template-description" name="description" type="text" value="[% club_template.description %]" /> |
54 |
<li> |
| 38 |
</li> |
55 |
<label for="description">Description:</label> |
| 39 |
|
56 |
<input id="club-template-description" name="description" type="text" value="[% club_template.description %]" /> |
| 40 |
<li> |
57 |
</li> |
| 41 |
<label for="is_enrollable_from_opac">Allow public enrollment:</label> |
58 |
|
| 42 |
[% IF club_template.is_enrollable_from_opac %] |
59 |
<li> |
| 43 |
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" /> |
60 |
<label for="is_enrollable_from_opac">Allow public enrollment:</label> |
| 44 |
[% ELSE %] |
61 |
[% IF club_template.is_enrollable_from_opac %] |
| 45 |
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" /> |
62 |
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" checked="checked" /> |
|
|
63 |
[% ELSE %] |
| 64 |
<input type="checkbox" id="club-template-is-enrollable-from-opac" name="is_enrollable_from_opac" /> |
| 65 |
[% END %] |
| 66 |
<span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span> |
| 67 |
</li> |
| 68 |
|
| 69 |
<li> |
| 70 |
<label for="is_email_required">Require valid email address:</label> |
| 71 |
[% IF club_template.is_email_required %] |
| 72 |
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" /> |
| 73 |
[% ELSE %] |
| 74 |
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" /> |
| 75 |
[% END %] |
| 76 |
<span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span> |
| 77 |
</li> |
| 78 |
|
| 79 |
<li> |
| 80 |
<label for="branchcode">Library:</label> |
| 81 |
<select name="branchcode" id="club-template-branchcode"> |
| 82 |
<option value=""></option> |
| 83 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %] |
| 84 |
</select> |
| 85 |
<div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div> |
| 86 |
</li> |
| 87 |
|
| 88 |
</ol> |
| 89 |
</fieldset> |
| 90 |
|
| 91 |
<fieldset class="rows"> |
| 92 |
<legend>Club fields:</legend> |
| 93 |
<p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p> |
| 94 |
<div id="club-template-fields"> |
| 95 |
[% FOREACH f IN club_template.club_template_fields %] |
| 96 |
<div class="club-field"> |
| 97 |
<ol class="clearfix"> |
| 98 |
<input type="hidden" name="club_template_field_id" value="[% f.id %]" /> |
| 99 |
<li> |
| 100 |
<label for="field-name-[% f.id %]">Name:</label> |
| 101 |
<input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" /> |
| 102 |
</li> |
| 103 |
|
| 104 |
<li> |
| 105 |
<label for="field-description-[% f.id %]">Description:</label> |
| 106 |
<input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" /> |
| 107 |
</li> |
| 108 |
|
| 109 |
<li> |
| 110 |
<label for="field-description-[% f.id %]">Authorised value category:</label> |
| 111 |
<select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]"> |
| 112 |
<option value=""></option> |
| 113 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %] |
| 114 |
</select> |
| 115 |
</li> |
| 116 |
|
| 117 |
<li> |
| 118 |
<label for="field-delete-[% f.id %]">Delete field:</label> |
| 119 |
<input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" /> |
| 120 |
</li> |
| 121 |
</ol> |
| 122 |
</div> |
| 46 |
[% END %] |
123 |
[% END %] |
| 47 |
<span class="hint">If a template allows public enrollment, patrons can enroll in a club based on this template from the public catalog.</span> |
124 |
</div> |
| 48 |
</li> |
125 |
<fieldset class="action"> |
| 49 |
|
126 |
<a href="#" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;"> |
| 50 |
<li> |
127 |
<i class="fa fa-plus"></i> Add new field |
| 51 |
<label for="is_email_required">Require valid email address:</label> |
128 |
</a> |
| 52 |
[% IF club_template.is_email_required %] |
129 |
</fieldset> |
| 53 |
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" checked="checked" /> |
130 |
</fieldset> |
| 54 |
[% ELSE %] |
131 |
|
| 55 |
<input type="checkbox" id="club-template-is-email-required" name="is_email_required" /> |
132 |
<fieldset class="rows"> |
|
|
133 |
<legend>Enrollment fields</legend> |
| 134 |
<p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p> |
| 135 |
<div id="club-template-enrollment-fields"> |
| 136 |
[% FOREACH f IN club_template.club_template_enrollment_fields %] |
| 137 |
<div class="enrollment-field"> |
| 138 |
<ol class="clearfix"> |
| 139 |
<li> |
| 140 |
<span class="label"> </span> |
| 141 |
<strong>Enrollment field</strong> |
| 142 |
</li> |
| 143 |
<li> |
| 144 |
<input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" /> |
| 145 |
<label for="enrollment-field-name-[% f.id %]">Name:</label> |
| 146 |
<input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" size="40" /> |
| 147 |
</li> |
| 148 |
|
| 149 |
<li> |
| 150 |
<label for="enrollment-field-description-[% f.id %]">Description:</label> |
| 151 |
<input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" size="40" /> |
| 152 |
</li> |
| 153 |
|
| 154 |
<li> |
| 155 |
<label for="enrollment-field-description-[% f.id %]">Authorised value category:</label> |
| 156 |
<select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]"> |
| 157 |
<option value=""></option> |
| 158 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %] |
| 159 |
</select> |
| 160 |
</li> |
| 161 |
|
| 162 |
<li> |
| 163 |
<label for="enrollment-field-delete-[% f.id %]">Delete field:</label> |
| 164 |
<input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" /> |
| 165 |
</li> |
| 166 |
</ol> |
| 167 |
</div> |
| 56 |
[% END %] |
168 |
[% END %] |
| 57 |
<span class="hint">If set, a club based on this template can only be enrolled in by patrons with a valid email address.</span> |
169 |
</div> |
| 58 |
</li> |
170 |
<fieldset class="action"> |
| 59 |
|
171 |
<a href="#" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;"> |
| 60 |
<li> |
172 |
<i class="fa fa-plus"></i> Add new field |
| 61 |
<label for="branchcode">Library:</label> |
173 |
</a> |
| 62 |
<select name="branchcode" id="club-template-branchcode"> |
174 |
</fieldset> |
| 63 |
<option value=""> </option> |
175 |
</fieldset> |
| 64 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %] |
176 |
|
| 65 |
</select> |
177 |
<fieldset class="action"> |
| 66 |
<span class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</span> |
178 |
<input type="hidden" name="id" value="[% club_template.id %]" /> |
| 67 |
</li> |
179 |
<input type="submit" value="Save" /> |
| 68 |
|
180 |
<a href="clubs.pl" class="cancel">Cancel</a> |
| 69 |
</ol> |
181 |
</fieldset> |
| 70 |
|
182 |
</form> |
| 71 |
<h2>Club fields:</h2> |
183 |
|
| 72 |
<p><span class="hint">These fields will be used in the creation of clubs based on this template</span></p> |
184 |
</div> <!-- /#yui-main --> |
| 73 |
<span id="club-template-fields"> |
185 |
</div> <!-- /#bd --> |
| 74 |
[% FOREACH f IN club_template.club_template_fields %] |
186 |
|
| 75 |
<ul> |
187 |
|
| 76 |
<input type="hidden" name="club_template_field_id" value="[% f.id %]" /> |
188 |
<div id="new-field-template" class="club-field" style="display:none"> |
| 77 |
<li> |
189 |
<h4 style="margin-left:1em;">New club field</h4> |
| 78 |
<label for="field-name-[% f.id %]">Name:</label> |
190 |
<input type="hidden" name="club_template_field_id" value="" /> |
| 79 |
<input name="club_template_field_name" id="field-name-[% f.id %]" value="[% f.name %]" /> |
191 |
<ol class="clearfix"> |
| 80 |
</li> |
|
|
| 81 |
|
| 82 |
<li> |
| 83 |
<label for="field-description-[% f.id %]">Description:</label> |
| 84 |
<input name="club_template_field_description" id="field-description-[% f.id %]" value="[% f.description %]" /> |
| 85 |
</li> |
| 86 |
|
| 87 |
<li> |
| 88 |
<label for="field-description-[% f.id %]">Authorised value category:</label> |
| 89 |
<select name="club_template_field_authorised_value_category" id="field-authorised-value-category-[% f.id %]"> |
| 90 |
<option value=""> </option> |
| 91 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %] |
| 92 |
</select> |
| 93 |
</li> |
| 94 |
|
| 95 |
<li> |
| 96 |
<label for="field-delete-[% f.id %]">Delete field:</label> |
| 97 |
<input type="checkbox" name="club_template_field_delete" id="field-delete-[% f.id %]" value="[% f.id %]" /> |
| 98 |
</li> |
| 99 |
|
| 100 |
<hr/> |
| 101 |
</ul> |
| 102 |
[% END %] |
| 103 |
</span> |
| 104 |
<div class="btn-toolbar"> |
| 105 |
<a href="#" class="btn btn-default" onclick="$('#new-field-template').clone().attr('id','').show().appendTo('#club-template-fields'); return false;"> |
| 106 |
<i class="fa fa-plus"></i> Add new field |
| 107 |
</a> |
| 108 |
</div> |
| 109 |
|
| 110 |
<h2>Enrollment fields:</h2> |
| 111 |
<p><span class="hint">These fields will be used when enrolling a patron in a club based on this template</span></p> |
| 112 |
<span id="club-template-enrollment-fields"> |
| 113 |
[% FOREACH f IN club_template.club_template_enrollment_fields %] |
| 114 |
<ul> |
| 115 |
<input type="hidden" name="club_template_enrollment_field_id" value="[% f.id %]" /> |
| 116 |
<li> |
| 117 |
<label for="enrollment-field-name-[% f.id %]">Name:</label> |
| 118 |
<input name="club_template_enrollment_field_name" id="enrollment-field-name-[% f.id %]" value="[% f.name %]" /> |
| 119 |
</li> |
| 120 |
|
| 121 |
<li> |
| 122 |
<label for="enrollment-field-description-[% f.id %]">Description:</label> |
| 123 |
<input name="club_template_enrollment_field_description" id="enrollment-field-description-[% f.id %]" value="[% f.description %]" /> |
| 124 |
</li> |
| 125 |
|
| 126 |
<li> |
| 127 |
<label for="enrollment-field-description-[% f.id %]">Authorised value category:</label> |
| 128 |
<select name="club_template_enrollment_field_authorised_value_category" id="enrollment-field-authorised-value-category-[% f.id %]"> |
| 129 |
<option value=""> </option> |
| 130 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => f.authorised_value_category) %] |
| 131 |
</select> |
| 132 |
</li> |
| 133 |
|
| 134 |
<li> |
| 135 |
<label for="enrollment-field-delete-[% f.id %]">Delete field:</label> |
| 136 |
<input type="checkbox" name="club_template_enrollment_field_delete" id="enrollment-field-delete-[% f.id %]" value="[% f.id %]" /> |
| 137 |
</li> |
| 138 |
|
| 139 |
<hr/> |
| 140 |
</ul> |
| 141 |
[% END %] |
| 142 |
</span> |
| 143 |
<div class="btn-toolbar"> |
| 144 |
<a href="#" class="btn btn-default" onclick="$('#new-enrollment-field-template').clone().attr('id','').show().appendTo('#club-template-enrollment-fields'); return false;"> |
| 145 |
<i class="fa fa-plus"></i> Add new field |
| 146 |
</a> |
| 147 |
</div> |
| 148 |
|
| 149 |
</fieldset> |
| 150 |
|
| 151 |
<fieldset class="action"> |
| 152 |
<input type="hidden" name="id" value="[% club_template.id %]" /> |
| 153 |
<input type="submit" class="btn btn-default" value="Save" /> |
| 154 |
<a href="clubs.pl" class="cancel">Cancel</a> |
| 155 |
</fieldset> |
| 156 |
</form> |
| 157 |
</div> |
| 158 |
</div> |
| 159 |
|
| 160 |
<span id="new-field-template" style="display:none"> |
| 161 |
<ul> |
| 162 |
<input type="hidden" name="club_template_field_id" value="" /> |
| 163 |
|
192 |
|
| 164 |
<li> |
193 |
<li> |
| 165 |
<label for="club_template_field_name">Name:</label> |
194 |
<label for="club_template_field_name">Name:</label> |
|
Lines 174-193
Link Here
|
| 174 |
<li> |
203 |
<li> |
| 175 |
<label for="club_template_field_authorised_value_category">Authorised value category:</label> |
204 |
<label for="club_template_field_authorised_value_category">Authorised value category:</label> |
| 176 |
<select name="club_template_field_authorised_value_category"> |
205 |
<select name="club_template_field_authorised_value_category"> |
| 177 |
<option value=""> </option> |
206 |
<option value=""></option> |
| 178 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %] |
207 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %] |
| 179 |
</select> |
208 |
</select> |
| 180 |
</li> |
209 |
</li> |
|
|
210 |
</ol> |
| 211 |
<fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset> |
| 212 |
<hr/> |
| 213 |
</div> |
| 181 |
|
214 |
|
| 182 |
<a href="#" onclick="$(this).parent().remove(); return false;">Cancel</a> |
215 |
<div id="new-enrollment-field-template" class="enrollment-field" style="display:none"> |
| 183 |
|
216 |
<h4 style="margin-left:1em;">New enrollment field</h4> |
| 184 |
<hr/> |
217 |
<input type="hidden" name="club_template_enrollment_field_id" value="" /> |
| 185 |
</ul> |
218 |
<ol class="clearfix"> |
| 186 |
</span> |
|
|
| 187 |
|
| 188 |
<span id="new-enrollment-field-template" style="display:none"> |
| 189 |
<ul> |
| 190 |
<input type="hidden" name="club_template_enrollment_field_id" value="" /> |
| 191 |
|
219 |
|
| 192 |
<li> |
220 |
<li> |
| 193 |
<label for="club_template_enrollment_field_name">Name:</label> |
221 |
<label for="club_template_enrollment_field_name">Name:</label> |
|
Lines 202-216
Link Here
|
| 202 |
<li> |
230 |
<li> |
| 203 |
<label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label> |
231 |
<label for="club_template_enrollment_field_authorised_value_category">Authorised value category:</label> |
| 204 |
<select name="club_template_enrollment_field_authorised_value_category"> |
232 |
<select name="club_template_enrollment_field_authorised_value_category"> |
| 205 |
<option value=""> </option> |
233 |
<option value=""></option> |
| 206 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %] |
234 |
[% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories() %] |
| 207 |
</select> |
235 |
</select> |
| 208 |
</li> |
236 |
</li> |
| 209 |
|
237 |
</ol> |
| 210 |
<a href="#" onclick="$(this).parent().remove(); return false;">Cancel</a> |
238 |
<fieldset class="action"><a href="#" onclick="$(this).parent().parent().remove(); return false;"><i class="fa fa-trash"></i> Delete field</a></fieldset> |
| 211 |
|
239 |
</div> |
| 212 |
<hr/> |
240 |
</div> |
| 213 |
</ul> |
|
|
| 214 |
</span> |
| 215 |
|
241 |
|
| 216 |
[% INCLUDE 'intranet-bottom.inc' %] |
242 |
[% INCLUDE 'intranet-bottom.inc' %] |