From 2b3391521b469f9f7b2928d104a9f620dddb25d2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 19 Jan 2011 15:38:10 +0100 Subject: [PATCH] =?utf8?q?Globale=20Variablen=20f=C3=BCr=20Druckvorlagen?= =?utf8?q?=20nach=20%::lx=5Foffice=5Fconf=20verschoben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Betroffen sind: $latex_templates $excel_templates $opendocument_templates $openofficeorg_daemon $openofficeorg_daemon_port --- SL/Controller/Base.pm | 4 ++-- SL/Form.pm | 4 ++-- SL/Template/OpenDocument.pm | 9 +++++---- bin/mozilla/am.pl | 8 ++++---- bin/mozilla/io.pl | 18 +++++++++--------- bin/mozilla/rp.pl | 6 +++--- config/lx-erp.conf | 21 +-------------------- config/lx-erp.conf.default | 21 +-------------------- config/lx_office.conf.default | 14 ++++++++++++++ 9 files changed, 41 insertions(+), 64 deletions(-) diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index 723ce1d6a..834c3e4b6 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -70,8 +70,8 @@ sub render { LXCONFIG => { dbcharset => $::dbcharset, webdav => $::webdav, lizenzen => $::lizenzen, - latex_templates => $::latex, - opendocument_templates => $::opendocument_templates, + latex_templates => $::lx_office_conf{print_templates}->{latex}, + opendocument_templates => $::lx_office_conf{print_templates}->{opendocument}, vertreter => $::vertreter, show_best_before => $::show_best_before, }, diff --git a/SL/Form.pm b/SL/Form.pm index 35a87340a..ae1bfb140 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -805,8 +805,8 @@ sub _prepare_html_template { $additional_params->{"conf_dbcharset"} = $::dbcharset; $additional_params->{"conf_webdav"} = $::webdav; $additional_params->{"conf_lizenzen"} = $::lizenzen; - $additional_params->{"conf_latex_templates"} = $::latex; - $additional_params->{"conf_opendocument_templates"} = $::opendocument_templates; + $additional_params->{"conf_latex_templates"} = $::lx_office_conf{print_templates}->{latex}; + $additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument}; $additional_params->{"conf_vertreter"} = $::vertreter; $additional_params->{"conf_show_best_before"} = $::show_best_before; $additional_params->{"conf_parts_image_css"} = $::parts_image_css; diff --git a/SL/Template/OpenDocument.pm b/SL/Template/OpenDocument.pm index b1267c1c8..e2f7dcd63 100644 --- a/SL/Template/OpenDocument.pm +++ b/SL/Template/OpenDocument.pm @@ -419,7 +419,8 @@ sub spawn_xvfb { sub is_openoffice_running { $main::lxdebug->enter_sub(); - my $output = `./scripts/oo-uno-test-conn.py $main::openofficeorg_daemon_port 2> /dev/null`; + my $cmd = "./scripts/oo-uno-test-conn.py " . $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . " 2> /dev/null"; + my $output = `$cmd`; chomp $output; my $res = ($? == 0) || $output; @@ -461,7 +462,7 @@ sub spawn_openoffice { "-minimized", "-norestore", "-nologo", "-nolockcheck", "-headless", "-accept=socket,host=localhost,port=" . - $main::openofficeorg_daemon_port . ";urp;"); + $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . ";urp;"); exec(@cmdline); } @@ -508,7 +509,7 @@ sub convert_to_pdf { } my @cmdline; - if (!$main::openofficeorg_daemon) { + if (!$::lx_office_conf{print_templates}->{openofficeorg_daemon}) { @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer}, "-minimized", "-norestore", "-nologo", "-nolockcheck", "-headless", @@ -522,7 +523,7 @@ sub convert_to_pdf { } @cmdline = ("./scripts/oo-uno-convert-pdf.py", - $main::openofficeorg_daemon_port, + $::lx_office_conf{print_templates}->{openofficeorg_daemon_port}, "${filename}.odt"); } diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 7717adae3..3c31bdd42 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -2457,21 +2457,21 @@ sub config { _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); my @formats = (); - if ($main::opendocument_templates + if ($::lx_office_conf{print_templates}->{opendocument} && $::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 ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" }); } push(@formats, { "name" => "HTML", "value" => "html" }); - if ($main::latex_templates) { + if ($::lx_office_conf{print_templates}->{latex}) { push(@formats, { "name" => $locale->text("Postscript"), "value" => "postscript" }); } - if ($main::opendocument_templates) { + if ($::lx_office_conf{print_templates}->{opendocument}) { push(@formats, { "name" => $locale->text("OpenDocument/OASIS"), "value" => "opendocument" }); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f7084c4df..2b9c780b0 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1166,26 +1166,26 @@ sub print_options { push @MEDIA, grep $_, opthash("screen", $form->{OP}{screen}, $locale->text('Screen')), - ($form->{printers} && scalar @{ $form->{printers} } && $main::latex_templates) ? + ($form->{printers} && scalar @{ $form->{printers} } && $::lx_office_conf{print_templates}->{latex}) ? opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef, - ($main::latex_templates && !$options{no_queue}) ? + ($::lx_office_conf{print_templates}->{latex} && !$options{no_queue}) ? opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef if ($form->{media} ne 'email'); push @FORMAT, grep $_, - ($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}) + ($::lx_office_conf{print_templates}->{opendocument} && $::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) ? + ($::lx_office_conf{print_templates}->{latex}) ? opthash("pdf", $form->{DF}{pdf}, $locale->text('PDF')) : undef, - ($main::latex_templates && !$options{no_postscript}) ? + ($::lx_office_conf{print_templates}->{latex} && !$options{no_postscript}) ? opthash("postscript", $form->{DF}{postscript}, $locale->text('Postscript')) : undef, (!$options{no_html}) ? opthash("html", $form->{DF}{html}, "HTML") : undef, - ($main::opendocument_templates && !$options{no_opendocument}) ? + ($::lx_office_conf{print_templates}->{opendocument} && !$options{no_opendocument}) ? opthash("opendocument", $form->{DF}{opendocument}, $locale->text("OpenDocument/OASIS")) : undef, - ($main::excel_templates && !$options{no_excel}) ? + ($::lx_office_conf{print_templates}->{excel} && !$options{no_excel}) ? opthash("excel", $form->{DF}{excel}, $locale->text("Excel")) : undef; push @LANGUAGE_ID, @@ -1213,7 +1213,7 @@ sub print_options { ); my %template_vars = ( - display_copies => scalar @{ $form->{printers} || [] } && $main::latex_templates && $form->{media} ne 'email', + display_copies => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email', display_remove_draft => (!$form->{id} && $form->{draft_id}), display_groupitems => !$dont_display_groupitems{$form->{type}}, groupitems_checked => $form->{groupitems} ? "checked" : '', diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 0dbea7864..4ce3f5e33 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -2542,14 +2542,14 @@ sub print_options { } else { $media = qq|