X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fpart_export%2Fbroadband_snmp.html;h=44b80f4d7c10ba5e3004bceb68504abeb97f6e09;hb=HEAD;hp=ebb765dee81fac97f19cf30fb01d582b970b5a9c;hpb=a618055d3a8cfc55a449847b433dcdc85df92bcd;p=freeside.git diff --git a/httemplate/edit/elements/part_export/broadband_snmp.html b/httemplate/edit/elements/part_export/broadband_snmp.html index ebb765dee..44b80f4d7 100644 --- a/httemplate/edit/elements/part_export/broadband_snmp.html +++ b/httemplate/edit/elements/part_export/broadband_snmp.html @@ -11,7 +11,7 @@ <& /elements/tr-input-text.html, label => 'Community', field => 'community', - curr_value => $part_export->option('community'), + curr_value => $curr_value->{'community'}, &> <& /elements/tr-checkbox.html, label => 'Send IP address changes to new address', @@ -30,7 +30,7 @@ function open_select_mib(obj) { nd(1); // if there's already one open, close it var rownum = obj.rownum; var curr_oid = obj.form.elements['oid' + rownum].value || ''; - var url = '<%$fsurl%>/elements/select-mib-popup.html?' + + var url = '<%$fsurl%>misc/select-mib-popup.html?' + 'callback=receive_mib;' + 'arg=' + rownum + ';curr_value=' + curr_oid; @@ -45,8 +45,10 @@ function open_select_mib(obj) { function receive_mib(obj, rownum) { //console.log(JSON.stringify(obj)); // we don't really need the numeric OID or any of the other properties - document.getElementById('oid'+rownum).value = obj.fullname; + var oidfield = document.getElementById('oid'+rownum); + oidfield.value = obj.fullname; document.getElementById('datatype'+rownum).value = obj.type; + oidfield.onchange(); //should be same as datatype, only need to run one } @@ -73,7 +75,7 @@ function receive_mib(obj, rownum) { - + <& /elements/auto-table.html, @@ -86,6 +88,10 @@ function receive_mib(obj, rownum) { <%init> my %opt = @_; my $part_export = $opt{part_export} || FS::part_export->new; +my $curr_value = {}; +$curr_value->{'community'} = ($opt{'part_export'} && $opt{'part_export'}->exportnum) + ? $part_export->option('community') + : $opt{'export_info'}->{'options'}->{'community'}->{'default'}; my @actions = split("\n", $part_export->option('action')); my @oids = split("\n", $part_export->option('oid'));