diff --git a/clubs/club-enrollments.pl b/clubs/club-enrollments.pl index 3eac228bb7..c2937f86af 100755 --- a/clubs/club-enrollments.pl +++ b/clubs/club-enrollments.pl @@ -24,6 +24,7 @@ use CGI; use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use Koha::Clubs; +use Koha::Club::Enrollment::Fields; my $cgi = CGI->new; @@ -38,9 +39,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $id = $cgi->param('id'); my $club = Koha::Clubs->find( $id ); +my @club_template_enrollment_fields = $club->club_template()->club_template_enrollment_fields()->as_list; +my @club_enrollment_fields = Koha::Club::Enrollment::Fields->search({'club_template_enrollment_field_id'=> { -in => [map { $_->id } @club_template_enrollment_fields] }})->as_list; $template->param( club => $club, + club_enrollment_fields => \@club_enrollment_fields, ); output_html_with_http_headers( $cgi, $cookie, $template->output ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt index eb8e503f75..cfee5d7669 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt @@ -3,6 +3,8 @@ [% USE KohaDates %] [% USE Branches %] [% USE Koha %] +[% USE AuthorisedValues %] +[% SET AuthorisedValuesCategories = AuthorisedValues.GetCategories %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Club enrollments › Patron clubs › Tools › Koha @@ -43,6 +45,9 @@ Name Card number + [% FOREACH club_template_enrollment_field IN club.club_template.club_template_enrollment_fields %] + [% club_template_enrollment_field.name %] + [% END %] @@ -56,6 +61,24 @@ [% p.cardnumber | html %] + [% IF club_enrollment_fields %] + [% FOREACH club_enrollment_field IN club_enrollment_fields %] + [% IF e.id == club_enrollment_field.club_enrollment_id %] + [% FOREACH club_template_enrollment_field IN club.club_template.club_template_enrollment_fields %] + [% IF club_enrollment_field.club_template_enrollment_field_id == club_template_enrollment_field.id %] + [% IF club_template_enrollment_field.authorised_value_category %] + [% FOREACH a IN AuthorisedValues.Get( club_template_enrollment_field.authorised_value_category ) %] + [% IF a.authorised_value == club_enrollment_field.value %] + [% SET club_enrollment_field.value = a.lib %] + [% END %] + [% END %] + [% END %] + [% club_enrollment_field.value | html %] + [% END %] + [% END %] + [% END %] + [% END %] + [% END %] [% END %]