From ae15b9a0775cb28e760460a3ae4de20d43c3cb5d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 18 Jan 2017 17:01:59 +0100 Subject: [PATCH] ActionBar: Verwendung im E-Mail-Journal --- SL/Controller/EmailJournal.pm | 29 +++++++++++++++++++ templates/webpages/email_journal/_filter.html | 2 -- templates/webpages/email_journal/show.html | 4 --- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/SL/Controller/EmailJournal.pm b/SL/Controller/EmailJournal.pm index c818cc393..376dfb3d1 100644 --- a/SL/Controller/EmailJournal.pm +++ b/SL/Controller/EmailJournal.pm @@ -32,6 +32,7 @@ sub action_list { if ( $::instance_conf->get_email_journal == 0 ) { flash('info', $::locale->text('Storing the emails in the journal is currently disabled in the client configuration.')); } + $self->setup_list_action_bar; $self->render('email_journal/list', title => $::locale->text('Email journal'), ENTRIES => $self->models->get, @@ -51,6 +52,7 @@ sub action_show { $::form->error(t8('You do not have permission to access this entry.')); } + $self->setup_show_action_bar; $self->render('email_journal/show', title => $::locale->text('View sent email'), back_to => $back_to); @@ -134,4 +136,31 @@ sub init_filter_summary { return join ', ', @filter_strings; } +sub setup_list_action_bar { + my ($self) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Filter'), + submit => [ '#filter_form', { action => 'EmailJournal/list' } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_show_action_bar { + my ($self) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} + 1; diff --git a/templates/webpages/email_journal/_filter.html b/templates/webpages/email_journal/_filter.html index fe46ff356..05a1a75ea 100644 --- a/templates/webpages/email_journal/_filter.html +++ b/templates/webpages/email_journal/_filter.html @@ -30,11 +30,9 @@ - [% L.hidden_tag("action", "EmailJournal/dispatch") %] [% L.hidden_tag("sort_by", FORM.sort_by) %] [% L.hidden_tag("sort_dir", FORM.sort_dir) %] [% L.hidden_tag("page", FORM.page) %] - [% L.submit_tag("action_list", LxERP.t8("Continue"))%] [% L.button_tag('$("#filter_form").resetForm()', LxERP.t8('Reset')) %] diff --git a/templates/webpages/email_journal/show.html b/templates/webpages/email_journal/show.html index 67d76219f..20444a9c8 100644 --- a/templates/webpages/email_journal/show.html +++ b/templates/webpages/email_journal/show.html @@ -77,7 +77,3 @@ [% END %] - -

- [%- LxERP.t8("Back") %] -

-- 2.20.1