Revision e0e3780c
Von Tamino Steinert vor 12 Monaten hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
32 | 32 |
use SL::DB::Translation; |
33 | 33 |
use SL::DB::TransferType; |
34 | 34 |
use SL::DB::ValidityToken; |
35 |
use SL::DB::EmailJournal; |
|
35 | 36 |
use SL::DB::Warehouse; |
36 | 37 |
use SL::DB::Helper::RecordLink qw(set_record_link_conversions RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF); |
37 | 38 |
use SL::DB::Helper::TypeDataProxy; |
... | ... | |
145 | 146 |
$self->action_add; |
146 | 147 |
} |
147 | 148 |
|
149 |
sub action_add_from_email_journal { |
|
150 |
my ($self) = @_; |
|
151 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
152 |
|
|
153 |
$self->action_add(); |
|
154 |
} |
|
155 |
|
|
156 |
sub action_edit_with_email_journal_workflow { |
|
157 |
my ($self) = @_; |
|
158 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
159 |
$::form->{workflow_email_journal_id} = delete $::form->{email_journal_id}; |
|
160 |
$::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id}; |
|
161 |
|
|
162 |
$self->action_edit(); |
|
163 |
} |
|
164 |
|
|
148 | 165 |
# edit an existing order |
149 | 166 |
sub action_edit { |
150 | 167 |
my ($self) = @_; |
... | ... | |
548 | 565 |
type => $to_type, |
549 | 566 |
from_id => $self->order->id, |
550 | 567 |
from_type => $self->order->type, |
568 |
email_journal_id => $::form->{workflow_email_journal_id}, |
|
569 |
email_attachment_id => $::form->{workflow_email_attachment_id}, |
|
551 | 570 |
%additional_params, |
552 | 571 |
); |
553 | 572 |
} |
... | ... | |
561 | 580 |
controller => 'do.pl', |
562 | 581 |
action => 'invoice_from_delivery_order_controller', |
563 | 582 |
from_id => $self->order->id, |
583 |
email_journal_id => $::form->{workflow_email_journal_id}, |
|
584 |
email_attachment_id => $::form->{workflow_email_attachment_id}, |
|
564 | 585 |
); |
565 | 586 |
} |
566 | 587 |
|
... | ... | |
1788 | 1809 |
items_to_delete => $items_to_delete, |
1789 | 1810 |
); |
1790 | 1811 |
|
1812 |
if ($::form->{email_journal_id}) { |
|
1813 |
my $email_journal = SL::DB::EmailJournal->new( |
|
1814 |
id => delete $::form->{email_journal_id} |
|
1815 |
)->load; |
|
1816 |
$email_journal->link_to_record_with_attachment( |
|
1817 |
$self->order, |
|
1818 |
delete $::form->{email_attachment_id} |
|
1819 |
); |
|
1820 |
} |
|
1821 |
|
|
1791 | 1822 |
delete $::form->{form_validity_token}; |
1792 | 1823 |
} |
1793 | 1824 |
|
templates/design40_webpages/delivery_order/form.html | ||
---|---|---|
2 | 2 |
[%- USE LxERP %] |
3 | 3 |
[%- USE L %] |
4 | 4 |
[%- USE HTML %] |
5 |
|
|
6 |
[% IF FORM.workflow_email_journal_id %] |
|
7 |
[% SET FORM.title = LxERP.t8("Email Journal Workflow") _ " - " _ FORM.title %] |
|
8 |
[% END %] |
|
5 | 9 |
<h1>[% FORM.title %] <span id='nr_in_title'>[%- SELF.order.number -%]</span></h1> |
6 | 10 |
|
7 | 11 |
<div id="print_options" style="display:none"> |
... | ... | |
21 | 25 |
[% L.hidden_tag('id', SELF.order.id) %] |
22 | 26 |
[% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %] |
23 | 27 |
[% L.hidden_tag('converted_from_record_id', SELF.order.converted_from_record_id) %] |
28 |
[% L.hidden_tag('email_journal_id', FORM.email_journal_id) %] |
|
29 |
[% L.hidden_tag('email_attachment_id', FORM.email_attachment_id) %] |
|
30 |
[% L.hidden_tag('workflow_email_journal_id', FORM.workflow_email_journal_id) %] |
|
31 |
[% L.hidden_tag('workflow_email_attachment_id', FORM.workflow_email_attachment_id) %] |
|
24 | 32 |
|
25 | 33 |
[% IF !SELF.order.id %] |
26 | 34 |
[% L.hidden_tag('form_validity_token', FORM.form_validity_token) %] |
... | ... | |
31 | 39 |
<div class="tabwidget" id="order_tabs"> |
32 | 40 |
<ul> |
33 | 41 |
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li> |
42 |
[% IF FORM.email_attachment_id || FORM.workflow_email_attachment_id %] |
|
43 |
<li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(FORM.email_attachment_id || FORM.workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li> |
|
44 |
[% END %] |
|
34 | 45 |
[%- IF INSTANCE_CONF.get_webdav %] |
35 | 46 |
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li> |
36 | 47 |
[%- END %] |
templates/design40_webpages/delivery_order/tabs/basic_data.html | ||
---|---|---|
8 | 8 |
|
9 | 9 |
<div id="ui-tabs-basic-data"> |
10 | 10 |
|
11 |
[% IF FORM.email_attachment_id || FORM.workflow_email_attachment_id%] |
|
12 |
<div class="wrapper" id="email_attachment_wrapper"> |
|
13 |
[% |
|
14 |
BLOCK panel_1; |
|
15 |
P.email_journal.attachment_preview( |
|
16 |
FORM.email_attachment_id || FORM.workflow_email_attachment_id, |
|
17 |
style="height:600px" |
|
18 |
); |
|
19 |
END; |
|
20 |
INCLUDE 'common/toggle_panel.html' |
|
21 |
block_name='panel_1' |
|
22 |
button_closed = LxERP.t8('Show Attachment') |
|
23 |
button_open = LxERP.t8('Hide Attachment') |
|
24 |
; |
|
25 |
%] |
|
26 |
</div> |
|
27 |
[% END %] |
|
28 |
|
|
11 | 29 |
<div class="wrapper" id="wrapper-1"> |
12 | 30 |
[% INCLUDE 'generic/toggle_wrapper.html' %] |
13 | 31 |
|
templates/webpages/delivery_order/form.html | ||
---|---|---|
2 | 2 |
[%- USE LxERP %] |
3 | 3 |
[%- USE L %] |
4 | 4 |
[%- USE HTML %] |
5 |
|
|
6 |
[% IF FORM.workflow_email_journal_id %] |
|
7 |
[% SET FORM.title = LxERP.t8("Email Journal Workflow") _ " - " _ FORM.title %] |
|
8 |
[% END %] |
|
5 | 9 |
<h1>[% FORM.title %] <span id='nr_in_title'>[%- SELF.order.number -%]</span></h1> |
6 | 10 |
|
7 | 11 |
<div id="print_options" style="display:none"> |
... | ... | |
21 | 25 |
[% L.hidden_tag('id', SELF.order.id) %] |
22 | 26 |
[% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %] |
23 | 27 |
[% L.hidden_tag('converted_from_record_id', SELF.order.converted_from_record_id) %] |
28 |
[% L.hidden_tag('email_journal_id', FORM.email_journal_id) %] |
|
29 |
[% L.hidden_tag('email_attachment_id', FORM.email_attachment_id) %] |
|
30 |
[% L.hidden_tag('workflow_email_journal_id', FORM.workflow_email_journal_id) %] |
|
31 |
[% L.hidden_tag('workflow_email_attachment_id', FORM.workflow_email_attachment_id) %] |
|
24 | 32 |
|
25 | 33 |
[% IF !SELF.order.id %] |
26 | 34 |
[% L.hidden_tag('form_validity_token', FORM.form_validity_token) %] |
... | ... | |
31 | 39 |
<div class="tabwidget" id="order_tabs"> |
32 | 40 |
<ul> |
33 | 41 |
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li> |
42 |
[% IF FORM.email_attachment_id || FORM.workflow_email_attachment_id %] |
|
43 |
<li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(FORM.email_attachment_id || FORM.workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li> |
|
44 |
[% END %] |
|
34 | 45 |
[%- IF INSTANCE_CONF.get_webdav %] |
35 | 46 |
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li> |
36 | 47 |
[%- END %] |
Auch abrufbar als: Unified diff
Workflow: E-Mail → Lieferschein hinzugefügt