X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FEmailJournal.pm;h=376dfb3d10d36fc7354ef548ade7b8630a96721b;hb=5474d397bbc42ffaea0b51ebb4bb9a4c7afaa881;hp=a4ffc62b591dda857c52e2ae81219eefa9a1e466;hpb=58c266eacda69e1a0dc2e4a201974bb9afd493f5;p=kivitendo-erp.git diff --git a/SL/Controller/EmailJournal.pm b/SL/Controller/EmailJournal.pm index a4ffc62b5..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); @@ -69,7 +71,7 @@ sub action_download_attachment { my $ref = \$attachment->content; if ( $attachment->file_id > 0 ) { my $file = SL::File->get(id => $attachment->file_id ); - $ref = SL::File->get_content(dbfile => $file) if $file; + $ref = $file->get_content if $file; } $self->send_file($ref, name => $attachment->name, type => $attachment->mime_type); } @@ -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;