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 <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
12 <fieldset class="rows">
14 [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
16 <label>[% f.name | html %]</label>
17 [% IF f.authorised_value_category %]
18 <select name="[% f.id | html %]">
19 [% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
20 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
24 <input type="text" name="[% f.id | html %]" />
26 <span class="hint">[% f.description | html %]</span>
31 <fieldset class="action">
32 <button class="btn btn-primary add_enrollment">Finish enrollment</button>
33 <a href="#" class="cancel show_clubs">Cancel</a>
39 function addEnrollment() {
40 $("body").css("cursor", "progress");
43 url: '/cgi-bin/koha/svc/club/enroll',
44 data: $( "#patron-enrollment-form" ).serialize(),
45 success: function( data ) {
47 $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
48 $("body").css("cursor", "default");
51 alert(_("Unable to create enrollment!"));
59 function showClubs() {
60 $("body").css("cursor", "progress");
61 $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
62 $("body").css("cursor", "default");
66 $(document).ready(function(){
67 $(".add_enrollment").on("click", function(e){
72 $(".show_clubs").on("click", function(e){