no message
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"elements": [
|
||||
{ "type": "ValidationTextBox", "name": "kunde", "caption": "Kundenname" },
|
||||
{ "type": "ValidationTextBox", "name": "URL", "caption": "Solcast URL" },
|
||||
{ "type": "SelectVariable", "name": "ActualVariableID", "caption": "Ist-Produktion Variable (Leistung)" },
|
||||
{ "type": "CheckBox", "name": "ActualIsWatt", "caption": "Istwerte sind in Watt (in kW umrechnen)" },
|
||||
|
||||
@@ -11,6 +11,7 @@ class PV_Forecast_plotmemory extends IPSModule
|
||||
|
||||
// Core
|
||||
$this->RegisterPropertyString("URL", "");
|
||||
$this->RegisterPropertyString("kunde", "");
|
||||
$this->RegisterPropertyInteger("ActualVariableID", 0);
|
||||
$this->RegisterPropertyBoolean("ActualIsWatt", true);
|
||||
|
||||
@@ -553,9 +554,22 @@ class PV_Forecast_plotmemory extends IPSModule
|
||||
echo "No snapshots found";
|
||||
return;
|
||||
}
|
||||
$kunde = trim($this->ReadPropertyString("kunde"));
|
||||
$kunde = trim($this->ReadPropertyString("kunde"));
|
||||
if ($kunde === "") {
|
||||
$kunde = "unbekannt";
|
||||
}
|
||||
|
||||
// Sonderzeichen entfernen (für Dateinamen!)
|
||||
$kundeSafe = preg_replace('/[^a-zA-Z0-9_-]/', '_', $kunde);
|
||||
|
||||
header("Content-Type: application/zip");
|
||||
header('Content-Disposition: attachment; filename="pv_plots_' . $this->InstanceID . '_' . $days . 'days.zip"');
|
||||
header(
|
||||
'Content-Disposition: attachment; filename="pv_plots_' .
|
||||
$kundeSafe . '_' .
|
||||
$this->InstanceID . '_' .
|
||||
$days . 'days.zip"'
|
||||
);
|
||||
header("Content-Length: " . filesize($zipPath));
|
||||
|
||||
readfile($zipPath);
|
||||
|
||||
Reference in New Issue
Block a user