Bug 22544: Move del_opac_new to Koha namespace
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
ae0c08c936
commit
5866c88d84
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue