@@ -, +, @@ --- C4/NewsChannels.pm | 24 +----------------------- tools/koha-news.pl | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) --- a/C4/NewsChannels.pm +++ a/C4/NewsChannels.pm @@ -30,7 +30,7 @@ BEGIN { @ISA = qw(Exporter); @EXPORT = qw( &GetNewsToDisplay - &add_opac_new &upd_opac_new &del_opac_new + &add_opac_new &upd_opac_new ); } @@ -123,28 +123,6 @@ sub upd_opac_new { return $retval; } -sub del_opac_new { - my ($ids) = @_; - if ($ids) { - - #Log news deletion - if (C4::Context->preference("NewsLog")) { - foreach my $newsid ( split(/,/, $ids )) { - my $n = Koha::News->find( $newsid ); - logaction('NEWS', 'DELETE', undef, $n->unblessed->{lang} . ' | ' . $n->unblessed->{content} ); - } - } - - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); - $sth->execute(); - return 1; - } else { - return 0; - } - -} - =head2 GetNewsToDisplay $news = &GetNewsToDisplay($lang,$branch); --- a/tools/koha-news.pl +++ a/tools/koha-news.pl @@ -143,7 +143,7 @@ elsif ( $op eq 'edit' ) { } elsif ( $op eq 'del' ) { my @ids = $cgi->multi_param('ids'); - del_opac_new( join ",", @ids ); + Koha::News->search({ idnew => @ids })->delete; print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); } --