Bug 14233: Add logging support to notices and slips management
[srvgit] / tools / koha-news.pl
index 3ac11ae..2b62aaf 100755 (executable)
@@ -33,7 +33,7 @@ use C4::Languages qw(getTranslatedLanguages);
 use Date::Calc qw/Date_to_Days Today/;
 use Koha::DateUtils;
 
-my $cgi = new CGI;
+my $cgi = CGI->new;
 
 my $id             = $cgi->param('id');
 my $title          = $cgi->param('title');
@@ -47,6 +47,12 @@ my $number         = $cgi->param('number');
 my $lang           = $cgi->param('lang');
 my $branchcode     = $cgi->param('branch');
 my $error_message  = $cgi->param('error_message');
+my $wysiwyg;
+if( $cgi->param('editmode') ){
+    $wysiwyg = $cgi->param('editmode') eq "wysiwyg" ? 1 : 0;
+} else {
+    $wysiwyg = C4::Context->preference("NewsToolEditor") eq "tinymce" ? 1 : 0;
+}
 
 # Foreign Key constraints work with NULL, not ''
 # NULL = All branches.
@@ -59,7 +65,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         template_name   => "tools/koha-news.tt",
         query           => $cgi,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { tools => 'edit_news' },
         debug           => 1,
     }
@@ -159,5 +164,8 @@ else {
         opac_news_count => $opac_news_count,
                );
 }
-$template->param( lang => $lang );
+$template->param(
+    lang => $lang,
+    wysiwyg => $wysiwyg,
+);
 output_html_with_http_headers $cgi, $cookie, $template->output;