X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgenerictranslations.pl;h=7b8d4a196a8d4f9358ca667ed9965d143f08fd82;hb=refs%2Fheads%2Forder_controller;hp=385ce80947c06ace3969c204635113ff253817b1;hpb=429203bfb57dd673aa807d749ab43c8e3332f8c8;p=kivitendo-erp.git diff --git a/bin/mozilla/generictranslations.pl b/bin/mozilla/generictranslations.pl index 385ce8094..7b8d4a196 100644 --- a/bin/mozilla/generictranslations.pl +++ b/bin/mozilla/generictranslations.pl @@ -71,4 +71,56 @@ sub save_greetings { $main::lxdebug->leave_sub(); } +sub edit_sepa_strings { + $main::lxdebug->enter_sub(); + + $main::auth->assert('config'); + + my $form = $main::form; + my $locale = $main::locale; + + $form->get_lists('languages' => 'LANGUAGES'); + + my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx'); + my %translations = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list }; + + unshift @{ $form->{LANGUAGES} }, { 'id' => 'default', }; + + foreach my $language (@{ $form->{LANGUAGES} }) { + $language->{translation} = $translations{$language->{id}}; + } + + $form->{title} = $locale->text('Edit SEPA strings'); + $form->header(); + print $form->parse_html_template('generictranslations/edit_sepa_strings'); + + $main::lxdebug->leave_sub(); +} + +sub save_sepa_strings { + $main::lxdebug->enter_sub(); + + $main::auth->assert('config'); + + my $form = $main::form; + my $locale = $main::locale; + + $form->get_lists('languages' => 'LANGUAGES'); + + unshift @{ $form->{LANGUAGES} }, { }; + + foreach my $language (@{ $form->{LANGUAGES} }) { + GenericTranslations->save('translation_type' => 'sepa_remittance_info_pfx', + 'translation_id' => undef, + 'language_id' => $language->{id}, + 'translation' => $form->{"translation__" . ($language->{id} || 'default')},); + } + + $form->{message} = $locale->text('The SEPA strings have been saved.'); + + edit_sepa_strings(); + + $main::lxdebug->leave_sub(); +} + 1;