From 0bb7eddf83a3bc050ca031fd1176967f614747ce Mon Sep 17 00:00:00 2001
From: Sunnyka <71286632+Sunnyka98@users.noreply.github.com>
Date: Tue, 13 Aug 2024 17:34:28 +0200
Subject: [PATCH 1/4] Add option of comma
---
MailReport/form.json | 11 ++++++---
MailReport/locale.json | 1 +
MailReport/module.php | 47 ++++++++-----------------------------
PDFReportEnergy/form.json | 5 ++++
PDFReportEnergy/locale.json | 3 ++-
PDFReportEnergy/module.php | 11 +++++++++
PDFReportMulti/form.json | 5 ++++
PDFReportMulti/locale.json | 1 +
PDFReportMulti/module.php | 4 +++-
PDFReportSingle/form.json | 5 ++++
PDFReportSingle/locale.json | 1 +
PDFReportSingle/module.php | 8 ++++++-
library.json | 4 ++--
13 files changed, 61 insertions(+), 45 deletions(-)
diff --git a/MailReport/form.json b/MailReport/form.json
index 765e3b3..10b6a8c 100644
--- a/MailReport/form.json
+++ b/MailReport/form.json
@@ -7,10 +7,15 @@
"moduleID": "{375EAF21-35EF-4BC4-83B3-C780FD8BD88A}"
},
{
- "type": "Select",
+ "type": "SelectVariable",
+ "requireLogging": 1,
"name": "Variable",
- "caption": "Aggregated Variable",
- "options": []
+ "caption": "Aggregated Variable"
+ },
+ {
+ "type": "CheckBox",
+ "name": "DecimalSeparator",
+ "caption": "Decimal Separator Comma"
},
{
"type": "Select",
diff --git a/MailReport/locale.json b/MailReport/locale.json
index 9b5cca5..ce52752 100644
--- a/MailReport/locale.json
+++ b/MailReport/locale.json
@@ -25,6 +25,7 @@
"December": "Dezember",
"Mail Report active": "Mail Report aktiv",
"None": "Keine",
+ "Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/mailreport/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/mailreport/"
}
}
diff --git a/MailReport/module.php b/MailReport/module.php
index 63f7f03..6392808 100644
--- a/MailReport/module.php
+++ b/MailReport/module.php
@@ -15,12 +15,13 @@ public function Create()
$this->RegisterPropertyInteger('SMTP', 0);
$this->RegisterPropertyInteger('Variable', 0);
$this->RegisterPropertyInteger('Interval', 1);
+ $this->RegisterPropertyBoolean('DecimalSeparator', true);
$this->RegisterPropertyInteger('ArchiveControlID', IPS_GetInstanceListByModuleID(ARCHIVE_CONTROL_MODULE_ID)[0]);
$this->RegisterVariableBoolean('Active', $this->Translate('Mail Report active'), '~Switch');
$this->EnableAction('Active');
- //Update at next full hour
+ //Update at next full hourF
$this->RegisterTimer('SendTimer', 0, "MR_SendInfo(\$_IPS['TARGET']);");
}
@@ -49,36 +50,6 @@ public function ApplyChanges()
}
}
- public function GetConfigurationForm()
- {
- $form = json_decode(file_get_contents(__DIR__ . '/form.json'));
-
- $variableIndex = $this->GetElementIndexByName('Variable');
-
- $variableOptions = [['label' => $this->Translate('None'), 'value' => 0]];
- foreach (AC_GetAggregationVariables($this->ReadPropertyInteger('ArchiveControlID'), false) as $variable) {
- if ($variable['AggregationActive'] && IPS_ObjectExists($variable['VariableID'])) {
- $variableOptions[] = ['label' => $this->CreateLabel($variable['VariableID']), 'value' => $variable['VariableID']];
- }
- }
-
- $compare = function ($a, $b)
- {
- if ($a['label'] == $b['label']) {
- return 0;
- } elseif ($a['label'] == $this->Translate('None')) {
- return -1;
- } elseif ($b['label'] == $this->Translate('None')) {
- return 1;
- } else {
- return strcmp($a['label'], $b['label']);
- }
- };
- usort($variableOptions, $compare);
- $form->elements[$variableIndex]->options = $variableOptions;
- return json_encode($form);
- }
-
public function RequestAction($Ident, $Value)
{
switch ($Ident) {
@@ -128,14 +99,16 @@ public function SendInfo()
$this->GetAggregationEnd(),
0
);
+ $decimalSeparator = $this->ReadPropertyBoolean('DecimalSeparator') ? ',' : '.';
+ $csvSeparator = $this->ReadPropertyBoolean('DecimalSeparator') ? ';' : ',';
for ($i = count($aggregatedValues) - 1; $i >= 0; $i--) {
$value = $aggregatedValues[$i];
- $dataString = date('j.n.Y H:i:s', $value['TimeStamp']) . ',' .
- number_format($value['Avg'], $digits, '.', '') . ',' .
- date('j.n.Y H:i:s', $value['MinTime']) . ',' .
- number_format($value['Min'], $digits, '.', '') . ',' .
- date('j.n.Y H:i:s', $value['MaxTime']) . ',' .
- number_format($value['Max'], $digits, '.', '') . "\n";
+ $dataString = date('j.n.Y H:i:s', $value['TimeStamp']) . $csvSeparator .
+ number_format($value['Avg'], $digits, $decimalSeparator, '') . $csvSeparator .
+ date('j.n.Y H:i:s', $value['MinTime']) . $csvSeparator .
+ number_format($value['Min'], $digits, $decimalSeparator, '') . $csvSeparator .
+ date('j.n.Y H:i:s', $value['MaxTime']) . $csvSeparator .
+ number_format($value['Max'], $digits, $decimalSeparator, '') . "\n";
fwrite($file, $dataString);
}
diff --git a/PDFReportEnergy/form.json b/PDFReportEnergy/form.json
index c26dbac..1acd8ca 100644
--- a/PDFReportEnergy/form.json
+++ b/PDFReportEnergy/form.json
@@ -19,6 +19,11 @@
"name": "EnergyType",
"value": "Gas"
},
+ {
+ "caption": "Decimal Separator Comma",
+ "type": "CheckBox",
+ "name": "DecimalSeparator"
+ },
{
"type": "SelectVariable",
"caption": "Outside temperature variable (optional)",
diff --git a/PDFReportEnergy/locale.json b/PDFReportEnergy/locale.json
index ce36293..341c7dc 100644
--- a/PDFReportEnergy/locale.json
+++ b/PDFReportEnergy/locale.json
@@ -45,7 +45,8 @@
"Last year you used up %s.": "Im Vorjahr hatten sie einen Verbrauch von %s.",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-energy/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-energie/",
"PDFReportEnergy": "PDFReportEnergie",
- "Report (PDF, Energy)": "Report (PDF, Energie)"
+ "Report (PDF, Energy)": "Report (PDF, Energie)",
+ "Decimal Separator Comma": "Dezimaltrennzeichen Komma"
}
}
}
\ No newline at end of file
diff --git a/PDFReportEnergy/module.php b/PDFReportEnergy/module.php
index 3f94185..736e9d6 100644
--- a/PDFReportEnergy/module.php
+++ b/PDFReportEnergy/module.php
@@ -17,6 +17,7 @@ public function Create()
$this->RegisterPropertyInteger('TemperatureID', 1);
$this->RegisterPropertyInteger('PredictionID', 1);
$this->RegisterPropertyInteger('CO2Type', -1);
+ $this->RegisterPropertyBoolean('DecimalSeparator', true);
$this->RegisterMediaDocument('ReportPDF', $this->Translate('Report (PDF)'), 'pdf');
}
@@ -324,6 +325,16 @@ private function FetchData()
$consumption = GetValueFormattedEx($counterID, $consumption);
}
+ //Format all values if with comma
+ if ($this->ReadPropertyBoolean('DecimalSeparator')) {
+ $consumption = str_replace('.', ',', $consumption);
+ $consumptionLastYear = str_replace('.', ',', $consumptionLastYear);
+ $avgTemp = str_replace('.', ',', $avgTemp);
+ $prediction = str_replace('.', ',', $prediction);
+ $percent = str_replace('.', ',', $percent);
+ $co2 = str_replace('.', ',', '' . $co2);
+ }
+
$data = [
'month' => $month,
'consumption' => $consumption,
diff --git a/PDFReportMulti/form.json b/PDFReportMulti/form.json
index c7740f5..78aa1d1 100644
--- a/PDFReportMulti/form.json
+++ b/PDFReportMulti/form.json
@@ -54,6 +54,11 @@
}
]
},
+ {
+ "caption": "Decimal Separator Comma",
+ "type": "CheckBox",
+ "name": "DecimalSeparator"
+ },
{
"name": "DataAggregation",
"type": "Select",
diff --git a/PDFReportMulti/locale.json b/PDFReportMulti/locale.json
index 1b977ca..17fb890 100644
--- a/PDFReportMulti/locale.json
+++ b/PDFReportMulti/locale.json
@@ -24,6 +24,7 @@
"Skip current unfinished dataset": "Überspringe den aktuellen unvollständigen Datensatz",
"Generate report now!": "Jetzt Report generieren!",
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
+ "Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-multi/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-multi/"
}
}
diff --git a/PDFReportMulti/module.php b/PDFReportMulti/module.php
index e80f364..167d233 100644
--- a/PDFReportMulti/module.php
+++ b/PDFReportMulti/module.php
@@ -20,6 +20,7 @@ public function Create()
$this->RegisterPropertyInteger('DataAggregation', 1);
$this->RegisterPropertyInteger('DataCount', 7);
$this->RegisterPropertyBoolean('DataSkipFirst', true);
+ $this->RegisterPropertyBoolean('DecimalSeparator', true);
$this->RegisterMediaDocument('ReportPDF', $this->Translate('Report (PDF)'), 'pdf');
}
@@ -196,7 +197,8 @@ private function GenerateHTMLRows()
foreach ($json as $data) {
$rows .= '
';
if (isset($values[$data['VariableID']])) {
- $rows .= GetValueFormattedEx($data['VariableID'], $values[$data['VariableID']]);
+ $value = GetValueFormattedEx($data['VariableID'], $values[$data['VariableID']]);
+ $rows .= $this->ReadPropertyBoolean('DecimalSeparator') ? str_replace('.', ',', $value) : $value;
}
$rows .= ' | ';
}
diff --git a/PDFReportSingle/form.json b/PDFReportSingle/form.json
index 5ed3f19..0127540 100644
--- a/PDFReportSingle/form.json
+++ b/PDFReportSingle/form.json
@@ -30,6 +30,11 @@
"name": "DataVariable",
"caption": "Data Source"
},
+ {
+ "caption": "Decimal Separator Comma",
+ "type": "CheckBox",
+ "name": "DecimalSeparator"
+ },
{
"name": "DataAggregation",
"type": "Select",
diff --git a/PDFReportSingle/locale.json b/PDFReportSingle/locale.json
index e6517d1..7eb6936 100644
--- a/PDFReportSingle/locale.json
+++ b/PDFReportSingle/locale.json
@@ -31,6 +31,7 @@
"Data Limit (Min)": "Toleranz (Min)",
"Data Limit (Max)": "Toleranz (Max)",
"Generate report now!": "Jetzt Report generieren!",
+ "Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-single/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-single/"
}
diff --git a/PDFReportSingle/module.php b/PDFReportSingle/module.php
index 5c91261..afeaa3f 100644
--- a/PDFReportSingle/module.php
+++ b/PDFReportSingle/module.php
@@ -17,6 +17,7 @@ public function Create()
$this->RegisterPropertyString('ReportTitle', '');
$this->RegisterPropertyString('ReportFooter', '');
$this->RegisterPropertyInteger('DataVariable', 0);
+ $this->RegisterPropertyBoolean('DecimalSeparator', true);
$this->RegisterPropertyInteger('DataAggregation', 1);
$this->RegisterPropertyInteger('DataCount', 7);
$this->RegisterPropertyBoolean('DataSkipFirst', true);
@@ -198,7 +199,6 @@ private function GenerateHTMLHeader()
private function GenerateHTMLRows()
{
$variableID = $this->ReadPropertyInteger('DataVariable');
-
$rows = '';
foreach ($this->FetchData() as $data) {
$date = date($this->GetDateTimeFormatForAggreagtion(), $data['TimeStamp']);
@@ -206,6 +206,12 @@ private function GenerateHTMLRows()
$max = GetValueFormattedEx($variableID, $data['Max']);
$avg = GetValueFormattedEx($variableID, $data['Avg']);
+ if ($this->ReadPropertyBoolean('DecimalSeparator')) {
+ $min = str_replace('.', ',', $min);
+ $max = str_replace('.', ',', $max);
+ $avg = str_replace('.', ',', $avg);
+ }
+
$status = $this->CheckDataLimit($data['Min'], $data['Max']);
$rows .= <<
Date: Sat, 17 Aug 2024 09:32:23 +0200
Subject: [PATCH 2/4] Checkbox to Select
---
MailReport/form.json | 14 ++++++++++++--
MailReport/locale.json | 3 ++-
MailReport/module.php | 6 +++---
PDFReportEnergy/form.json | 16 +++++++++++++---
PDFReportEnergy/locale.json | 4 +++-
PDFReportEnergy/module.php | 4 ++--
PDFReportMulti/form.json | 19 ++++++++++++++-----
PDFReportMulti/locale.json | 3 ++-
PDFReportMulti/module.php | 4 ++--
PDFReportSingle/form.json | 19 ++++++++++++++-----
PDFReportSingle/locale.json | 3 ++-
PDFReportSingle/module.php | 4 ++--
12 files changed, 71 insertions(+), 28 deletions(-)
diff --git a/MailReport/form.json b/MailReport/form.json
index 10b6a8c..faa2919 100644
--- a/MailReport/form.json
+++ b/MailReport/form.json
@@ -13,9 +13,19 @@
"caption": "Aggregated Variable"
},
{
- "type": "CheckBox",
+ "type": "Select",
+ "caption": "Decimal Separator",
"name": "DecimalSeparator",
- "caption": "Decimal Separator Comma"
+ "options": [
+ {
+ "caption": "Comma",
+ "value": ","
+ },
+ {
+ "caption": "Dot",
+ "value": "."
+ }
+ ]
},
{
"type": "Select",
diff --git a/MailReport/locale.json b/MailReport/locale.json
index ce52752..33c438b 100644
--- a/MailReport/locale.json
+++ b/MailReport/locale.json
@@ -27,6 +27,7 @@
"None": "Keine",
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/mailreport/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/mailreport/"
- }
+ , "Dot": "Punkt",
+ "Comma": "Komma" }
}
}
\ No newline at end of file
diff --git a/MailReport/module.php b/MailReport/module.php
index 6392808..be37bd8 100644
--- a/MailReport/module.php
+++ b/MailReport/module.php
@@ -15,7 +15,7 @@ public function Create()
$this->RegisterPropertyInteger('SMTP', 0);
$this->RegisterPropertyInteger('Variable', 0);
$this->RegisterPropertyInteger('Interval', 1);
- $this->RegisterPropertyBoolean('DecimalSeparator', true);
+ $this->RegisterPropertyString('DecimalSeparator', ',');
$this->RegisterPropertyInteger('ArchiveControlID', IPS_GetInstanceListByModuleID(ARCHIVE_CONTROL_MODULE_ID)[0]);
$this->RegisterVariableBoolean('Active', $this->Translate('Mail Report active'), '~Switch');
@@ -99,8 +99,8 @@ public function SendInfo()
$this->GetAggregationEnd(),
0
);
- $decimalSeparator = $this->ReadPropertyBoolean('DecimalSeparator') ? ',' : '.';
- $csvSeparator = $this->ReadPropertyBoolean('DecimalSeparator') ? ';' : ',';
+ $decimalSeparator = $this->ReadPropertyString('DecimalSeparator');
+ $csvSeparator = $decimalSeparator == ',' ? ';' : ',';
for ($i = count($aggregatedValues) - 1; $i >= 0; $i--) {
$value = $aggregatedValues[$i];
$dataString = date('j.n.Y H:i:s', $value['TimeStamp']) . $csvSeparator .
diff --git a/PDFReportEnergy/form.json b/PDFReportEnergy/form.json
index 1acd8ca..bc18565 100644
--- a/PDFReportEnergy/form.json
+++ b/PDFReportEnergy/form.json
@@ -20,9 +20,19 @@
"value": "Gas"
},
{
- "caption": "Decimal Separator Comma",
- "type": "CheckBox",
- "name": "DecimalSeparator"
+ "type": "Select",
+ "caption": "Decimal Separator",
+ "name": "DecimalSeparator",
+ "options": [
+ {
+ "caption": "Comma",
+ "value": ","
+ },
+ {
+ "caption": "Dot",
+ "value": "."
+ }
+ ]
},
{
"type": "SelectVariable",
diff --git a/PDFReportEnergy/locale.json b/PDFReportEnergy/locale.json
index 341c7dc..83d83f0 100644
--- a/PDFReportEnergy/locale.json
+++ b/PDFReportEnergy/locale.json
@@ -46,7 +46,9 @@
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-energy/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-energie/",
"PDFReportEnergy": "PDFReportEnergie",
"Report (PDF, Energy)": "Report (PDF, Energie)",
- "Decimal Separator Comma": "Dezimaltrennzeichen Komma"
+ "Decimal Separator Comma": "Dezimaltrennzeichen",
+ "Dot": "Punkt",
+ "Comma": "Komma"
}
}
}
\ No newline at end of file
diff --git a/PDFReportEnergy/module.php b/PDFReportEnergy/module.php
index 736e9d6..4588909 100644
--- a/PDFReportEnergy/module.php
+++ b/PDFReportEnergy/module.php
@@ -17,7 +17,7 @@ public function Create()
$this->RegisterPropertyInteger('TemperatureID', 1);
$this->RegisterPropertyInteger('PredictionID', 1);
$this->RegisterPropertyInteger('CO2Type', -1);
- $this->RegisterPropertyBoolean('DecimalSeparator', true);
+ $this->RegisterPropertyString('DecimalSeparator', ',');
$this->RegisterMediaDocument('ReportPDF', $this->Translate('Report (PDF)'), 'pdf');
}
@@ -326,7 +326,7 @@ private function FetchData()
}
//Format all values if with comma
- if ($this->ReadPropertyBoolean('DecimalSeparator')) {
+ if ($this->ReadPropertyString('DecimalSeparator') == ',') {
$consumption = str_replace('.', ',', $consumption);
$consumptionLastYear = str_replace('.', ',', $consumptionLastYear);
$avgTemp = str_replace('.', ',', $avgTemp);
diff --git a/PDFReportMulti/form.json b/PDFReportMulti/form.json
index 78aa1d1..59dd505 100644
--- a/PDFReportMulti/form.json
+++ b/PDFReportMulti/form.json
@@ -53,11 +53,20 @@
}
}
]
- },
- {
- "caption": "Decimal Separator Comma",
- "type": "CheckBox",
- "name": "DecimalSeparator"
+ },{
+ "type": "Select",
+ "caption": "Decimal Separator",
+ "name": "DecimalSeparator",
+ "options": [
+ {
+ "caption": "Comma",
+ "value": ","
+ },
+ {
+ "caption": "Dot",
+ "value": "."
+ }
+ ]
},
{
"name": "DataAggregation",
diff --git a/PDFReportMulti/locale.json b/PDFReportMulti/locale.json
index 17fb890..bd223ad 100644
--- a/PDFReportMulti/locale.json
+++ b/PDFReportMulti/locale.json
@@ -26,6 +26,7 @@
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-multi/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-multi/"
- }
+ , "Dot": "Punkt",
+ "Comma": "Komma"}
}
}
\ No newline at end of file
diff --git a/PDFReportMulti/module.php b/PDFReportMulti/module.php
index 167d233..9360a6d 100644
--- a/PDFReportMulti/module.php
+++ b/PDFReportMulti/module.php
@@ -20,7 +20,7 @@ public function Create()
$this->RegisterPropertyInteger('DataAggregation', 1);
$this->RegisterPropertyInteger('DataCount', 7);
$this->RegisterPropertyBoolean('DataSkipFirst', true);
- $this->RegisterPropertyBoolean('DecimalSeparator', true);
+ $this->RegisterPropertyString('DecimalSeparator', ',');
$this->RegisterMediaDocument('ReportPDF', $this->Translate('Report (PDF)'), 'pdf');
}
@@ -198,7 +198,7 @@ private function GenerateHTMLRows()
$rows .= '';
if (isset($values[$data['VariableID']])) {
$value = GetValueFormattedEx($data['VariableID'], $values[$data['VariableID']]);
- $rows .= $this->ReadPropertyBoolean('DecimalSeparator') ? str_replace('.', ',', $value) : $value;
+ $rows .= $this->ReadPropertyString('DecimalSeparator') == ',' ? str_replace('.', ',', $value) : $value;
}
$rows .= ' | ';
}
diff --git a/PDFReportSingle/form.json b/PDFReportSingle/form.json
index 0127540..dab07c6 100644
--- a/PDFReportSingle/form.json
+++ b/PDFReportSingle/form.json
@@ -29,11 +29,20 @@
"type": "SelectVariable",
"name": "DataVariable",
"caption": "Data Source"
- },
- {
- "caption": "Decimal Separator Comma",
- "type": "CheckBox",
- "name": "DecimalSeparator"
+ },{
+ "type": "Select",
+ "caption": "Decimal Separator",
+ "name": "DecimalSeparator",
+ "options": [
+ {
+ "caption": "Comma",
+ "value": ","
+ },
+ {
+ "caption": "Dot",
+ "value": "."
+ }
+ ]
},
{
"name": "DataAggregation",
diff --git a/PDFReportSingle/locale.json b/PDFReportSingle/locale.json
index 7eb6936..c53af6a 100644
--- a/PDFReportSingle/locale.json
+++ b/PDFReportSingle/locale.json
@@ -34,6 +34,7 @@
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-single/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-single/"
- }
+ , "Dot": "Punkt",
+ "Comma": "Komma"}
}
}
\ No newline at end of file
diff --git a/PDFReportSingle/module.php b/PDFReportSingle/module.php
index afeaa3f..7eedaeb 100644
--- a/PDFReportSingle/module.php
+++ b/PDFReportSingle/module.php
@@ -17,7 +17,7 @@ public function Create()
$this->RegisterPropertyString('ReportTitle', '');
$this->RegisterPropertyString('ReportFooter', '');
$this->RegisterPropertyInteger('DataVariable', 0);
- $this->RegisterPropertyBoolean('DecimalSeparator', true);
+ $this->RegisterPropertyString('DecimalSeparator', ',');
$this->RegisterPropertyInteger('DataAggregation', 1);
$this->RegisterPropertyInteger('DataCount', 7);
$this->RegisterPropertyBoolean('DataSkipFirst', true);
@@ -206,7 +206,7 @@ private function GenerateHTMLRows()
$max = GetValueFormattedEx($variableID, $data['Max']);
$avg = GetValueFormattedEx($variableID, $data['Avg']);
- if ($this->ReadPropertyBoolean('DecimalSeparator')) {
+ if ($this->ReadPropertyString('DecimalSeparator') == ',') {
$min = str_replace('.', ',', $min);
$max = str_replace('.', ',', $max);
$avg = str_replace('.', ',', $avg);
From bb4748cd24d357092c918f5042ea49d61676ad47 Mon Sep 17 00:00:00 2001
From: Sunnyka <71286632+Sunnyka98@users.noreply.github.com>
Date: Sat, 17 Aug 2024 09:33:12 +0200
Subject: [PATCH 3/4] :cookie: fix style
---
MailReport/locale.json | 7 ++++---
PDFReportEnergy/locale.json | 2 +-
PDFReportMulti/form.json | 3 ++-
PDFReportMulti/locale.json | 7 ++++---
PDFReportSingle/form.json | 3 ++-
PDFReportSingle/locale.json | 7 ++++---
6 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/MailReport/locale.json b/MailReport/locale.json
index 33c438b..1992a54 100644
--- a/MailReport/locale.json
+++ b/MailReport/locale.json
@@ -26,8 +26,9 @@
"Mail Report active": "Mail Report aktiv",
"None": "Keine",
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
- "https://www.symcon.de/en/service/documentation/module-reference/symconreport/mailreport/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/mailreport/"
- , "Dot": "Punkt",
- "Comma": "Komma" }
+ "https://www.symcon.de/en/service/documentation/module-reference/symconreport/mailreport/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/mailreport/",
+ "Dot": "Punkt",
+ "Comma": "Komma"
+ }
}
}
\ No newline at end of file
diff --git a/PDFReportEnergy/locale.json b/PDFReportEnergy/locale.json
index 83d83f0..b7aadf2 100644
--- a/PDFReportEnergy/locale.json
+++ b/PDFReportEnergy/locale.json
@@ -47,7 +47,7 @@
"PDFReportEnergy": "PDFReportEnergie",
"Report (PDF, Energy)": "Report (PDF, Energie)",
"Decimal Separator Comma": "Dezimaltrennzeichen",
- "Dot": "Punkt",
+ "Dot": "Punkt",
"Comma": "Komma"
}
}
diff --git a/PDFReportMulti/form.json b/PDFReportMulti/form.json
index 59dd505..7d6fc71 100644
--- a/PDFReportMulti/form.json
+++ b/PDFReportMulti/form.json
@@ -53,7 +53,8 @@
}
}
]
- },{
+ },
+ {
"type": "Select",
"caption": "Decimal Separator",
"name": "DecimalSeparator",
diff --git a/PDFReportMulti/locale.json b/PDFReportMulti/locale.json
index bd223ad..0127885 100644
--- a/PDFReportMulti/locale.json
+++ b/PDFReportMulti/locale.json
@@ -25,8 +25,9 @@
"Generate report now!": "Jetzt Report generieren!",
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
- "https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-multi/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-multi/"
- , "Dot": "Punkt",
- "Comma": "Komma"}
+ "https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-multi/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-multi/",
+ "Dot": "Punkt",
+ "Comma": "Komma"
+ }
}
}
\ No newline at end of file
diff --git a/PDFReportSingle/form.json b/PDFReportSingle/form.json
index dab07c6..48f63cd 100644
--- a/PDFReportSingle/form.json
+++ b/PDFReportSingle/form.json
@@ -29,7 +29,8 @@
"type": "SelectVariable",
"name": "DataVariable",
"caption": "Data Source"
- },{
+ },
+ {
"type": "Select",
"caption": "Decimal Separator",
"name": "DecimalSeparator",
diff --git a/PDFReportSingle/locale.json b/PDFReportSingle/locale.json
index c53af6a..7437c97 100644
--- a/PDFReportSingle/locale.json
+++ b/PDFReportSingle/locale.json
@@ -33,8 +33,9 @@
"Generate report now!": "Jetzt Report generieren!",
"Decimal Separator Comma": "Dezimaltrennzeichen Komma",
"Done! Please open the media file beneath this instance!": "Fertig! Bitte öffnen Sie die Mediendatei unterhalb der Instanz!",
- "https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-single/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-single/"
- , "Dot": "Punkt",
- "Comma": "Komma"}
+ "https://www.symcon.de/en/service/documentation/module-reference/symconreport/pdfreport-single/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/pdfreport-single/",
+ "Dot": "Punkt",
+ "Comma": "Komma"
+ }
}
}
\ No newline at end of file
From 2d42dea4de30ce526f042e294b79b166e061e511 Mon Sep 17 00:00:00 2001
From: Sunnyka <71286632+Sunnyka98@users.noreply.github.com>
Date: Mon, 26 Aug 2024 09:41:29 +0200
Subject: [PATCH 4/4] fix translation and typo
---
MailReport/locale.json | 2 +-
MailReport/module.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/MailReport/locale.json b/MailReport/locale.json
index 1992a54..11d728e 100644
--- a/MailReport/locale.json
+++ b/MailReport/locale.json
@@ -25,7 +25,7 @@
"December": "Dezember",
"Mail Report active": "Mail Report aktiv",
"None": "Keine",
- "Decimal Separator Comma": "Dezimaltrennzeichen Komma",
+ "Decimal Separator": "Dezimaltrennzeichen",
"https://www.symcon.de/en/service/documentation/module-reference/symconreport/mailreport/": "https://www.symcon.de/de/service/dokumentation/modulreferenz/symconreport/mailreport/",
"Dot": "Punkt",
"Comma": "Komma"
diff --git a/MailReport/module.php b/MailReport/module.php
index be37bd8..5bb18ea 100644
--- a/MailReport/module.php
+++ b/MailReport/module.php
@@ -21,7 +21,7 @@ public function Create()
$this->RegisterVariableBoolean('Active', $this->Translate('Mail Report active'), '~Switch');
$this->EnableAction('Active');
- //Update at next full hourF
+ //Update at next full hour
$this->RegisterTimer('SendTimer', 0, "MR_SendInfo(\$_IPS['TARGET']);");
}