Revision 063a92cf
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/EmailJournal.pm | ||
---|---|---|
11 | 11 |
use SL::Helper::Flash; |
12 | 12 |
use SL::Locale::String; |
13 | 13 |
use SL::System::TaskServer; |
14 |
use SL::Presenter::EmailJournal; |
|
14 | 15 |
|
15 | 16 |
use Rose::Object::MakeMethods::Generic |
16 | 17 |
( |
... | ... | |
19 | 20 |
); |
20 | 21 |
|
21 | 22 |
__PACKAGE__->run_before('add_stylesheet'); |
23 |
__PACKAGE__->run_before('add_js'); |
|
22 | 24 |
|
23 | 25 |
# |
24 | 26 |
# actions |
... | ... | |
76 | 78 |
$self->send_file($ref, name => $attachment->name, type => $attachment->mime_type); |
77 | 79 |
} |
78 | 80 |
|
81 |
sub action_update_attachment_preview { |
|
82 |
my ($self) = @_; |
|
83 |
$::auth->assert('email_journal'); |
|
84 |
my $attachment_id = $::form->{attachment_id}; |
|
85 |
|
|
86 |
my $attachment; |
|
87 |
$attachment = SL::DB::EmailJournalAttachment->new( |
|
88 |
id => $attachment_id, |
|
89 |
)->load if $attachment_id; |
|
90 |
|
|
91 |
$self->js |
|
92 |
->replaceWith('#attachment_preview', |
|
93 |
SL::Presenter::EmailJournal::attachment_preview( |
|
94 |
$attachment, |
|
95 |
style => "width:489px;border:1px solid black;margin:9px" |
|
96 |
) |
|
97 |
) |
|
98 |
->render(); |
|
99 |
} |
|
100 |
|
|
79 | 101 |
# |
80 | 102 |
# filters |
81 | 103 |
# |
... | ... | |
88 | 110 |
# helpers |
89 | 111 |
# |
90 | 112 |
|
113 |
sub add_js { |
|
114 |
$::request->{layout}->use_javascript("${_}.js") for qw( |
|
115 |
kivi.EmailJournal |
|
116 |
); |
|
117 |
} |
|
118 |
|
|
91 | 119 |
sub init_can_view_all { $::auth->assert('email_employee_readall', 1) } |
92 | 120 |
|
93 | 121 |
sub init_models { |
Auch abrufbar als: Unified diff
EmailJournal: Zeige Vorschau von Anhängen an