Owen Leonard
693dde521d
This patch addresses template issues with the newly-added patron clubs pages. - Move Clubs tab out of second position in Circulation page tabs. - Link patron name in enrollments list to the patron record - Make page titles on some pages more specific - Correct label "for" attributes so that it matches input id - Correst style of buttons: Buttons in tables must be "btn-xs," all Bootstrap buttons must have "btn-default." - Correct "Edit" icons: Should be "fa-pencil" This patch also revises the club template editing form to make it more consistent with similar interfaces in Koha and (hopefully) make it more clear. To test, apply the patch and test adding clubs and club templates and enrolling patrons in clubs via the staff client and OPAC. Confirm that everything looks and work okay. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
66 lines
2.4 KiB
Text
66 lines
2.4 KiB
Text
[% USE AuthorisedValues %]
|
|
[% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %]
|
|
|
|
<h3>
|
|
Enroll in <i>[% club.name %]</i>
|
|
</h3>
|
|
|
|
<div class="container">
|
|
<form id="patron-enrollment-form">
|
|
<input type="hidden" name="id" value="[% club.id %]" />
|
|
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
|
|
<fieldset class="rows">
|
|
<ol>
|
|
[% FOREACH f IN club.club_template.club_template_enrollment_fields %]
|
|
<li>
|
|
<label>[% f.name %]</label>
|
|
[% IF f.authorised_value_category %]
|
|
<select name="[% f.id %]">
|
|
[% FOREACH a IN AuthorisedValues.Get( f.authorised_value_category ) %]
|
|
<option value="[% a.authorised_value %]">[% a.lib %]</option>
|
|
[% END %]
|
|
</select>
|
|
[% ELSE %]
|
|
<input type="text" name="[% f.id %]" />
|
|
[% END %]
|
|
<span class="hint">[% f.description %]</span>
|
|
</li>
|
|
[% END %]
|
|
|
|
<li>
|
|
<a href="#" class="btn btn-sm btn-default" onclick="addEnrollment(); return false;">Finish enrollment</a>
|
|
<a class="cancel" href="#" onclick="showClubs(); return false;">Cancel</a>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
function addEnrollment() {
|
|
$("body").css("cursor", "progress");
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/cgi-bin/koha/svc/club/enroll',
|
|
data: $( "#patron-enrollment-form" ).serialize(),
|
|
success: function( data ) {
|
|
if ( data.success ) {
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]&id=[% club.id %]', function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
} else {
|
|
alert(_("Unable to create enrollment!"));
|
|
}
|
|
},
|
|
dataType: 'json'
|
|
});
|
|
return false;
|
|
}
|
|
|
|
function showClubs() {
|
|
$("body").css("cursor", "progress");
|
|
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]&id=[% club.id %]', function() {
|
|
$("body").css("cursor", "default");
|
|
});
|
|
}
|
|
</script>
|