Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 4 Feb 2013 10:19:45 +0000 (11:19 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 4 Feb 2013 10:19:45 +0000 (11:19 +0100)
SL/Controller/SellPriceInformation.pm
SL/DB/Manager/OrderItem.pm
SL/Form.pm
SL/InstallationCheck.pm
SL/Layout/Javascript.pm
SL/Menu.pm
SL/MoreCommon.pm

index bf85c86..e44478a 100644 (file)
@@ -115,7 +115,7 @@ sub prepare_report {
   $report->set_columns(%$column_defs);
   $report->set_column_order(@columns);
   $report->set_options(allow_pdf_export => 0, allow_csv_export => 0);
-  $report->set_sort_indicator(%params);
+  $report->set_sort_indicator($self->{sort_by}, $self->{sort_dir});
   $report->set_export_options(@{ $params{report_generator_export_options} || [] });
   $report->set_options(
     %{ $params{report_generator_options} || {} },
index 000369e..e908b6b 100644 (file)
@@ -24,7 +24,7 @@ sub _sort_spec {
                         orddate       => [ 'order.orddate' ],
                         sellprice     => [ 'sellprice' ],
                         discount      => [ 'discount' ],
-                        transdate     => [ 'transdate::date', 'order.reqdate' ],
+                        transdate     => [ 'orderitems.transdate::date', 'order.reqdate' ],
                       },
            default => [ 'position', 1 ],
            nulls   => { }
index c6fd574..94d3c56 100644 (file)
@@ -380,9 +380,10 @@ sub _get_request_uri {
   my $self = shift;
 
   return URI->new($ENV{HTTP_REFERER})->canonical() if $ENV{HTTP_X_FORWARDED_FOR};
+  return URI->new                                  if !$ENV{REQUEST_URI}; # for testing
 
   my $scheme =  $ENV{HTTPS} && (lc $ENV{HTTPS} eq 'on') ? 'https' : 'http';
-  my $port   =  $ENV{SERVER_PORT} || '';
+  my $port   =  $ENV{SERVER_PORT};
   $port      =  undef if (($scheme eq 'http' ) && ($port == 80))
                       || (($scheme eq 'https') && ($port == 443));
 
@@ -479,7 +480,7 @@ sub header {
   );
 
   $self->{favicon} ||= "favicon.ico";
-  $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
+  $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title} || !$self->{titlebar};
 
   # build includes
   if ($self->{refresh_url} || $self->{refresh_time}) {
index 39911d7..b3bd020 100644 (file)
@@ -53,7 +53,7 @@ BEGIN {
   { name => "Perl::Tags",                          url => "http://search.cpan.org/~osfameron/", debian => 'libperl-tags-perl' },
   { name => "Test::Deep",                          url => "http://search.cpan.org/~rjbs/",      debian => 'libtest-deep-perl' },
   { name => "Test::Exception",                     url => "http://search.cpan.org/~adie/",      debian => 'libtest-exception-perl' },
-  { name => "Test::Deep",                          url => "http://search.cpan.org/~bdfoy/",     debian => 'libtest-output-perl' },
+  { name => "Test::Output",                        url => "http://search.cpan.org/~bdfoy/",     debian => 'libtest-output-perl' },
   { name => "GD",              version => '2.00',  url => "http://search.cpan.org/~lds/",       debian => 'libgd-perl' },
 );
 
index c63b1f7..2cda0f4 100644 (file)
@@ -110,10 +110,13 @@ sub create_menu {
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
 
+  $depth ||= 0;
+
   die if ($depth * 1 > 5);
 
   my @menuorder  = $menu->access_control(\%myconfig, $parent);
   $parent       .= "--" if ($parent);
+  $parent      ||= '';
 
   foreach my $name (@menuorder) {
     substr($name, 0, length($parent), "");
index 57d8b4e..0fb1b1a 100644 (file)
@@ -94,7 +94,7 @@ sub access_control {
 
   my @menu = ();
 
-  if ($menulevel eq "") {
+  if (!$menulevel) {
     @menu = grep { !/--/ } @{ $self->{ORDER} };
   } else {
     @menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} };
index 13d421b..6fbf87d 100644 (file)
@@ -171,7 +171,7 @@ sub uri_encode {
 }
 
 sub uri_decode {
-  my ($str) = @_;
+  my $str = $_[0] || '';
 
   $str =~ tr/+/ /;
   $str =~ s/\\$//;