@@ -, +, @@ Club enrollments should only list active enrollments Confirms should warn of cascading delete Branch limited clubs should only be available to members of that branch Fix breadcrumbs --- Koha/Club.pm | 2 +- Koha/Clubs.pm | 5 ++++- clubs/club-enrollments.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) --- a/Koha/Club.pm +++ a/Koha/Club.pm @@ -72,7 +72,7 @@ sub club_enrollments { return unless $self->id(); - return scalar Koha::Club::Enrollments->search( { club_id => $self->id() } ); + return scalar Koha::Club::Enrollments->search( { club_id => $self->id(), date_canceled => undef } ); } =head3 club_fields --- a/Koha/Clubs.pm +++ a/Koha/Clubs.pm @@ -57,7 +57,10 @@ sub get_enrollable { } # Only clubs with no end date or an end date in the future can be enrolled in - $params->{'-or'} = [ date_end => { '>=' => \'CURRENT_DATE()' }, date_end => undef ]; + $params->{'-and'} = [ + -or => [ date_end => { '>=' => \'CURRENT_DATE()' }, date_end => undef], + -or => [ 'me.branchcode' => $borrower->branchcode, 'me.branchcode' => undef ] + ]; my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } ); --- a/clubs/club-enrollments.pl +++ a/clubs/club-enrollments.pl @@ -38,7 +38,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); my $id = $cgi->param('id'); -my $club = Koha::Clubs->find($id); +my $club = Koha::Clubs->find( $id ); $template->param( club => $club, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt @@ -27,7 +27,7 @@
[% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +