X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fpart_export%2Fcacti.html;fp=httemplate%2Fedit%2Felements%2Fpart_export%2Fcacti.html;h=9e4a8ecd7a5d9cb5aa9675c9c2386ec2e912c39d;hb=f715c23517292a11330ab241fb13221fd89ffc37;hp=0000000000000000000000000000000000000000;hpb=3acf33a87b4e8ebaac08652177d79b22721e2690;p=freeside.git diff --git a/httemplate/edit/elements/part_export/cacti.html b/httemplate/edit/elements/part_export/cacti.html new file mode 100644 index 000000000..9e4a8ecd7 --- /dev/null +++ b/httemplate/edit/elements/part_export/cacti.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + +<& /elements/auto-table.html, + template_row => 'mytemplate', + fieldorder => ['graph_template_id','snmp_query_id','snmp_query_type_id','snmp_field','snmp_value'], + data => \@data, + table => 'cacti', +&> +
Graph Template IDSNMP Query IDSNMP Query Type IDSNMP FieldSNMP Value
+ +<%init> +my %opt = @_; +my $part_export = $opt{part_export} || die "No part_export specified"; + +my @fields = ('cacti_graph_template_id','cacti_snmp_query_id','cacti_snmp_query_type_id','cacti_snmp_field','cacti_snmp_value'); +my $multiopts = join(',',@fields); +my @byfield = map { + [ split("\n", $part_export->option($_)) ] +} @fields; +my @data; +for (my $i = 0; $i < @{$byfield[0]}; $i++) { + my @thisrow; + for (my $j = 0; $j < @byfield; $j++) { + push(@thisrow,$byfield[$j][$i]); + } + push(@data,\@thisrow); +} + +