summaryrefslogtreecommitdiff
path: root/httemplate/view/svc_hardware.cgi
blob: eef1c11407e6327522312fec1f4511f922600279 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<% include('elements/svc_Common.html',
            'table'        => 'svc_hardware',
            'labels'       => \%labels,
            'fields'       => \@fields,
          )
%>
<%init>

my $conf = new FS::Conf;
my $fields = FS::svc_hardware->table_info->{'fields'};
my %labels = map { $_ =>  ( ref($fields->{$_})
                             ? $fields->{$_}{'label'}
                             : $fields->{$_}
                         );
                 } keys %$fields;

$labels{'display_hw_addr'} = 'Hardware address';

my $model =  { field => 'typenum',
               type  => 'text',
               value_callback => sub { $_[0]->hardware_type->description }
             };
my $status = { field => 'statusnum',
               type  => 'text',
               value_callback => sub { $_[0]->status_label }
             };
my $note =   { field => 'note',
               type  => 'text',
               value_callback => sub { encode_entities($_[0]->note) }
             };

my @fields = (
  $model,
  'serial',
  'display_hw_addr',
  'ip_addr',
  'smartcard',
  $status,
  $note,
);
</%init>