Bug 17395 - exporting checkouts in CVS generates a file with wrong extension
[koha.git] / tools / koha-news.pl
index d5f2c5b..53b943d 100755 (executable)
@@ -32,7 +32,6 @@ use C4::Output;
 use C4::NewsChannels;
 use C4::Languages qw(getTranslatedLanguages);
 use Date::Calc qw/Date_to_Days Today/;
-use C4::Branch qw/GetBranches/;
 use Koha::DateUtils;
 
 my $cgi = new CGI;
@@ -40,7 +39,10 @@ my $cgi = new CGI;
 my $id             = $cgi->param('id');
 my $title          = $cgi->param('title');
 my $new            = $cgi->param('new');
-my $expirationdate = output_pref({ dt => dt_from_string( scalar $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 });
+my $expirationdate;
+if ( $cgi->param('expirationdate') ) {
+    $expirationdate = output_pref({ dt => dt_from_string( scalar $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 });
+}
 my $timestamp      = output_pref({ dt => dt_from_string( scalar $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
 my $number         = $cgi->param('number');
 my $lang           = $cgi->param('lang');
@@ -81,10 +83,7 @@ foreach my $language ( @$tlangs ) {
     }
 }
 
-my $branches = GetBranches;
-
 $template->param( lang_list   => \@lang_list,
-                  branch_list => $branches,
                   branchcode  => $branchcode );
 
 my $op = $cgi->param('op') // '';