Auftrags-Controller: Sprache f. Überstzung im E-Mail-Dialog verwenden
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 2 Jul 2020 13:28:07 +0000 (15:28 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 2 Jul 2020 13:28:07 +0000 (15:28 +0200)
SL/Controller/Order.pm
js/kivi.Order.js

index e464498..689c597 100644 (file)
@@ -370,7 +370,8 @@ sub action_show_email_dialog {
   $form->{$self->nr_key()}  = $self->order->number;
   $form->{formname}         = $self->type;
   $form->{type}             = $self->type;
-  $form->{language}         = 'de';
+  $form->{language}         = '_' . $self->order->language->template_code if $self->order->language;
+  $form->{language_id}      = $self->order->language->id                  if $self->order->language;
   $form->{format}           = 'pdf';
 
   $email_form->{subject}             = $form->generate_email_subject();
index f50db04..e4cebb2 100644 (file)
@@ -94,6 +94,7 @@ namespace('kivi.Order', function(ns) {
     if (!ns.check_cv()) return;
 
     var data = $('#order_form').serializeArray();
+    data.push({ name: 'order.language_id', value: $('#language_id').val() }); // language from print options
     data.push({ name: 'action', value: 'Order/show_email_dialog' });
 
     $.post("controller.pl", data, kivi.eval_json_result);