diff --git a/clubs/patron-enroll.pl b/clubs/patron-enroll.pl index 367b3c0f4b..b0f66bdb08 100755 --- a/clubs/patron-enroll.pl +++ b/clubs/patron-enroll.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,12 +39,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $id = $cgi->param('id'); my $borrowernumber = $cgi->param('borrowernumber'); +my $enrollent_id = scalar $cgi->param('enrollent_id'); my $club = Koha::Clubs->find($id); +my @club_enrollment_fields = Koha::Club::Enrollment::Fields->search({'club_enrollment_id'=> $enrollent_id})->as_list; $template->param( - club => $club, - borrowernumber => $borrowernumber, + club => $club, + borrowernumber => $borrowernumber, + enrollent_id => $enrollent_id || 0, + 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/patron-clubs-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt index 53dd18dc7a..6b2f5f93d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt @@ -21,6 +21,9 @@ [% e.date_enrolled | $KohaDates %] [% IF CAN_user_clubs_enroll %] + @@ -72,9 +75,9 @@ $("#table_clubnoenrollmemnts, #table_clubenrollments").dataTable($.extend(true, })); [% IF CAN_user_clubs_enroll %] -function loadEnrollmentForm( id ) { +function loadEnrollmentForm( id, enrollent_id = 0 ) { $("body").css("cursor", "progress"); - $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber | html %]&id=' + id, function() { + $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=[% borrowernumber | html %]&id=' + id +'&enrollent_id='+ enrollent_id, function() { $("body").css("cursor", "default"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt index 64adfafd71..46f60e001e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-enroll.tt @@ -1,6 +1,6 @@ [% USE AuthorisedValues %] -

+

Enroll in [% club.name | html %]

@@ -8,8 +8,30 @@
+
    + [% IF club_enrollment_fields %] + [% FOREACH f IN club.club_template.club_template_enrollment_fields %] + [% FOREACH c IN club_enrollment_fields %] + [% IF f.id == c.club_template_enrollment_field_id %] +
  1. + + [% IF f.authorised_value_category %] + + [% ELSE %] + + [% END %] + [% f.description %] +
  2. + [% END %] + [% END %] + [% END %] + [% ELSE %] [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
  3. @@ -25,7 +47,7 @@ [% f.description | html %]
  4. [% END %] - + [% END %]
  5. Finish enrollment Cancel @@ -36,6 +58,9 @@