$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'));
}
} or do {
my $errors = $@;
flash('error', t8('The export failed because of malformed transactions. Please fix those before exporting.'));
+ flash('error', $_) for @$errors;
- $::lxdebug->dump(0, "GoBD errors:", \@$errors);
$self->action_filter;
return;
};
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;