X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5494f687372570c9d1c5eb5c6aad73767e50820a..dfb76ebf04df9aed8ba63d7b51bc558d2928030e:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index c7539354c..15d66cec9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -674,7 +674,7 @@ sub header { # extra code is currently only used by menuv3 and menuv4 to set their css. # it is strongly deprecated, and will be changed in a future version. - my ($self, $extra_code) = @_; + my ($self, %params) = @_; my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET; my @header; @@ -722,10 +722,15 @@ sub header { |; } + my %doctypes = ( + strict => qq||, + transitional => qq||, + frameset => qq||, + ); + # output print $self->create_http_response(content_type => 'text/html', charset => $db_charset); - print "\n" - if $ENV{'HTTP_USER_AGENT'} =~ m/MSIE\s+\d/; # Other browsers may choke on menu scripts with DOCTYPE. + print $doctypes{$params{doctype} || 'transitional'}, $/; print < @@ -734,9 +739,9 @@ sub header { EOT print " $_\n" for @header; print < - - + + + - $extra_code + $params{extra_code} $title_hack @@ -1408,7 +1413,7 @@ sub parse_template { for my $i (1 .. $self->{copies}) { if ($self->{OUT}) { open OUT, '>', $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!"); - print OUT while ; + print OUT $_ while ; close OUT; seek IN, 0, 0; @@ -2336,7 +2341,7 @@ sub _get_taxcharts { $key = $params; } - my $where = ' WHERE ' . join(' AND ', map { "($_)" } @where) if (@where); + my $where = @where ? ' WHERE ' . join(' AND ', map { "($_)" } @where) : ''; my $query = qq|SELECT * FROM tax $where ORDER BY taxkey|; @@ -2451,7 +2456,7 @@ sub _get_customers { my $options = ref $key eq 'HASH' ? $key : { key => $key }; $options->{key} ||= "all_customers"; - my $limit_clause = "LIMIT $options->{limit}" if $options->{limit}; + my $limit_clause = $options->{limit} ? "LIMIT $options->{limit}" : ''; my @where; push @where, qq|business_id IN (SELECT id FROM business WHERE salesman)| if $options->{business_is_salesman}; @@ -3660,8 +3665,8 @@ sub prepare_for_printing { $extension = 'xls'; } - my $printer_code = '_' . $self->{printer_code} if $self->{printer_code}; - my $email_extension = '_email' if -f "$self->{templates}/$self->{formname}_email${language}${printer_code}.${extension}"; + my $printer_code = $self->{printer_code} ? '_' . $self->{printer_code} : ''; + my $email_extension = -f "$::myconfig{templates}/$self->{formname}_email${language}.${extension}" ? '_email' : ''; $self->{IN} = "$self->{formname}${email_extension}${language}${printer_code}.${extension}"; # Format dates.