Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4b686f98

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 4b686f98ac519416404d4b5011420dbd9dfd8f53
  • Vorgänger 034cbfaa
  • Nachfolger 9badeafc

EmailJournal: Funktion für Anhangsvorschau hinzugefügt

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
);
}
sub action_attachment_preview {
my ($self) = @_;
eval {
$::auth->assert('email_journal');
my $attachment_id = $::form->{attachment_id};
die "no 'attachment_id' was given" unless $attachment_id;
my $attachment;
$attachment = SL::DB::EmailJournalAttachment->new(
id => $attachment_id,
)->load;
if (!$self->can_view_all
&& $attachment->email_journal->sender_id
&& ($attachment->email_journal->sender_id != SL::DB::Manager::Employee->current->id)) {
$::form->error(t8('You do not have permission to access this entry.'));
}
my $output = SL::Presenter::EmailJournal::attachment_preview(
$attachment,
style => "height: 1800px"
);
$self->render( \$output, { layout => 0, process => 0,});
} or do {
$self->render('generic/error', { layout => 0 }, label_error => $@);
};
}
sub action_show_attachment {
my ($self) = @_;
......
my $attachment_id = $::form->{attachment_id};
my $attachment = SL::DB::EmailJournalAttachment->new(id => $attachment_id)->load;
if (!$self->can_view_all && ($attachment->email_journal->sender_id != SL::DB::Manager::Employee->current->id)) {
$::form->error(t8('You do not have permission to access this entry.'));
}
return $self->send_file(
\$attachment->content,
name => $attachment->name,

Auch abrufbar als: Unified diff