Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b827f193

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID b827f19325fa8dbd32bee2cfdfe454a8476b8ab2
  • Vorgänger c9a2c038
  • Nachfolger 20690953

Workflow: E-Mail → Angebot/Auftrag

Unterschiede anzeigen:

SL/Controller/EmailJournal.pm
$additional_params{controller} = $RECORD_TYPE_TO_CONTROLLER{$record_action};
$self->redirect_to(
action => 'add',
email_journal_id => $email_journal_id,
attachment_id => $attachment_id,
action => 'add_from_email_journal',
from_id => $email_journal_id,
from_type => 'email_journal',
email_attachment_id => $attachment_id,
%additional_params,
);
}
SL/Controller/Order.pm
use SL::DB::RecordLink;
use SL::DB::Shipto;
use SL::DB::Translation;
use SL::DB::EmailJournal;
use SL::DB::EmailJournalAttachment;
use SL::DB::ValidityToken;
use SL::DB::Helper::RecordLink qw(set_record_link_conversions RECORD_ID RECORD_TYPE_REF RECORD_ITEM_ID RECORD_ITEM_TYPE_REF);
use SL::DB::Helper::TypeDataProxy;
......
$self->action_edit();
}
sub action_add_from_email_journal {
my ($self) = @_;
my $email_journal_id = $::form->{from_id};
my $email_attachment_id = $::form->{email_attachment_id};
$self->order->{RECORD_ID()} = $email_journal_id;
$self->order->{RECORD_TYPE_REF()} = 'SL::DB::EmailJournal';
$self->{email_attachment_id} = $email_attachment_id;
$self->action_add();
}
# edit an existing order
sub action_edit {
my ($self) = @_;
......
set_project_in_linked_requirement_specs => 1,
);
if ($::form->{email_attachment_id}) {
my $attachment = SL::DB::EmailJournalAttachment->new(id => $::form->{email_attachment_id})->load;
$attachment->add_file_to_record($self->order);
}
if ($is_new && $self->order->is_sales) {
my $imap_client = SL::IMAPClient->new();
if ($imap_client) {
SL/DB/Order.pm
sub _after_save_link_records {
my ($self) = @_;
my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order);
my @allowed_record_sources = qw(SL::DB::Reclamation SL::DB::Order SL::DB::EmailJournal);
my @allowed_item_sources = qw(SL::DB::ReclamationItem SL::DB::OrderItem);
SL::DB::Helper::RecordLink::link_records(
templates/design40_webpages/order/form.html
[% L.hidden_tag('id', SELF.order.id) %]
[% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %]
[% L.hidden_tag('converted_from_record_id', SELF.order.converted_from_record_id) %]
[% L.hidden_tag('email_attachment_id' , SELF.email_attachment_id) %]
[% IF !SELF.order.id %]
[% L.hidden_tag('form_validity_token', FORM.form_validity_token) %]
......
<ul>
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
[% IF SELF.email_attachment_id %]
<li><a href="#ui-tabs-email-attachment-preview">[% 'Email Attachment Preview' | $T8 %]</a></li>
[% END %]
[% IF INSTANCE_CONF.get_webdav %]
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
[% END %]
......
cvars=SELF.order.custom_shipto.cvars_by_config
id_selector='#order_shipto_id' %]
</div>
[% IF SELF.email_attachment_id %]
<div id="ui-tabs-email-attachment-preview">
<div class="wrapper" id="email_attachment_wrapper">
[% P.email_journal.attachment_preview(
SELF.email_attachment_id,
style="border:1px solid black;margin:9px"
);
%]
</div><!-- /.wrapper -->
</div><!-- /#ui-tabs-attachment-preview -->
[% END %]
</div><!-- /.tabwidget -->
</form>
templates/design40_webpages/order/tabs/basic_data.html
<div id="ui-tabs-basic-data">
<!-- PENDENT: EXPERIMENTELL -->
[% IF SELF.email_attachment_id %]
<div class="wrapper" id="email_attachment_wrapper">
[%
BLOCK panel_1;
P.email_journal.attachment_preview(
SELF.email_attachment_id,
style="width:520px;border:1px solid black;margin:9px"
);
END;
INCLUDE 'common/toggle_panel.html'
block_name='panel_1'
button_closed = LxERP.t8('Show Attachment')
button_open = LxERP.t8('Hide Attachment')
;
%]
</div>
[% END %]
<div class="wrapper" id="wrapper-1">
[% INCLUDE 'generic/toggle_wrapper.html' %]
templates/webpages/order/form.html
[% L.hidden_tag('id', SELF.order.id) %]
[% L.hidden_tag('converted_from_record_type_ref', SELF.order.converted_from_record_type_ref) %]
[% L.hidden_tag('converted_from_record_id', SELF.order.converted_from_record_id) %]
[% L.hidden_tag('email_attachment_id' , SELF.email_attachment_id) %]
[% IF !SELF.order.id %]
[% L.hidden_tag('form_validity_token', FORM.form_validity_token) %]

Auch abrufbar als: Unified diff