Revision ee264bd8
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/EmailJournal.pm | ||
---|---|---|
144 | 144 |
$additional_params{controller} = $RECORD_TYPE_TO_CONTROLLER{$record_action}; |
145 | 145 |
|
146 | 146 |
$self->redirect_to( |
147 |
action => 'add', |
|
148 |
email_journal_id => $email_journal_id, |
|
149 |
attachment_id => $attachment_id, |
|
147 |
action => 'add_from_email_journal', |
|
148 |
from_id => $email_journal_id, |
|
149 |
from_type => 'email_journal', |
|
150 |
email_attachment_id => $attachment_id, |
|
150 | 151 |
%additional_params, |
151 | 152 |
); |
152 | 153 |
} |
SL/Controller/Order.pm | ||
---|---|---|
33 | 33 |
use SL::DB::Shipto; |
34 | 34 |
use SL::DB::Translation; |
35 | 35 |
use SL::DB::ValidityToken; |
36 |
use SL::DB::EmailJournal; |
|
37 |
use SL::DB::EmailJournalAttachment; |
|
36 | 38 |
|
37 | 39 |
use SL::Helper::CreatePDF qw(:all); |
38 | 40 |
use SL::Helper::PrintOptions; |
... | ... | |
128 | 130 |
); |
129 | 131 |
} |
130 | 132 |
|
133 |
sub action_add_from_email_journal { |
|
134 |
my ($self) = @_; |
|
135 |
my $email_journal_id = $::form->{from_id}; |
|
136 |
my $email_attachment_id = $::form->{email_attachment_id}; |
|
137 |
|
|
138 |
$self->{converted_from_email_journal_id} = $email_journal_id; |
|
139 |
$self->{email_attachment_id} = $email_attachment_id; |
|
140 |
|
|
141 |
$self->action_add(); |
|
142 |
} |
|
143 |
|
|
131 | 144 |
# edit an existing order |
132 | 145 |
sub action_edit { |
133 | 146 |
my ($self) = @_; |
... | ... | |
2285 | 2298 |
} |
2286 | 2299 |
} |
2287 | 2300 |
} |
2301 |
if ($::form->{converted_from_email_journal_id}) { |
|
2302 |
my $email_journal_id = $::form->{converted_from_email_journal_id}; |
|
2303 |
my $src = SL::DB::EmailJournal->new(id => $email_journal_id)->load; |
|
2304 |
$src->link_to_record($self->order); |
|
2305 |
$src->hard_link_to_record($self->order); |
|
2306 |
} |
|
2307 |
if ($::form->{email_attachment_id}) { |
|
2308 |
my $email_attachment_id = $::form->{email_attachment_id}; |
|
2309 |
my $attachment = SL::DB::EmailJournalAttachment->new(id => $email_attachment_id)->load; |
|
2310 |
$attachment->add_file_to_record($self->order); |
|
2311 |
} |
|
2288 | 2312 |
|
2289 | 2313 |
$self->set_project_in_linked_requirement_specs if $self->order->globalproject_id; |
2290 | 2314 |
|
templates/design40_webpages/order/form.html | ||
---|---|---|
23 | 23 |
[% L.hidden_tag('id', SELF.order.id) %] |
24 | 24 |
[% L.hidden_tag('converted_from_oe_id', SELF.converted_from_oe_id) %] |
25 | 25 |
[% L.hidden_tag('converted_from_reclamation_id', SELF.converted_from_reclamation_id) %] |
26 |
[% L.hidden_tag('converted_from_email_journal_id', SELF.converted_from_email_journal_id) %] |
|
27 |
[% L.hidden_tag('email_attachment_id' , SELF.email_attachment_id) %] |
|
26 | 28 |
|
27 | 29 |
[% IF !SELF.order.id %] |
28 | 30 |
[% L.hidden_tag('form_validity_token', FORM.form_validity_token) %] |
... | ... | |
34 | 36 |
|
35 | 37 |
<ul> |
36 | 38 |
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li> |
39 |
[% IF SELF.email_attachment_id %] |
|
40 |
<li><a href="#ui-tabs-email-attachment-preview">[% 'Email Attachment Preview' | $T8 %]</a></li> |
|
41 |
[% END %] |
|
37 | 42 |
[% IF INSTANCE_CONF.get_webdav %] |
38 | 43 |
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li> |
39 | 44 |
[% END %] |
... | ... | |
66 | 71 |
cvars=SELF.order.custom_shipto.cvars_by_config |
67 | 72 |
id_selector='#order_shipto_id' %] |
68 | 73 |
</div> |
74 |
[% IF SELF.email_attachment_id %] |
|
75 |
<div id="ui-tabs-email-attachment-preview"> |
|
76 |
<div class="wrapper" id="email_attachment_wrapper"> |
|
77 |
[% P.email_journal.attachment_preview( |
|
78 |
SELF.email_attachment_id, |
|
79 |
style="border:1px solid black;margin:9px" |
|
80 |
); |
|
81 |
%] |
|
82 |
</div><!-- /.wrapper --> |
|
83 |
</div><!-- /#ui-tabs-attachment-preview --> |
|
84 |
[% END %] |
|
85 |
|
|
69 | 86 |
|
70 | 87 |
</div><!-- /.tabwidget --> |
71 | 88 |
</form> |
templates/design40_webpages/order/tabs/basic_data.html | ||
---|---|---|
9 | 9 |
<div id="ui-tabs-basic-data"> |
10 | 10 |
<!-- PENDENT: EXPERIMENTELL --> |
11 | 11 |
|
12 |
[% IF SELF.email_attachment_id %] |
|
13 |
<div class="wrapper" id="email_attachment_wrapper"> |
|
14 |
[% |
|
15 |
BLOCK panel_1; |
|
16 |
P.email_journal.attachment_preview( |
|
17 |
SELF.email_attachment_id, |
|
18 |
style="width:520px;border:1px solid black;margin:9px" |
|
19 |
); |
|
20 |
END; |
|
21 |
INCLUDE 'common/toggle_panel.html' |
|
22 |
block_name='panel_1' |
|
23 |
button_closed = LxERP.t8('Show Attachment') |
|
24 |
button_open = LxERP.t8('Hide Attachment') |
|
25 |
; |
|
26 |
%] |
|
27 |
</div> |
|
28 |
[% END %] |
|
12 | 29 |
|
13 | 30 |
<div class="wrapper" id="wrapper-1"> |
14 | 31 |
[% INCLUDE 'generic/toggle_wrapper.html' %] |
Auch abrufbar als: Unified diff
Workflow: E-Mail → Angebot/Auftrag