Auftrags-Controller: Spracheinstellungen aus Druck-/E-Mail-Dialog speichern.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 18 Oct 2019 10:58:27 +0000 (12:58 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 18 Oct 2019 10:58:27 +0000 (12:58 +0200)
SL/Controller/Order.pm
js/kivi.Order.js

index 9b4f42f..c19c87f 100644 (file)
@@ -1649,10 +1649,11 @@ sub pre_render {
   $self->{positions_scrollbar_height} = SL::Helper::UserPreferences::PositionsScrollbar->new()->get_height();
 
   my $print_form = Form->new('');
-  $print_form->{type}      = $self->type;
-  $print_form->{printers}  = SL::DB::Manager::Printer->get_all_sorted;
-  $print_form->{languages} = SL::DB::Manager::Language->get_all_sorted;
-  $self->{print_options}   = SL::Helper::PrintOptions->get_print_options(
+  $print_form->{type}        = $self->type;
+  $print_form->{printers}    = SL::DB::Manager::Printer->get_all_sorted;
+  $print_form->{languages}   = SL::DB::Manager::Language->get_all_sorted;
+  $print_form->{language_id} = $self->order->language_id;
+  $self->{print_options}     = SL::Helper::PrintOptions->get_print_options(
     form => $print_form,
     options => {dialog_name_prefix => 'print_options.',
                 show_headers       => 1,
@@ -2145,10 +2146,6 @@ should be implemented.
 C<show_multi_items_dialog> does not use the currently inserted string for
 filtering.
 
-=item *
-
-The language selected in print or email dialog is not saved when the order is saved.
-
 =back
 
 =head1 To discuss / Nice to have
index e77b63e..6c739b5 100644 (file)
@@ -51,6 +51,7 @@ namespace('kivi.Order', function(ns) {
     if (warn_on_reqdate    && !ns.check_valid_reqdate())   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/' + action });
 
     $.post("controller.pl", data, kivi.eval_json_result);
@@ -82,6 +83,7 @@ namespace('kivi.Order', function(ns) {
 
     var data = $('#order_form').serializeArray();
     data = data.concat($('#print_options_form').serializeArray());
+    data.push({ name: 'order.language_id', value: $('#language_id').val() }); // language from print options
     data.push({ name: 'action', value: 'Order/print' });
 
     $.post("controller.pl", data, kivi.eval_json_result);
@@ -147,6 +149,7 @@ namespace('kivi.Order', function(ns) {
     var data = $('#order_form').serializeArray();
     data = data.concat($('[name^="email_form."]').serializeArray());
     data = data.concat($('[name^="print_options."]').serializeArray());
+    data.push({ name: 'order.language_id', value: $('#language_id').val() }); // language from print options
     data.push({ name: 'action', value: 'Order/send_email' });
     $.post("controller.pl", data, kivi.eval_json_result);
   };