1 [% USE AuthorisedValues %]
4 Enroll in <em>[% club.name | html %]</em>
7 <div class="container">
8 <form id="patron-enrollment-form">
9 <legend class="sr-only">Enrollment</legend>
10 <input type="hidden" name="id" value="[% club.id | html %]" />
11 <fieldset class="rows">
13 [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
15 <label>[% f.name | html %]</label>
16 [% IF f.authorised_value_category %]
17 <select name="[% f.id | html %]">
18 [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
19 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
23 <input type="text" name="[% f.id | html %]" />
25 <span class="hint">[% f.description | html %]</span>
30 <fieldset class="action">
31 <button class="btn btn-primary add_enrollment">Finish enrollment</button>
32 <a href="#" class="cancel show_clubs">Cancel</a>
38 function addEnrollment() {
39 $("body").css("cursor", "progress");
42 url: '/cgi-bin/koha/svc/club/enroll',
43 data: $( "#patron-enrollment-form" ).serialize(),
44 success: function( data ) {
46 $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?id=[% club.id | html %]', function() {
47 $("body").css("cursor", "default");
50 alert(_("Unable to create enrollment!"));
58 function showClubs() {
59 $("body").css("cursor", "progress");
60 $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
61 $("body").css("cursor", "default");
65 $(document).ready(function(){
66 $(".add_enrollment").on("click", function(e){
71 $(".show_clubs").on("click", function(e){