From 15e4b73285e0b4901eee0737df74f32aeca2c048 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 1 Jul 2013 16:40:07 +0200 Subject: [PATCH] Template-Parameter "conf_xyz" durch "INSTANCE_CONF.get_xyz" ersetzt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ansonsten haben wir ein Henne/Ei-Problem: Form::parse_html_template will die Variablen "conf_xyz" anhand der Werte in $::instance_conf setzen, ruft also dort die Funktionen auf. Wurde aber das dazugehörige DB-Upgrade noch nicht eingespielt, so croakt() das. --- SL/Form.pm | 9 +-------- templates/webpages/ct/form_header.html | 6 +++--- templates/webpages/do/form_header.html | 2 +- templates/webpages/ic/form_header.html | 4 ++-- templates/webpages/ic/search.html | 2 +- templates/webpages/ir/form_header.html | 2 +- templates/webpages/is/form_header.html | 2 +- templates/webpages/oe/form_header.html | 2 +- templates/webpages/webdav/_list.html | 2 +- 9 files changed, 12 insertions(+), 19 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 7bc62e886..5c701f792 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -614,14 +614,7 @@ sub _prepare_html_template { map { $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys %::myconfig; } - $additional_params->{"conf_webdav"} = $::instance_conf->get_webdav; - $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"} = $::instance_conf->get_vertreter; - $additional_params->{"conf_parts_image_css"} = $::instance_conf->get_parts_image_css; - $additional_params->{"conf_parts_listing_image"} = $::instance_conf->get_parts_listing_image; - $additional_params->{"conf_parts_show_image"} = $::instance_conf->get_parts_show_image; - $additional_params->{"INSTANCE_CONF"} = $::instance_conf; + $additional_params->{INSTANCE_CONF} = $::instance_conf; if (my $debug_options = $::lx_office_conf{debug}{options}) { map { $additional_params->{'DEBUG_' . uc($_)} = $debug_options->{$_} } keys %$debug_options; diff --git a/templates/webpages/ct/form_header.html b/templates/webpages/ct/form_header.html index 294cf4769..cd5f61021 100644 --- a/templates/webpages/ct/form_header.html +++ b/templates/webpages/ct/form_header.html @@ -26,7 +26,7 @@ - [% IF conf_vertreter %] + [% IF INSTANCE_CONF.get_vertreter %] - [% UNLESS conf_vertreter %] + [% UNLESS INSTANCE_CONF.get_vertreter %] - [%- IF is_customer && !conf_vertreter %] + [%- IF is_customer && !INSTANCE_CONF.get_vertreter %] [%- END %] diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index ceed4e564..baf7b3fee 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -48,7 +48,7 @@
[% IF is_customer %][% 'Type of Customer' | $T8 %][%- ELSE %][% 'Type of Vendor' | $T8 %][%- END %] @@ -238,7 +238,7 @@
[% IF is_customer %][% 'Type of Customer' | $T8 %][% ELSE %][% 'Type of Vendor' | $T8 %][%- END %] [%- INCLUDE generic/multibox.html @@ -295,7 +295,7 @@ label_key = 'description', -%] [% 'Salesman' | $T8 %] [% L.select_tag('salesman_id', ALL_SALESMEN, default = salesman_id, with_empty = 1, title_key = 'safe_name') %]
-[%- IF image && conf_parts_show_image %] - +[%- IF image && INSTANCE_CONF.get_parts_show_image %] + [%- END %] diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index a9799a57c..ce904eb1c 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -186,7 +186,7 @@ - + diff --git a/templates/webpages/ir/form_header.html b/templates/webpages/ir/form_header.html index 10739b6ea..fb9660a01 100644 --- a/templates/webpages/ir/form_header.html +++ b/templates/webpages/ir/form_header.html @@ -28,7 +28,7 @@
  • [% 'Basic Data' | $T8 %]
  • -[%- IF conf_webdav %] +[%- IF INSTANCE_CONF.get_webdav %]
  • [% 'WebDAV' | $T8 %]
  • [%- END %] [%- IF id %] diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index 89aa3fc4f..f0184be3a 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -29,7 +29,7 @@
    • [% 'Basic Data' | $T8 %]
    • -[%- IF conf_webdav %] +[%- IF INSTANCE_CONF.get_webdav %]
    • [% 'WebDAV' | $T8 %]
    • [%- END %] [%- IF id %] diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index 50c9c46db..8d07f73a7 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -32,7 +32,7 @@
      • [% 'Basic Data' | $T8 %]
      • -[%- IF conf_webdav %] +[%- IF INSTANCE_CONF.get_webdav %]
      • [% 'WebDAV' | $T8 %]
      • [%- END %] [%- IF id %] diff --git a/templates/webpages/webdav/_list.html b/templates/webpages/webdav/_list.html index 2e1d1e44e..50e92d660 100644 --- a/templates/webpages/webdav/_list.html +++ b/templates/webpages/webdav/_list.html @@ -1,6 +1,6 @@ [% USE HTML %][% USE T8 %] -[%- IF conf_webdav %] +[%- IF INSTANCE_CONF.get_webdav %]
        [% 'Documents in the WebDAV repository' | $T8 %]
        -- 2.20.1
[%- L.checkbox_tag('l_image', label=LxERP.t8('Image'), value='Y', checked=(conf_parts_listing_images ? 1 : 0)) %][%- L.checkbox_tag('l_image', label=LxERP.t8('Image'), value='Y', checked=(INSTANCE_CONF.get_parts_listing_images ? 1 : 0)) %] [%- L.checkbox_tag('l_drawing', label=LxERP.t8('Drawing'), value='Y') %] [%- L.checkbox_tag('l_microfiche', label=LxERP.t8('Microfiche'), value='Y') %] [%- L.checkbox_tag('l_partsgroup', label=LxERP.t8('Group'), value='Y') %]