Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 37c03103

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 37c0310344ac135657e19d2090a196bca288e97c
  • Vorgänger 4e155b5c
  • Nachfolger 2003e056

ActionBar: Verwendung bei »Kontoauszug importieren«

Unterschiede anzeigen:

SL/Controller/BankImport.pm
if ( ! $profile ) {
$profile = SL::DB::Manager::CsvImportProfile->find_by(name => 'MT940', login => 'default');
}
$self->render('bankimport/form', title => $::locale->text('MT940 import'), profile => $profile ? 1 : 0);
$self->setup_upload_mt940_action_bar;
$self->render('bankimport/form', title => $::locale->text('MT940 import'), profile => $profile ? 1 : 0);
}
sub action_import_mt940 {
......
die t8("The MT940 import needs an import profile called MT940") unless $profile;
$self->redirect_to(controller => 'controller.pl', action => 'CsvImport/test', 'profile.type' => 'bank_transactions', 'profile.id' => $profile->id, force_profile => 1);
};
}
sub check_auth {
$::auth->assert('bank_transaction');
}
1;
sub setup_upload_mt940_action_bar {
my ($self) = @_;
for my $bar ($::request->layout->get('actionbar')) {
$bar->add(
action => [
$::locale->text('Preview'),
submit => [ '#form', { action => 'BankImport/import_mt940' } ],
accesskey => 'enter',
],
);
}
}
1;
templates/webpages/bankimport/form.html
[% "Import a MT940 file:" | $T8 %]
</p>
<form method="post" action="controller.pl" enctype="multipart/form-data">
[% L.hidden_tag('action', 'BankImport/import_mt940') %]
<form method="post" action="controller.pl" enctype="multipart/form-data" id="form">
[% L.input_tag('file', '', type => 'file', accept => '*') %]
[% L.submit_tag('action_import_mt940', LxERP.t8('Import')) %]
</form>
[% ELSE %]
<p>

Auch abrufbar als: Unified diff