X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/cf4ac17020af74a0ab2443fde0ae2c85b181af0a..28d69bb85e934088a56e6e8458cd08d3794e1f8b:/SL/Form.pm
diff --git a/SL/Form.pm b/SL/Form.pm
index 0268aaf2e..eaee0965a 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -40,7 +40,6 @@ package Form;
use Data::Dumper;
use CGI;
-use CGI::Ajax;
use Cwd;
use Encode;
use File::Copy;
@@ -702,6 +701,7 @@ sub header {
'',
'',
'',
+ '',
'';
push @header, $self->{javascript} if $self->{javascript};
push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] };
@@ -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.