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

(-)a/Koha/Clubs.pm (-13 / +1 lines)
Lines 70-88 sub get_enrollable { Link Here
70
        ]
70
        ]
71
    ];
71
    ];
72
72
73
    my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } );
73
    return $self->search( $params, { prefetch => 'club_template' } );
74
75
    if (wantarray) {
76
        my $class = ref($self) ? ref($self) : $self;
77
78
        return $class->_wrap( $rs->all() );
79
80
    }
81
    else {
82
        my $class = ref($self) ? ref($self) : $self;
83
84
        return $class->_new_from_dbic($rs);
85
    }
86
}
74
}
87
75
88
=head3 filter_out_empty
76
=head3 filter_out_empty
(-)a/Koha/Patron.pm (-2 / +2 lines)
Lines 1355-1361 sub first_valid_email_address { Link Here
1355
=cut
1355
=cut
1356
1356
1357
sub get_club_enrollments {
1357
sub get_club_enrollments {
1358
    my ( $self, $return_scalar ) = @_;
1358
    my ( $self ) = @_;
1359
1359
1360
    return Koha::Club::Enrollments->search( { borrowernumber => $self->borrowernumber(), date_canceled => undef } );
1360
    return Koha::Club::Enrollments->search( { borrowernumber => $self->borrowernumber(), date_canceled => undef } );
1361
}
1361
}
Lines 1365-1371 sub get_club_enrollments { Link Here
1365
=cut
1365
=cut
1366
1366
1367
sub get_enrollable_clubs {
1367
sub get_enrollable_clubs {
1368
    my ( $self, $is_enrollable_from_opac, $return_scalar ) = @_;
1368
    my ( $self, $is_enrollable_from_opac ) = @_;
1369
1369
1370
    my $params;
1370
    my $params;
1371
    $params->{is_enrollable_from_opac} = $is_enrollable_from_opac
1371
    $params->{is_enrollable_from_opac} = $is_enrollable_from_opac
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +2 lines)
Lines 805-812 Link Here
805
805
806
                        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
806
                        <li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
807
807
808
                        [% SET enrollments = patron.get_club_enrollments(1) %]
808
                        [% SET enrollments = patron.get_club_enrollments %]
809
                        [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
809
                        [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
810
                        [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
810
                        [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
811
                            <li>
811
                            <li>
812
                                <a id="clubs-tab-link" href="#clubs-tab">
812
                                <a id="clubs-tab-link" href="#clubs-tab">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +2 lines)
Lines 732-739 Link Here
732
                            <li>
732
                            <li>
733
                                <a id="debarments-tab-link" href="#reldebarments">[% debarments.size | html %] Restrictions</a>
733
                                <a id="debarments-tab-link" href="#reldebarments">[% debarments.size | html %] Restrictions</a>
734
                            </li>
734
                            </li>
735
                            [% SET enrollments = patron.get_club_enrollments(1) %]
735
                            [% SET enrollments = patron.get_club_enrollments %]
736
                            [% SET enrollable  = patron.get_enrollable_clubs(0,1) %]
736
                            [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
737
                            [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
737
                            [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
738
                                <li>
738
                                <li>
739
                                    <a id="clubs-tab-link" href="#clubs-tab">
739
                                    <a id="clubs-tab-link" href="#clubs-tab">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-3 / +2 lines)
Lines 10-17 Link Here
10
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
10
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
11
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
11
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
12
12
13
[% SET borrower_club_enrollments =  logged_in_user.get_club_enrollments(1) %]
13
[% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
14
[% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1,1) %]
14
[% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
15
15
16
[% INCLUDE 'doc-head-open.inc' %]
16
[% INCLUDE 'doc-head-open.inc' %]
17
<title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
17
<title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
18
- 

Return to bug 29844