]> wagnertech.de Git - kivitendo-erp.git/commitdiff
ActionBar: Verwendung beim CSV-Import
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 26 Jan 2017 16:17:01 +0000 (17:17 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 09:44:03 +0000 (10:44 +0100)
SL/Controller/CsvImport.pm
locale/de/all
templates/webpages/csv_import/form.html
templates/webpages/csv_import/report.html

index 014514d1f542cf54acb88abb84c83e79ac89e1fc..43d6fbf7ad95d4737b44f692184714344b933a79 100644 (file)
@@ -333,6 +333,8 @@ sub render_inputs {
 
   $self->setup_help;
 
+  $self->setup_render_inputs_action_bar;
+
   $self->render('csv_import/form', title => $title);
 }
 
@@ -726,4 +728,25 @@ sub init_mappings {
   [ grep { $_->{from} } @{ $::form->{mappings} || [] } ]
 }
 
+sub setup_render_inputs_action_bar {
+  my ($self, %params) = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Preview'),
+        submit    => [ '#form', { action => 'CsvImport/test' } ],
+        accesskey => 'enter',
+        not_if    => ($self->profile && $self->profile->get('dont_edit_profile')),
+      ],
+      action => [
+        t8('Import'),
+        submit    => [ '#form', { action => 'CsvImport/import' } ],
+        disabled  => t8('The test import has not been executed yet.'),
+        id        => 'action_import',
+      ],
+    );
+  }
+}
+
 1;
index 280e2b905a6e8b915af93bd6645ed0b8f079ebae..e3496a3a2f69553c0e07ebc795f35da672c40e9a 100755 (executable)
@@ -2179,7 +2179,7 @@ $self->{texts} = {
   'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten',
   'Prepare bank transfer via SEPA XML' => 'Überweisung via SEPA XML vorbereiten',
   'Prepayment'                  => 'Vorauszahlung',
-  'Preview'                     => 'Druckvorschau',
+  'Preview'                     => 'Vorschau',
   'Preview Mode'                => 'Vorschaumodus',
   'Previous transdate text'     => 'wurde gespeichert am',
   'Previous transnumber text'   => 'Letzte Buchung mit der Buchungsnummer',
@@ -2843,7 +2843,6 @@ $self->{texts} = {
   'Template suggestions'        => 'Vorschläge für Vorlagen',
   'Templates'                   => 'Vorlagen',
   'Terms missing in row '       => '+Tage fehlen in Zeile ',
-  'Test and preview'            => 'Test und Vorschau',
   'Test database connectivity'  => 'Datenbankverbindung testen',
   'Text block actions'          => 'Textblockaktionen',
   'Text block picture actions'  => 'Aktionen für Textblockbilder',
@@ -3111,6 +3110,7 @@ $self->{texts} = {
   'The tax zone is in use and cannot be deleted.' => 'Die Steuerzone wird benutzt und kann nicht gelöscht werden',
   'The taxzone has been created.' => 'Die Steuerzone wurde erstellt.',
   'The taxzone has been saved.' => 'Die Steuerzone wurde gespeichert.',
+  'The test import has not been executed yet.' => 'Der Testimport wurde noch nicht durchgeführt.',
   'The third reason is that wrong (taxkey) settings for the credit / debit CSV-import were used.' => 'Der dritte Grund ist, dass fehlerhafte Einstellungen (Steuerschlüssel) beim Kreditoren / Debitoren CSV-Import benutzt worden sind.',
   'The third way is to download the module from the above mentioned URL and to install the module manually following the installations instructions contained in the source archive.' => 'Die dritte Variante besteht darin, das Paket von der oben genannten URL herunterzuladen und es manuell zu installieren. Beachten Sie dabei die im Paket enthaltenen Installationsanweisungen.',
   'The three columns "make_X", "model_X" and "lastcost_X" with the same number "X" are used to import vendor part numbers and vendor prices.' => 'Die drei Spalten "make_X", "model_X" und "lastcost_X" mit derselben Nummer "X" werden zum Import von Lieferantenartikelnummern und -preisen genutzt.',
index 2fff25263221948c22ef8471f96e03957aaee391..b838fcdeaf745f79034dc2b31310ae67980a8719 100644 (file)
@@ -6,7 +6,7 @@
 
  [%- INCLUDE 'common/flash.html' %]
 
- <form method="post" action="controller.pl" enctype="multipart/form-data">
+ <form method="post" action="controller.pl" enctype="multipart/form-data" id="form">
   [% L.hidden_tag('form_sent', '1') %]
   [% L.hidden_tag('action', 'CsvImport/dispatch') %]
   [% L.hidden_tag('profile.type', SELF.profile.type) %]
   </div>
   <hr>
 [%- END %][%# UNLESS SELF.worker.is_multiplexed %]
-  [% L.submit_tag('action_test', LxERP.t8('Test and preview')) %]
 [%- END %][%# IF SELF.profile.get('dont_edit_profile') %]
-  [% L.submit_tag('action_import', LxERP.t8('Import'), style='display:none') %]
-
  </form>
 
  <div id='results'>
index f2ea4212c846e0afb1d6526be811460e1949cc66..77e69601ea02b1699bdbcd6137085eba196de0dc 100644 (file)
 [%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
 
 <script type='text/javascript'>
-  $(function(){ [%- IF SELF.reporterror %] kivi.clear_flash('info',0);kivi.display_flash('error','[% SELF.reporterror %]',0); [%- ELSE %][%- IF SELF.report.test_mode %] $('#action_import').show() [%- END %][%- END %] });
+  $(function(){
+    [%- IF SELF.reporterror %]
+      kivi.clear_flash('info',0);
+      kivi.display_flash('error','[% SELF.reporterror %]',0);
+    [%- ELSIF SELF.report.test_mode %]
+      kivi.ActionBar.Action('#action_import').enable();
+    [%- END %]
+  });
 </script>