use strict;
+# convention:
+# preset_text_$formname will generate a input textarea
+# and will be preset in $form email dialog if the form name matches
+
+my %mail_strings = (
+ salutation_male => t8('Salutation male'),
+ salutation_female => t8('Salutation female'),
+ salutation_general => t8('Salutation general'),
+ salutation_punctuation_mark => t8('Salutation punctuation mark'),
+ preset_text_sales_quotation => t8('Preset email text for sales quotations'),
+ preset_text_sales_order => t8('Preset email text for sales orders'),
+ preset_text_sales_delivery_order => t8('Preset email text for sales delivery orders'),
+ preset_text_invoice => t8('Preset email text for sales invoices'),
+ preset_text_request_quotation => t8('Preset email text for requests (rfq)'),
+ preset_text_purchase_order => t8('Preset email text for purchase orders'),
+);
+
sub edit_greetings {
$main::lxdebug->enter_sub();
$main::lxdebug->leave_sub();
}
+sub edit_email_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} }, { 'id' => 'default', };
+
+ my (%translations, $translation_list);
+ foreach (keys %mail_strings) {
+ $translation_list = GenericTranslations->list(translation_type => $_);
+ %translations = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list };
+
+ foreach my $language (@{ $form->{LANGUAGES} }) {
+ $language->{$_} = $translations{$language->{id}};
+ }
+ }
+ setup_generictranslations_edit_email_strings_action_bar();
+
+ $form->{title} = $locale->text('Edit preset email strings');
+ $form->header();
+ print $form->parse_html_template('generictranslations/edit_email_strings',{ 'MAIL_STRINGS' => \%mail_strings });
+
+ $main::lxdebug->leave_sub();
+}
+
+sub save_email_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} }) {
+ foreach (keys %mail_strings) {
+ GenericTranslations->save('translation_type' => $_,
+ 'translation_id' => undef,
+ 'language_id' => $language->{id},
+ 'translation' => $form->{"translation__" . ($language->{id} || 'default') . "__" . $_},
+ );
+ }
+ }
+ $form->{message} = $locale->text('The Mail strings have been saved.');
+
+ edit_email_strings();
+
+ $main::lxdebug->leave_sub();
+}
sub setup_generictranslations_edit_greetings_action_bar {
my %params = @_;
);
}
}
+sub setup_generictranslations_edit_email_strings_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => "save_email_strings" } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
1;
- SEPA-XML: alle Sonderzeichen filtern
- SEPA-Export: Export wieder rückgängig machen, falls noch Status offen
- Stammdaten -> Berichte -> Artikel: Standardlager und Lagerplatz optional anzeigen
+ - Vorbelegte Texte inkl. Ansprechpartner für den E-Mail-Versand bei allen Workflows hinzugefügt.
2017-07-17 - Release 3.5.0
'Edit payment term' => 'Zahlungsbedingungen bearbeiten',
'Edit picture' => 'Bild bearbeiten',
'Edit pre-defined text' => 'Vordefinierten Textblock bearbeiten',
+ 'Edit preset email strings' => 'Vorbelegte Texte für E-Mails editieren',
'Edit price rule' => 'Preisregel bearbeiten',
'Edit pricegroup' => 'Preisgruppe bearbeiten',
'Edit prices and discount (if not used, textfield is ONLY set readonly)' => 'Preise und Rabatt in Formularen frei anpassen (falls deaktiviert, wird allerdings NUR das textfield auf READONLY gesetzt / kann je nach Browserversion und technischen Fähigkeiten des Anwenders noch umgangen werden)',
'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten',
'Prepare bank transfer via SEPA XML' => 'Überweisung via SEPA XML vorbereiten',
'Prepayment' => 'Vorauszahlung',
+ 'Preset email strings' => 'Vorbelegte E-Mail-Texte',
+ 'Preset email text for purchase orders' => 'Vorbelegter E-Mail-Text für Einkaufsaufträge',
+ 'Preset email text for requests (rfq)' => 'Vorbelegter E-Mail-Text für Anfragen',
+ 'Preset email text for sales delivery orders' => 'Vorbelegter E-Mail-Text für Verkaufs-Lieferscheine',
+ 'Preset email text for sales invoices' => 'Vorbelegter E-Mail-Text für Rechnungen',
+ 'Preset email text for sales orders' => 'Vorbelegter E-Mail-Text für Aufträge',
+ 'Preset email text for sales quotations' => 'Vorbelegter E-Mail-Text für Angebote',
'Preview' => 'Vorschau',
'Preview Mode' => 'Vorschaumodus',
'Previous transdate text' => 'wurde gespeichert am',
'Sales quotation #1 has been deleted.' => 'Angebot #1 wurde gelöscht.',
'Sales quotation #1 has been updated.' => 'Angebot #1 wurde aktualisiert.',
'Salesman' => 'Verkäufer/in',
- 'Salesman (ID)' => 'Verkäufer/in (ID)',
'Salesman (database ID)' => 'Verkäufer/in (Datenbank-ID)',
'Salesman (login)' => 'Verkäufer/in (Login)',
'Salesperson' => 'Verkäufer',
+ 'Salutation female' => 'Anrede weiblich',
+ 'Salutation general' => 'Anrede anonym (personenlos)',
+ 'Salutation male' => 'Anrede männlich',
+ 'Salutation punctuation mark' => 'Zeichensetzungs-Trenner nach der Anrede-Formel (Punkt, Ausrufezeichen, etc)',
'Same Filename !' => 'unveränderter Dateiname !',
'Same as the quote character' => 'Wie Anführungszeichen',
'Sat. Fax' => 'Sat. Fax',
'The ID #1 is not a valid database ID.' => 'Die ID #1 ist keine gültige Datenbank-ID.',
'The LDAP server "#1:#2" is unreachable. Please check config/kivitendo.conf.' => 'Der LDAP-Server "#1:#2" ist nicht erreichbar. Bitte überprüfen Sie die Angaben in config/kivitendo.conf.',
'The MT940 import needs an import profile called MT940' => 'Der MT940 Import benötigt ein Importprofil mit dem Namen "MT940"',
+ 'The Mail strings have been saved.' => 'Die vorbelegten E-Mail-Texte wurden gespeichert.',
'The PDF has been created' => 'Die PDF-Datei wurde erstellt.',
'The PDF has been printed' => 'Das PDF-Dokument wurde gedruckt.',
'The SEPA export has been created.' => 'Der SEPA-Export wurde erstellt',
module: generictranslations.pl
params:
action: edit_sepa_strings
+- parent: system_languages_and_translations
+ id: system_languages_and_translations_email_strings
+ name: Preset email strings
+ order: 500
+ module: generictranslations.pl
+ params:
+ action: edit_email_strings
- parent: system
id: system_payment_terms
name: Payment Terms
--- /dev/null
+[%- USE T8 %]
+[%- USE HTML %]
+<h1>[% HTML.escape(title) %]</h1>
+[%- IF message %]
+ <p>
+ [% HTML.escape(message) %]
+ </p>
+[%- END %]
+ <form method="post" action="generictranslations.pl" id="form">
+ <table>
+ [%- FOREACH mail_string IN MAIL_STRINGS.keys.sort %]
+ <tr>
+ <th class="listheading"> </th>
+ <th class="listheading">[% MAIL_STRINGS.$mail_string %]</th>
+ </tr>
+
+ [%- FOREACH language = LANGUAGES %]
+ <tr>
+ <td>
+ [%- IF language.id == 'default' %]
+ [% 'Default (no language selected)' | $T8 %]
+ [%- ELSE %]
+ [%- HTML.escape(language.description) %]
+ [%- END %]
+ </td>
+ <td>
+ [%- IF mail_string.search('preset') %]
+ <textarea name="translation__[% language.id %]__[% mail_string %]" rows="4" cols="60">[% HTML.escape(language.$mail_string) %]</textarea>
+ [%- ELSE %]
+ <input name="translation__[% language.id %]__[% mail_string %]" size="40" value="[% HTML.escape(language.$mail_string) %]">
+ [%- END %]
+ </td>
+ </tr>
+ [%- END %]
+ [%- END %]
+ </table>
+ </form>