Revision 37c03103
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/BankImport.pm | ||
---|---|---|
16 | 16 |
if ( ! $profile ) { |
17 | 17 |
$profile = SL::DB::Manager::CsvImportProfile->find_by(name => 'MT940', login => 'default'); |
18 | 18 |
} |
19 |
$self->render('bankimport/form', title => $::locale->text('MT940 import'), profile => $profile ? 1 : 0); |
|
20 | 19 |
|
20 |
$self->setup_upload_mt940_action_bar; |
|
21 |
$self->render('bankimport/form', title => $::locale->text('MT940 import'), profile => $profile ? 1 : 0); |
|
21 | 22 |
} |
22 | 23 |
|
23 | 24 |
sub action_import_mt940 { |
... | ... | |
39 | 40 |
die t8("The MT940 import needs an import profile called MT940") unless $profile; |
40 | 41 |
|
41 | 42 |
$self->redirect_to(controller => 'controller.pl', action => 'CsvImport/test', 'profile.type' => 'bank_transactions', 'profile.id' => $profile->id, force_profile => 1); |
42 |
|
|
43 |
}; |
|
43 |
} |
|
44 | 44 |
|
45 | 45 |
sub check_auth { |
46 | 46 |
$::auth->assert('bank_transaction'); |
47 | 47 |
} |
48 | 48 |
|
49 |
1; |
|
49 |
sub setup_upload_mt940_action_bar { |
|
50 |
my ($self) = @_; |
|
51 |
|
|
52 |
for my $bar ($::request->layout->get('actionbar')) { |
|
53 |
$bar->add( |
|
54 |
action => [ |
|
55 |
$::locale->text('Preview'), |
|
56 |
submit => [ '#form', { action => 'BankImport/import_mt940' } ], |
|
57 |
accesskey => 'enter', |
|
58 |
], |
|
59 |
); |
|
60 |
} |
|
61 |
} |
|
50 | 62 |
|
63 |
1; |
templates/webpages/bankimport/form.html | ||
---|---|---|
10 | 10 |
[% "Import a MT940 file:" | $T8 %] |
11 | 11 |
</p> |
12 | 12 |
|
13 |
<form method="post" action="controller.pl" enctype="multipart/form-data"> |
|
14 |
[% L.hidden_tag('action', 'BankImport/import_mt940') %] |
|
15 |
|
|
13 |
<form method="post" action="controller.pl" enctype="multipart/form-data" id="form"> |
|
16 | 14 |
[% L.input_tag('file', '', type => 'file', accept => '*') %] |
17 |
[% L.submit_tag('action_import_mt940', LxERP.t8('Import')) %] |
|
18 |
|
|
19 | 15 |
</form> |
20 | 16 |
[% ELSE %] |
21 | 17 |
<p> |
Auch abrufbar als: Unified diff
ActionBar: Verwendung bei »Kontoauszug importieren«