]> wagnertech.de Git - kivitendo-erp.git/commitdiff
E-Mail-Versand: CC an andere kivi-Benutzer per Auswahlliste
authorJan Büren <jan@kivitendo.de>
Fri, 14 May 2021 08:32:37 +0000 (10:32 +0200)
committerJan Büren <jan@kivitendo.de>
Fri, 14 May 2021 08:32:37 +0000 (10:32 +0200)
SL/Controller/Order.pm
SL/Form.pm
bin/mozilla/io.pl
doc/changelog
templates/webpages/common/_send_email_dialog.html

index 5a7d58eb8ba55bc0ad9b52106ef9a4d74fc4922c..952d90e5733c7efddfd0be476db5b3cf52a646c0 100644 (file)
@@ -423,11 +423,13 @@ sub action_save_and_show_email_dialog {
   $email_form->{js_send_function}    = 'kivi.Order.send_email()';
 
   my %files = $self->get_files_for_email_dialog();
   $email_form->{js_send_function}    = 'kivi.Order.send_email()';
 
   my %files = $self->get_files_for_email_dialog();
+  $self->{all_employees} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
   my $dialog_html = $self->render('common/_send_email_dialog', { output => 0 },
                                   email_form  => $email_form,
                                   show_bcc    => $::auth->assert('email_bcc', 'may fail'),
                                   FILES       => \%files,
                                   is_customer => $self->cv eq 'customer',
   my $dialog_html = $self->render('common/_send_email_dialog', { output => 0 },
                                   email_form  => $email_form,
                                   show_bcc    => $::auth->assert('email_bcc', 'may fail'),
                                   FILES       => \%files,
                                   is_customer => $self->cv eq 'customer',
+                                  ALL_EMPLOYEES => $self->{all_employees},
   );
 
   $self->js
   );
 
   $self->js
index 921cb253ef452fc884e8220db702479d91c9796a..239f7b938cfab0d5c863b4b2035f91392e2d1b13 100644 (file)
@@ -1002,6 +1002,14 @@ sub send_email {
   map { $mail->{$_} = $self->{$_} }
     qw(cc subject message format);
 
   map { $mail->{$_} = $self->{$_} }
     qw(cc subject message format);
 
+  if ($self->{cc_employee}) {
+    my ($user, $my_emp_cc);
+    $user        = SL::DB::Manager::AuthUser->find_by(login => $self->{cc_employee});
+    $my_emp_cc   = $user->get_config_value('email') if ref $user eq 'SL::DB::AuthUser';
+    $mail->{cc} .= ", "       if $mail->{cc};
+    $mail->{cc} .= $my_emp_cc if $my_emp_cc;
+  }
+
   $mail->{bcc}    = $self->get_bcc_defaults($myconfig, $self->{bcc});
   $mail->{to}     = $self->{EMAIL_RECIPIENT} ? $self->{EMAIL_RECIPIENT} : $self->{email};
   $mail->{from}   = qq|"$myconfig->{name}" <$myconfig->{email}>|;
   $mail->{bcc}    = $self->get_bcc_defaults($myconfig, $self->{bcc});
   $mail->{to}     = $self->{EMAIL_RECIPIENT} ? $self->{EMAIL_RECIPIENT} : $self->{email};
   $mail->{from}   = qq|"$myconfig->{name}" <$myconfig->{email}>|;
index 7c7fa49d6cd53ff5da3929025bd5ccaed7f278f1..9982d9eb5c3371959884064efc18815645e46480 100644 (file)
@@ -2100,6 +2100,7 @@ sub show_sales_purchase_email_dialog {
     $body_params{fallback_translation_type} = "preset_text_invoice";
   }
 
     $body_params{fallback_translation_type} = "preset_text_invoice";
   }
 
+  $::form->{all_employees} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
   my $email_form = {
     to                  => $email,
     cc                  => $email_cc,
   my $email_form = {
     to                  => $email,
     cc                  => $email_cc,
@@ -2116,6 +2117,7 @@ sub show_sales_purchase_email_dialog {
     FILES       => \%files,
     is_customer => $::form->{vc} eq 'customer',
     is_invoice_mail => ($record_email && $::form->{type} eq 'invoice'),
     FILES       => \%files,
     is_customer => $::form->{vc} eq 'customer',
     is_invoice_mail => ($record_email && $::form->{type} eq 'invoice'),
+    ALL_EMPLOYEES   => $::form->{all_employees},
   });
 
   print $::form->ajax_response_header, $html;
   });
 
   print $::form->ajax_response_header, $html;
index a8b4d8145fff179504c7d4dbdb92b3033e13eab4..e47f57e274267d1bd5cd337e19868c505cde3c1d 100644 (file)
@@ -36,6 +36,8 @@ Mittelgroße neue Features:
      Mahnung
 
 Kleinere neue Features und Detailverbesserungen:
      Mahnung
 
 Kleinere neue Features und Detailverbesserungen:
+  - E-Mail-Versand: Neben dem Freitext CC-Feld kann jetzt auch ein
+    kivitendo Benutzer mittels einer Auswahlliste in CC gesetzt werden
   - Falls der Mandant zu jeder Buchung einen Beleg hinzufügen möchte,
     ist dies jetzt in der Mandantenkonfiguration einstellbar und falls
     zusätzlich die DMS Funktion aktiv ist, bleibt der Bearbeiter nach
   - Falls der Mandant zu jeder Buchung einen Beleg hinzufügen möchte,
     ist dies jetzt in der Mandantenkonfiguration einstellbar und falls
     zusätzlich die DMS Funktion aktiv ist, bleibt der Bearbeiter nach
index b58e762c47b42d0f499ac40371c0c49bb5e07ab7..79b984c81b8c0e09f69c158bb515f1f8fd2c87f7 100644 (file)
    </td>
   </tr>
 
    </td>
   </tr>
 
+ [%- IF ALL_EMPLOYEES.size %]
+  <tr class="hidden" data-toggle-recipients="1">
+   <th align="right" nowrap>[% LxERP.t8("CC to Employee") %]</th>
+   <td>[% L.select_tag('email_form.cc_employee',  ALL_EMPLOYEES, value_key='login' title_key='safe_name', with_empty=1, style=style) %]</td>
+  </tr>
+ [%- END %]
+
   <tr class="hidden" data-toggle-recipients="1">
    <th align="right" nowrap>[% LxERP.t8("Cc") %]</th>
    <td>[% L.input_tag("email_form.cc", email_form.cc, size="80") %]</td>
   <tr class="hidden" data-toggle-recipients="1">
    <th align="right" nowrap>[% LxERP.t8("Cc") %]</th>
    <td>[% L.input_tag("email_form.cc", email_form.cc, size="80") %]</td>