From bc0386a49ddf723675331faeae842447d8c1fa2e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 16 Apr 2021 08:45:20 +0200 Subject: [PATCH] =?utf8?q?Dateianh=C3=A4nge=20aus=20Projekten=20auch=20in?= =?utf8?q?=20E-Mail=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In Anlehnung an odyn fa2f21bb7d9247782f5e Im E-Mail-Dialog werden hochgeladene Dateianhänge aus einem globalen Projekt angeboten und sind vorausgewählt. --- SL/Controller/Order.pm | 1 + bin/mozilla/io.pl | 4 +++- js/kivi.SalesPurchase.js | 1 + templates/webpages/common/_send_email_dialog.html | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 15df1582a..27e89467e 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -1965,6 +1965,7 @@ sub get_files_for_email_dialog { $files{versions} = [ SL::File->get_all_versions(object_id => $self->order->id, object_type => $self->order->type, file_type => 'document') ]; $files{files} = [ SL::File->get_all( object_id => $self->order->id, object_type => $self->order->type, file_type => 'attachment') ]; $files{vc_files} = [ SL::File->get_all( object_id => $self->order->{$self->cv}->id, object_type => $self->cv, file_type => 'attachment') ]; + $files{project_files} = [ SL::File->get_all( object_id => $self->order->globalproject_id, object_type => 'project', file_type => 'attachment') ]; } my @parts = diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 0a6b861d0..7c7fa49d6 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -2021,7 +2021,7 @@ sub setup_sales_purchase_print_options { } sub _get_files_for_email_dialog { - my %files = map { ($_ => []) } qw(versions files vc_files part_files); + my %files = map { ($_ => []) } qw(versions files vc_files part_files project_files); return %files if !$::instance_conf->get_doc_storage; @@ -2030,6 +2030,8 @@ sub _get_files_for_email_dialog { $files{files} = [ SL::File->get_all( object_id => $::form->{id}, object_type => $::form->{type}, file_type => 'attachment') ]; $files{vc_files} = [ SL::File->get_all( object_id => $::form->{vc_id}, object_type => $::form->{vc}, file_type => 'attachment') ] if $::form->{vc} && $::form->{"vc_id"}; + $files{project_files} = [ SL::File->get_all(object_id => $::form->{project_id}, object_type => 'project',file_type => 'attachment') ] + if $::form->{project_id}; } my @parts = diff --git a/js/kivi.SalesPurchase.js b/js/kivi.SalesPurchase.js index 2b63a1a33..98a538c19 100644 --- a/js/kivi.SalesPurchase.js +++ b/js/kivi.SalesPurchase.js @@ -286,6 +286,7 @@ namespace('kivi.SalesPurchase', function(ns) { type: $('#type').val(), vc: vc, vc_id: $('#' + vc + '_id').val(), + project_id: $('#globalproject_id').val(), }; $('[name^=id_],[name^=partnumber_]').each(function(idx, elt) { diff --git a/templates/webpages/common/_send_email_dialog.html b/templates/webpages/common/_send_email_dialog.html index 9f03f7e5f..b58e762c4 100644 --- a/templates/webpages/common/_send_email_dialog.html +++ b/templates/webpages/common/_send_email_dialog.html @@ -103,6 +103,10 @@ files = FILES.part_files checked = INSTANCE_CONF.get_email_attachment_part_files_checked label = LxERP.t8("Files from parts") %] + + [% PROCESS attach_file_list + files = FILES.project_files + label = LxERP.t8("Files from projects") %] [% END %] -- 2.20.1