Bug 6886: ensure that singleBranchMode does not display library name for reference...
[koha_fer] / admin / currency.pl
index 1e3f160..ea22431 100755 (executable)
@@ -46,18 +46,18 @@ use C4::Dates qw(format_date);
 use C4::Output;
 use C4::Budgets qw/GetCurrency GetCurrencies/;
 
-my $input = CGI->new;
+our $input = CGI->new;
 my $searchfield = $input->param('searchfield') || $input->param('description') || q{};
-my $offset      = $input->param('offset') || 0;
+our $offset      = $input->param('offset') || 0;
 my $op          = $input->param('op')     || q{};
 my $script_name = '/cgi-bin/koha/admin/currency.pl';
-my $pagesize = 20;
+our $pagesize = 20;
 
-my ($template, $loggedinuser, $cookie) = get_template_and_user({
+our ($template, $loggedinuser, $cookie) = get_template_and_user({
     template_name => 'admin/currency.tmpl',
     query => $input,
     type => 'intranet',
-    flagsrequired => {parameters => 1},
+    flagsrequired => {parameters => 'parameters_remaining_permissions'},
     authnotrequired => 0,
 });
 
@@ -67,7 +67,7 @@ $searchfield=~ s/\,//g;
 $template->param(searchfield => $searchfield,
         script_name => $script_name);
 
-my $dbh = C4::Context->dbh;
+our $dbh = C4::Context->dbh;
 
 if ( $op eq 'add_form' ) {
     add_form($searchfield);
@@ -162,15 +162,16 @@ sub add_form {
     $template->param( add_form => 1 );
 
     #---- if primkey exists, it's a modify action, so read values to modify...
+    my $date;
     if ($curr) {
         my $curr_rec =
           $dbh->selectrow_hashref( 'select * from currency where currency=?',
             {}, $curr );
         for ( keys %{$curr_rec} ) {
+            if($_ eq "timestamp"){ $date = $curr_rec->{$_}; }
             $template->param( $_ => $curr_rec->{$_} );
         }
     }
-    my $date = $template->param('timestamp');
     if ($date) {
         $template->param( 'timestamp' => format_date($date) );
     }