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