From b05b5075ac0f3cbb0823c2f513cdbcacfb17bede Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 4 Jan 2016 16:57:07 +0100 Subject: [PATCH] country_mode entfernt. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Flags sollten unabhängig funktionieren, ausserdem in das im admin bereich der hass. --- SL/Controller/Admin.pm | 7 +------ SL/Controller/ClientConfig.pm | 1 - SL/DB/MetaSetup/Default.pm | 1 - SL/DefaultManager.pm | 8 -------- SL/User.pm | 19 +++++++++++++------ sql/Pg-upgrade2/defaults_add_country_mode.sql | 5 ----- templates/webpages/admin/create_dataset.html | 5 ----- 7 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 sql/Pg-upgrade2/defaults_add_country_mode.sql diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index c595b2411..94dfc6967 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -21,7 +21,7 @@ use SL::Layout::AdminLogin; use Rose::Object::MakeMethods::Generic ( 'scalar --get_set_init' => [ qw(client user group printer db_cfg is_locked - all_dateformats all_numberformats all_countrycodes all_countrymodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers + all_dateformats all_numberformats all_countrycodes all_stylesheets all_menustyles all_clients all_groups all_users all_rights all_printers all_dbsources all_used_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ], ); @@ -552,11 +552,6 @@ sub init_all_countrycodes { return [ map { id => $_, title => $cc{$_} }, sort { $cc{$a} cmp $cc{$b} } keys %cc ]; } -sub init_all_countrymodes { - my %cm = SL::DefaultManager->country_modes; - return [ map { id => $_, title => "$_ ($cm{$_})" }, sort keys %cm ]; -} - # # filters # diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index bdd52d280..d002f427a 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -29,7 +29,6 @@ sub action_edit { my ($self, %params) = @_; $::form->{use_templates} = $self->defaults->templates ? 'existing' : 'new'; - $::form->{country_mode} = $self->defaults->country_mode; $self->edit_form; } diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index ac5df0fd3..20610fd3b 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -35,7 +35,6 @@ __PACKAGE__->meta->columns( customer_hourly_rate => { type => 'numeric', precision => 8, scale => 2 }, customer_projects_only_in_sales => { type => 'boolean', default => 'false', not_null => 1 }, customernumber => { type => 'text' }, - country_mode => { type => 'text', default => 'DE', not_null => 1 }, datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, diff --git a/SL/DefaultManager.pm b/SL/DefaultManager.pm index 41314ddb3..620996581 100644 --- a/SL/DefaultManager.pm +++ b/SL/DefaultManager.pm @@ -34,14 +34,6 @@ sub _get { } } -sub country_modes { - my ($self) = @_; - return ( - 'CH' => 'Switzerland', - 'DE' => 'Germany', - ) -} - sub AUTOLOAD { our $AUTOLOAD; diff --git a/SL/User.pm b/SL/User.pm index 44efe5c58..38154283e 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -46,6 +46,7 @@ use SL::DBUtils; use SL::Iconv; use SL::Inifile; use SL::System::InstallationLock; +use SL::DefaultManager; use strict; @@ -283,11 +284,16 @@ sub dbcreate { # create the tables $dbupdater->process_query($dbh, "sql/lx-office.sql"); + # process update-scripts needed before 1st user-login + $self->create_schema_info_table($form, $dbh); + $dbupdater->process_query($dbh, "sql/Pg-upgrade2/defaults_add_precision.sql"); + $dbh->do("INSERT INTO schema_info (tag, login) VALUES ('defaults_add_precision', 'admin')"); + # load chart of accounts $dbupdater->process_query($dbh, "sql/$form->{chart}-chart.sql"); - $query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?|; - do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency)); + $query = qq|UPDATE defaults SET coa = ?, accounting_method = ?, profit_determination = ?, inventory_system = ?, curr = ?, precision = ?|; + do_query($form, $dbh, $query, map { $form->{$_} } qw(chart accounting_method profit_determination inventory_system defaultcurrency precision countrymode)); $dbh->disconnect; @@ -414,14 +420,15 @@ sub data { sub get_default_myconfig { my ($self_or_class, %user_config) = @_; + my $defaults = SL::DefaultManager->new($::lx_office_conf{system}->{default_manager}); return ( - countrycode => 'de', + countrycode => $defaults->language('de'), css_path => 'css', # Needed for menunew, see SL::Layout::Base::get_stylesheet_for_user - dateformat => 'dd.mm.yy', - numberformat => '1.000,00', + dateformat => $defaults->dateformat('dd.mm.yy'), + numberformat => $defaults->numberformat('1.000,00'), stylesheet => 'kivitendo.css', - timeformat => 'hh:mm', + timeformat => $defaults->timeformat('hh:mm'), %user_config, ); } diff --git a/sql/Pg-upgrade2/defaults_add_country_mode.sql b/sql/Pg-upgrade2/defaults_add_country_mode.sql deleted file mode 100644 index d6495e1d7..000000000 --- a/sql/Pg-upgrade2/defaults_add_country_mode.sql +++ /dev/null @@ -1,5 +0,0 @@ --- @tag: defaults_add_country_mode --- @description: adds new column 'country_mode' (ISO-3166) in table defaults used for erp.ini --- @depends: release_3_2_0 -ALTER TABLE defaults ADD COLUMN country_mode TEXT NOT NULL DEFAULT('DE'); - diff --git a/templates/webpages/admin/create_dataset.html b/templates/webpages/admin/create_dataset.html index 4f875a882..d02865aff 100644 --- a/templates/webpages/admin/create_dataset.html +++ b/templates/webpages/admin/create_dataset.html @@ -21,11 +21,6 @@ [% L.input_tag('db', FORM.db, class="initial_focus") %] - - [% LxERP.t8('Country') %] - [% L.select_tag('countrymode', SELF.all_countrymodes, title_key="title", default=(FORM.countrymode), onchange='select_country_defaults(this.value)') %] - -
-- 2.20.1