X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/0d6920540b289a59b021a6be86445279b39a26ef..8b68b3f8f2cc88d620b484a2219c85f6ff4d78a8:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 3c0e2e6bb..fe9d2b862 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -197,7 +197,7 @@ sub quote { my ($self, $str) = @_; if ($str && !ref($str)) { - $str =~ s/"/"/g; + $str =~ s/\"/"/g; } $str; @@ -208,7 +208,7 @@ sub unquote { my ($self, $str) = @_; if ($str && !ref($str)) { - $str =~ s/"/"/g; + $str =~ s/"/\"/g; } $str; @@ -415,15 +415,33 @@ sub parse_html_template { $main::lxdebug->enter_sub(); my ($self, $file, $additional_params) = @_; + my $language; - if (-f "templates/webpages/${file}_" . $main::myconfig{"countrycode"} . - ".html") { - $file = "templates/webpages/${file}_" . $main::myconfig{"countrycode"} . - ".html"; + if (!defined($main::myconfig) || !defined($main::myconfig{"countrycode"})) { + $language = $main::language; + } else { + $language = $main::myconfig{"countrycode"}; + } + + if (-f "templates/webpages/${file}_${language}.html") { + if ((-f ".developer") && + (-f "templates/webpages/${file}_master.html") && + ((stat("templates/webpages/${file}_master.html"))[9] > + (stat("templates/webpages/${file}_${language}.html"))[9])) { + my $info = "Developper information: templates/webpages/${file}_master.html is newer than the localized version.\n" . + "Please re-run 'locales.pl' in 'locale/${language}'."; + print(qq|
$info|); + die($info); + } + + $file = "templates/webpages/${file}_${language}.html"; } elsif (-f "templates/webpages/${file}.html") { $file = "templates/webpages/${file}.html"; } else { - $self->error("Web page template '${file}' not found."); + my $info = "Web page template '${file}' not found.\n" . + "Please re-run 'locales.pl' in 'locale/${language}'."; + print(qq|
$info|); + die($info); } my $template = HTML::Template->new("filename" => $file, @@ -674,7 +692,7 @@ sub parse_amount { } if ($myconfig->{numberformat} eq "1'000.00") { - $amount =~ s/'//g; + $amount =~ s/\'//g; } $amount =~ s/,//g;