Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a78e5571

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID a78e5571e1d44369d292ce0946f954f217f3e909
  • Vorgänger 0af1d584
  • Nachfolger 36e45d3d

EmailJournal: Basisfunktionalität fürs Verlinken und Neu erstellen von Belegen

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
8 8
use SL::DB::Employee;
9 9
use SL::DB::EmailJournal;
10 10
use SL::DB::EmailJournalAttachment;
11
use SL::DB::Order;
12
use SL::DB::Helper::HardRecordLinks;
11 13
use SL::Helper::Flash;
12 14
use SL::Locale::String;
13 15
use SL::System::TaskServer;
......
22 24
__PACKAGE__->run_before('add_stylesheet');
23 25
__PACKAGE__->run_before('add_js');
24 26

  
27
my %RECORD_TYPES_INFO = (
28
  # Order
29
  Order => {
30
    controller => 'Order',
31
    model      => 'SL::DB::Order',
32
    types => [
33
      'purchase_order',
34
      'purchase_quotation_intake',
35
      'request_quotation',
36
      'sales_order',
37
      'sales_order_intake',
38
      'sales_quotation',
39
    ],
40
  },
41
);
42
my %RECORD_TYPE_TO_CONTROLLER =
43
  map {
44
    my $controller = $RECORD_TYPES_INFO{$_}->{controller};
45
    map { $_ => $controller } @{ $RECORD_TYPES_INFO{$_}->{types} }
46
  } keys %RECORD_TYPES_INFO;
47
my %RECORD_TYPE_TO_MODEL =
48
  map {
49
    my $model = $RECORD_TYPES_INFO{$_}->{model};
50
    map { $_ => $model } @{ $RECORD_TYPES_INFO{$_}->{types} }
51
  } keys %RECORD_TYPES_INFO;
52

  
25 53
#
26 54
# actions
27 55
#
......
56 84

  
57 85
  $self->setup_show_action_bar;
58 86
  $self->render('email_journal/show',
59
                title   => $::locale->text('View sent email'),
87
                title   => $::locale->text('View email'),
60 88
                back_to => $back_to);
61 89
}
62 90

  
......
78 106
  $self->send_file($ref, name => $attachment->name, type => $attachment->mime_type);
79 107
}
80 108

  
109
sub action_apply_record_action {
110
  my ($self) = @_;
111
  my $email_journal_id = $::form->{email_journal_id};
112
  my $attachment_id = $::form->{attachment_id};
113
  my $record_action = $::form->{record_action};
114
  my $vendor_id = $::form->{vendor_id};
115
  my $customer_id = $::form->{customer_id};
116

  
117
  if ( $record_action =~ s/^link_// ) { # remove prefix
118

  
119
    # Load record
120
    my $record_type = $record_action;
121
    my $record_id = $::form->{$record_type . "_id"};
122
    my $record_type_model = $RECORD_TYPE_TO_MODEL{$record_type};
123
    my $record = $record_type_model->new(id => $record_id)->load;
124
    my $email_journal = SL::DB::EmailJournal->new(id => $email_journal_id)->load;
125

  
126
    my $attachment = $attachment_id ?
127
          SL::DB::EmailJournalAttachment->new(id => $attachment_id)->load
128
        : undef;
129

  
130
    $self->hard_link_email_journal_to_record(
131
      email_journal => $email_journal,
132
      record        => $record,
133
      attachment    => $attachment,
134
    );
135
    return $self->js->flash('info',  $::locale->text('Hard linked to record: ') . $record->displayable_name)->render();
136
  }
137

  
138
  my %additional_params = ();
139
  if ( $record_action =~ s/^customer_// ) {  # remove prefix
140
    $additional_params{customer_id} = $customer_id;
141
  } elsif ( $record_action =~ s/^vendor_// ) { # remove prefix
142
    $additional_params{vendor_id} = $vendor_id;
143
  }
144
  $additional_params{type} = $record_action;
145
  $additional_params{controller} = $RECORD_TYPE_TO_CONTROLLER{$record_action};
146

  
147
  $self->redirect_to(
148
    action           => 'add',
149
    email_journal_id => $email_journal_id,
150
    attachment_id    => $attachment_id,
151
    %additional_params,
152
  );
153
}
154

  
81 155
sub action_update_attachment_preview {
82 156
  my ($self) = @_;
83 157
  $::auth->assert('email_journal');
......
92 166
    ->replaceWith('#attachment_preview',
93 167
      SL::Presenter::EmailJournal::attachment_preview(
94 168
        $attachment,
95
        style => "width:489px;border:1px solid black;margin:9px"
169
        style => "width:655px;border:1px solid black;margin:9px"
96 170
      )
97 171
    )
98 172
    ->render();
......
110 184
# helpers
111 185
#
112 186

  
187
sub hard_link_email_journal_to_record {
188
  my ($self, %params) = @_;
189
  my $email_journal = $params{email_journal};
190
  my $attachment = $params{attachment};
191
  my $record = $params{record};
192

  
193
  # soft link
194
  $email_journal->link_to_record($record);
195

  
196
  # hard link
197
  SL::DB::Helper::HardRecordLinks->create_link($record, $email_journal);
198

  
199
  if ($attachment) {
200
    $attachment->add_file_to_record($record);
201
  }
202

  
203
}
204

  
205
sub link_attachment_to_record {
206
  my ($self, $attachment, $record) = @_;
207

  
208
}
209

  
210
sub find_cv_from_email {
211
  my ($self, $cv_type, $email_journal) = @_;
212
  my $email_address = $email_journal->from;
213

  
214
  # search for customer or vendor or both
215
  my $customer;
216
  my $vendor;
217
  if ($cv_type ne 'vendor') {
218
    $customer = SL::DB::Manager::Customer->get_first(
219
      where => [
220
        or => [
221
          email => $email_address,
222
          cc    => $email_address,
223
          bcc   => $email_address,
224
          'contacts.cp_email' => $email_address,
225
          'contacts.cp_privatemail' => $email_address,
226
          'shipto.shiptoemail' => $email_address,
227
        ],
228
      ],
229
      with_objects => [ 'contacts', 'shipto' ],
230
    );
231
  } elsif ($cv_type ne 'customer') {
232
    $vendor = SL::DB::Manager::Vendor->get_first(
233
      where => [
234
        or => [
235
          email => $email_address,
236
          cc    => $email_address,
237
          bcc   => $email_address,
238
          'contacts.cp_email' => $email_address,
239
          'contacts.cp_privatemail' => $email_address,
240
          'shipto.shiptoemail' => $email_address,
241
        ],
242
      ],
243
      with_objects => [ 'contacts', 'shipto' ],
244
    );
245
  }
246

  
247
  return $customer || $vendor;
248
}
249

  
250
sub find_customer_from_email {
251
  my ($self, $email_journal) = @_;
252
  my $email_address = $email_journal->from;
253

  
254
  my $customer = SL::DB::Manager::Customer->get_first(
255
    where => [
256
      or => [
257
        email => $email_address,
258
        cc    => $email_address,
259
        bcc   => $email_address,
260
        'contacts.cp_email' => $email_address,
261
        'contacts.cp_privatemail' => $email_address,
262
        'shipto.shiptoemail' => $email_address,
263
      ],
264
    ],
265
    with_objects => [ 'contacts', 'shipto' ],
266
  );
267

  
268
  return $customer;
269
}
270

  
113 271
sub add_js {
114 272
  $::request->{layout}->use_javascript("${_}.js") for qw(
115 273
    kivi.EmailJournal
js/kivi.EmailJournal.js
3 3

  
4 4
  ns.update_attachment_preview = function() {
5 5

  
6
    var data = $('#attachment_form').serializeArray();
6
    let data = $('#record_action_form').serializeArray();
7 7
    data.push({ name: 'action', value: 'EmailJournal/update_attachment_preview' });
8 8

  
9 9
    $.post("controller.pl", data, kivi.eval_json_result);
10 10
  }
11

  
12
  ns.update_extra_div_selection = function() {
13
    let record_action = $('#record_action').val();
14

  
15
    $('#customer_div').hide();
16
    $('#vendor_div').hide();
17

  
18
    $('#link_sales_quotation_div').hide();
19
    $('#link_sales_order_intake_div').hide();
20
    $('#link_sales_order_div').hide();
21
    $('#link_request_quotation_div').hide();
22
    $('#link_purchase_quotation_intake_div').hide();
23
    $('#link_purchase_order_div').hide();
24

  
25
    $('#placeholder_div').hide();
26

  
27
    // customer vendor
28
    if (record_action.match(/^customer/)) {
29
      $('#customer_div').show();
30
    } else if (record_action.match(/^vendor/)) {
31
      $('#vendor_div').show();
32
    // link
33
    } else if (record_action.match(/^link_/)) {
34
      $('#'+record_action+'_div').show();
35
    // placeholder
36
    } else {
37
      $('#placeholder_div').show();
38
    }
39
  }
40

  
41
  ns.apply_record_action = function() {
42
    let record_action = $('#record_action').val();
43
    if (record_action == '') {
44
      alert(kivi.t8('Please select an action.'));
45
      return;
46
    }
47

  
48
    let data = $('#record_action_form').serializeArray();
49
    data.push({ name: 'action', value: 'EmailJournal/apply_record_action' });
50

  
51
    $.post("controller.pl", data, kivi.eval_json_result);
52
  }
53
});
54

  
55
$(function() {
56
  kivi.EmailJournal.update_attachment_preview();
57
  kivi.EmailJournal.update_extra_div_selection();
11 58
});
templates/design40_webpages/email_journal/show.html
2 2
[% USE L %]
3 3
[% USE LxERP %]
4 4
[% USE P %]
5
[% USE T8 %]
5 6

  
6
<h1>[% FORM.title %]</h1>
7

  
8
[% INCLUDE 'common/flash.html' %]
9

  
10
<div class="wrapper" id="wrapper-0">
11

  
12
<div class="input-panel" style="vertical-align:top;" id="wrapper-1">
13

  
7
[% BLOCK filter_toggle_panel # can't change name %]
14 8
<table id="email_journal_details" class="tbl-horizontal">
15 9
  <tbody>
16 10
    <tr>
17
      <th>[% LxERP.t8("From") %]</th>
18
      <td>[% L.input_tag('from', HTML.escape(SELF.entry.from), style="color:black", class="wi-verywide", disabled=1) %]</td>
11
      <th>[% 'From' | $T8 %]</th>
12
      <td>[% L.input_tag('from',  SELF.entry.from, style="color:black", class="wi-verywide", disabled=1) %]</td>
19 13
    </tr>
20 14
    <tr>
21
      <th>[% LxERP.t8("Recipients") %]</th>
22
      <td>[% L.input_tag('recipients', HTML.escape(SELF.entry.recipients), style="color:black", class="wi-verywide", disabled=1) %]</td>
15
      <th>[% 'Recipients' | $T8 %]</th>
16
      <td>[% L.input_tag('recipients', SELF.entry.recipients, style="color:black", class="wi-verywide", disabled=1) %]</td>
23 17
    </tr>
24 18
    <tr>
25
      <th>[% LxERP.t8("Subject") %]</th>
26
      <td>[% L.input_tag('subject', HTML.escape(SELF.entry.subject), style="color:black", class="wi-verywide", disabled=1) %]</td>
19
      <th>[% 'Subject' | $T8 %]</th>
20
      <td>[% L.input_tag('subject', SELF.entry.subject, style="color:black", class="wi-verywide", disabled=1) %]</td>
27 21
    </tr>
28 22
    <tr>
29
      <th>[% LxERP.t8("Sent on") %]</th>
30
      <td>[% L.input_tag('sent_on', HTML.escape(SELF.entry.sent_on.to_lxoffice("precision" => "second")), style="color:black", class="wi-verywide", disabled=1) %]</td>
23
      <th>[% 'Sent on' | $T8 %]</th>
24
      <td>[% L.input_tag('sent_on', SELF.entry.sent_on.to_lxoffice("precision" => "second"), style="color:black", class="wi-verywide", disabled=1) %]</td>
31 25
    </tr>
32 26
    <tr>
33
      <th>[% LxERP.t8("Status") %]</th>
27
      <th>[% 'Status' | $T8 %]</th>
34 28
      <td>[% L.input_tag('status', P.email_journal.entry_status(SELF.entry), style="color:black", class="wi-verywide", disabled=1) %]</td>
35 29
    </tr>
36 30
    <tr>
37
      <th>[% LxERP.t8("Extended status") %]</th>
31
      <th>[% 'Extended status' | $T8 %]</th>
38 32
      <td>
39
        [% L.textarea_tag('extended_status', HTML.escape(SELF.entry.extended_status), wrap="soft", style="color:black; height:25px", class="wi-verywide", disabled=1) %]
33
        [% L.textarea_tag('extended_status', SELF.entry.extended_status, wrap="soft", style="color:black; height:25px", class="wi-verywide", disabled=1) %]
40 34
      </td>
41 35
    </tr>
42 36
    <tr>
43
      <th>[% LxERP.t8("Headers") %]</th>
37
      <th>[% 'Headers' | $T8 %]</th>
44 38
      <td>
45 39
        [% L.textarea_tag('headers', HTML.escape(SELF.entry.headers), wrap="soft", style="color:black; height:25px", class="wi-verywide", disabled=1) %]
46 40
      </td>
47 41
    </tr>
48 42
    <tr>
49
      <th>[% LxERP.t8("Body") %]</th>
43
      <th>[% 'Body' | $T8 %]</th>
50 44
      <td>
51 45
        [% IF SELF.entry.headers.match('(?i)content-type:.*text/html') %]
52 46
          <div style="border:1px solid black;">
53 47
          [% P.restricted_html(SELF.entry.body) %]
54 48
          </div>
55 49
        [% ELSE %]
56
          [% L.textarea_tag('body', HTML.escape(SELF.entry.body), wrap="soft", style="color:black; height:200px", class="wi-verywide", disabled=1) %]
50
          [% L.textarea_tag('body', SELF.entry.body, wrap="soft", style="color:black; height:200px", class="wi-verywide", disabled=1) %]
57 51
        [% END %]
58 52
      </td>
59 53
    </tr>
60 54
  </tbody>
61 55
</table>
56
[% END %]
57

  
58

  
59

  
60
<h1>[% FORM.title %]</h1>
61

  
62
[% INCLUDE 'common/flash.html' %]
63

  
64
<div class="wrapper" id="wrapper-0">
65

  
66
<div class="wrapper">
67
  [%
68
    display_status = 'open';
69
    button_closed  = LxERP.t8('Show Email');
70
    button_open    = LxERP.t8('Hide Email');
71
    INCLUDE 'common/toggle_panel.html';
72
  %]
73
</div><!-- /.wrapper -->
62 74

  
63
</div> <!-- wrapper-1 -->
64 75

  
65 76
[% SET attachments = SELF.entry.attachments_sorted %]
66 77

  
......
68 79

  
69 80
[% IF attachments.size %]
70 81
<table id="email_journal_details" class="tbl-list">
71
  <caption>[% LxERP.t8("Attachments") %]</caption>
82
  <caption>[% 'Attachments' | $T8 %]</caption>
72 83
  <thead>
73 84
    <tr>
74
      <th>[% LxERP.t8("Attachment name") %]</th>
75
      <th>[% LxERP.t8("MIME type") %]</th>
76
      <th>[% LxERP.t8("Size") %]</th>
85
      <th>[% 'Attachment name' | $T8 %]</th>
86
      <th>[% 'MIME type' | $T8 %]</th>
87
      <th>[% 'Size' | $T8 %]</th>
77 88
    </tr>
78 89
  </thead>
79 90
  <tbody>
......
88 99
</table>
89 100
[% END %]
90 101

  
91
<form method="post" action="controller.pl" id="attachment_form">
92
  [% L.hidden_tag('id', SELF.entry.id) %]
93
  [% L.select_tag('attachment_id',
94
       attachments, value_key='id', title_key='name',
95
       with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
96
       'data-title'=LxERP.t8("Attachment"), class="wi-normal",
97
       onchange='kivi.EmailJournal.update_attachment_preview();'
98
       )
99
    %]
100
  [% L.select_tag('record_type', [ ["value", "Name"] ], class="wi-normal") %]
101

  
102
  [% L.button_tag('kivi.EmailJournal.create_record();', LxERP.t8('Create Record with Attachment')) %]
102
[% IF SELF.entry.status == 'imported' || SELF.entry.status == 'record_imported' %]
103
<form method="post" action="controller.pl" id="record_action_form">
104
  [% L.hidden_tag('email_journal_id', SELF.entry.id) %]
105

  
106
  <div id="action_div" class="input-panel">
107

  
108
    <div class="col">
109
    [% L.select_tag('attachment_id',
110
         attachments, value_key='id', title_key='name',
111
         default = attachments.0.id,
112
         with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
113
         'data-title'=LxERP.t8("Attachment"), class="wi-normal",
114
         onchange='kivi.EmailJournal.update_attachment_preview();'
115
         )
116
      %]
117
    </div>
118

  
119
    <div class="col">
120
    [% L.select_tag('record_action',
121
       # id has to start with customer_ or vendor_ for picker selection
122
       [
123
         [ LxERP.t8("Hard linking"), [
124
           {id => "link_sales_quotation",           name => LxERP.t8("Link to sales quotation")},
125
           {id => "link_sales_order_intake",        name => LxERP.t8("Link to sales order intake")},
126
           {id => "link_sales_order",               name => LxERP.t8("Link to sales order")},
127
           {id => "link_request_quotation",         name => LxERP.t8("Link to request quotation")},
128
           {id => "link_purchase_quotation_intake", name => LxERP.t8("Link to purchase quotation intake")},
129
           {id => "link_purchase_order",            name => LxERP.t8("Link to purchase order")},
130

  
131
         ] ],
132
         [ LxERP.t8("Sales"), [
133
             {id => "customer_sales_order",  name => LxERP.t8("Create sales order")},
134
             {id => "customer_sales_order_intake",  name => LxERP.t8("Create sales order intake")},
135
             {id => "customer_sales_quotation",  name => LxERP.t8("Create sales quotation")},
136
         ] ],
137
         [ LxERP.t8("Purchase"), [
138
             {id => "vendor_purchase_order", name => LxERP.t8("Create purchase order")},
139
             {id => "vendor_purchase_quotation_intake", name => LxERP.t8("Create purchase quotation intake")},
140
             {id => "vendor_request_quotation", name => LxERP.t8("Create request quotation")},
141

  
142
         ] ],
143
       ],
144
       value_key='id', title_key='name',
145
       with_empty=1, empty_value='', empty_title=LxERP.t8("No action"),
146
       with_optgroups=1,
147
       class="wi-normal",
148
       onchange='kivi.EmailJournal.update_extra_div_selection();'
149
       ) %]
150
    </div>
151

  
152
    [% FOREACH cv_type_name = [['customer', 'Customer'], ['vendor', 'Vendor']] %]
153
    [% SET cv_type = cv_type_name.0 %]
154
    [% SET cv_name = cv_type_name.1 %]
155
    <div id="[% cv_type _ "_div" %]" class="col" style="display:none">
156
      [% P.customer_vendor.picker(
157
           cv_type _ "_id", SELF.find_cv_from_email(cv_type, SELF.entry),
158
           type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
159
           ) %]
160
    </div>
161
    [% END %]
162
    [% FOREACH record_type  = [
163
         'sales_quotation', 'sales_order_intake', 'sales_order',
164
         'request_quotation', 'purchase_quotation_intake', 'purchase_order'
165
         ] %]
166
    <div id="[% "link_" _ record_type _ "_div" %]" class="col" style="display:none">
167
      [% L.input_tag(record_type _ "_id", '',
168
           style="color:black", class="wi-normal",
169
           placeholder=record_type _ " id") %]
170
    </div>
171
    [% END %]
172
    <div id="placeholder_div" class="col" style="display:block">
173
      [% L.input_tag('cv_placeholder', '',
174
           style="color:black", class="wi-normal", disabled=1,
175
           placeholder=LxERP.t8("Select action first"),
176
           ) %]
177
    </div>
178

  
179
    <div class="col">
180
      [% L.button_tag('kivi.EmailJournal.apply_record_action();', LxERP.t8('Apply with Attachment')) %]
181
    </div>
182
  </div> <!-- action_div -->
103 183
</form>
104 184

  
105
<!--  <div id="attachment_preview"> -->
106
[% P.email_journal.attachment_preview(attachments.0,
107
     style="width:489px;border:1px solid black;margin:9px") %]
185
<!-- kivi.EmailJournal.update_attachment_preview -->
186
<div id="attachment_preview"></div>
187
[% END %]
108 188

  
109 189
</div> <!-- wrapper-2 -->
110 190

  
templates/webpages/email_journal/show.html
79 79
   </tbody>
80 80
  </table>
81 81
 [% END %]
82
<div>
83
  <form method="post" action="controller.pl" id="attachment_form">
84
    [% L.hidden_tag('id', SELF.entry.id) %]
85
    [% L.select_tag('attachment_id',
86
         attachments, value_key='id', title_key='name',
87
         with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
88
         'data-title'=LxERP.t8("Attachment"), class="wi-normal",
89
         onchange='kivi.EmailJournal.update_attachment_preview();'
90
         )
91
      %]
92
    [% L.select_tag('record_type', [ ["value", "Name"] ], class="wi-normal") %]
93

  
94
    [% L.button_tag('kivi.EmailJournal.create_record();', LxERP.t8('Create Record with Attachment')) %]
95
  </form>
96

  
97
  <!--  <div id="attachment_preview"> -->
98
  [% P.email_journal.attachment_preview(attachments.0,
99
       style="width:489px;border:1px solid black;margin:9px") %]
100
</div>
82

  
83
[% IF SELF.entry.status == 'imported' || SELF.entry.status == 'record_imported' %]
84
<form method="post" action="controller.pl" id="record_action_form">
85
  [% L.hidden_tag('email_journal_id', SELF.entry.id) %]
86

  
87
  <table> <tr>
88
    <td>
89
      [% L.select_tag('attachment_id',
90
           attachments, value_key='id', title_key='name',
91
           default = attachments.0.id,
92
           with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
93
           'data-title'=LxERP.t8("Attachment"), class="wi-normal",
94
           onchange='kivi.EmailJournal.update_attachment_preview();'
95
           )
96
        %]
97
    </td>
98

  
99
    <td>
100
      [% L.select_tag('record_action',
101
         # id has to start with customer_ or vendor_ for picker selection
102
         [
103
           [ LxERP.t8("Hard linking"), [
104
             {id => "link_sales_quotation",           name => LxERP.t8("Link to sales quotation")},
105
             {id => "link_sales_order_intake",        name => LxERP.t8("Link to sales order intake")},
106
             {id => "link_sales_order",               name => LxERP.t8("Link to sales order")},
107
             {id => "link_request_quotation",         name => LxERP.t8("Link to request quotation")},
108
             {id => "link_purchase_quotation_intake", name => LxERP.t8("Link to purchase quotation intake")},
109
             {id => "link_purchase_order",            name => LxERP.t8("Link to purchase order")},
110

  
111
           ] ],
112
           [ LxERP.t8("Sales"), [
113
               {id => "customer_sales_order",  name => LxERP.t8("Create sales order")},
114
               {id => "customer_sales_order_intake",  name => LxERP.t8("Create sales order intake")},
115
               {id => "customer_sales_quotation",  name => LxERP.t8("Create sales quotation")},
116
           ] ],
117
           [ LxERP.t8("Purchase"), [
118
               {id => "vendor_purchase_order", name => LxERP.t8("Create purchase order")},
119
               {id => "vendor_purchase_quotation_intake", name => LxERP.t8("Create purchase quotation intake")},
120
               {id => "vendor_request_quotation", name => LxERP.t8("Create request quotation")},
121

  
122
           ] ],
123
         ],
124
         value_key='id', title_key='name',
125
         with_empty=1, empty_value='', empty_title=LxERP.t8("No action"),
126
         with_optgroups=1,
127
         class="wi-normal",
128
         onchange='kivi.EmailJournal.update_extra_div_selection();'
129
         ) %]
130
    </td>
131

  
132
    <td>
133
      [% FOREACH cv_type_name = [['customer', 'Customer'], ['vendor', 'Vendor']] %]
134
      [% SET cv_type = cv_type_name.0 %]
135
      [% SET cv_name = cv_type_name.1 %]
136
      <div id="[% cv_type _ "_div" %]" style="display:none">
137
        [% P.customer_vendor.picker(
138
             cv_type _ "_id", SELF.find_cv_from_email(cv_type, SELF.entry),
139
             type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
140
             ) %]
141
      </div>
142
      [% END %]
143
      [% FOREACH record_type  = [
144
           'sales_quotation', 'sales_order_intake', 'sales_order',
145
           'request_quotation', 'purchase_quotation_intake', 'purchase_order'
146
           ] %]
147
      <div id="[% "link_" _ record_type _ "_div" %]" style="display:none">
148
        [% L.input_tag(record_type _ "_id", '',
149
             style="color:black", class="wi-normal",
150
             placeholder=record_type _ " id") %]
151
      </div>
152
      [% END %]
153
      <div id="placeholder_div" style="display:block">
154
        [% L.input_tag('cv_placeholder', '',
155
             style="color:black", class="wi-normal", disabled=1,
156
             placeholder=LxERP.t8("Select action first"),
157
             ) %]
158
      </div>
159
    </td>
160

  
161
    <td>
162
      [% L.button_tag('kivi.EmailJournal.apply_record_action();', LxERP.t8('Apply with Attachment')) %]
163
    </td>
164
  </tr> </table>
165
</form>
166

  
167
<!-- kivi.EmailJournal.update_attachment_preview -->
168
<div id="attachment_preview"></div>
169
[% END %]

Auch abrufbar als: Unified diff