View | Details | Raw Unified | Return to bug 28717
Collapse All | Expand All

(-)a/tools/koha-news.pl (-1 / +13 lines)
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 creation
122
        if (C4::Context->preference("NewsLog")) {
123
            logaction('OPACNEWS', '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 135-146 elsif ( $op eq 'edit' ) { Link Here
135
            number         => $number,
140
            number         => $number,
136
            branchcode     => $branchcode,
141
            branchcode     => $branchcode,
137
        })->store;
142
        })->store;
143
        #log modification
144
        if (C4::Context->preference("NewsLog")) {
145
                logaction('OPACNEWS', 'MODIFY' , undef, $lang . ' | ' . $content);
146
        }
138
    }
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 new OPAC news deletion
154
    if (C4::Context->preference("NewsLog")) {
155
        logaction('OPACNEWS', 'DELETE', undef, $lang . ' | ' . $content );
156
    }
144
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
157
    print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
145
}
158
}
146
159
147
- 

Return to bug 28717