4 <h4>Clubs currently enrolled in</h4>
6 <table id="table_clubenrollments">
11 <th>Date enrolled</th>
12 [% IF CAN_user_clubs_enroll %]<th class="NoSort">Actions</th>[% END %]
17 [% FOREACH e IN enrollments %]
19 <td>[% e.club.name | html %]</td>
20 <td>[% e.club.description | html %]</td>
21 <td>[% e.date_enrolled | $KohaDates %]</td>
22 [% IF CAN_user_clubs_enroll %]
24 <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% e.club.id | html %],[% e.id | html %])">
25 <i class="fa-solid fa-pencil"></i> Modify enrollment
27 <button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id | html %] )">
28 <i class="fa fa-times"></i> Cancel enrollment
40 <h4>Clubs not enrolled in</h4>
42 <table id="table_clubnoenrollmemnts">
47 [% IF CAN_user_clubs_enroll %]<th class="NoSort">Actions</th>[% END %]
52 [% FOREACH c IN clubs %]
54 <td>[% c.name | html %]</td>
55 <td>[% c.description | html %]</td>
56 [% IF CAN_user_clubs_enroll %]
58 <button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id | html %])">
59 <i class="fa fa-plus"></i> Enroll
70 $("#table_clubnoenrollmemnts, #table_clubenrollments").dataTable($.extend(true, {}, dataTablesDefaults, {
72 { 'sortable': false, 'targets': [ 'NoSort' ] }
77 [% IF CAN_user_clubs_enroll %]
78 function loadEnrollmentForm( id, enrollent_id = 0 ) {
79 $("body").css("cursor", "progress");
80 $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber | html %]&id=' + id +'&enrollent_id='+ enrollent_id, function() {
81 $("body").css("cursor", "default");
87 function cancelEnrollment( id ) {
88 $("body").css("cursor", "progress");
91 url: '/cgi-bin/koha/svc/club/cancel_enrollment',
93 success: function( data ) {
95 $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber | html %]', function() {
96 $("body").css("cursor", "default");
99 alert(_("Unable to cancel enrollment!"));