Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 13b5fc65

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 13b5fc65921f5c030a64a3c6f2faf4c822bc14a4
  • Vorgänger ecf5708c
  • Nachfolger 4970b5b2

Statusausgabe verbessert

Unterschiede anzeigen:

SL/Controller/CsvImport.pm
15 15
use Rose::Object::MakeMethods::Generic
16 16
(
17 17
 scalar => [ qw(type profile file all_profiles all_charsets sep_char all_sep_chars quote_char all_quote_chars escape_char all_escape_chars all_buchungsgruppen
18
                import_status errors headers data num_imported) ],
18
                import_status errors headers data num_imported num_importable) ],
19 19
);
20 20

  
21 21
__PACKAGE__->run_before('check_auth');
......
147 147
  $worker->run;
148 148
  $worker->save_objects if !$params{test};
149 149

  
150
  $self->num_importable(scalar grep { !$_ } map { scalar @{ $_->{errors} } } @{ $self->data });
150 151
  $self->import_status($params{test} ? 'tested' : 'imported');
151 152

  
152 153
  $self->action_new;
SL/Controller/CsvImport/CustomerVendor.pm
52 52

  
53 53
  my %by_name;
54 54
  if ('check_db' eq $self->controller->profile->get('duplicates')) {
55
    %by_name = map { ( $normalizer->($_->name) => 1 ) } @{ $self->existing_objects };
55
    %by_name = map { ( $normalizer->($_->name) => 'db' ) } @{ $self->existing_objects };
56 56
  }
57 57

  
58 58
  foreach my $entry (@{ $self->controller->data }) {
......
60 60

  
61 61
    my $name = $normalizer->($entry->{object}->name);
62 62
    if (!$by_name{$name}) {
63
      $by_name{$name} = 1;
63
      $by_name{$name} = 'csv';
64 64

  
65 65
    } else {
66
      push @{ $entry->{errors} }, $::locale->text('Duplicate');
66
      push @{ $entry->{errors} }, $by_name{$name} eq 'db' ? $::locale->text('Duplicate in database') : $::locale->text('Duplicate in CSV file');
67 67
    }
68 68
  }
69 69
}
locale/de/all
13 13
  ' Date missing!'              => ' Datum fehlt!',
14 14
  ' Part Number missing!'       => ' Artikelnummer fehlt!',
15 15
  ' missing!'                   => ' fehlt!',
16
  '#1 objects were imported.'   => '#1 Objekte wurden importiert.',
16
  '#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
17 17
  '#1 prices were updated.'     => '#1 Preise wurden aktualisiert.',
18 18
  '*/'                          => '*/',
19 19
  '---please select---'         => '---bitte auswählen---',
......
623 623
  'Dunning number'              => 'Mahnungsnummer',
624 624
  'Dunning overview'            => 'Mahnungsübersicht',
625 625
  'Dunnings'                    => 'Mahnungen',
626
  'Duplicate'                   => 'Duplikat',
626
  'Duplicate in CSV file'       => 'Duplikat in CSV-Datei',
627
  'Duplicate in database'       => 'Duplikat in Datenbank',
627 628
  'During this user migration Lx-Office can create such a group for you and grant all users access to all of Lx-Office\'s functions.' => 'Im Rahmen dieser Benutzerdatenmigration kann Lx-Office eine solche Gruppe für Sie anlegen und allen Benutzern Zugriff auf alle Lx-Office-Funktionen gewähren.',
628 629
  'E-mail'                      => 'eMail',
629 630
  'E-mail Statement to'         => 'Fälligkeitsabrechnung als eMail an',
......
807 808
  'Form details (second row)'   => 'Formulardetails (zweite Positionszeile)',
808 809
  'Formula'                     => 'Formel',
809 810
  'Found #1 errors.'            => '#1 Fehler gefunden.',
810
  'Found #1 objects to import.' => '#1 zu importierende Objekte gefunden.',
811
  'Found #1 objects of which #2 can be imported.' => 'Es wurden #1 Objekte gefunden, von denen #2 importiert werden können.',
811 812
  'Free report period'          => 'Freier Zeitraum',
812 813
  'Free-form text'              => 'Textzeile',
813 814
  'Fristsetzung'                => 'Fristsetzung',
templates/webpages/csv_import/_data.html
1
[% USE LxERP %]
2

  
3
[%- IF SELF.errors %]
4
 [%- PROCESS 'csv_import/_errors.html' %]
5
[%- END %]
6

  
7
[%- IF SELF.import_status == 'imported' %]
8
 [%- PROCESS 'csv_import/_result.html' %]
9
[%- END %]
10

  
11
[%- PROCESS 'csv_import/_preview.html' %]
templates/webpages/csv_import/_preview.html
9 9
 [%- END %]
10 10
</h3>
11 11

  
12
<p>[%- LxERP.t8('Found #1 objects to import.', SELF.data.size || 0) %]</p>
13

  
14 12
[% IF SELF.data.size %]
15 13
 <table>
16 14
  <tr class="listheading">
templates/webpages/csv_import/_result.html
2 2

  
3 3
<h3>[%- LxERP.t8('Import summary') %]</h3>
4 4

  
5
<p>[%- LxERP.t8('#1 objects were imported.', SELF.data.size || 0) %]</p>
5
[%- IF SELF.import_status == 'imported' %]
6
 <p>[%- LxERP.t8('#1 of #2 importable objects were imported.', SELF.num_imported, SELF.num_importable || 0) %]</p>
7
[%- ELSE %]
8
 <p>[%- LxERP.t8('Found #1 objects of which #2 can be imported.', SELF.data.size || 0, SELF.num_importable || 0) %]</p>
9
[%- END %]
templates/webpages/csv_import/form.html
140 140
  </table>
141 141

  
142 142
  [% L.submit_tag('action_test', LxERP.t8('Test and preview')) %]
143
  [% IF SELF.import_status && SELF.data.size %]
143
  [% IF SELF.import_status && SELF.num_importable %]
144 144
   [% L.submit_tag('action_import', LxERP.t8('Import')) %]
145 145
  [%- END %]
146 146

  
147 147
 </form>
148 148

  
149 149
 [%- IF SELF.import_status %]
150
  [%- PROCESS 'csv_import/_data.html' %]
150
  [%- IF SELF.errors %]
151
   [%- PROCESS 'csv_import/_errors.html' %]
152
  [%- END %]
153

  
154
  [%- PROCESS 'csv_import/_result.html' %]
155
  [%- PROCESS 'csv_import/_preview.html' %]
151 156
 [%- END %]
152 157

  
153 158
 <script type="text/javascript">

Auch abrufbar als: Unified diff