Fix für: Einlagern über Einkauslieferschein macht keine action
[kivitendo-erp.git] / bin / mozilla / generictranslations.pl
index 7b8d4a1..5d94556 100644 (file)
@@ -1,6 +1,7 @@
 use SL::Auth;
 use SL::Form;
 use SL::GenericTranslations;
+use SL::Locale::String qw(t8);
 
 use strict;
 
@@ -34,6 +35,8 @@ sub edit_greetings {
     }
   }
 
+  setup_generictranslations_edit_greetings_action_bar();
+
   $form->{title} = $locale->text('Edit greetings');
   $form->header();
   print $form->parse_html_template('generictranslations/edit_greetings');
@@ -84,12 +87,18 @@ sub edit_sepa_strings {
   my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx');
   my %translations     = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list };
 
+  my $translation_list_vc = GenericTranslations->list(translation_type => 'sepa_remittance_vc_no_pfx');
+  my %translations_vc     =  map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list_vc };
+
   unshift @{ $form->{LANGUAGES} }, { 'id' => 'default', };
 
   foreach my $language (@{ $form->{LANGUAGES} }) {
-    $language->{translation} = $translations{$language->{id}};
+    $language->{translation}    = $translations{$language->{id}};
+    $language->{translation_vc} = $translations_vc{$language->{id}};
   }
 
+  setup_generictranslations_edit_sepa_strings_action_bar();
+
   $form->{title} = $locale->text('Edit SEPA strings');
   $form->header();
   print $form->parse_html_template('generictranslations/edit_sepa_strings');
@@ -114,6 +123,10 @@ sub save_sepa_strings {
                               'translation_id'   => undef,
                               'language_id'      => $language->{id},
                               'translation'      => $form->{"translation__" . ($language->{id} || 'default')},);
+    GenericTranslations->save('translation_type' => 'sepa_remittance_vc_no_pfx',
+                              'translation_id'   => undef,
+                              'language_id'      => $language->{id},
+                              'translation'      => $form->{"translation__" . ($language->{id} || 'default') . "__vc" },);
   }
 
   $form->{message} = $locale->text('The SEPA strings have been saved.');
@@ -123,4 +136,32 @@ sub save_sepa_strings {
   $main::lxdebug->leave_sub();
 }
 
+sub setup_generictranslations_edit_greetings_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Save'),
+        submit    => [ '#form', { action => "save_greetings" } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
+sub setup_generictranslations_edit_sepa_strings_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Save'),
+        submit    => [ '#form', { action => "save_sepa_strings" } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
 1;