View | Details | Raw Unified | Return to bug 35941
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt (-3 / +3 lines)
Lines 58-64 Link Here
58
                    <td>[% c.name | html %]</td>
58
                    <td>[% c.name | html %]</td>
59
                    <td>[% c.description | html %]</td>
59
                    <td>[% c.description | html %]</td>
60
                    <td>
60
                    <td>
61
                        [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && borrower.notice_email_address ) %]
61
                        [% IF !c.club_template.is_email_required || ( c.club_template.is_email_required && patron.notice_email_address ) %]
62
                            <button class="btn btn-sm btn-primary load_enrollment" data-id="[% c.id | html%]">
62
                            <button class="btn btn-sm btn-primary load_enrollment" data-id="[% c.id | html%]">
63
                                <i class="fa fa-plus" aria-hidden="true"></i> Enroll
63
                                <i class="fa fa-plus" aria-hidden="true"></i> Enroll
64
                            </button>
64
                            </button>
Lines 76-82 Link Here
76
<script>
76
<script>
77
function loadEnrollmentForm( id ) {
77
function loadEnrollmentForm( id ) {
78
    $("body").css("cursor", "progress");
78
    $("body").css("cursor", "progress");
79
    $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% borrower.borrowernumber | html %]&id=' + id, function() {
79
    $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=[% patron.borrowernumber | html %]&id=' + id, function() {
80
        $("body").css("cursor", "default");
80
        $("body").css("cursor", "default");
81
    });
81
    });
82
82
Lines 91-97 function cancelEnrollment( id ) { Link Here
91
        data: { id: id },
91
        data: { id: id },
92
        success: function( data ) {
92
        success: function( data ) {
93
            if ( data.success ) {
93
            if ( data.success ) {
94
                $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrower.borrowernumber | html %]', function() {
94
                $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]', function() {
95
                    $("body").css("cursor", "default");
95
                    $("body").css("cursor", "default");
96
                });
96
                });
97
            } else {
97
            } else {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/enroll.tt (-2 / +1 lines)
Lines 8-14 Link Here
8
    <form id="patron-enrollment-form">
8
    <form id="patron-enrollment-form">
9
        <legend class="sr-only">Enrollment</legend>
9
        <legend class="sr-only">Enrollment</legend>
10
        <input type="hidden" name="id" value="[% club.id | html %]" />
10
        <input type="hidden" name="id" value="[% club.id | html %]" />
11
        <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
12
        <fieldset class="rows">
11
        <fieldset class="rows">
13
            <ol>
12
            <ol>
14
                [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
13
                [% FOREACH f IN club.club_template.club_template_enrollment_fields %]
Lines 44-50 function addEnrollment() { Link Here
44
        data: $( "#patron-enrollment-form" ).serialize(),
43
        data: $( "#patron-enrollment-form" ).serialize(),
45
        success: function( data ) {
44
        success: function( data ) {
46
            if ( data.success ) {
45
            if ( data.success ) {
47
                $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]&id=[% club.id | html %]', function() {
46
                $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?id=[% club.id | html %]', function() {
48
                    $("body").css("cursor", "default");
47
                    $("body").css("cursor", "default");
49
                });
48
                });
50
            } else {
49
            } else {
(-)a/opac/clubs/clubs-tab.pl (-6 / +4 lines)
Lines 35-51 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
35
    }
35
    }
36
);
36
);
37
37
38
my $borrowernumber = $cgi->param('borrowernumber');
38
my $patron = Koha::Patrons->find( $loggedinuser );
39
39
40
my $borrower = Koha::Patrons->find($borrowernumber);
40
my @enrollments = $patron->get_club_enrollments->as_list;
41
41
my @clubs = $patron->get_enrollable_clubs( my $opac = 1 )->as_list;
42
my @enrollments = $borrower->get_club_enrollments->as_list;
43
my @clubs = $borrower->get_enrollable_clubs( my $opac = 1 )->as_list;
44
42
45
$template->param(
43
$template->param(
46
    enrollments => \@enrollments,
44
    enrollments => \@enrollments,
47
    clubs       => \@clubs,
45
    clubs       => \@clubs,
48
    borrower    => $borrower,
46
    patron      => $patron,
49
);
47
);
50
48
51
output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } );
49
output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } );
(-)a/opac/clubs/enroll.pl (-7 / +2 lines)
Lines 35-48 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
35
    }
35
    }
36
);
36
);
37
37
38
my $id             = $cgi->param('id');
38
my $id = $cgi->param('id');
39
my $borrowernumber = $cgi->param('borrowernumber');
40
41
my $club = Koha::Clubs->find($id);
42
39
43
$template->param(
40
$template->param(
44
    club           => $club,
41
    club => Koha::Clubs->find($id),
45
    borrowernumber => $borrowernumber,
46
);
42
);
47
43
48
output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } );
44
output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } );
49
- 

Return to bug 35941