+ if ( $part_svc->has_router ) {
+ # these will be set up as pseudo-fields in the new_ and edit_ callbacks
+ push @{ $opt->{'fields'} }, (
+ { field => 'router_routernum', type => 'hidden' },
+ { field => 'router_routername', type => 'text', size => 32 },
+ # router address block selection
+ # (one-to-one for now)
+ { field => 'router_blocknum',
+ type => 'select-table',
+ table => 'addr_block',
+ hashref => { 'routernum' => '0' },
+ agent_virt => 1,
+ agent_null => 1,
+ name_col => 'cidr',
+ order_by => 'ORDER BY ip_gateway, ip_netmask',
+ empty_label => '(none)',
+ disable_empty => 0,
+ },
+ );
+ $labels->{router_routername} = 'Attached router name';
+ $labels->{router_blocknum} = 'Attached address block';
+ }