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

(-)a/C4/NewsChannels.pm (-13 / +1 lines)
Lines 28-34 BEGIN { Link Here
28
    @ISA = qw(Exporter);
28
    @ISA = qw(Exporter);
29
    @EXPORT = qw(
29
    @EXPORT = qw(
30
        &GetNewsToDisplay
30
        &GetNewsToDisplay
31
        &add_opac_new &upd_opac_new &del_opac_new
31
        &add_opac_new &upd_opac_new
32
    );
32
    );
33
}
33
}
34
34
Lines 111-128 sub upd_opac_new { Link Here
111
    return $retval;
111
    return $retval;
112
}
112
}
113
113
114
sub del_opac_new {
115
    my ($ids) = @_;
116
    if ($ids) {
117
        my $dbh = C4::Context->dbh;
118
        my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)");
119
        $sth->execute();
120
        return 1;
121
    } else {
122
        return 0;
123
    }
124
}
125
126
=head2 GetNewsToDisplay
114
=head2 GetNewsToDisplay
127
115
128
    $news = &GetNewsToDisplay($lang,$branch);
116
    $news = &GetNewsToDisplay($lang,$branch);
(-)a/tools/koha-news.pl (-2 / +1 lines)
Lines 144-150 elsif ( $op eq 'edit' ) { Link Here
144
}
144
}
145
elsif ( $op eq 'del' ) {
145
elsif ( $op eq 'del' ) {
146
    my @ids = $cgi->multi_param('ids');
146
    my @ids = $cgi->multi_param('ids');
147
    del_opac_new( join ",", @ids );
147
    Koha::News->search({ idnew => @ids })->delete;
148
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
148
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
149
}
149
}
150
150
151
- 

Return to bug 22544