628d8391d2
The button to cancel a club enrollement is labelled with 'Cancel'. That is ambiguous and translates e.g. in German to 'Abbrechen' which can lead to mistakes. To test: - Apply patch - Enroll a patron to a club - Enable public enrollment in OPAC - Verify that the button to cancel enrollment in both OPAC and staff client reads 'Cancel enrollement' (instead of 'Cancel' without patch) (The button appears on the patron's detail pages in OPAC and staff client) Amended for comment #4 / mv Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
97 lines
2.8 KiB
Text
97 lines
2.8 KiB
Text
[% USE KohaDates %]
|
|
|
|
[% IF enrollments %]
|
|
<h4>Clubs currently enrolled in</h4>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
<th>Date enrolled</th>
|
|
[% IF CAN_user_clubs_enroll %]<th> </th>[% END %]
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH e IN enrollments %]
|
|
<tr>
|
|
<td>[% e.club.name %]</td>
|
|
<td>[% e.club.description %]</td>
|
|
<td>[% e.date_enrolled | $KohaDates %]</td>
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<td>
|
|
<button class="btn btn-xs btn-default" onclick="cancelEnrollment( [% e.id %] )">
|
|
<i class="fa fa-remove"></i> Cancel enrollment
|
|
</button>
|
|
</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
|
|
[% IF clubs %]
|
|
|
|
<h4>Clubs not enrolled in</h4>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
[% IF CAN_user_clubs_enroll %]<th> </th>[% END %]
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
[% FOREACH c IN clubs %]
|
|
<tr>
|
|
<td>[% c.name %]</td>
|
|
<td>[% c.description %]</td>
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<td class="action">
|
|
<button class="btn btn-xs btn-default" onclick="loadEnrollmentForm([% c.id %])">
|
|
<i class="fa fa-plus"></i> Enroll
|
|
</button>
|
|
</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
|
|
[% IF CAN_user_clubs_enroll %]
|
|
<script type="text/javascript">
|
|
function loadEnrollmentForm( id ) {
|
|
$("body").css("cursor", "progress");
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber %]&id=' + id, function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
|
|
return false;
|
|
}
|
|
|
|
function cancelEnrollment( id ) {
|
|
$("body").css("cursor", "progress");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/cgi-bin/koha/svc/club/cancel_enrollment',
|
|
data: { id: id },
|
|
success: function( data ) {
|
|
if ( data.success ) {
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]', function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
} else {
|
|
alert(_("Unable to cancel enrollment!"));
|
|
}
|
|
},
|
|
dataType: 'json'
|
|
});
|
|
return false;
|
|
}
|
|
</script>
|
|
[% END %]
|