Mongolian updates
[koha.git] / tools / koha-news.pl
index b0196d2..08b38c8 100755 (executable)
@@ -38,6 +38,7 @@ my $id             = $cgi->param('id');
 my $title          = $cgi->param('title');
 my $new            = $cgi->param('new');
 my $expirationdate = format_date_in_iso($cgi->param('expirationdate'));
+my $timestamp      = format_date_in_iso($cgi->param('timestamp'));
 my $number         = $cgi->param('number');
 my $lang           = $cgi->param('lang');
 
@@ -49,7 +50,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         query           => $cgi,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { tools => 1 },
+        flagsrequired   => { tools => 'edit_news' },
         debug           => 1,
     }
 );
@@ -83,11 +84,11 @@ if ( $op eq 'add_form' ) {
     }
 }
 elsif ( $op eq 'add' ) {
-    add_opac_new( $title, $new, $lang, $expirationdate, $number );
+    add_opac_new( $title, $new, $lang, $expirationdate, $timestamp, $number );
     print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
 }
 elsif ( $op eq 'edit' ) {
-    upd_opac_new( $id, $title, $new, $lang, $expirationdate, $number );
+    upd_opac_new( $id, $title, $new, $lang, $expirationdate, $timestamp ,$number );
     print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl");
 }
 elsif ( $op eq 'del' ) {
@@ -117,5 +118,6 @@ else {
 }
 $template->param(
                                DHTMLcalendar_dateformat =>  C4::Dates->DHTMLcalendar(),
+                               dateformat    => C4::Context->preference("dateformat"),
                );
 output_html_with_http_headers $cgi, $cookie, $template->output;