installers, RT#16584
[freeside.git] / httemplate / view / svc_hardware.cgi
1 <% include('elements/svc_Common.html',
2             'table'        => 'svc_hardware',
3             'labels'       => \%labels,
4             'fields'       => \@fields,
5           )
6 %>
7 <%init>
8
9 my $conf = new FS::Conf;
10 my $fields = FS::svc_hardware->table_info->{'fields'};
11 my %labels = map { $_ =>  ( ref($fields->{$_})
12                              ? $fields->{$_}{'label'}
13                              : $fields->{$_}
14                          );
15                  } keys %$fields;
16
17 $labels{'display_hw_addr'} = 'Hardware address';
18
19 my $model =  { field => 'typenum',
20                type  => 'text',
21                value_callback => sub { $_[0]->hardware_type->description }
22              };
23 my $status = { field => 'statusnum',
24                type  => 'text',
25                value_callback => sub { $_[0]->status_label }
26              };
27 my $note =   { field => 'note',
28                type  => 'text',
29                value_callback => sub { encode_entities($_[0]->note) }
30              };
31
32 my @fields = (
33   $model,
34   'serial',
35   'display_hw_addr',
36   'ip_addr',
37   'smartcard',
38   $status,
39   $note,
40 );
41 </%init>