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