Revision 159dd378
Von Thomas Heck vor mehr als 12 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
use SL::Controller::CsvImport::CustomerVendor;
|
||
use SL::Controller::CsvImport::Part;
|
||
use SL::Controller::CsvImport::Shipto;
|
||
use SL::Controller::CsvImport::Project;
|
||
|
||
use List::MoreUtils qw(none);
|
||
|
||
... | ... | |
sub check_type {
|
||
my ($self) = @_;
|
||
|
||
die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts customers_vendors addresses contacts);
|
||
die "Invalid CSV import type" if none { $_ eq $::form->{profile}->{type} } qw(parts customers_vendors addresses contacts projects);
|
||
$self->type($::form->{profile}->{type});
|
||
}
|
||
|
||
... | ... | |
: $self->type eq 'addresses' ? $::locale->text('CSV import: shipping addresses')
|
||
: $self->type eq 'contacts' ? $::locale->text('CSV import: contacts')
|
||
: $self->type eq 'parts' ? $::locale->text('CSV import: parts and services')
|
||
: $self->type eq 'projects' ? $::locale->text('CSV import: projects')
|
||
: die;
|
||
|
||
if ($self->{type} eq 'parts') {
|
||
... | ... | |
: $self->{type} eq 'contacts' ? SL::Controller::CsvImport::Contact->new( controller => $self, file => $file)
|
||
: $self->{type} eq 'addresses' ? SL::Controller::CsvImport::Shipto->new( controller => $self, file => $file)
|
||
: $self->{type} eq 'parts' ? SL::Controller::CsvImport::Part->new( controller => $self, file => $file)
|
||
: $self->{type} eq 'projects' ? SL::Controller::CsvImport::Project->new( controller => $self, file => $file)
|
||
: die "Program logic error";
|
||
}
|
||
|
SL/Controller/CsvImport/Project.pm | ||
---|---|---|
package SL::Controller::CsvImport::Project;
|
||
|
||
use strict;
|
||
|
||
use SL::Helper::Csv;
|
||
use SL::DB::CustomVariable;
|
||
use SL::DB::CustomVariableConfig;
|
||
|
||
use parent qw(SL::Controller::CsvImport::Base);
|
||
|
||
use Rose::Object::MakeMethods::Generic
|
||
(
|
||
scalar => [ qw(table) ],
|
||
);
|
||
|
||
sub init_class {
|
||
my ($self) = @_;
|
||
$self->class('SL::DB::Project');
|
||
}
|
||
|
||
sub init_all_cvar_configs {
|
||
my ($self) = @_;
|
||
|
||
return SL::DB::Manager::CustomVariableConfig->get_all(where => [ module => 'Projects' ]);
|
||
}
|
||
|
||
sub check_objects {
|
||
my ($self) = @_;
|
||
|
||
foreach my $entry (@{ $self->controller->data }) {
|
||
$self->handle_cvars($entry);
|
||
}
|
||
|
||
$self->add_cvar_raw_data_columns;
|
||
}
|
||
|
||
sub check_duplicates {
|
||
my $self = shift;
|
||
|
||
my %duplicates_by_number;
|
||
|
||
if ( $self->controller->profile->get('duplicates') eq 'check_db' ) {
|
||
foreach my $object (@{$self->existing_objects}) {
|
||
$duplicates_by_number{$object->{projectnumber}} = 'db';
|
||
}
|
||
}
|
||
|
||
foreach my $entry (@{ $self->controller->data }) {
|
||
|
||
my $object = $entry->{object};
|
||
|
||
if ( $duplicates_by_number{$object->projectnumber()} )
|
||
{
|
||
push( @{$entry->{errors}},
|
||
$duplicates_by_number{$object->projectnumber()} eq 'db' ? $::locale->text('Duplicate in database') : $::locale->text('Duplicate in CSV file')
|
||
);
|
||
} else {
|
||
$duplicates_by_number{$object->projectnumber()} = 'csv';
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
sub setup_displayable_columns {
|
||
my ($self) = @_;
|
||
|
||
$self->SUPER::setup_displayable_columns;
|
||
$self->add_cvar_columns_to_displayable_columns;
|
||
|
||
$self->add_displayable_columns({ name => 'projectnumber', description => $::locale->text('number') },
|
||
{ name => 'description', description => $::locale->text('Description') },
|
||
{ name => 'active', description => $::locale->text('Active') },
|
||
);
|
||
}
|
||
|
||
1;
|
SL/DB/Project.pm | ||
---|---|---|
|
||
use SL::DB::MetaSetup::Project;
|
||
|
||
use SL::DB::Helper::CustomVariables(
|
||
module => 'Project',
|
||
cvars_alias => 1,
|
||
);
|
||
|
||
__PACKAGE__->meta->make_manager_class;
|
||
__PACKAGE__->meta->initialize;
|
||
|
||
1;
|
||
|
locale/de/all | ||
---|---|---|
'CSV import: contacts' => 'CSV-Import: Ansprechpersonen',
|
||
'CSV import: customers and vendors' => 'CSV-Import: Kunden und Lieferanten',
|
||
'CSV import: parts and services' => 'CSV-Import: Waren und Dienstleistungen',
|
||
'CSV import: projects' => 'CSV-Import: Projekte',
|
||
'CSV import: shipping addresses' => 'CSV-Import: Lieferadressen',
|
||
'Calculate' => 'Berechnen',
|
||
'Calendar' => 'Kalender',
|
||
... | ... | |
'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/lx_office.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/lx_office.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 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 Authentifizierungsdatenbank selber einrichten wollen, so melden Sie sich an der Administrationsoberfläche an. kivitendo wird dann die Datenbank und die Tabellen für Sie anlegen.',
|
||
'If you yourself want to upgrade the installation then please read the file "doc/UPGRADE" and follow the steps outlined in this file.' => 'Wenn Sie selber die Aktualisierung bzw. Einrichtung übernehmen wollen, so lesen Sie bitte die Datei "doc/UPGRADE" und folgen Sie den dort beschriebenen Schritten.',
|
||
'Image' => 'Grafik',
|
||
'Import' => 'Import',
|
||
'Import CSV' => 'CSV-Import',
|
||
... | ... | |
'Incoming Payments' => 'Zahlungseingänge',
|
||
'Incoming invoice number' => 'Eingangsrechnungsnummer',
|
||
'Incorrect Password!' => 'Ungültiges Passwort!',
|
||
'Incorrect password!' => '',
|
||
'Incorrect username or password!' => 'Ungültiger Benutzername oder falsches Passwort!',
|
||
'Increase' => 'Erhöhen',
|
||
'Individual Items' => 'Einzelteile',
|
||
... | ... | |
'The application "#1" was not found on the system.' => 'Die Anwendung "#1" wurde auf dem System nicht gefunden.',
|
||
'The assembly has been created.' => 'Das Erzeugnis wurde hergestellt.',
|
||
'The assistant could not find anything wrong with #1. Maybe the problem has been solved in the meantime.' => 'Der Korrekturassistent konnte kein Problem bei #1 feststellen. Eventuell wurde das Problem in der Zwischenzeit bereits behoben.',
|
||
'The authentication configuration file "config/lx_office.conf" does not exist. This kivitendo installation has probably not been updated correctly yet. Please contact your administrator.' => '',
|
||
'The authentication database is not reachable at the moment. Either it hasn\'t been set up yet or the database server might be down. Please contact your administrator.' => 'Die Authentifizierungsdatenbank kann momentan nicht erreicht werden. Entweder wurde sie noch nicht eingerichtet, oder der Datenbankserver antwortet nicht. Bitte wenden Sie sich an Ihren Administrator.',
|
||
'The available options depend on the varibale type:' => 'Die verfügbaren Optionen hängen vom Variablentypen ab:',
|
||
'The backup you upload here has to be a file created with "pg_dump -o -Ft".' => 'Die von Ihnen hochzuladende Sicherungsdatei muss mit dem Programm und den Parametern "pg_dump -o -Ft" erstellt worden sein.',
|
||
'The bank information must not be empty.' => 'Die Bankinformationen müssen vollständig ausgefüllt werden.',
|
||
... | ... | |
'You cannot continue until all unknown units have been mapped to known ones.' => 'Sie können nicht fortfahren, bis alle unbekannten Einheiten in neue Einheiten umgewandelt wurden.',
|
||
'You cannot create an invoice for delivery orders for different customers.' => 'Sie können keine Rechnung zu Lieferscheinen für verschiedene Kunden erstellen.',
|
||
'You cannot create an invoice for delivery orders from different vendors.' => 'Sie können keine Rechnung aus Lieferscheinen von verschiedenen Lieferanten erstellen.',
|
||
'You did not enter a name!' => 'Sie haben keinen Namen eingegeben!',
|
||
'You do not have the permissions to access this function.' => 'Sie verfügen nicht über die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
|
||
'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:',
|
||
'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.',
|
menu.ini | ||
---|---|---|
action=CsvImport/new
|
||
profile.type=parts
|
||
|
||
[System--Import CSV--Projects]
|
||
module=controller.pl
|
||
action=CsvImport/new
|
||
profile.type=projects
|
||
|
||
[System--Templates]
|
||
ACCESS=admin
|
Auch abrufbar als: Unified diff
CSV-Import: Projekte
implementiert #1907