From 002517b469b85cb6e7ce37c8be89273e028a1d02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 6 Dec 2013 14:54:45 +0100 Subject: [PATCH] =?utf8?q?Lieferbedingungen=20=C3=BCbersetzbar=20gemacht.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/DeliveryTerm.pm | 9 ++++++++- SL/DB/DeliveryTerm.pm | 1 + SL/DO.pm | 1 + SL/IS.pm | 1 + SL/OE.pm | 1 + templates/webpages/delivery_term/form.html | 9 +++++++++ 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/SL/Controller/DeliveryTerm.pm b/SL/Controller/DeliveryTerm.pm index 3c4d44a9f..4810d2141 100644 --- a/SL/Controller/DeliveryTerm.pm +++ b/SL/Controller/DeliveryTerm.pm @@ -5,15 +5,17 @@ use strict; use parent qw(SL::Controller::Base); use SL::DB::DeliveryTerm; +use SL::DB::Language; use SL::Helper::Flash; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(delivery_term) ], + scalar => [ qw(delivery_term languages) ], ); __PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('load_delivery_term', only => [ qw(edit update destroy) ]); +__PACKAGE__->run_before('load_languages', only => [ qw(new list edit create update) ]); # @@ -113,4 +115,9 @@ sub load_delivery_term { $self->{delivery_term} = SL::DB::DeliveryTerm->new(id => $::form->{id})->load; } +sub load_languages { + my ($self) = @_; + $self->{languages} = SL::DB::Manager::Language->get_all_sorted; +} + 1; diff --git a/SL/DB/DeliveryTerm.pm b/SL/DB/DeliveryTerm.pm index c315e9bfd..68c5d9282 100644 --- a/SL/DB/DeliveryTerm.pm +++ b/SL/DB/DeliveryTerm.pm @@ -8,6 +8,7 @@ use strict; use SL::DB::MetaSetup::DeliveryTerm; use SL::DB::Manager::DeliveryTerm; use SL::DB::Helper::ActsAsList; +use SL::DB::Helper::TranslatedAttributes; sub validate { diff --git a/SL/DO.pm b/SL/DO.pm index cec2e9b5d..d83c49b3e 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -895,6 +895,7 @@ sub order_details { $h_bin_wh->finish(); $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); + $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; $form->{username} = $myconfig->{name}; diff --git a/SL/IS.pm b/SL/IS.pm index b9c3e0aeb..23b6f80f7 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -430,6 +430,7 @@ sub invoice_details { $form->set_payment_options($myconfig, $form->{invdate}); $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); + $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; $form->{username} = $myconfig->{name}; diff --git a/SL/OE.pm b/SL/OE.pm index 2d124723c..0e5c05b46 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -1336,6 +1336,7 @@ sub order_details { $dbh->disconnect; $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); + $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; $main::lxdebug->leave_sub(); } diff --git a/templates/webpages/delivery_term/form.html b/templates/webpages/delivery_term/form.html index 7ac53938b..92d98c210 100755 --- a/templates/webpages/delivery_term/form.html +++ b/templates/webpages/delivery_term/form.html @@ -20,6 +20,15 @@ + [%- FOREACH language = SELF.languages %] + + [%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %]) + + + + + [%- END %] +

-- 2.20.1