$dunning_id =~ s|[^\d]||g;
- my $in = IO::File->new("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
+ my $in = IO::File->new($::lx_office_conf{applications}->{ghostscript} . " -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
$form->error($main::locale->text('Could not spawn ghostscript.')) unless $in;
if ($form->{media} eq 'printer') {
{
no warnings 'once';
$::menufile = "menu.ini";
- $::sendmail = "| /usr/sbin/sendmail -t";
$::lxdebug = LXDebug->new;
$::auth = SL::Auth->new;
$::form = undef;
my %temp_form = ( %{ $form }, 'myconfig_email' => $email );
my $template = SL::Template::create(type => 'PlainText', form => \%temp_form);
- my $sendmail = $template->parse_block($main::sendmail);
+ my $sendmail = $template->parse_block($::lx_office_conf{applications}->{sendmail});
- if (!open(OUT, $sendmail)) {
+ if (!open(OUT, "|$sendmail")) {
$main::lxdebug->leave_sub();
return "$sendmail : $!";
}
$psfile .= ".ps";
}
- system("html2ps -f html2ps-config < $form->{tmpfile} > $psfile");
+ system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} > $psfile");
if ($?) {
$self->{"error"} = $form->cleanup();
$self->cleanup();
$pdffile .= ".pdf";
}
- system("html2ps -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
+ system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
if ($?) {
$self->{"error"} = $form->cleanup();
$self->cleanup();
}
sub _get_latex_path {
- return $main::latex_bin || 'pdflatex';
+ return $::lx_office_conf{applications}->{latex} || 'pdflatex';
}
sub get_mime_type() {
my $pid = fork();
if (0 == $pid) {
$main::lxdebug->message(LXDebug->DEBUG2(), " Child execing\n");
- exec($main::xvfb_bin, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
+ exec($::lx_office_conf{applications}->{xvfb}, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
}
sleep(3);
$main::lxdebug->message(LXDebug->DEBUG2(), " parent dont sleeping\n");
exit if ($new_pid);
my $ssres = setsid();
$main::lxdebug->message(LXDebug->DEBUG2(), " Child execing\n");
- my @cmdline = ($main::openofficeorg_writer_bin,
+ my @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck",
"-headless",
"-accept=socket,host=localhost,port=" .
my @cmdline;
if (!$main::openofficeorg_daemon) {
- @cmdline = ($main::openofficeorg_writer_bin,
+ @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck",
"-headless",
"file:${filename}.odt",
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
- if ("$main::pg_dump_exe" eq "DISABLED") {
+ if ($::lx_office_conf{applications}->{pg_dump} eq "DISABLED") {
$form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
}
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
- $main::pg_dump_exe ||= "pg_dump";
+ my $pg_dump_exe = $::lx_office_conf{applications}->{pg_dump} || "pg_dump";
- if ("$main::pg_dump_exe" eq "DISABLED") {
+ if ("$pg_dump_exe" eq "DISABLED") {
$form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
}
push @args, ("-p", $form->{dbport}) if ($form->{dbport});
push @args, $form->{dbname};
- my $cmd = "$main::pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
+ my $cmd = "$pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
my $name = "dataset_backup_$form->{dbname}_" . strftime("%Y%m%d", localtime()) . ".tar";
if ($form->{destination} ne "email") {
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
- if ("$main::pg_restore_exe" eq "DISABLED") {
+ if ($::lx_office_conf{applications}->{pg_restore} eq "DISABLED") {
$form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
}
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
- $main::pg_restore_exe ||= "pg_restore";
+ my $pg_restore_exe = $::lx_office_conf{applications}->{pg_restore} || "pg_restore";
- if ("$main::pg_restore_exe" eq "DISABLED") {
+ if ("$pg_restore_exe" eq "DISABLED") {
$form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
}
push @args, ("-p", $form->{dbport}) if ($form->{dbport});
push @args, $tmp;
- my $cmd = "$main::pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
+ my $cmd = "$pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
my $in = IO::File->new("$cmd 2>&1 |");
_build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00'));
my @formats = ();
- if ($main::opendocument_templates && $main::openofficeorg_writer_bin &&
- $main::xvfb_bin && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)) {
+ if ($main::opendocument_templates
+ && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer})
+ && $::lx_office_conf{applications}->{xvfb} && (-x $::lx_office_conf{applications}->{xvfb})) {
push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
"value" => "opendocument_pdf" });
}
if ($form->{media} ne 'email');
push @FORMAT, grep $_,
- ($main::opendocument_templates && $main::openofficeorg_writer_bin && $main::xvfb_bin
- && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)
+ ($main::opendocument_templates && $::lx_office_conf{applications}->{openofficeorg_writer} && $::lx_office_conf{applications}->{xvfb}
+ && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb})
&& !$options{no_opendocument_pdf}) ?
opthash("opendocument_pdf", $form->{DF}{"opendocument_pdf"}, $locale->text("PDF (OpenDocument/OASIS)")) : undef,
($main::latex_templates) ?
use Cwd;
our (
- $dbcharset, $eur, $ghostscript_bin, $html2ps_bin, $language, $latex_bin,
- $latex_templates, $lizenzen, $memberfile, $opendocument_templates,
- $openofficeorg_daemon, $openofficeorg_daemon_port, $openofficeorg_writer_bin,
- $parts_image_css, $parts_listing_images, $parts_show_image, $pg_dump_exe,
- $pg_restore_exe, $sendmail, $show_best_before, $sid, $spool, $templates,
- $userspath, $vertreter, $webdav, $xvfb_bin
+ $dbcharset, $eur, $language,
+ $latex_templates, $lizenzen, $opendocument_templates,
+ $openofficeorg_daemon, $openofficeorg_daemon_port,
+ $parts_image_css, $parts_listing_images, $parts_show_image,
+ $show_best_before, $vertreter, $webdav
);
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
$eur = 1;
-# location of sendmail
-$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
-
# set language for login and admin
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
$language = "de";
# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-# Pfad zu OpenOffice.org writer
-$openofficeorg_writer_bin = "/usr/bin/oowriter";
-
# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
# Dokumente geht dann schneller. Allerdings wird auf dem System ein
# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
$openofficeorg_daemon = 1;
$openofficeorg_daemon_port = 2002;
-# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
-$xvfb_bin = "/usr/bin/Xvfb";
-
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
# $dbcharset = "ISO-8859-15";
-
-# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
-$html2ps_bin = "/usr/bin/html2ps";
-$ghostscript_bin = "/usr/bin/gs";
-
-# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
-# wie z.B. 'xetex'
-$latex_bin = 'pdflatex';
-
-# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
-# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
-# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
-# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
-# nicht angeboten.
-# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
-$pg_dump_exe = "pg_dump";
-$pg_restore_exe = "pg_restore";
-
1;
use Cwd;
our (
- $dbcharset, $eur, $ghostscript_bin, $html2ps_bin, $language, $latex_bin,
- $latex_templates, $lizenzen, $memberfile, $opendocument_templates,
- $openofficeorg_daemon, $openofficeorg_daemon_port, $openofficeorg_writer_bin,
- $parts_image_css, $parts_listing_images, $parts_show_image, $pg_dump_exe,
- $pg_restore_exe, $sendmail, $show_best_before, $sid, $spool, $templates,
- $userspath, $vertreter, $webdav, $xvfb_bin
+ $dbcharset, $eur, $language,
+ $latex_templates, $lizenzen, $opendocument_templates,
+ $openofficeorg_daemon, $openofficeorg_daemon_port,
+ $parts_image_css, $parts_listing_images, $parts_show_image,
+ $show_best_before, $vertreter, $webdav
);
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
$eur = 1;
-# location of sendmail
-$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
-
# set language for login and admin
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
$language = "de";
# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-# Pfad zu OpenOffice.org writer
-$openofficeorg_writer_bin = "/usr/bin/oowriter";
-
# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
# Dokumente geht dann schneller. Allerdings wird auf dem System ein
# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
$openofficeorg_daemon = 1;
$openofficeorg_daemon_port = 2002;
-# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
-$xvfb_bin = "/usr/bin/Xvfb";
-
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
# $dbcharset = "ISO-8859-15";
-
-# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
-$html2ps_bin = "/usr/bin/html2ps";
-$ghostscript_bin = "/usr/bin/gs";
-
-# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
-# wie z.B. 'xetex'
-$latex_bin = 'pdflatex';
-
-# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
-# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
-# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
-# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
-# nicht angeboten.
-# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
-$pg_dump_exe = "pg_dump";
-$pg_restore_exe = "pg_restore";
-
1;
# Path to the old memberfile (ignored on new installations)
memberfile = users/members
+[applications]
+# Location of sendmail
+sendmail = /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>
+# Location of OpenOffice.org writer
+openofficeorg_writer = oowriter
+# Location of the X virtual frame buffer used for OpenOffice
+xvfb = Xvfb
+# Location of the html2ps binary
+html2ps = html2ps
+# Location of the Ghostscript binary
+ghostscript = gs
+# Location of the pdflatex (or compatible, e.g. xetex) binary
+latex = pdflatex
+# Location of the two executables "pg_dump" and "pg_restore" used for
+# database backup and restoration from the admin section. If
+# "pg_dump" or "pg_restore" is set to "DISABLED" then the
+# corresponding option (backup/restoration) will be hidden from the
+# admin section.
+pg_dump = pg_dump
+pg_restore = pg_restore
+
[environment]
# Add the following paths to the PATH environment variable.
path = /usr/local/bin:/usr/X11R6/bin:/usr/X11/bin
package main;
- { no warnings 'once';
- $::sendmail = "| /usr/sbin/sendmail -t";
- }
-
eval { require "config/lx-erp.conf"; };
eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
my $login = shift @ARGV;
- $::sendmail = "| /usr/sbin/sendmail -t";
-
$::lxdebug = LXDebug->new();
require "config/lx-erp.conf";
package main;
- { no warnings 'once';
- $::sendmail = "| /usr/sbin/sendmail -t";
- }
-
eval { require "config/lx-erp.conf"; 1; } or die $EVAL_ERROR;
eval { require "config/lx-erp-local.conf"; 1; } or die $EVAL_ERROR if -f "config/lx-erp-local.conf";