show imported region and rate #s, RT#83146
[freeside.git] / httemplate / edit / nas.html
1 <& elements/edit.html,  
2     'name_singular' => 'RADIUS client',
3     'table'         => 'nas',
4     'viewall_dir'   => 'browse',
5     'labels'        => { 'nasnum'      => 'NAS',
6                          'nasname'     => 'Hostname',
7                          'shortname'   => 'Short name',
8                          'secret'      => 'Shared secret',
9                          'type'        => 'Type',
10                          'ports'       => 'Ports',
11                          'server'      => 'Virtual server',
12                          'community'   => 'Community',
13                          'description' => 'Description',
14                        },
15     'fields'        => [
16       { field=> 'nasname', required=>1, size=>40, maxlength=>128 },
17       { field=>'shortname', size=>16, maxlength=>32 },
18       { field=>'secret', size=>40, maxlength=>60, required=>1 },
19       { field=>'type', type=>'select',
20         options=>[qw( cisco computone livingston max40xx multitech netserver
21                       pathras patton portslave tc usrhiper other )],
22       },
23       { field=>'ports', size=>5 },
24       { field=>'server', size=>40, maxlength=>64 },
25       { field=>'community', size=>40, maxlength=>50 },
26       { field=>'description', size=>100, maxlength=>200 },
27     ],
28     'html_bottom'   => \&html_bottom,
29     'new_hashref_callback' => sub { +{ 'type'        => 'other',
30                                        'secret'      => 'secret',
31                                        'description' => 'RADIUS Client',
32                                      };
33                                   },
34 &>
35 <%init>
36
37 die "access denied"
38   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
39
40 sub html_bottom {
41   my $nas = shift;
42   '<font color="#ff0000">*</font>&nbsp;'.
43   emt('required fields'). '<BR><BR>'.
44   '<FONT SIZE="+1"><B>'.emt('Export to these RADIUS servers:').
45   '</B></FONT><BR>'.
46
47   include('/elements/checkboxes-table.html',
48             'source_obj'    => $nas,
49             'link_table'    => 'export_nas',
50             'target_table'  => 'part_export',
51             'hashref'       => { 'exporttype' => 
52                                   { op => 'LIKE', value => '%sqlradius%' }
53                                 },
54             'name_callback' => sub { $_[0]->label },
55             'default'       => 'yes',
56             'target_link'   => $p.'edit/part_export.cgi?',
57             'disable-able'  => 1,
58           )
59 }
60
61
62 </%init>