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

(-)a/Koha/Club.pm (-1 / +1 lines)
Lines 72-78 sub club_enrollments { Link Here
72
72
73
    return unless $self->id();
73
    return unless $self->id();
74
74
75
    return scalar Koha::Club::Enrollments->search( { club_id => $self->id() } );
75
    return scalar Koha::Club::Enrollments->search( { club_id => $self->id(), date_canceled => undef } );
76
}
76
}
77
77
78
=head3 club_fields
78
=head3 club_fields
(-)a/Koha/Clubs.pm (-1 / +4 lines)
Lines 57-63 sub get_enrollable { Link Here
57
    }
57
    }
58
58
59
    # Only clubs with no end date or an end date in the future can be enrolled in
59
    # Only clubs with no end date or an end date in the future can be enrolled in
60
    $params->{'-or'} = [ date_end => { '>=' => \'CURRENT_DATE()' }, date_end => undef ];
60
    $params->{'-and'} = [
61
        -or => [ date_end => { '>=' => \'CURRENT_DATE()' }, date_end => undef],
62
        -or => [ 'me.branchcode' => $borrower->branchcode, 'me.branchcode' => undef ]
63
    ];
61
64
62
    my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } );
65
    my $rs = $self->_resultset()->search( $params, { prefetch => 'club_template' } );
63
66
(-)a/clubs/club-enrollments.pl (-1 / +1 lines)
Lines 38-44 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
38
);
38
);
39
39
40
my $id = $cgi->param('id');
40
my $id = $cgi->param('id');
41
my $club = Koha::Clubs->find($id);
41
my $club = Koha::Clubs->find( $id );
42
42
43
$template->param(
43
$template->param(
44
    club          => $club,
44
    club          => $club,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/club-enrollments.tt (-1 / +1 lines)
Lines 27-33 Link Here
27
<body id="club_enrollments" class="clubs">
27
<body id="club_enrollments" class="clubs">
28
[% INCLUDE 'header.inc' %]
28
[% INCLUDE 'header.inc' %]
29
[% INCLUDE 'cat-search.inc' %]
29
[% INCLUDE 'cat-search.inc' %]
30
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Patron clubs &rsaquo; Club enrollments</div>
30
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="clubs.pl">Patron clubs</a> &rsaquo; Club enrollments</div>
31
31
32
<div id="doc3" class="yui-t2">
32
<div id="doc3" class="yui-t2">
33
   <div id="bd">
33
   <div id="bd">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt (-3 / +2 lines)
Lines 29-35 Link Here
29
    });
29
    });
30
30
31
    function ConfirmDeleteTemplate( id, name, a ) {
31
    function ConfirmDeleteTemplate( id, name, a ) {
32
        if ( confirm( _("Are you sure you want to delete the club template %s?" ).format(name) ) ) {
32
        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) ) ) {
33
            $.ajax({
33
            $.ajax({
34
                type: "POST",
34
                type: "POST",
35
                url: '/cgi-bin/koha/svc/club/template/delete',
35
                url: '/cgi-bin/koha/svc/club/template/delete',
Lines 47-53 Link Here
47
    }
47
    }
48
48
49
    function ConfirmDeleteClub( id, name, a ) {
49
    function ConfirmDeleteClub( id, name, a ) {
50
        if ( confirm( _("Are you sure you want to delete the club %s?" ).format(name) ) ) {
50
        if ( confirm( _("Are you sure you want to delete the club %s? This will cancel all patron enrollments in this club." ).format(name) ) ) {
51
            $.ajax({
51
            $.ajax({
52
                type: "POST",
52
                type: "POST",
53
                url: '/cgi-bin/koha/svc/club/delete',
53
                url: '/cgi-bin/koha/svc/club/delete',
54
- 

Return to bug 12461