Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c87efc08

Von Tamino Steinert vor 11 Monaten hinzugefügt

  • ID c87efc08c5eec679d6a468eb22ce98ef15604456
  • Vorgänger d88cc6da
  • Nachfolger b9c5b0a8

Workflow: E-Mail → Angebot/Auftrag

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
142 142
  $additional_params{controller} = $RECORD_TYPE_TO_CONTROLLER{$record_action};
143 143

  
144 144
  $self->redirect_to(
145
    action           => 'add',
146
    email_journal_id => $email_journal_id,
147
    attachment_id    => $attachment_id,
145
    action              => 'add_from_email_journal',
146
    from_id             => $email_journal_id,
147
    from_type           => 'email_journal',
148
    email_attachment_id => $attachment_id,
148 149
    %additional_params,
149 150
  );
150 151
}
SL/Controller/Order.pm
32 32
use SL::DB::RecordLink;
33 33
use SL::DB::Shipto;
34 34
use SL::DB::Translation;
35
use SL::DB::EmailJournal;
36
use SL::DB::EmailJournalAttachment;
35 37
use SL::DB::ValidityToken;
36 38
use SL::DB::Helper::RecordLink qw(set_record_link_conversions RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF);
37 39
use SL::DB::Helper::TypeDataProxy;
......
156 158
  $self->action_edit();
157 159
}
158 160

  
161
sub action_add_from_email_journal {
162
  my ($self) = @_;
163
  my $email_journal_id    = $::form->{from_id};
164
  my $email_attachment_id = $::form->{email_attachment_id};
165

  
166
  $self->order->{RECORD_ID()}       = $email_journal_id;
167
  $self->order->{RECORD_TYPE_REF()} = 'SL::DB::EmailJournal';
168
  $self->{email_attachment_id} = $email_attachment_id;
169

  
170
  $self->action_add();
171
}
172

  
159 173
# edit an existing order
160 174
sub action_edit {
161 175
  my ($self) = @_;
......
2112 2126
                          set_project_in_linked_requirement_specs                => 1,
2113 2127
  );
2114 2128

  
2129
  if ($::form->{email_attachment_id}) {
2130
    my $attachment = SL::DB::EmailJournalAttachment->new(id => $::form->{email_attachment_id})->load;
2131
    $attachment->add_file_to_record($self->order);
2132
  }
2133

  
2115 2134
  if ($is_new && $self->order->is_sales) {
2116 2135
    my $imap_client = SL::IMAPClient->new();
2117 2136
    if ($imap_client) {
SL/DB/Order.pm
145 145
sub _after_save_link_records {
146 146
  my ($self) = @_;
147 147

  
148
  my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order);
148
  my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order SL::DB::EmailJournal);
149 149
  my @allowed_item_sources = qw(SL::DB::ReclamationItem SL::DB::OrderItem);
150 150

  
151 151
  SL::DB::Helper::RecordLink::link_records(
templates/design40_webpages/order/form.html
23 23
  [% L.hidden_tag('id',                   SELF.order.id) %]
24 24
  [% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %]
25 25
  [% L.hidden_tag('converted_from_record_id',  SELF.order.converted_from_record_id) %]
26
  [% L.hidden_tag('email_attachment_id'   , SELF.email_attachment_id) %]
26 27

  
27 28
  [% IF !SELF.order.id %]
28 29
  [%   L.hidden_tag('form_validity_token', FORM.form_validity_token) %]
......
34 35

  
35 36
<ul>
36 37
  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
38
  [% IF SELF.email_attachment_id %]
39
    <li><a href="#ui-tabs-email-attachment-preview">[% 'Email Attachment Preview' | $T8 %]</a></li>
40
  [% END %]
37 41
  [% IF INSTANCE_CONF.get_webdav %]
38 42
    <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
39 43
  [% END %]
......
66 70
    cvars=SELF.order.custom_shipto.cvars_by_config
67 71
    id_selector='#order_shipto_id' %]
68 72
</div>
73
[% IF SELF.email_attachment_id %]
74
<div id="ui-tabs-email-attachment-preview">
75
  <div class="wrapper" id="email_attachment_wrapper">
76
    [% P.email_journal.attachment_preview(
77
          SELF.email_attachment_id,
78
          style="border:1px solid black;margin:9px"
79
          );
80
     %]
81
  </div><!-- /.wrapper -->
82
</div><!-- /#ui-tabs-attachment-preview -->
83
[% END %]
84

  
69 85

  
70 86
</div><!-- /.tabwidget -->
71 87
</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' %]
templates/webpages/order/form.html
23 23
  [% L.hidden_tag('id',                   SELF.order.id) %]
24 24
  [% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %]
25 25
  [% L.hidden_tag('converted_from_record_id',  SELF.order.converted_from_record_id) %]
26
  [% L.hidden_tag('email_attachment_id'   , SELF.email_attachment_id) %]
26 27

  
27 28
  [% IF !SELF.order.id %]
28 29
  [%   L.hidden_tag('form_validity_token', FORM.form_validity_token) %]

Auch abrufbar als: Unified diff