]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
Form::parse_html_template() darf Form::error() nicht aufrufen, weil die wiederum...
[kivitendo-erp.git] / SL / Form.pm
index 241cf0bf53acb06cca2ea12abf8143dd79c3458e..b6f62fb9155637049a0601f937323b92ed8750f9 100644 (file)
@@ -143,7 +143,6 @@ sub new {
   $self->{action} =~ s/( |-|,|#)/_/g;
 
   $self->{version}   = "2.2.0";
-  $self->{dbversion} = "2.2.0";
 
   $main::lxdebug->leave_sub();
 
@@ -245,17 +244,7 @@ sub error {
     $msg =~ s/\n/<br>/g;
 
     $self->header;
-
-    print qq|
-    <body>
-
-    <h2 class=error>Error!</h2>
-
-    <p><b>$msg</b>
-
-    </body>
-    </html>
-    |;
+    $self->show_generic_error($msg);
 
     die "Error: $msg\n";
 
@@ -429,12 +418,26 @@ sub parse_html_template {
 
   if (-f "templates/webpages/${file}_" . $main::myconfig{"countrycode"} .
       ".html") {
+    if ((-f ".developer") &&
+        (-f "templates/webpages/${file}_master.html") &&
+        ((stat("templates/webpages/${file}_master.html"))[9] >
+         (stat("templates/webpages/${file}_" . $main::myconfig{"countrycode"} .
+               ".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/" . $main::myconfig{"countrycode"} . "'.";
+      print(qq|<pre>$info</pre>|);
+      die($info);
+    }
+
     $file = "templates/webpages/${file}_" . $main::myconfig{"countrycode"} .
       ".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/" . $main::myconfig{"countrycode"} . "'.";
+    print(qq|<pre>$info</pre>|);
+    die($info);
   }
 
   my $template = HTML::Template->new("filename" => $file,