From: Mark Wells Date: Fri, 15 Aug 2014 23:08:24 +0000 (-0700) Subject: SNMP export: allow manually entering OIDs, #20945 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=d87c9f804b0cb7b6798bf770f753fb83022f5e6a SNMP export: allow manually entering OIDs, #20945 --- diff --git a/FS/FS/part_export/broadband_snmp.pm b/FS/FS/part_export/broadband_snmp.pm index 9afca0872..0ba275670 100644 --- a/FS/FS/part_export/broadband_snmp.pm +++ b/FS/FS/part_export/broadband_snmp.pm @@ -34,9 +34,10 @@ tie my %options, 'Tie::IxHash', }, 'community' => { label=>'Community', default=>'public' }, - 'action' => { multiple=>1 }, - 'oid' => { multiple=>1 }, - 'value' => { multiple=>1 }, + 'action' => { multiple=>1 }, + 'oid' => { multiple=>1 }, + 'value' => { multiple=>1 }, + 'datatype'=> { multiple=>1 }, 'ip_addr_change_to_new' => { label=>'Send IP address changes to new address', diff --git a/httemplate/edit/elements/part_export/broadband_snmp.html b/httemplate/edit/elements/part_export/broadband_snmp.html index 4c0367c5a..ebb765dee 100644 --- a/httemplate/edit/elements/part_export/broadband_snmp.html +++ b/httemplate/edit/elements/part_export/broadband_snmp.html @@ -29,7 +29,7 @@ function open_select_mib(obj) { nd(1); // if there's already one open, close it var rownum = obj.rownum; - var curr_oid = obj.value || ''; + var curr_oid = obj.form.elements['oid' + rownum].value || ''; var url = '<%$fsurl%>/elements/select-mib-popup.html?' + 'callback=receive_mib;' + 'arg=' + rownum + @@ -66,10 +66,11 @@ function receive_mib(obj, rownum) { - + + - + diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index e0c470675..7fe3d0369 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -41,7 +41,7 @@ foreach my $option (split(',', $cgi->param('multi_options'))) { foreach my $option (split(',', $cgi->param('multi_options'))) { my $value = ''; foreach my $row (sort keys %{$optionrows{_ALL_}}) { - $value .= ($optionrows{$option}{$row} || '') . "\n"; + $value .= ($optionrows{$option}{$row} // '') . "\n"; } chomp($value); $options{$option} = $value; diff --git a/httemplate/elements/select-mib-popup.html b/httemplate/elements/select-mib-popup.html index bd485ef65..f95ce2b97 100644 --- a/httemplate/elements/select-mib-popup.html +++ b/httemplate/elements/select-mib-popup.html @@ -7,7 +7,7 @@ Object: - +