From 44d893c2d2589ac8d09d255f9be0e38d74c48407 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 17 Jun 2013 17:13:31 +0200 Subject: [PATCH] Datenbankverwaltung in neuen Admin-Controller verschoben --- SL/Controller/Admin.pm | 97 +++++++- SL/User.pm | 73 +----- bin/mozilla/admin.pl | 222 ------------------ locale/de/all | 30 +-- templates/webpages/admin/create_dataset.html | 231 ++++++++----------- templates/webpages/admin/dbadmin.html | 104 +++------ templates/webpages/admin/dbcreate.html | 8 - templates/webpages/admin/delete_dataset.html | 46 ++-- templates/webpages/admin/show.html | 4 +- 9 files changed, 275 insertions(+), 540 deletions(-) delete mode 100755 bin/mozilla/admin.pl delete mode 100644 templates/webpages/admin/dbcreate.html diff --git a/SL/Controller/Admin.pm b/SL/Controller/Admin.pm index 4e46e9879..e26d16554 100644 --- a/SL/Controller/Admin.pm +++ b/SL/Controller/Admin.pm @@ -4,9 +4,10 @@ use strict; use parent qw(SL::Controller::Base); -use IO::File; +use IO::Dir; use List::Util qw(first); +use SL::Common (); use SL::DB::AuthUser; use SL::DB::AuthGroup; use SL::DB::Printer; @@ -18,7 +19,8 @@ use SL::User; 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_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_unused_dbsources all_accounting_methods all_inventory_systems all_profit_determinations all_charts) ], ); __PACKAGE__->run_before(\&setup_layout); @@ -360,6 +362,70 @@ sub action_delete_printer { $self->redirect_to(action => 'list_printers', 'client.id' => $self->client->id); } +# +# actions: database administration +# + +sub action_database_administration { + my ($self) = @_; + + $::form->{dbhost} ||= $::auth->{DB_config}->{host} || 'localhost'; + $::form->{dbport} ||= $::auth->{DB_config}->{port} || 5432; + $::form->{dbuser} ||= $::auth->{DB_config}->{user} || 'kivitendo'; + $::form->{dbpasswd} ||= $::auth->{DB_config}->{password}; + $::form->{dbdefault} ||= 'template1'; + + $::request->layout->focus('#dbhost'); + + $self->render('admin/dbadmin', title => t8('Database Administration')); +} + +sub action_create_dataset { + my ($self) = @_; + $self->create_dataset_form; +} + +sub action_do_create_dataset { + my ($self) = @_; + + my @errors; + push @errors, t8("Dataset missing!") if !$::form->{db}; + push @errors, t8("Default currency missing!") if !$::form->{defaultcurrency}; + + if (@errors) { + flash('error', @errors); + return $self->create_dataset_form; + } + + $::form->{encoding} = 'UNICODE'; + User->new->dbcreate($::form); + + flash_later('info', t8("The dataset #1 has been created.", $::form->{db})); + $self->redirect_to(action => 'database_administration'); +} + +sub action_delete_dataset { + my ($self) = @_; + $self->delete_dataset_form; +} + +sub action_do_delete_dataset { + my ($self) = @_; + + my @errors; + push @errors, t8("Dataset missing!") if !$::form->{db}; + + if (@errors) { + flash('error', @errors); + return $self->create_dataset_form; + } + + User->new->dbdelete($::form); + + flash_later('info', t8("The dataset #1 has been deleted.", $::form->{db})); + $self->redirect_to(action => 'database_administration'); +} + # # actions: locking, unlocking # @@ -397,6 +463,23 @@ sub init_all_printers { SL::DB::Manager::Printer ->get_all_sorted sub init_all_dateformats { [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ] } sub init_all_numberformats { [ qw(1,000.00 1000.00 1.000,00 1000,00) ] } sub init_all_stylesheets { [ qw(lx-office-erp.css Mobile.css kivitendo.css) ] } +sub init_all_dbsources { [ sort User->dbsources($::form) ] } +sub init_all_unused_dbsources { [ sort User->dbsources_unused($::form) ] } +sub init_all_accounting_methods { [ { id => 'accrual', name => t8('Accrual accounting') }, { id => 'cash', name => t8('Cash accounting') } ] } +sub init_all_inventory_systems { [ { id => 'perpetual', name => t8('Perpetual inventory') }, { id => 'periodic', name => t8('Periodic inventory') } ] } +sub init_all_profit_determinations { [ { id => 'balance', name => t8('Balancing') }, { id => 'income', name => t8('Cash basis accounting') } ] } + +sub init_all_charts { + tie my %dir_h, 'IO::Dir', 'sql/'; + + return [ + map { s/-chart\.sql$//; +{ id => $_ } } + sort + grep { /-chart\.sql\z/ && !/Default-chart.sql\z/ } + keys %dir_h + ]; +} + sub init_all_menustyles { return [ { id => 'old', title => $::locale->text('Old (on the side)') }, @@ -488,6 +571,16 @@ sub edit_printer_form { $self->render('admin/edit_printer', %params); } +sub create_dataset_form { + my ($self, %params) = @_; + $self->render('admin/create_dataset', title => (t8('Database Administration') . " / " . t8('Create Dataset'))); +} + +sub delete_dataset_form { + my ($self, %params) = @_; + $self->render('admin/delete_dataset', title => (t8('Database Administration') . " / " . t8('Delete Dataset'))); +} + # # helpers # diff --git a/SL/User.pm b/SL/User.pm index 03961d6c3..9f411a1b5 100644 --- a/SL/User.pm +++ b/SL/User.pm @@ -38,6 +38,7 @@ use IO::File; use Fcntl qw(:seek); #use SL::Auth; +use SL::DB::AuthClient; use SL::DBConnect; use SL::DBUpgrade2; use SL::DBUtils; @@ -224,25 +225,6 @@ sub dbsources { return @dbsources; } -sub dbclusterencoding { - $main::lxdebug->enter_sub(); - - my ($self, $form) = @_; - - $form->{dbdefault} ||= $form->{dbuser}; - - dbconnect_vars($form, $form->{dbdefault}); - - my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}, SL::DBConnect->get_options) || $form->dberror(); - my $query = qq|SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'template0'|; - my ($cluster_encoding) = $dbh->selectrow_array($query); - $dbh->disconnect(); - - $main::lxdebug->leave_sub(); - - return $cluster_encoding; -} - sub dbcreate { $main::lxdebug->enter_sub(); @@ -316,10 +298,11 @@ sub dbsources_unused { my ($self, $form) = @_; - $form->{only_acc_db} = 1; + my %dbexcl = map { $_->dbname => 1 } + grep { ($_->dbhost eq $form->{dbhost}) && ($_->dbport eq $form->{dbport}) } + @{ SL::DB::Manager::AuthClient->get_all }; - my %members = $main::auth->read_all_users(); - my %dbexcl = map { $_ => 1 } grep { $_ } map { $_->{dbname} } values %members; + $form->{only_acc_db} = 1; $dbexcl{$form->{dbdefault}} = 1; $dbexcl{$main::auth->{DB_config}->{db}} = 1; @@ -331,52 +314,6 @@ sub dbsources_unused { return @dbunused; } -sub dbneedsupdate { - $main::lxdebug->enter_sub(); - - my ($self, $form) = @_; - - my %members = $main::auth->read_all_users(); - my $dbupdater = SL::DBUpgrade2->new(form => $form)->parse_dbupdate_controls; - - my ($query, $sth, %dbs_needing_updates); - - foreach my $login (grep /[a-z]/, keys %members) { - my $member = $members{$login}; - - map { $form->{$_} = $member->{$_} } qw(dbname dbuser dbpasswd dbhost dbport); - dbconnect_vars($form, $form->{dbname}); - - my $dbh = SL::DBConnect->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}, SL::DBConnect->get_options); - - next unless $dbh; - - my $version; - - $query = qq|SELECT version FROM defaults|; - $sth = prepare_query($form, $dbh, $query); - if ($sth->execute()) { - ($version) = $sth->fetchrow_array(); - } - $sth->finish(); - - $dbh->disconnect and next unless $version; - - my $update_available = $dbupdater->update_available($version) || $dbupdater->update2_available($dbh); - $dbh->disconnect; - - if ($update_available) { - my $dbinfo = {}; - map { $dbinfo->{$_} = $member->{$_} } grep /^db/, keys %{ $member }; - $dbs_needing_updates{$member->{dbhost} . "::" . $member->{dbname}} = $dbinfo; - } - } - - $main::lxdebug->leave_sub(); - - return values %dbs_needing_updates; -} - sub calc_version { $main::lxdebug->enter_sub(2); diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl deleted file mode 100755 index b6569ecdc..000000000 --- a/bin/mozilla/admin.pl +++ /dev/null @@ -1,222 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -#===================================================================== -# SQL-Ledger Accounting -# Copyright (c) 2002 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# setup module -# add/edit/delete users -# -#====================================================================== - -use DBI; -use Encode; -use English qw(-no_match_vars); -use Fcntl; -use File::Copy; -use File::Find; -use File::Spec; -use Cwd; -use IO::Dir; -use IO::File; -use POSIX qw(strftime); -use Sys::Hostname; - -use SL::Auth; -use SL::Auth::PasswordPolicy; -use SL::DB::AuthClient; -use SL::DB::AuthUser; -use SL::Form; -use SL::Iconv; -use SL::Mailer; -use SL::User; -use SL::Common; -use SL::Inifile; -use SL::DBUpgrade2; -use SL::DBUtils; -use SL::Template; - -require "bin/mozilla/common.pl"; - -use strict; - -# parserhappy(R): - -# $locale->text('periodic') -# $locale->text('income') -# $locale->text('perpetual') -# $locale->text('balance') - -our $cgi; -our $form; -our $locale; -our $auth; - -sub run { - $::lxdebug->enter_sub; - my $session_result = shift; - - $form = $::form; - $locale = $::locale; - $auth = $::auth; - - $::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin'); - $::request->{layout}->use_stylesheet("lx-office-erp.css"); - $form->{favicon} = "favicon.ico"; - - if ($form->{action}) { - if ($auth->authenticate_root($form->{'{AUTH}admin_password'}) != $auth->OK()) { - $auth->punish_wrong_login; - $form->{error} = $locale->text('Incorrect password!'); - $auth->delete_session_value('admin_password'); - adminlogin(); - } else { - if ($auth->session_tables_present()) { - delete $::form->{'{AUTH}admin_password'}; - } - - call_sub($locale->findsub($form->{action})); - } - } else { - adminlogin(); - } - $::lxdebug->leave_sub; -} - -sub adminlogin { - print $::request->cgi->redirect('controller.pl?action=Admin/login'); -} - -sub pg_database_administration { - my $form = $main::form; - dbselect_source(); -} - -sub dbselect_source { - my $form = $main::form; - my $locale = $main::locale; - - $form->{dbport} = $::auth->{DB_config}->{port} || 5432; - $form->{dbuser} = $::auth->{DB_config}->{user} || 'lxoffice'; - $form->{dbdefault} = 'template1'; - $form->{dbhost} = $::auth->{DB_config}->{host} || 'localhost'; - - $form->{title} = "kivitendo / " . $locale->text('Database Administration'); - - $form->header(); - print $form->parse_html_template("admin/dbadmin"); -} - -sub continue { - call_sub($main::form->{"nextsub"}); -} - - -sub create_dataset { - my $form = $main::form; - my $locale = $main::locale; - - $form->{dbsources} = join " ", map { "[${_}]" } sort User->dbsources($form); - - $form->{CHARTS} = []; - - tie my %dir_h, 'IO::Dir', 'sql/'; - foreach my $item (map { s/-chart\.sql$//; $_ } sort grep { /-chart\.sql\z/ && !/Default-chart.sql\z/ } keys %dir_h) { - push @{ $form->{CHARTS} }, { name => $item, - selected => $item eq "Germany-DATEV-SKR03EU" }; - } - - $form->{ACCOUNTING_METHODS} = [ map { { name => $_, selected => $_ eq 'cash' } } qw(accrual cash) ]; - $form->{INVENTORY_SYSTEMS} = [ map { { name => $_, selected => $_ eq 'periodic' } } qw(perpetual periodic) ]; - $form->{PROFIT_DETERMINATIONS} = [ map { { name => $_, selected => $_ eq 'income' } } qw(balance income) ]; - - my $default_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET; - - my $cluster_encoding = User->dbclusterencoding($form); - if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i)) { - if ($::lx_office_conf{system}->{dbcharset} !~ m/^UTF-?8$/i) { - $form->show_generic_error($locale->text('The selected PostgreSQL installation uses UTF-8 as its encoding. ' . - 'Therefore you have to configure kivitendo to use UTF-8 as well.'), - 'back_button' => 1); - } - - $form->{FORCE_DBENCODING} = 'UNICODE'; - - } else { - $form->{DBENCODINGS} = [ map { { %{$_}, selected => $_->{charset} eq $default_charset } } @Common::db_encodings ]; - } - - $form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Create Dataset'); - - $form->header(); - print $form->parse_html_template("admin/create_dataset"); -} - -sub dbcreate { - my $form = $main::form; - my $locale = $main::locale; - - $form->isblank("db", $locale->text('Dataset missing!')); - $form->isblank("defaultcurrency", $locale->text('Default currency missing!')); - - User->dbcreate(\%$form); - - $form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Create Dataset'); - - $form->header(); - print $form->parse_html_template("admin/dbcreate"); -} - -sub delete_dataset { - my $form = $main::form; - my $locale = $main::locale; - - my @dbsources = User->dbsources_unused($form); - $form->error($locale->text('Nothing to delete!')) unless @dbsources; - - $form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Delete Dataset'); - $form->{DBSOURCES} = [ map { { "name", $_ } } sort @dbsources ]; - - $form->header(); - print $form->parse_html_template("admin/delete_dataset"); -} - -sub dbdelete { - my $form = $main::form; - my $locale = $main::locale; - - if (!$form->{db}) { - $form->error($locale->text('No Dataset selected!')); - } - - User->dbdelete(\%$form); - - $form->{title} = "kivitendo " . $locale->text('Database Administration') . " / " . $locale->text('Delete Dataset'); - $form->header(); - print $form->parse_html_template("admin/dbdelete"); -} - -1; diff --git a/locale/de/all b/locale/de/all index da933184e..713abd0a6 100755 --- a/locale/de/all +++ b/locale/de/all @@ -19,8 +19,6 @@ $self->{texts} = { '#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.', '#1 prices were updated.' => '#1 Preise wurden aktualisiert.', '(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) Fügen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.', - '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' => ' für die Bestandsmethode gibt es Einschränkungen, siehe Kapitel "Bemerkungen zu Bestandsmethode" in', - '*) Since version 2.7 these parameters ares set in the client database and not in the configuration file, details in chapter:' => '*) Seit 2.7 werden Gewinnermittlungsart, Versteuerungsart und Warenbuchungsmethode in der Mandanten-DB gesteuert und nicht mehr in der Konfigurationsdatei, Umstellungs-Details:', '*/' => '*/', ', if set' => ', falls gesetzt', '---please select---' => '---bitte auswählen---', @@ -115,6 +113,7 @@ $self->{texts} = { 'Accounting Group saved!' => 'Buchungsgruppe gespeichert!', 'Accounting method' => 'Versteuerungsart', 'Accrual' => 'Soll-Versteuerung', + 'Accrual accounting' => 'Soll-Versteuerung', 'Actions' => 'Aktionen', 'Active' => 'Aktiv', 'Active?' => 'Aktiviert?', @@ -177,10 +176,8 @@ $self->{texts} = { 'Aktion' => 'Aktion', 'All' => 'Alle', 'All Accounts' => 'Alle Konten', - 'All Datasets up to date!' => 'Alle Datenbanken sind auf aktuellem Stand.', 'All changes in that file have been reverted.' => 'Alle Änderungen in dieser Datei wurden rückgängig gemacht.', 'All clients' => 'Alle Mandanten', - 'All database upgrades have been applied.' => 'Alle Datenbankupdates wurden eingespielt.', 'All general ledger entries' => 'Alle Hauptbucheinträge', 'All groups' => 'Alle Gruppen', 'All of the exports you have selected were already closed.' => 'Alle von Ihnen ausgewählten Exporte sind bereits abgeschlossen.', @@ -268,9 +265,9 @@ $self->{texts} = { 'Background job history' => 'Verlauf der Hintergrund-Jobs', 'Background jobs' => 'Hintergrund-Jobs', 'Background jobs and task server' => 'Hintergrund-Jobs und Task-Server', - 'Backup Dataset' => 'Datenbank sichern', 'Balance' => 'Bilanz', 'Balance Sheet' => 'Bilanz', + 'Balancing' => 'Bilanzierung', 'Bank' => 'Bank', 'Bank Code' => 'BLZ', 'Bank Code (long)' => 'Bankleitzahl (BLZ)', @@ -403,6 +400,8 @@ $self->{texts} = { 'Cannot transfer.
Reason:
#1' => 'Kann nicht auslagern.
Grund:
#1', 'Carry over shipping address' => 'Lieferadresse übernehmen', 'Cash' => 'Zahlungsverkehr', + 'Cash accounting' => 'Ist-Versteuerung', + 'Cash basis accounting' => 'Einnahmen-Überschuss-Rechnung', 'Cc' => 'Cc', 'Cc E-mail' => 'CC (E-Mail)', 'Change default bin for this parts' => 'Standardlagerplatz für diese Waren ändern', @@ -726,7 +725,6 @@ $self->{texts} = { 'Download sample file' => 'Beispieldatei herunterladen', 'Draft saved.' => 'Entwurf gespeichert.', 'Drawing' => 'Zeichnung', - 'Driver' => 'Treiber', 'Dropdown Limit' => 'Auswahllistenbegrenzung', 'Due' => 'Fällig', 'Due Date' => 'Fälligkeitsdatum', @@ -1042,7 +1040,7 @@ $self->{texts} = { 'If you see this message, you most likely just setup your LX-Office and haven\'t added any entry types. If this is the case, the option is accessible for administrators in the System menu.' => 'Wenn Sie diese Meldung sehen haben Sie wahrscheinlich ein frisches LX-Office Setup und noch keine Buchungsgruppen eingerichtet. Ein Administrator kann dies im Systemmenü erledigen.', 'If you select a base unit then you also have to enter a factor.' => 'Wenn Sie eine Basiseinheit auswählen, dann müssen Sie auch einen Faktor eingeben.', 'If you want to change any of these parameters then press the "Back" button, edit the file "config/kivitendo.conf" and login into the admin module again.' => 'Wenn Sie einen der Parameter ändern wollen, so drücken Sie auf den "Zurück"-Button, bearbeiten Sie die Datei "config/kivitendo.conf", und melden Sie sich erneut im Administrationsbereich an.', - 'If you want to delete such a dataset you have to edit the user(s) that are using the dataset in question and have them use another dataset.' => 'Wenn Sie eine solche Datenbank löschen wollen, so müssen Sie zuerst die Benutzer bearbeiten, die die fragliche Datenbank benutzen, und sie so ändern, dass sie eine andere Datenbank benutzen.', + 'If you want to delete such a dataset you have to edit the client(s) that are using the dataset in question and have them use another dataset.' => 'Wenn Sie eine solche Datenbank löschen möchten, dann müssen Sie zuerst den/die Mandanten auf eine andere Datenbank umstellen, die die zu löschende Datenbank benutzen.', 'If you want to set up the authentication database yourself then log in to the administration panel. kivitendo will then create the database and tables for you.' => 'Wenn Sie die Authentifizierungs-Datenbank selber einrichten wollen, so melden Sie sich im Administrationsbereich an. kivitendo wird dann die Datenbank und die erforderlichen Tabellen für Sie anlegen.', 'If your old bins match exactly Bins in the Warehouse CLICK on AUTOMATICALLY MATCH BINS.' => 'Falls die alte Lagerplatz-Beschreibung in Stammdaten genau mit einem Lagerplatz in einem vorhandenem Lager übereinstimmt, KLICK auf LAGERPLÄTZE AUTOMATISCH ZUWEISEN', 'Illegal characters have been removed from the following fields: #1' => 'Ungültige Zeichen wurden aus den folgenden Feldern entfernt: #1', @@ -1186,7 +1184,6 @@ $self->{texts} = { 'Lastcost (with X being a number)' => 'Einkaufspreis (X ist eine fortlaufende Zahl)', 'Lead' => 'Kundenquelle', 'Leads' => 'Leads', - 'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.', 'Left' => 'Links', 'Liability' => 'Passiva/Mittelherkunft', 'Limit part selection' => 'Artikelauswahl eingrenzen', @@ -1285,7 +1282,6 @@ $self->{texts} = { 'More than one #1 found matching, please be more specific.' => 'Mehr als ein #1 wurde gefunden, bitte geben Sie den Namen genauer an.', 'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.', 'Multi mode not supported.' => 'Multimodus wird nicht unterstützt.', - 'Multibyte Encoding' => 'Zeichenkodierung', 'MwSt. inkl.' => 'MwSt. inkl.', 'Name' => 'Name', 'Name and Street' => 'Name und Straße', @@ -1320,7 +1316,6 @@ $self->{texts} = { 'No Company Address given' => 'Keine Firmenadresse hinterlegt!', 'No Company Name given' => 'Kein Firmenname hinterlegt!', 'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden', - 'No Dataset selected!' => 'Keine Datenbank ausgewählt!', 'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden', 'No action defined.' => 'Keine Aktion definiert.', 'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.', @@ -1332,7 +1327,6 @@ $self->{texts} = { 'No contact selected to delete' => 'Keine Ansprechperson zum Löschen ausgewählt', 'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.', 'No data was found.' => 'Es wurden keine Daten gefunden.', - 'No datasets have been selected.' => 'Es wurden keine Datenbanken ausgewählt.', 'No default currency' => 'Keine Standardwährung', 'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.', 'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.', @@ -1372,7 +1366,6 @@ $self->{texts} = { 'Nothing has been selected for removal.' => 'Es wurde nichts für eine Entnahme ausgewählt.', 'Nothing has been selected for transfer.' => 'Es wurde nichts zum Umlagern ausgewählt.', 'Nothing selected!' => 'Es wurde nichts ausgewählt!', - 'Nothing to delete!' => 'Es konnte nichts gelöscht werden!', 'Nov' => 'Nov', 'November' => 'November', 'Now the user must select a single Buchungsgruppe for each part instead of three distinct accounts.' => 'Der Benutzer muss nun für jeden Artikel nur noch die Buchungsgruppe anstelle der drei einzelnen Konten auswählen.', @@ -1489,9 +1482,11 @@ $self->{texts} = { 'Period' => 'Zeitraum', 'Period:' => 'Zeitraum:', 'Periodic Invoices' => 'Wiederkehrende Rechnungen', + 'Periodic inventory' => 'Aufwandsmethode', 'Periodic invoices active' => 'Wiederkehrende Rechnungen aktiv', 'Periodic invoices inactive' => 'Wiederkehrende Rechnungen inaktiv', 'Periodicity' => 'Periodizität', + 'Perpetual inventory' => 'Bestandsmethode', 'Personal settings' => 'Persönliche Einstellungen', 'Pg Database Administration' => 'Datenbankadministration', 'Phone' => 'Telefon', @@ -1528,10 +1523,10 @@ $self->{texts} = { 'Please select a part from the list below.' => 'Bitte wählen Sie einen Artikel aus der Liste aus.', 'Please select a vendor from the list below.' => 'Bitte einen Händler aus der Liste auswählen', 'Please select the chart of accounts this installation is using from the list below.' => 'Bitte wählen Sie den Kontenrahmen aus, der bei dieser Installation verwendet wird.', + 'Please select the dataset you want to delete:' => 'Bitte wählen Sie die zu löschende Datenbank aus:', 'Please select the destination bank account for the collections:' => 'Bitte wählen Sie das Bankkonto als Ziel für die Einzüge aus:', 'Please select the source bank account for the transfers:' => 'Bitte wählen Sie das Bankkonto als Quelle für die Überweisungen aus:', 'Please select which client configurations you want to create.' => 'Bitte wählen Sie aus, welche Mandanten mit welchen Einstellungen angelegt werden sollen.', - 'Please seletct the dataset you want to delete:' => 'Bitte wählen Sie die zu löschende Datenbank aus:', 'Please set another taxnumber for the following taxes and run the update again:' => 'Bitte wählen Sie ein anderes Steuerautomatik-Konto für die folgenden Steuern aus uns starten Sie dann das Update erneut.', 'Please specify a description for the warehouse designated for these goods.' => 'Bitte geben Sie den Namen des Ziellagers für die übernommenen Daten ein.', 'Plural' => 'Plural', @@ -1690,7 +1685,6 @@ $self->{texts} = { 'Requested execution date to' => 'Gewünschtes Ausführungsdatum bis', 'Required by' => 'Lieferdatum', 'Reset' => 'Zurücksetzen', - 'Restore Dataset' => 'Datenbank wiederherstellen', 'Result' => 'Ergebnis', 'Revenue' => 'Erlöskonto', 'Revenue Account' => 'Erlöskonto', @@ -2040,7 +2034,6 @@ $self->{texts} = { 'The creation of the authentication database failed:' => 'Das Anlegen der Authentifizierungsdatenbank schlug fehl:', 'The custom variable has been deleted.' => 'Die benutzerdefinierte Variable wurde gelöscht.', 'The custom variable has been saved.' => 'Die benutzerdefinierte Variable wurde gespeichert.', - 'The database #1 has been successfully deleted.' => 'Die Datenbank #1 wurde erfolgreich gelöscht.', 'The database for user management and authentication does not exist. You can create let kivitendo create it with the following parameters:' => 'Die Datenbank für die Benutzeranmeldung existiert nicht. Sie können Sie von kivitendo automatisch mit den folgenden Parametern anlegen lassen:', 'The database host is missing.' => 'Der Datenbankhost fehlt.', 'The database name is missing.' => 'Der Datenbankname fehlt.', @@ -2049,7 +2042,8 @@ $self->{texts} = { 'The database upgrade for the introduction of Buchungsgruppen is now complete.' => 'Das Datenbankupgrade für die Einführung von Buchungsgruppen ist jetzt beendet.', 'The database upgrade for the introduction of units is now complete.' => 'Das Datenbankupgrade zwecks Einführung von Einheiten ist nun beendet.', 'The database user is missing.' => 'Der Datenbankbenutzer fehlt.', - 'The dataset #1 has been successfully created.' => 'Die Datenbank #1 wurde erfolgreich angelegt.', + 'The dataset #1 has been created.' => 'Die Datenbank #1 wurde angelegt.', + 'The dataset #1 has been deleted.' => 'Die Datenbank #1 wurde gelöscht.', 'The deductible amount' => 'Der abziehbare Skontobetrag', 'The default value depends on the variable type:' => 'Die Bedeutung des Standardwertes hängt vom Variablentypen ab:', 'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => 'Der Lieferschein wurde nicht als geliefert markiert. Der Lagerinhalt wurde nicht verändert.', @@ -2075,7 +2069,6 @@ $self->{texts} = { 'The first reason is that kivitendo contained a bug which resulted in the wrong taxkeys being recorded for transactions in which two entries are posted for the same chart with different taxkeys.' => 'Der erste Grund war ein Fehler in kivitendo, der dazu führte, dass bei einer Transaktion, bei der zwei Buchungen mit unterschiedlichen Steuerschlüsseln auf dasselbe Konto durchgeführt wurden, die falschen Steuerschlüssel gespeichert wurden.', 'The follow-up date is missing.' => 'Das Wiedervorlagedatum fehlt.', 'The following Buchungsgruppen have already been created:' => 'Die folgenden Buchungsgruppen wurden bereits angelegt:', - 'The following Datasets need to be updated' => 'Folgende Datenbanken müssen aktualisiert werden', 'The following currencies have been used, but they are not defined:' => 'Die folgenden Währungen wurden benutzt, sind aber nicht ordnungsgemäß in der Datenbank eingetragen:', 'The following drafts have been saved and can be loaded.' => 'Die folgenden Entwürfe wurden gespeichert und können geladen werden.', 'The following groups are valid for this client' => 'Die folgenden Gruppen sind für diesen Mandanten gültig', @@ -2134,7 +2127,6 @@ $self->{texts} = { 'The project number is missing.' => 'Die Projektnummer fehlt.', 'The second reason is that kivitendo allowed the user to enter the tax amount manually regardless of the taxkey used.' => 'Der zweite Grund war, dass kivitendo zuließ, dass die Benutzer beliebige, von den tatsächlichen Steuerschlüsseln unabhängige Steuerbeträge eintrugen.', 'The second way is to use Perl\'s CPAN module and let it download and install the module for you.' => 'Die zweite Variante besteht darin, Perls CPAN-Modul zu benutzen und es das Modul für Sie installieren zu lassen.', - 'The selected PostgreSQL installation uses UTF-8 as its encoding. Therefore you have to configure kivitendo to use UTF-8 as well.' => 'Die ausgewählte PostgreSQL-Installation benutzt UTF-8 als Zeichensatz. Deshalb müssen Sie kivitendo so konfigurieren, dass es ebenfalls UTF-8 als Zeichensatz benutzt.', 'The selected bank account does not exist anymore.' => 'Das ausgewählte Bankkonto existiert nicht mehr.', 'The selected bin does not exist.' => 'Der ausgewählte Lagerplatz existiert nicht.', 'The selected currency' => 'Die ausgewählte Währung', @@ -2327,14 +2319,12 @@ $self->{texts} = { 'Unlock System' => 'System entsperren', 'Until' => 'Bis', 'Update' => 'Erneuern', - 'Update Dataset' => 'Datenbank aktualisieren', 'Update Prices' => 'Preise aktualisieren', 'Update SKR04: new tax account 3804 (19%)' => 'Update SKR04: neues Steuerkonto 3804 (19%) für innergemeinschaftlichen Erwerb', 'Update complete' => 'Update beendet.', 'Update prices' => 'Preise aktualisieren', 'Update prices of existing entries' => 'Preise von vorhandenen Artikeln aktualisieren', 'Update properties of existing entries' => 'Eigenschaften von existierenden Einträgen aktualisieren', - 'Update?' => 'Aktualisieren?', 'Updated' => 'Erneuert am', 'Updating existing entry in database' => 'Existierenden Eintrag in Datenbank aktualisieren', 'Updating prices of existing entry in database' => 'Preis des Eintrags in der Datenbank wird aktualisiert', diff --git a/templates/webpages/admin/create_dataset.html b/templates/webpages/admin/create_dataset.html index 9f8b60d44..220ed845b 100644 --- a/templates/webpages/admin/create_dataset.html +++ b/templates/webpages/admin/create_dataset.html @@ -1,133 +1,98 @@ -[%- USE T8 %] -[%- USE HTML %] -

[% title %]

- -
-

[% 'Back' | $T8 %]

-

- [% 'You can either create a new database or chose an existing database.' | $T8 %] - [% 'In the latter case the tables needed by kivitendo will be created in that database.' | $T8 %] -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% 'Existing Datasets' | $T8 %][% HTML.escape(dbsources) %]
[% 'Create Dataset' | $T8 %]
[% 'Multibyte Encoding' | $T8 %] - [%- IF FORCE_DBENCODING %] - - [% HTML.escape(FORCE_DBENCODING) %] - [%- ELSE %] - - [%- END %] -
[% 'Default currency' | $T8 %]
[% 'Create Chart of Accounts' | $T8 %] - -
[% 'Accounting method' | $T8 %] * - -
[% 'Inventory system' | $T8 %] * - - [% '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' | $T8 %] kivitendo-Dokumentation.pdf. -
[% 'Profit determination' | $T8 %] * - -
- [% '*) Since version 2.7 these parameters ares set in the client database and not in the configuration file, details in chapter:' | $T8 %] Kapitel Konfiguration zur Einnahmenüberschussrechnung/ Bilanzierung: EUR -
- - - - - - - - - - - -
- -

- -
- - +[%- USE HTML %][%- USE LxERP -%][%- USE T8 -%][%- USE L -%] + +[% INCLUDE 'common/flash.html' %] + +

[% HTML.escape(title) %]

+ +

[% LxERP.t8('Back') %]

+ +
+

+ [% LxERP.t8('You can either create a new database or chose an existing database.') %] + [% LxERP.t8('In the latter case the tables needed by kivitendo will be created in that database.') %] +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% LxERP.t8('Existing Datasets') %][% FOREACH db = SELF.all_dbsources %][% UNLESS loop.first %] [% END %][[% HTML.escape(db) %]][% END %]
[% LxERP.t8('Create Dataset') %][% L.input_tag('db', FORM.db) %]
[% LxERP.t8('Default currency') %][% L.input_tag('defaultcurrency', FORM.defaultcurrency || 'EUR') %]
[% LxERP.t8('Create Chart of Accounts') %][% L.select_tag('chart', SELF.all_charts, onchange='comment_selected_chart(this.value)', default=(FORM.chart || 'Germany-DATEV-SKR03EU')) %]
[% LxERP.t8('Accounting method') %] *[% L.select_tag('accounting_method', SELF.all_accounting_methods, title_key='name', default=(FORM.accounting_method || 'cash')) %]
[% LxERP.t8('Inventory system') %] *[% L.select_tag('inventory_system', SELF.all_inventory_systems, title_key='name', default=(FORM.inventory_system || 'periodic')) %]
[% LxERP.t8('Profit determination') %] *[% L.select_tag('profit_determination', SELF.all_profit_determinations, title_key='name', default=(FORM.profit_determination || 'income')) %]
+ + [% L.hidden_tag("dbhost", FORM.dbhost) %] + [% L.hidden_tag("dbport", FORM.dbport) %] + [% L.hidden_tag("dbuser", FORM.dbuser) %] + [% L.hidden_tag("dbpasswd", FORM.dbpasswd) %] + [% L.hidden_tag("dbdefault", FORM.dbdefault) %] + [% L.hidden_tag("action", "Admin/do_create_dataset") %] + +
+ +
+ [% L.submit_tag('dummy', LxERP.t8('Create Dataset')) %] +
+ +
+ + diff --git a/templates/webpages/admin/dbadmin.html b/templates/webpages/admin/dbadmin.html index 1a07dc749..a0e91a748 100644 --- a/templates/webpages/admin/dbadmin.html +++ b/templates/webpages/admin/dbadmin.html @@ -1,66 +1,38 @@ -[%- USE T8 %] -[%- USE HTML %] -

[% title %]

- -
- [% 'Back' | $T8 %] - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% 'Host' | $T8 %][% 'Port' | $T8 %]
[% 'Database User' | $T8 %][% 'Password' | $T8 %]
[% 'Database template' | $T8 %]
- -
- - - -
- - - - [% IF ALLOW_DBBACKUP %] - - - [% END %] -
-
- -

[% 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' | $T8 %]

- -

[% 'Leave host and port field empty unless you want to make a remote connection.' | $T8 %]

+[%- USE HTML %][%- USE LxERP -%][%- USE L -%] + +[% INCLUDE 'common/flash.html' %] + +

[% HTML.escape(title) %]

+ +

[% LxERP.t8('Back') %]

+ +
+ + + + + + + + + + + + + + + + + + + +
[% LxERP.t8('Host') %][% L.input_tag('dbhost', FORM.dbhost, size=30) %][% LxERP.t8('Port') %][% L.input_tag('dbport', FORM.dbport, size=6) %]
[% LxERP.t8('Database User') %][% L.input_tag("dbuser", FORM.dbuser, size=30) %][% LxERP.t8('Password') %][% L.input_tag("dbpasswd", FORM.dbpasswd, type='password', size=30) %]
[% LxERP.t8('Database template') %][% L.input_tag("dbdefault", FORM.dbdefault, size=30) %]
+ +
+ [% L.hidden_tag("action", 'Admin/dispatch') %] + [% L.submit_tag('action_create_dataset', LxERP.t8('Create Dataset')) %] + [% L.submit_tag('action_delete_dataset', LxERP.t8('Delete Dataset')) %] +
+
+ +

[% LxERP.t8('This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!') %]

diff --git a/templates/webpages/admin/dbcreate.html b/templates/webpages/admin/dbcreate.html deleted file mode 100644 index 814ca83aa..000000000 --- a/templates/webpages/admin/dbcreate.html +++ /dev/null @@ -1,8 +0,0 @@ -[%- USE T8 %] -[%- USE HTML %] -[%- USE LxERP %][%- USE L -%] -

[% title %]

- -

[% LxERP.t8('The dataset #1 has been successfully created.', db) | html %]

- -

[% L.link("controller.pl?action=Admin/show", LxERP.t8("Continue")) %]

diff --git a/templates/webpages/admin/delete_dataset.html b/templates/webpages/admin/delete_dataset.html index 1de867f8a..b32f1ed8b 100644 --- a/templates/webpages/admin/delete_dataset.html +++ b/templates/webpages/admin/delete_dataset.html @@ -1,27 +1,35 @@ -[%- USE T8 %] -[%- USE HTML %] -

[% title %]

-

[% 'Back' | $T8 %]

-
+[%- USE HTML %][%- USE LxERP -%][%- USE L -%] -

[% 'You can only delete datasets that are not in use.' | $T8 %] - [% 'If you want to delete such a dataset you have to edit the user(s) that are using the dataset in question and have them use another dataset.' | $T8 %]

+[% INCLUDE 'common/flash.html' %] -

[% 'Please seletct the dataset you want to delete:' | $T8 %] - -

+

[% HTML.escape(title) %]

- - - - - +

[% LxERP.t8('Back') %]

- +

+ [% LxERP.t8('You can only delete datasets that are not in use.') %] + [% LxERP.t8('If you want to delete such a dataset you have to edit the client(s) that are using the dataset in question and have them use another dataset.') %] +

+[% IF SELF.all_unused_dbsources.size %] - + +

+ [% LxERP.t8('Please select the dataset you want to delete:') %] + [% L.select_tag('db', SELF.all_unused_dbsources) %] +

-

+ [% L.hidden_tag("dbhost", FORM.dbhost) %] + [% L.hidden_tag("dbport", FORM.dbport) %] + [% L.hidden_tag("dbuser", FORM.dbuser) %] + [% L.hidden_tag("dbpasswd", FORM.dbpasswd) %] + [% L.hidden_tag("dbdefault", FORM.dbdefault) %] + [% L.hidden_tag("action", "Admin/do_delete_dataset") %] -
+
+ [% L.submit_tag('dummy', LxERP.t8('Delete Dataset'), confirm=LxERP.t8('Are you sure?')) %] +
+ + + +[% END %] diff --git a/templates/webpages/admin/show.html b/templates/webpages/admin/show.html index b707237f7..f8bd272b9 100644 --- a/templates/webpages/admin/show.html +++ b/templates/webpages/admin/show.html @@ -2,7 +2,7 @@ [% INCLUDE 'common/flash.html' %] -

[% title %]

+

[% HTML.escape(title) %]

[% LxERP.t8("Actions") %]: @@ -13,7 +13,7 @@ | [% L.link(SELF.url_for(action="new_group"), LxERP.t8("Add User Group")) %] | - [% L.link(SELF.url_for(action="pg_database_administration", controller="admin.pl"), LxERP.t8("Pg Database Administration")) %] + [% L.link(SELF.url_for(action="database_administration"), LxERP.t8("Pg Database Administration")) %] | [% L.link(SELF.url_for(action="list_printers"), LxERP.t8("Printer Management")) %] | -- 2.20.1