|
Lines 30-35
use C4::Output qw( output_html_with_http_headers );
Link Here
|
| 30 |
use C4::Languages qw( getTranslatedLanguages ); |
30 |
use C4::Languages qw( getTranslatedLanguages ); |
| 31 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
31 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
| 32 |
use Koha::News; |
32 |
use Koha::News; |
|
|
33 |
use C4::Log qw(logaction); |
| 33 |
|
34 |
|
| 34 |
my $cgi = CGI->new; |
35 |
my $cgi = CGI->new; |
| 35 |
|
36 |
|
|
Lines 115-120
elsif ( $op eq 'add' ) {
Link Here
|
| 115 |
branchcode => $branchcode, |
116 |
branchcode => $branchcode, |
| 116 |
borrowernumber => $borrowernumber, |
117 |
borrowernumber => $borrowernumber, |
| 117 |
})->store; |
118 |
})->store; |
|
|
119 |
#log news addition |
| 120 |
if (C4::Context->preference("NewsLog")) { |
| 121 |
logaction('NEWS', 'ADD' , undef, $lang . ' | ' . $content); |
| 122 |
} |
| 118 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
123 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
| 119 |
} |
124 |
} |
| 120 |
else { |
125 |
else { |
|
Lines 134-143
elsif ( $op eq 'edit' ) {
Link Here
|
| 134 |
branchcode => $branchcode, |
139 |
branchcode => $branchcode, |
| 135 |
})->store; |
140 |
})->store; |
| 136 |
} |
141 |
} |
|
|
142 |
#log news modification |
| 143 |
if (C4::Context->preference("NewsLog")) { |
| 144 |
logaction('NEWS', 'MODIFY' , undef, $lang . ' | ' . $content); |
| 145 |
} |
| 137 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
146 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
| 138 |
} |
147 |
} |
| 139 |
elsif ( $op eq 'del' ) { |
148 |
elsif ( $op eq 'del' ) { |
| 140 |
my @ids = $cgi->multi_param('ids'); |
149 |
my @ids = $cgi->multi_param('ids'); |
|
|
150 |
#log news deletion then delete it |
| 151 |
if (C4::Context->preference("NewsLog")) { |
| 152 |
foreach my $newsid ( @ids ) { |
| 153 |
my $n = Koha::News->find( $newsid ); |
| 154 |
logaction('NEWS', 'DELETE', undef, $n->lang . ' | ' . $n->content ); |
| 155 |
} |
| 156 |
} |
| 141 |
Koha::News->search({ idnew => \@ids })->delete; |
157 |
Koha::News->search({ idnew => \@ids })->delete; |
| 142 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
158 |
print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); |
| 143 |
} |
159 |
} |
| 144 |
- |
|
|