|
Lines 30-36
BEGIN {
Link Here
|
| 30 |
@ISA = qw(Exporter); |
30 |
@ISA = qw(Exporter); |
| 31 |
@EXPORT = qw( |
31 |
@EXPORT = qw( |
| 32 |
&GetNewsToDisplay |
32 |
&GetNewsToDisplay |
| 33 |
&add_opac_new &upd_opac_new &del_opac_new |
33 |
&add_opac_new &upd_opac_new |
| 34 |
); |
34 |
); |
| 35 |
} |
35 |
} |
| 36 |
|
36 |
|
|
Lines 123-150
sub upd_opac_new {
Link Here
|
| 123 |
return $retval; |
123 |
return $retval; |
| 124 |
} |
124 |
} |
| 125 |
|
125 |
|
| 126 |
sub del_opac_new { |
|
|
| 127 |
my ($ids) = @_; |
| 128 |
if ($ids) { |
| 129 |
|
| 130 |
#Log news deletion |
| 131 |
if (C4::Context->preference("NewsLog")) { |
| 132 |
foreach my $newsid ( split(/,/, $ids )) { |
| 133 |
my $n = Koha::News->find( $newsid ); |
| 134 |
logaction('NEWS', 'DELETE', undef, $n->unblessed->{lang} . ' | ' . $n->unblessed->{content} ); |
| 135 |
} |
| 136 |
} |
| 137 |
|
| 138 |
my $dbh = C4::Context->dbh; |
| 139 |
my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); |
| 140 |
$sth->execute(); |
| 141 |
return 1; |
| 142 |
} else { |
| 143 |
return 0; |
| 144 |
} |
| 145 |
|
| 146 |
} |
| 147 |
|
| 148 |
=head2 GetNewsToDisplay |
126 |
=head2 GetNewsToDisplay |
| 149 |
|
127 |
|
| 150 |
$news = &GetNewsToDisplay($lang,$branch); |
128 |
$news = &GetNewsToDisplay($lang,$branch); |