Revision 4b686f98
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/EmailJournal.pm | ||
---|---|---|
172 | 172 |
); |
173 | 173 |
} |
174 | 174 |
|
175 |
sub action_attachment_preview { |
|
176 |
my ($self) = @_; |
|
177 |
|
|
178 |
eval { |
|
179 |
$::auth->assert('email_journal'); |
|
180 |
|
|
181 |
my $attachment_id = $::form->{attachment_id}; |
|
182 |
die "no 'attachment_id' was given" unless $attachment_id; |
|
183 |
|
|
184 |
my $attachment; |
|
185 |
$attachment = SL::DB::EmailJournalAttachment->new( |
|
186 |
id => $attachment_id, |
|
187 |
)->load; |
|
188 |
|
|
189 |
|
|
190 |
if (!$self->can_view_all |
|
191 |
&& $attachment->email_journal->sender_id |
|
192 |
&& ($attachment->email_journal->sender_id != SL::DB::Manager::Employee->current->id)) { |
|
193 |
$::form->error(t8('You do not have permission to access this entry.')); |
|
194 |
} |
|
195 |
|
|
196 |
my $output = SL::Presenter::EmailJournal::attachment_preview( |
|
197 |
$attachment, |
|
198 |
style => "height: 1800px" |
|
199 |
); |
|
200 |
|
|
201 |
$self->render( \$output, { layout => 0, process => 0,}); |
|
202 |
} or do { |
|
203 |
$self->render('generic/error', { layout => 0 }, label_error => $@); |
|
204 |
}; |
|
205 |
} |
|
206 |
|
|
175 | 207 |
sub action_show_attachment { |
176 | 208 |
my ($self) = @_; |
177 | 209 |
|
... | ... | |
180 | 212 |
my $attachment_id = $::form->{attachment_id}; |
181 | 213 |
my $attachment = SL::DB::EmailJournalAttachment->new(id => $attachment_id)->load; |
182 | 214 |
|
215 |
if (!$self->can_view_all && ($attachment->email_journal->sender_id != SL::DB::Manager::Employee->current->id)) { |
|
216 |
$::form->error(t8('You do not have permission to access this entry.')); |
|
217 |
} |
|
218 |
|
|
183 | 219 |
return $self->send_file( |
184 | 220 |
\$attachment->content, |
185 | 221 |
name => $attachment->name, |
Auch abrufbar als: Unified diff
EmailJournal: Funktion für Anhangsvorschau hinzugefügt