X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=15d66cec9b785564916aa7304ecc661f51a55f88;hb=388a2ff5471adc27084f77e60fe154f25790dc9e;hp=0268aaf2e2a82eb659425192f17f69904c787449;hpb=cf4ac17020af74a0ab2443fde0ae2c85b181af0a;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 0268aaf2e..15d66cec9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -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 < @@ -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.