Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f2af9def

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID f2af9def6777d0192a83c8a86f1332569c742051
  • Vorgänger 2b82ec61
  • Nachfolger 2b339152

Globale Variablen nach %::lx_office_conf verschoben

Betroffen sind:
$sendmail
$openofficeorg_writer_bin
$xvfb_bin
$html2ps_bin
$ghostscript_bin
$latex_bin
$pg_dump_exe
$pg_restore_exe

Unterschiede anzeigen:

SL/DN.pm
667 667

  
668 668
  $dunning_id     =~ s|[^\d]||g;
669 669

  
670
  my $in = IO::File->new("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
670
  my $in = IO::File->new($::lx_office_conf{applications}->{ghostscript} . " -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
671 671
  $form->error($main::locale->text('Could not spawn ghostscript.')) unless $in;
672 672

  
673 673
  if ($form->{media} eq 'printer') {
SL/Dispatcher.pm
89 89
  {
90 90
    no warnings 'once';
91 91
    $::menufile    = "menu.ini";
92
    $::sendmail    = "| /usr/sbin/sendmail -t";
93 92
    $::lxdebug     = LXDebug->new;
94 93
    $::auth        = SL::Auth->new;
95 94
    $::form        = undef;
SL/Mailer.pm
116 116

  
117 117
  my %temp_form   = ( %{ $form }, 'myconfig_email' => $email );
118 118
  my $template    = SL::Template::create(type => 'PlainText', form => \%temp_form);
119
  my $sendmail    = $template->parse_block($main::sendmail);
119
  my $sendmail    = $template->parse_block($::lx_office_conf{applications}->{sendmail});
120 120

  
121
  if (!open(OUT, $sendmail)) {
121
  if (!open(OUT, "|$sendmail")) {
122 122
    $main::lxdebug->leave_sub();
123 123
    return "$sendmail : $!";
124 124
  }
SL/Template/HTML.pm
70 70
    $psfile .= ".ps";
71 71
  }
72 72

  
73
  system("html2ps -f html2ps-config < $form->{tmpfile} > $psfile");
73
  system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} > $psfile");
74 74
  if ($?) {
75 75
    $self->{"error"} = $form->cleanup();
76 76
    $self->cleanup();
......
103 103
    $pdffile .= ".pdf";
104 104
  }
105 105

  
106
  system("html2ps -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
106
  system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
107 107
  if ($?) {
108 108
    $self->{"error"} = $form->cleanup();
109 109
    $self->cleanup();
SL/Template/LaTeX.pm
447 447
}
448 448

  
449 449
sub _get_latex_path {
450
  return $main::latex_bin || 'pdflatex';
450
  return $::lx_office_conf{applications}->{latex} || 'pdflatex';
451 451
}
452 452

  
453 453
sub get_mime_type() {
SL/Template/OpenDocument.pm
382 382
  my $pid = fork();
383 383
  if (0 == $pid) {
384 384
    $main::lxdebug->message(LXDebug->DEBUG2(), "  Child execing\n");
385
    exec($main::xvfb_bin, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
385
    exec($::lx_office_conf{applications}->{xvfb}, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
386 386
  }
387 387
  sleep(3);
388 388
  $main::lxdebug->message(LXDebug->DEBUG2(), "  parent dont sleeping\n");
......
457 457
        exit if ($new_pid);
458 458
        my $ssres = setsid();
459 459
        $main::lxdebug->message(LXDebug->DEBUG2(), "  Child execing\n");
460
        my @cmdline = ($main::openofficeorg_writer_bin,
460
        my @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
461 461
                       "-minimized", "-norestore", "-nologo", "-nolockcheck",
462 462
                       "-headless",
463 463
                       "-accept=socket,host=localhost,port=" .
......
509 509

  
510 510
  my @cmdline;
511 511
  if (!$main::openofficeorg_daemon) {
512
    @cmdline = ($main::openofficeorg_writer_bin,
512
    @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
513 513
                "-minimized", "-norestore", "-nologo", "-nolockcheck",
514 514
                "-headless",
515 515
                "file:${filename}.odt",
bin/mozilla/admin.pl
845 845

  
846 846
  $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
847 847

  
848
  if ("$main::pg_dump_exe" eq "DISABLED") {
848
  if ($::lx_office_conf{applications}->{pg_dump} eq "DISABLED") {
849 849
    $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
850 850
  }
851 851

  
......
867 867

  
868 868
  $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
869 869

  
870
  $main::pg_dump_exe ||= "pg_dump";
870
  my $pg_dump_exe = $::lx_office_conf{applications}->{pg_dump} || "pg_dump";
871 871

  
872
  if ("$main::pg_dump_exe" eq "DISABLED") {
872
  if ("$pg_dump_exe" eq "DISABLED") {
873 873
    $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
874 874
  }
875 875

  
......
895 895
  push @args, ("-p", $form->{dbport}) if ($form->{dbport});
896 896
  push @args, $form->{dbname};
897 897

  
898
  my $cmd  = "$main::pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
898
  my $cmd  = "$pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
899 899
  my $name = "dataset_backup_$form->{dbname}_" . strftime("%Y%m%d", localtime()) . ".tar";
900 900

  
901 901
  if ($form->{destination} ne "email") {
......
954 954

  
955 955
  $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
956 956

  
957
  if ("$main::pg_restore_exe" eq "DISABLED") {
957
  if ($::lx_office_conf{applications}->{pg_restore} eq "DISABLED") {
958 958
    $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
959 959
  }
960 960

  
......
979 979

  
980 980
  $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
981 981

  
982
  $main::pg_restore_exe ||= "pg_restore";
982
  my $pg_restore_exe = $::lx_office_conf{applications}->{pg_restore} || "pg_restore";
983 983

  
984
  if ("$main::pg_restore_exe" eq "DISABLED") {
984
  if ("$pg_restore_exe" eq "DISABLED") {
985 985
    $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
986 986
  }
987 987

  
......
1068 1068
  push @args, ("-p", $form->{dbport}) if ($form->{dbport});
1069 1069
  push @args, $tmp;
1070 1070

  
1071
  my $cmd = "$main::pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
1071
  my $cmd = "$pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
1072 1072

  
1073 1073
  my $in = IO::File->new("$cmd 2>&1 |");
1074 1074

  
bin/mozilla/am.pl
2457 2457
  _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00'));
2458 2458

  
2459 2459
  my @formats = ();
2460
  if ($main::opendocument_templates && $main::openofficeorg_writer_bin &&
2461
      $main::xvfb_bin && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)) {
2460
  if ($main::opendocument_templates
2461
      && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer})
2462
      && $::lx_office_conf{applications}->{xvfb}                 && (-x $::lx_office_conf{applications}->{xvfb})) {
2462 2463
    push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
2463 2464
                     "value" => "opendocument_pdf" });
2464 2465
  }
bin/mozilla/io.pl
1173 1173
        if ($form->{media} ne 'email');
1174 1174

  
1175 1175
  push @FORMAT, grep $_,
1176
    ($main::opendocument_templates &&     $main::openofficeorg_writer_bin  &&     $main::xvfb_bin
1177
                                   && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)
1176
    ($main::opendocument_templates &&     $::lx_office_conf{applications}->{openofficeorg_writer}  &&     $::lx_office_conf{applications}->{xvfb}
1177
                                   && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb})
1178 1178
     && !$options{no_opendocument_pdf}) ?
1179 1179
      opthash("opendocument_pdf",    $form->{DF}{"opendocument_pdf"},  $locale->text("PDF (OpenDocument/OASIS)")) : undef,
1180 1180
    ($main::latex_templates) ?
config/lx-erp.conf
1 1
use Cwd;
2 2

  
3 3
our (
4
  $dbcharset, $eur, $ghostscript_bin, $html2ps_bin, $language, $latex_bin,
5
  $latex_templates, $lizenzen, $memberfile, $opendocument_templates,
6
  $openofficeorg_daemon, $openofficeorg_daemon_port, $openofficeorg_writer_bin,
7
  $parts_image_css, $parts_listing_images, $parts_show_image, $pg_dump_exe,
8
  $pg_restore_exe, $sendmail, $show_best_before, $sid, $spool, $templates,
9
  $userspath, $vertreter, $webdav, $xvfb_bin
4
  $dbcharset, $eur, $language,
5
  $latex_templates, $lizenzen, $opendocument_templates,
6
  $openofficeorg_daemon, $openofficeorg_daemon_port,
7
  $parts_image_css, $parts_listing_images, $parts_show_image,
8
  $show_best_before, $vertreter, $webdav
10 9
);
11 10

  
12 11
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
13 12
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
14 13
$eur = 1;
15 14

  
16
# location of sendmail
17
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
18

  
19 15
# set language for login and admin
20 16
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
21 17
$language = "de";
......
46 42
# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
47 43
# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
48 44

  
49
# Pfad zu OpenOffice.org writer
50
$openofficeorg_writer_bin = "/usr/bin/oowriter";
51

  
52 45
# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
53 46
# Dokumente geht dann schneller. Allerdings wird auf dem System ein
54 47
# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
......
56 49
$openofficeorg_daemon = 1;
57 50
$openofficeorg_daemon_port = 2002;
58 51

  
59
# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
60
$xvfb_bin = "/usr/bin/Xvfb";
61

  
62 52
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
63 53
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
64 54
# $dbcharset = "ISO-8859-15";
65 55

  
66

  
67
# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
68
$html2ps_bin = "/usr/bin/html2ps";
69
$ghostscript_bin = "/usr/bin/gs";
70

  
71
# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
72
# wie z.B. 'xetex'
73
$latex_bin = 'pdflatex';
74

  
75
# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
76
# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
77
# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
78
# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
79
# nicht angeboten.
80
# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
81
$pg_dump_exe    = "pg_dump";
82
$pg_restore_exe = "pg_restore";
83

  
84 56
1;
config/lx-erp.conf.default
1 1
use Cwd;
2 2

  
3 3
our (
4
  $dbcharset, $eur, $ghostscript_bin, $html2ps_bin, $language, $latex_bin,
5
  $latex_templates, $lizenzen, $memberfile, $opendocument_templates,
6
  $openofficeorg_daemon, $openofficeorg_daemon_port, $openofficeorg_writer_bin,
7
  $parts_image_css, $parts_listing_images, $parts_show_image, $pg_dump_exe,
8
  $pg_restore_exe, $sendmail, $show_best_before, $sid, $spool, $templates,
9
  $userspath, $vertreter, $webdav, $xvfb_bin
4
  $dbcharset, $eur, $language,
5
  $latex_templates, $lizenzen, $opendocument_templates,
6
  $openofficeorg_daemon, $openofficeorg_daemon_port,
7
  $parts_image_css, $parts_listing_images, $parts_show_image,
8
  $show_best_before, $vertreter, $webdav
10 9
);
11 10

  
12 11
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
13 12
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
14 13
$eur = 1;
15 14

  
16
# location of sendmail
17
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
18

  
19 15
# set language for login and admin
20 16
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
21 17
$language = "de";
......
46 42
# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
47 43
# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
48 44

  
49
# Pfad zu OpenOffice.org writer
50
$openofficeorg_writer_bin = "/usr/bin/oowriter";
51

  
52 45
# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
53 46
# Dokumente geht dann schneller. Allerdings wird auf dem System ein
54 47
# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
......
56 49
$openofficeorg_daemon = 1;
57 50
$openofficeorg_daemon_port = 2002;
58 51

  
59
# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
60
$xvfb_bin = "/usr/bin/Xvfb";
61

  
62 52
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
63 53
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
64 54
# $dbcharset = "ISO-8859-15";
65 55

  
66

  
67
# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
68
$html2ps_bin = "/usr/bin/html2ps";
69
$ghostscript_bin = "/usr/bin/gs";
70

  
71
# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
72
# wie z.B. 'xetex'
73
$latex_bin = 'pdflatex';
74

  
75
# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
76
# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
77
# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
78
# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
79
# nicht angeboten.
80
# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
81
$pg_dump_exe    = "pg_dump";
82
$pg_restore_exe = "pg_restore";
83

  
84 56
1;
config/lx_office.conf.default
8 8
# Path to the old memberfile (ignored on new installations)
9 9
memberfile = users/members
10 10

  
11
[applications]
12
# Location of sendmail
13
sendmail = /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>
14
# Location of OpenOffice.org writer
15
openofficeorg_writer = oowriter
16
# Location of the X virtual frame buffer used for OpenOffice
17
xvfb = Xvfb
18
# Location of the html2ps binary
19
html2ps = html2ps
20
# Location of the Ghostscript binary
21
ghostscript = gs
22
# Location of the pdflatex (or compatible, e.g. xetex) binary
23
latex = pdflatex
24
# Location of the two executables "pg_dump" and "pg_restore" used for
25
# database backup and restoration from the admin section.  If
26
# "pg_dump" or "pg_restore" is set to "DISABLED" then the
27
# corresponding option (backup/restoration) will be hidden from the
28
# admin section.
29
pg_dump = pg_dump
30
pg_restore = pg_restore
31

  
11 32
[environment]
12 33
# Add the following paths to the PATH environment variable.
13 34
path = /usr/local/bin:/usr/X11R6/bin:/usr/X11/bin
scripts/console
59 59

  
60 60
  package main;
61 61

  
62
  { no warnings 'once';
63
    $::sendmail   = "| /usr/sbin/sendmail -t";
64
  }
65

  
66 62
  eval { require "config/lx-erp.conf"; };
67 63
  eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
68 64

  
scripts/rose_auto_create_model.pl
42 42

  
43 43
  my $login     = shift @ARGV;
44 44

  
45
  $::sendmail   = "| /usr/sbin/sendmail -t";
46

  
47 45
  $::lxdebug    = LXDebug->new();
48 46

  
49 47
  require "config/lx-erp.conf";
scripts/task_server.pl
42 42

  
43 43
  package main;
44 44

  
45
  { no warnings 'once';
46
    $::sendmail   = "| /usr/sbin/sendmail -t";
47
  }
48

  
49 45
  eval { require "config/lx-erp.conf";       1; } or die $EVAL_ERROR;
50 46
  eval { require "config/lx-erp-local.conf"; 1; } or die $EVAL_ERROR if -f "config/lx-erp-local.conf";
51 47

  

Auch abrufbar als: Unified diff