Die globale Konfigurationsvariable $latex in $latex_templates umbenannt. Einige globale Konfigurationsvariablen in allen HTML-Vorlagen unter dem Namen "conf_<variablenname>" bekannt gemacht.
Zwei Variablen lokal zur aktuellen Funktion gemacht.
Automatisch in HTML-Vorlagen die Zugriffsberechtigungen als Variablen der Form "access_menu_name" verfuegbar machen.
Alle Variablen aus %myconfig in HTML-Webseitenvorlagen verfuegbar gemacht. Ausserdem aus das Datumsformat fuer den Javascript-Kalendar aus dem Datenbankdatumsformat ableiten und zur Verfuegung stellen.
Beim Aufruf von $form->show_generic_error() auf jeden Fall $form->header() aufrufen und danach das Script beenden.
[Merge der Revisionen 876 883 902 987 1093 aus dem LINET prog Repo]
package Form;
use HTML::Template;
+use SL::Menu;
sub _input_to_hash {
$main::lxdebug->enter_sub(2);
if ($ENV{HTTP_USER_AGENT}) {
$msg =~ s/\n/<br>/g;
-
- $self->header;
$self->show_generic_error($msg);
- die "Error: $msg\n";
-
} else {
if ($self->{error_function}) {
}
#Set Calendar
- $jsscript = "";
+ my $jsscript = "";
if ($self->{jsscript} == 1) {
$jsscript = qq|
$main::lxdebug->leave_sub();
}
-use Data::Dumper;
sub parse_html_template {
$main::lxdebug->enter_sub();
"<br><em>DEBUG INFORMATION:</em><pre>" . $additional_params->{"DEBUG"} . "</pre>";
}
+ if (%main::myconfig) {
+ map({ $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys(%main::myconfig));
+ my $jsc_dateformat = $main::myconfig{"dateformat"};
+ $jsc_dateformat =~ s/d+/\%d/gi;
+ $jsc_dateformat =~ s/m+/\%m/gi;
+ $jsc_dateformat =~ s/y+/\%Y/gi;
+ $additional_params->{"myconfig_jsc_dateformat"} = $jsc_dateformat;
+ }
+
+ $additional_params->{"conf_jscalendar"} = $main::jscalendar;
+ $additional_params->{"conf_lizenzen"} = $main::lizenzen;
+ $additional_params->{"conf_latex_templates"} = $main::latex;
+ $additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates;
+
+ my $menu;
+ if (-f $self->{"login"} . "_menu.ini") {
+ $menu = Menu->new($self->{"login"} . "_menu.ini");
+ } else {
+ $menu = Menu->new("menu.ini");
+ }
+ $menu->generate_acl("", $additional_params);
+
my @additional_param_names = keys(%{$additional_params});
foreach my $key ($template->param()) {
$add_params->{"title"} = $title if ($title);
$self->{"label_error"} = $error;
+ $self->header();
print($self->parse_html_template("generic/error", $add_params));
+
+ die("Error: $error\n");
+}
+
+sub show_generic_information {
+ my ($self, $error, $title) = @_;
+
+ my $add_params = {};
+ $add_params->{"title"} = $title if ($title);
+ $self->{"label_information"} = $error;
+
+ $self->header();
+ print($self->parse_html_template("generic/information", $add_params));
+
+ die("Information: $error\n");
}
# write Trigger JavaScript-Code ($qty = quantity of Triggers)
);
|;
}
- $jsscript = qq|
+ my $jsscript = qq|
<script type="text/javascript">
<!--| . join("", @triggers) . qq|//-->
</script>
my ($current_page, $current_line, $current_row) = (1, 1, 0);
my $pagebreak = "";
my $sum = 0;
-
# } Moritz Bunkus
# Make sure that all *notes* (intnotes, partnotes_*, notes etc) are converted to markup correctly.
close(IN);
}
- $self->cleanup;
-
}
+ $self->cleanup;
+
chdir("$self->{cwd}");
$main::lxdebug->leave_sub();
}
$query = qq| SELECT * FROM tax t|;
$sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
- $form->{TAX} = ();
+ $self->{TAX} = ();
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
push @{ $self->{TAX} }, $ref;
}
$query = qq|UPDATE defaults
SET $fld = '$var'|;
- $dbh->do($query) || $form->dberror($query);
+ $dbh->do($query) || $self->dberror($query);
$dbh->commit;
$dbh->disconnect;
}
$query = qq|UPDATE business
SET customernumberinit = '$var' WHERE id=$business_id|;
- $dbh->do($query) || $form->dberror($query);
+ $dbh->do($query) || $self->dberror($query);
$dbh->commit;
$dbh->disconnect;
$media = qq|
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if ($myconfig{printer} && $latex) {
+ if ($myconfig{printer} && $latex_templates) {
$media .= qq|
<option value=printer $form->{OP}{printer}>|
. $locale->text('Printer');
}
- if ($latex) {
+ if ($latex_templates) {
$media .= qq|
<option value=queue $form->{OP}{queue}>| . $locale->text('Queue');
$format .= qq|
<input class=submit type=submit name=action value="|
. $locale->text('Post') . qq|">|;
- if ($latex) {
+ if ($latex_templates) {
print qq|
<input class=submit type=submit name=action value="|
. $locale->text('Print') . qq|">|;
} else {
$media = qq|<select name=media>
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if ($myconfig{printer} && $latex) {
+ if ($myconfig{printer} && $latex_templates) {
$media .= qq|
<option value=printer $form->{OP}{printer}>|
. $locale->text('Printer');
}
- if ($latex) {
+ if ($latex_templates) {
$media .= qq|
<option value=queue $form->{OP}{queue}>| . $locale->text('Queue');
}
$format = qq|<select name=format>
<option value=html $form->{DF}{html}>html|;
- if ($latex) {
+ if ($latex_templates) {
$format = qq|<select name=format>
<option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF') . qq|
<option value=html $form->{DF}{html}>html
. $locale->text('Postscript');
}
+ $format .= qq|<option value=html $form->{DF}{html}>HTML</option>|;
+
+ if ($latex_templates) {
+ $format .= qq|<option value=postscript $form->{DF}{postscript}>| .
+ $locale->text('Postscript') . qq|</option>|;
+ }
+
$language_select = qq|<select name=language>
<option value=""></option>|;
%lang = (de => "deutsch", en => "englisch", fr => "französisch");
<td>$media</select></td>
|;
- if ($myconfig{printer} && $latex && $form->{media} ne 'email') {
+ if ($myconfig{printer} && $latex_templates && $form->{media} ne 'email') {
print qq|
<td>| . $locale->text('Copies') . qq|
<input name=copies size=2 value=$form->{copies}></td>
} else {
$media = qq|
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if ($myconfig{printer} && $latex) {
+ if ($myconfig{printer} && $latex_templates) {
$media .= qq|
<option value=printer $form->{OP}{printer}>|
. $locale->text('Printer');
}
}
- if ($latex) {
+ if ($latex_templates) {
$format .= qq|
<option value=postscript $form->{DF}{postscript}>|
. $locale->text('Postscript') . qq|
<td><select name=media>$media</select></td>
|;
- if ($myconfig{printer} && $latex && $form->{media} ne 'email') {
+ if ($myconfig{printer} && $latex_templates && $form->{media} ne 'email') {
print qq|
<td>| . $locale->text('Copies') . qq|
<input name=copies size=2 value=$form->{copies}></td>
} else {
$media = qq|
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if ($myconfig{printer} && $latex) {
+ if ($myconfig{printer} && $latex_templates) {
$media .= qq|
<option value=printer $form->{OP}{printer}>|
. $locale->text('Printer');
}
}
- if ($latex) {
+ if ($latex_templates) {
$format .= qq|
<option value=html $form->{DF}{html}>|
. $locale->text('HTML') . qq|
<td><select name=media>$media</select></td>
|;
- if ($myconfig{printer} && $latex && $form->{media} ne 'email') {
+ if ($myconfig{printer} && $latex_templates && $form->{media} ne 'email') {
print qq|
<td>| . $locale->text('Copies') . qq|
<input name=copies size=2 value=$form->{copies}></td>
qq| <option value=html selected>|
. $locale->text('Vorschau')
. qq|</option>|;
- if ($latex) {
+ if ($latex_templates) {
$format .=
qq| <option value=pdf>|
. $locale->text('UStVA als PDF-Dokument')
$ENV{"ORACLE_HOME"} = "/usr/local/oracle";
# if you have latex installed set to 1
-$latex = 1;
+$latex_templates = 1;
# if the server can't find gzip, latex, dvips or pdflatex, add the path
$ENV{PATH} .= ":/usr/local/bin";