From 38a9098d83035ac4cd646af59739afcb7acfefba Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 26 Jan 2017 13:43:34 +0100 Subject: [PATCH] =?utf8?q?ActionBar:=20Verwendung=20bei=20=C2=BBKontenabgl?= =?utf8?q?eich=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/rc.pl | 40 +++++++++++++++++++++++++++++--- templates/webpages/rc/step1.html | 10 +------- templates/webpages/rc/step2.html | 9 +------ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/bin/mozilla/rc.pl b/bin/mozilla/rc.pl index 864357dfa..f0ef98e73 100644 --- a/bin/mozilla/rc.pl +++ b/bin/mozilla/rc.pl @@ -33,6 +33,7 @@ #====================================================================== use SL::RC; +use SL::Locale::String qw(t8); require "bin/mozilla/common.pl"; @@ -48,6 +49,8 @@ sub reconciliation { RC->paymentaccounts(\%::myconfig, $::form); + setup_rc_reconciliation_action_bar(); + $::form->header; print $::form->parse_html_template('rc/step1', { selection_sub => sub { ("$_[0]{accno}--$_[0]{description}")x2 }, @@ -56,8 +59,6 @@ sub reconciliation { $::lxdebug->leave_sub; } -sub continue { call_sub($::form->{"nextsub"}); } - sub get_payments { $::lxdebug->enter_sub; $::auth->assert('cash'); @@ -103,6 +104,8 @@ sub display_form { my $statementbalance = $::form->parse_amount(\%::myconfig, $::form->{statementbalance}); my $difference = $statementbalance - $clearedbalance - $cleared; + setup_rc_display_form_action_bar(); + $::form->header; print $::form->parse_html_template('rc/step2', { is_asset => $::form->{category} eq 'A', @@ -146,7 +149,7 @@ sub update { $::lxdebug->leave_sub; } -sub done { +sub reconcile { $::lxdebug->enter_sub; $::auth->assert('cash'); @@ -160,3 +163,34 @@ sub done { $::lxdebug->leave_sub; } +sub setup_rc_reconciliation_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Show'), + submit => [ '#form', { action => "get_payments" } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_rc_display_form_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Update'), + submit => [ '#form', { action => "update" } ], + accesskey => 'enter', + ], + action => [ + t8('Reconcile'), + submit => [ '#form', { action => "reconcile" } ], + ], + ); + } +} diff --git a/templates/webpages/rc/step1.html b/templates/webpages/rc/step1.html index 940b3065c..7debc6688 100644 --- a/templates/webpages/rc/step1.html +++ b/templates/webpages/rc/step1.html @@ -4,7 +4,7 @@ [%- USE LxERP %]

[% 'Reconciliation' | $T8 %]

-
+ @@ -18,12 +18,4 @@
[% L.date_tag('todate') %]
- -
-
- -[% L.hidden_tag('nextsub', 'get_payments') %] -[% L.submit_tag('action', LxERP.t8('Continue')) %] -
- diff --git a/templates/webpages/rc/step2.html b/templates/webpages/rc/step2.html index 0270d5bbc..369ccc707 100644 --- a/templates/webpages/rc/step2.html +++ b/templates/webpages/rc/step2.html @@ -7,7 +7,7 @@

[% FOREACH row IN option %][% row %][% ', ' UNLESS loop.last %][% END %]

-
+ @@ -98,9 +98,6 @@
-
-
- @@ -108,8 +105,4 @@ -
- - -
-- 2.20.1