Revision 91fc0b6e
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/DeliveryOrder.pm | ||
---|---|---|
31 | 31 |
use SL::DB::Translation; |
32 | 32 |
use SL::DB::TransferType; |
33 | 33 |
use SL::DB::ValidityToken; |
34 |
use SL::DB::EmailJournal; |
|
34 | 35 |
use SL::DB::Warehouse; |
35 | 36 |
use SL::DB::Helper::RecordLink qw(set_record_link_conversions RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF); |
36 | 37 |
use SL::DB::Helper::TypeDataProxy; |
... | ... | |
135 | 136 |
$self->action_add; |
136 | 137 |
} |
137 | 138 |
|
139 |
sub action_add_from_email_journal { |
|
140 |
my ($self) = @_; |
|
141 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
142 |
|
|
143 |
$self->action_add(); |
|
144 |
} |
|
145 |
|
|
146 |
sub action_edit_with_email_journal_workflow { |
|
147 |
my ($self) = @_; |
|
148 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
149 |
$::form->{workflow_email_journal_id} = delete $::form->{email_journal_id}; |
|
150 |
$::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id}; |
|
151 |
|
|
152 |
$self->action_edit(); |
|
153 |
} |
|
154 |
|
|
138 | 155 |
# edit an existing order |
139 | 156 |
sub action_edit { |
140 | 157 |
my ($self) = @_; |
... | ... | |
538 | 555 |
type => $to_type, |
539 | 556 |
from_id => $self->order->id, |
540 | 557 |
from_type => $self->order->type, |
558 |
email_journal_id => $::form->{workflow_email_journal_id}, |
|
559 |
email_attachment_id => $::form->{workflow_email_attachment_id}, |
|
541 | 560 |
%additional_params, |
542 | 561 |
); |
543 | 562 |
} |
... | ... | |
551 | 570 |
controller => 'do.pl', |
552 | 571 |
action => 'invoice_from_delivery_order_controller', |
553 | 572 |
from_id => $self->order->id, |
573 |
email_journal_id => $::form->{workflow_email_journal_id}, |
|
574 |
email_attachment_id => $::form->{workflow_email_attachment_id}, |
|
554 | 575 |
); |
555 | 576 |
} |
556 | 577 |
|
... | ... | |
1659 | 1680 |
items_to_delete => $items_to_delete, |
1660 | 1681 |
); |
1661 | 1682 |
|
1683 |
if ($::form->{email_journal_id}) { |
|
1684 |
my $email_journal = SL::DB::EmailJournal->new( |
|
1685 |
id => delete $::form->{email_journal_id} |
|
1686 |
)->load; |
|
1687 |
$email_journal->link_to_record_with_attachment( |
|
1688 |
$self->order, |
|
1689 |
delete $::form->{email_attachment_id} |
|
1690 |
); |
|
1691 |
} |
|
1692 |
|
|
1662 | 1693 |
delete $::form->{form_validity_token}; |
1663 | 1694 |
} |
1664 | 1695 |
|
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