1 <% include('elements/edit.html',
2 'post_url' => popurl(1).'process/router.cgi',
5 'viewall_url' => "${p}browse/router.cgi",
6 'labels' => { 'routernum' => 'Router',
7 'routername' => 'Name',
8 'svc_part' => 'Service',
10 'manual_addr' => 'Assign IP addresses manually',
13 { 'field'=>'routername', 'type'=>'text', 'size'=>32 },
14 { 'field'=>'agentnum', 'type'=>'select-agent' },
15 { 'field'=>'svcnum', 'type'=>'hidden' },
16 { 'field'=>'manual_addr','type'=>'checkbox','value'=>'Y'},
18 'error_callback' => $callback,
19 'edit_callback' => $callback,
20 'new_callback' => $callback,
21 'html_table_bottom' => $html_table_bottom,
26 my $curuser = $FS::CurrentUser::CurrentUser;
29 unless $curuser->access_right('Broadband configuration')
30 || $curuser->access_right('Broadband global configuration');
32 my @svc_x = 'svc_broadband';
33 if ( FS::Conf->new->exists('svc_acct-ip_addr') ) {
34 push @svc_x, 'svc_acct';
38 my ($cgi, $object, $fields) = (shift, shift, shift);
40 my $extra_sql = ' AND svcdb IN(' . join(',', map { "'$_'" } @svc_x) . ')';
41 unless ($object->svcnum) {
43 { 'type' => 'tablebreak-tr-title',
44 'value' => 'Select the service types available on this router',
46 { 'field' => 'svc_part',
47 'type' => 'checkboxes-table',
48 'target_table' => 'part_svc',
49 'link_table' => 'part_svc_router',
51 'hashref' => { 'disabled' => '' },
52 'extra_sql' => $extra_sql,
57 my $html_table_bottom = sub {
60 foreach my $field ($router->virtual_fields) {
61 $html .= $router->pvf($field)->widget('HTML', 'edit', $router->get($field));