From: Bernd Blessmann Date: Thu, 28 Jul 2011 10:21:28 +0000 (+0200) Subject: Vorauswahl der Sprache fuer Kunden in defaults X-Git-Tag: release-2.7.0beta1~343 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a9937c8511f6adec85906257afba39990c42ced7;p=kivitendo-erp.git Vorauswahl der Sprache fuer Kunden in defaults --- diff --git a/SL/AM.pm b/SL/AM.pm index 1501b22e7..ab983b757 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -1065,7 +1065,8 @@ sub save_defaults { pdonumber = ?, curr = ?, businessnumber = ?, - weightunit = ?|; + weightunit = ?, + language_id = ?|; my @values = ($accnos{inventory_accno}, $accnos{income_accno}, $accnos{expense_accno}, $accnos{fxgain_accno}, $accnos{fxloss_accno}, $accnos{ar_paid_accno}, $form->{invnumber}, $form->{cnnumber}, @@ -1075,7 +1076,8 @@ sub save_defaults { $form->{articlenumber}, $form->{servicenumber}, $form->{sdonumber}, $form->{pdonumber}, $currency, - $form->{businessnumber}, $form->{weightunit}); + $form->{businessnumber}, $form->{weightunit}, + $form->{language_id}); do_query($form, $dbh, $query, @values); $dbh->commit(); diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 7406c22f8..53ecc68e9 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -46,6 +46,7 @@ __PACKAGE__->meta->setup( accounting_method => { type => 'text' }, inventory_system => { type => 'text' }, profit_determination => { type => 'text' }, + language_id => { type => 'integer' }, ], primary_key_columns => [ 'id' ], diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 9abf79883..687314056 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -1549,6 +1549,9 @@ sub edit_defaults { map { $form->{"defaults_${_}"} = $form->{defaults}->{$_} } keys %{ $form->{defaults} }; + # default language + my @ALL_LANGUAGES = SL::DB::Manager::Language->get_all; + # EÜR = cash, Bilanzierung = accrual foreach my $key (keys %{ $form->{IC} }) { @@ -1568,7 +1571,8 @@ sub edit_defaults { $form->{title} = $locale->text('Ranges of numbers and default accounts'); $form->header(); - print $form->parse_html_template('am/edit_defaults'); + print $form->parse_html_template('am/edit_defaults', + { ALL_LANGUAGES => @ALL_LANGUAGES, }); $main::lxdebug->leave_sub(); } diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index cdb08529d..284f06175 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -50,6 +50,7 @@ use POSIX qw(strftime); use SL::CT; use SL::CVar; use SL::DB::Business; +use SL::DB::Default; use SL::ReportGenerator; require "bin/mozilla/common.pl"; @@ -336,6 +337,13 @@ sub form_header { $form->{NOTES} ||= [ ]; + if (!$form->{'language_id'}) { + my $l_id = SL::DB::Default->get->{'language_id'}; + if ($l_id) { + $form->{'default_language_id'} = $l_id; + } + } + $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'CT', 'trans_id' => $form->{id}); CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} }); diff --git a/sql/Pg-upgrade2/defaults_add_language_id.sql b/sql/Pg-upgrade2/defaults_add_language_id.sql new file mode 100644 index 000000000..7376a4e42 --- /dev/null +++ b/sql/Pg-upgrade2/defaults_add_language_id.sql @@ -0,0 +1,5 @@ +-- @tag: defaults_add_language_id +-- @description: Id der Standardsprache in defaults speichern +-- @depends: release_2_6_2 +-- @charset: utf-8 +ALTER TABLE defaults ADD COLUMN language_id integer; diff --git a/templates/webpages/am/edit_defaults.html b/templates/webpages/am/edit_defaults.html index 8829ba60c..d8aee7535 100644 --- a/templates/webpages/am/edit_defaults.html +++ b/templates/webpages/am/edit_defaults.html @@ -156,6 +156,20 @@ + + [% 'Language' | $T8 %] + + [%- INCLUDE 'generic/multibox.html' + name = 'language_id', + default = defaults_language_id, + style = 'size:20; maxength:5', + DATA = ALL_LANGUAGES, + id_key = 'id', + label_key = 'description', + -%] + + + [% 'Configuration' | $T8 %] diff --git a/templates/webpages/ct/form_header.html b/templates/webpages/ct/form_header.html index 91d863678..796f2a3ba 100644 --- a/templates/webpages/ct/form_header.html +++ b/templates/webpages/ct/form_header.html @@ -231,6 +231,7 @@ [%- INCLUDE generic/multibox.html name = 'language_id', + default = default_language_id, DATA = languages, show_empty = 1, id_key = 'id',