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
}
# 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' } );
);
my $id = $cgi->param('id');
-my $club = Koha::Clubs->find($id);
+my $club = Koha::Clubs->find( $id );
$template->param(
club => $club,
<body id="club_enrollments" class="clubs">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › Patron clubs › Club enrollments</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="clubs.pl">Patron clubs</a> › Club enrollments</div>
<div id="doc3" class="yui-t2">
<div id="bd">
});
function ConfirmDeleteTemplate( id, name, a ) {
- if ( confirm( _("Are you sure you want to delete the club template %s?" ).format(name) ) ) {
+ if ( confirm( _("Are you sure you want to delete the club template %s? This will delete all clubs using this template and cancel patron enrollments" ).format(name) ) ) {
$.ajax({
type: "POST",
url: '/cgi-bin/koha/svc/club/template/delete',
}
function ConfirmDeleteClub( id, name, a ) {
- if ( confirm( _("Are you sure you want to delete the club %s?" ).format(name) ) ) {
+ if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
$.ajax({
type: "POST",
url: '/cgi-bin/koha/svc/club/delete',