1 [% USE AuthorisedValues %]
4 Enroll in <em>[% club.name | html %]</em>
7 <div class="container">
8 <form id="patron-enrollment-form">
9 <input type="hidden" name="id" value="[% club.id | html %]" />
10 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
11 <input type="hidden" name="enrollent_id" value="[% enrollent_id | html %]" />
12 <fieldset class="rows">
14 [% IF club_enrollment_fields %]
15 [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
16 [% FOREACH c IN club_enrollment_fields %]
17 [% IF f.id == c.club_template_enrollment_field_id %]
19 <label>[% f.name | html %]</label>
20 [% IF f.authorised_value_category %]
21 <select name="[% f.id | html %]">
22 [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
23 [% IF a.authorised_value == c.value %]
24 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
26 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
31 <input type="text" name="[% f.id | html %]" value="[% c.value | html %]"/>
33 <span class="hint">[% f.description | html %]</span>
39 [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
41 <label>[% f.name | html %]</label>
42 [% IF f.authorised_value_category %]
43 <select name="[% f.id | html %]">
44 [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
45 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
49 <input type="text" name="[% f.id | html %]" />
51 <span class="hint">[% f.description | html %]</span>
56 <a href="#" class="btn btn-sm btn-default" onclick="addEnrollment(); return false;">Finish enrollment</a>
57 <a class="cancel" href="#" onclick="showClubs(); return false;">Cancel</a>
65 if([% enrollent_id | html %]){
66 $("#heading").html(_("Modifying enrollment")+" <em>[% club.name | html %]</em>");
68 function addEnrollment() {
69 $("body").css("cursor", "progress");
72 url: '/cgi-bin/koha/svc/club/enroll',
73 data: $( "#patron-enrollment-form" ).serialize(),
74 success: function( data ) {
76 $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
77 $("body").css("cursor", "default");
80 alert(_("Unable to create enrollment!"));
88 function showClubs() {
89 $("body").css("cursor", "progress");
90 $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
91 $("body").css("cursor", "default");