From 6f2050063ffa5417ab4495af84625385c766bc2d Mon Sep 17 00:00:00 2001
From: Moritz Bunkus
Date: Mon, 21 Jan 2008 08:46:54 +0000
Subject: [PATCH] =?utf8?q?=C3=9Cbergabe=20des=20Templates=20an=20den=20Rep?=
=?utf8?q?ortGenerator=20nicht=20=C3=BCber=20$form,=20sondern=20=C3=BCber?=
=?utf8?q?=20ReportGenerator::set=5Foptions().?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
---
SL/ReportGenerator.pm | 16 ++++++++++------
bin/mozilla/rp.pl | 7 +++++--
locale/de/all | 4 ++--
locale/de/rp | 2 +-
.../html_report_susa_de.html | 2 +-
.../html_report_susa_master.html | 0
6 files changed, 19 insertions(+), 12 deletions(-)
rename templates/webpages/{report_generator => rp}/html_report_susa_de.html (98%)
rename templates/webpages/{report_generator => rp}/html_report_susa_master.html (100%)
diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm
index 648ea1dd5..23dd50821 100644
--- a/SL/ReportGenerator.pm
+++ b/SL/ReportGenerator.pm
@@ -7,6 +7,10 @@ use Text::Iconv;
use SL::Form;
+# Cause locales.pl to parse these files:
+# parse_html_template('report_generator/html_report')
+# parse_html_template('report_generator/pdf_report')
+
sub new {
my $type = shift;
@@ -21,6 +25,8 @@ sub new {
'output_format' => 'HTML',
'allow_pdf_export' => 1,
'allow_csv_export' => 1,
+ 'html_template' => 'report_generator/html_report',
+ 'pdf_template' => 'report_generator/pdf_report',
'pdf_export' => {
'paper_size' => 'A4',
'orientation' => 'landscape',
@@ -390,9 +396,8 @@ sub prepare_html_content {
sub generate_html_content {
my $self = shift;
my $variables = $self->prepare_html_content();
- my $report_template = $self->{form}->{report_template} ? $self->{form}->{report_template} : 'report_generator/html_report';
- # $form->parse_html_template('report_generator/html_report', $variables));
- return $self->{form}->parse_html_template($report_template, $variables);
+
+ return $self->{form}->parse_html_template($self->{options}->{html_template}, $variables);
}
sub verify_paper_size {
@@ -411,7 +416,6 @@ sub generate_pdf_content {
my $form = $self->{form};
my $myconfig = $self->{myconfig};
my $opt = $self->{options}->{pdf_export};
- my $report_template = $form->{report_template} ? $form->{report_template} : 'report_generator/pdf_report';
my $opt_number = $opt->{number} ? 'number : 1' : '';
my $opt_landscape = $opt->{orientation} eq 'landscape' ? 'landscape : 1' : '';
@@ -468,8 +472,8 @@ END
unlink $cfg_file_name;
$form->error($locale->text('Could not write the temporary HTML file.'));
}
- # $form->parse_html_template('report_generator/pdf_report', $variables));
- $html_file->print($form->parse_html_template($report_template, $variables));
+
+ $html_file->print($form->parse_html_template($self->{options}->{pdf_template}, $variables));
$html_file->close();
my $cmdline =
diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl
index 7fef683c3..c23abeb59 100644
--- a/bin/mozilla/rp.pl
+++ b/bin/mozilla/rp.pl
@@ -91,6 +91,8 @@ require "bin/mozilla/reportgenerator.pl";
# $locale->text('Non-taxable Sales')
# $locale->text('Non-taxable Purchases')
+# $form->parse_html_template('rp/html_report_susa')
+
my $rp_access_map = {
'projects' => 'report',
'ar_aging' => 'general_ledger',
@@ -1417,10 +1419,11 @@ sub generate_trial_balance {
$report->set_options('output_format' => 'HTML',
'title' => $form->{title},
'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time),
+ 'html_template' => 'report_generator/html_report_susa',
+ 'pdf_template' => 'report_generator/html_report_susa',
);
$report->set_options_from_form();
- # $form->parse_html_template('report_generator/html_report_susa', $variables));
- $form->{report_template} = 'report_generator/html_report_susa';
+
# add sort and escape callback, this one we use for the add sub
$form->{callback} = $href .= "&sort=$form->{sort}";
diff --git a/locale/de/all b/locale/de/all
index 68feab4ce..04b2a5ac5 100644
--- a/locale/de/all
+++ b/locale/de/all
@@ -148,7 +148,7 @@ $self->{texts} = {
'Advance turnover tax return' => 'Umsatzsteuervoranmeldung',
'Aktion' => 'Aktion',
'All' => 'Alle',
- 'All Accounts' => '',
+ 'All Accounts' => 'Alle Konten',
'All Datasets up to date!' => 'Alle Datenbanken sind auf aktuellem Stand.',
'All changes in that file have been reverted.' => 'Alle Änderungen in dieser Datei wurden rückgängig gemacht.',
'All database upgrades have been applied.' => 'Alle Datenbankupdates wurden eingespielt.',
@@ -911,7 +911,7 @@ aktualisieren wollen?',
'No backup file has been uploaded.' => 'Es wurde keine Sicherungsdatei hochgeladen.',
'No bins have been added to this warehouse yet.' => 'Es wurden zu diesem Lager noch keine Lagerplätze angelegt.',
'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
- 'No data was found.' => 'Keine Daten gefunden',
+ 'No data was found.' => 'Es wurden keine Daten gefunden.',
'No databases have been found on this server.' => 'Auf diesem Server wurden keine Datenbanken gefunden.',
'No datasets have been selected.' => 'Es wurden keine Datenbanken ausgewählt.',
'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.',
diff --git a/locale/de/rp b/locale/de/rp
index 32149f784..14d1cf148 100644
--- a/locale/de/rp
+++ b/locale/de/rp
@@ -11,7 +11,7 @@ $self->{texts} = {
'Accrual' => 'Bilanzierung',
'Address' => 'Adresse',
'Advance turnover tax return' => 'Umsatzsteuervoranmeldung',
- 'All Accounts' => 'All Accounts',
+ 'All Accounts' => 'Alle Konten',
'All reports' => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)',
'Amount' => 'Betrag',
'Apr' => 'Apr',
diff --git a/templates/webpages/report_generator/html_report_susa_de.html b/templates/webpages/rp/html_report_susa_de.html
similarity index 98%
rename from templates/webpages/report_generator/html_report_susa_de.html
rename to templates/webpages/rp/html_report_susa_de.html
index fd72a837d..6b634469f 100644
--- a/templates/webpages/report_generator/html_report_susa_de.html
+++ b/templates/webpages/rp/html_report_susa_de.html
@@ -90,7 +90,7 @@
[% ELSE %]
- Keine Daten gefunden
+ Es wurden keine Daten gefunden.
[% END %]
[% RAW_BOTTOM_INFO_TEXT %]
diff --git a/templates/webpages/report_generator/html_report_susa_master.html b/templates/webpages/rp/html_report_susa_master.html
similarity index 100%
rename from templates/webpages/report_generator/html_report_susa_master.html
rename to templates/webpages/rp/html_report_susa_master.html
--
2.20.1