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 109-126 sub upd_opac_new { Link Here
109
    return $retval;
109
    return $retval;
110
}
110
}
111
111
112
sub del_opac_new {
113
    my ($ids) = @_;
114
    if ($ids) {
115
        my $dbh = C4::Context->dbh;
116
        my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)");
117
        $sth->execute();
118
        return 1;
119
    } else {
120
        return 0;
121
    }
122
}
123
124
=head2 GetNewsToDisplay
112
=head2 GetNewsToDisplay
125
113
126
    $news = &GetNewsToDisplay($lang,$branch);
114
    $news = &GetNewsToDisplay($lang,$branch);
(-)a/tools/koha-news.pl (-2 / +1 lines)
Lines 139-145 elsif ( $op eq 'edit' ) { Link Here
139
}
139
}
140
elsif ( $op eq 'del' ) {
140
elsif ( $op eq 'del' ) {
141
    my @ids = $cgi->multi_param('ids');
141
    my @ids = $cgi->multi_param('ids');
142
    del_opac_new( join ",", @ids );
142
    Koha::News->search({ idnew => @ids })->delete;
143
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
143
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
144
}
144
}
145
145
146
- 

Return to bug 22544