X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Frouter.cgi;h=0df9b457e7c35ca67976b3528dd9a47e1b5fb8f7;hb=ecf1c9cc0a20be6e489657e005ea771977b9f69c;hp=6672d5d7584ca9d70cfd1302bca6929249d2edcb;hpb=eb9d1063e1203231ee0c6922ea5638370f7b5ece;p=freeside.git diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi index 6672d5d75..0df9b457e 100755 --- a/httemplate/edit/router.cgi +++ b/httemplate/edit/router.cgi @@ -7,13 +7,13 @@ 'routername' => 'Name', 'svc_part' => 'Service', 'agentnum' => 'Agent', - 'auto_addr' => 'Assign IP addresses automatically', + 'manual_addr' => 'Assign IP addresses manually', }, 'fields' => [ { 'field'=>'routername', 'type'=>'text', 'size'=>32 }, { 'field'=>'agentnum', 'type'=>'select-agent' }, { 'field'=>'svcnum', 'type'=>'hidden' }, - { 'field'=>'auto_addr','type'=>'checkbox','value'=>'Y'}, + { 'field'=>'manual_addr','type'=>'checkbox','value'=>'Y'}, ], 'error_callback' => $callback, 'edit_callback' => $callback, @@ -29,8 +29,15 @@ die "access denied" unless $curuser->access_right('Broadband configuration') || $curuser->access_right('Broadband global configuration'); +my @svc_x = 'svc_broadband'; +if ( FS::Conf->new->exists('svc_acct-ip_addr') ) { + push @svc_x, 'svc_acct'; +} + my $callback = sub { my ($cgi, $object, $fields) = (shift, shift, shift); + + my $extra_sql = ' AND svcdb IN(' . join(',', map { "'$_'" } @svc_x) . ')'; unless ($object->svcnum) { push @{$fields}, { 'type' => 'tablebreak-tr-title', @@ -41,7 +48,8 @@ my $callback = sub { 'target_table' => 'part_svc', 'link_table' => 'part_svc_router', 'name_col' => 'svc', - 'hashref' => { 'svcdb' => 'svc_broadband', 'disabled' => '' }, + 'hashref' => { 'disabled' => '' }, + 'extra_sql' => $extra_sql, }; } };