X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgenerictranslations.pl;h=5d945566f486cf1021de294627a35a0b932edacf;hb=7ed3358a378888281b3ccfa5bba9e877145654e0;hp=7b8d4a196a8d4f9358ca667ed9965d143f08fd82;hpb=57463eed482c9f107a6bb35d8b24d666175570a3;p=kivitendo-erp.git diff --git a/bin/mozilla/generictranslations.pl b/bin/mozilla/generictranslations.pl index 7b8d4a196..5d945566f 100644 --- a/bin/mozilla/generictranslations.pl +++ b/bin/mozilla/generictranslations.pl @@ -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;