ActionBar: Verwendung beim GoDB-Export
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 18 Jan 2017 12:40:10 +0000 (13:40 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 09:44:01 +0000 (10:44 +0100)
SL/Controller/GoBD.pm
templates/webpages/gobd/filter.html

index 7f80faf..182d8b2 100644 (file)
@@ -24,6 +24,7 @@ sub action_filter {
   $self->to(DateTime->today)                                     if !$self->to;
 
   $::request->layout->add_javascripts('kivi.GoBD.js');
+  $self->setup_filter_action_bar;
   $self->render('gobd/filter', current_year => DateTime->today->year, title => t8('GoBD Export'));
 }
 
@@ -102,4 +103,18 @@ sub available_years {
 sub init_from { DateTime->from_kivitendo($::form->{from}) }
 sub init_to { DateTime->from_kivitendo($::form->{to}) }
 
+sub setup_filter_action_bar {
+  my ($self) = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Export'),
+        submit    => [ '#filter_form', { action => 'GoBD/export' } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
 1;
index aaffd02..6d4eddd 100644 (file)
@@ -25,9 +25,4 @@
     <td>[% L.date_tag('to', SELF.to) %]</td>
   </tr>
 </table>
-
-[% L.hidden_tag('action', 'GoBD/dispatch') %]
-
-[% L.submit_tag('action_export', LxERP.t8('Export')) %]
-
 </form>