Merge branch '1855-opennebula-datos-como-array' into 'develop'

Fix PluginTools datalist modules

See merge request artica/pandorafms!1269
This commit is contained in:
vgilc 2018-02-01 15:04:14 +01:00
commit 7eeb5fad70
1 changed files with 8 additions and 1 deletions

View File

@ -427,7 +427,14 @@ sub print_module {
if (ref ($data->{value}) eq "ARRAY") {
$xml_module .= "\t<datalist>\n";
foreach (@{$data->{value}}) {
$xml_module .= "\t<data><![CDATA[" . $data->{value} . "]]></data>\n";
if ((ref($_) eq "HASH") && defined($_->{value})) {
$xml_module .= "\t<data>\n";
$xml_module .= "\t\t<value><![CDATA[" . $_->{value} . "]]></value>\n";
if (defined($_->{timestamp})) {
$xml_module .= "\t\t<timestamp><![CDATA[" . $_->{timestamp} . "]]></timestamp>\n";
}
$xml_module .= "\t</data>\n";
}
}
$xml_module .= "\t</datalist>\n";
}