fix interface addition for ports with dashes (Juniper, others), RT#14703
[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 $fields = FS::svc_hardware->table_info->{'fields'};
10 my %labels = map { $_ =>  ( ref($fields->{$_})
11                              ? $fields->{$_}{'label'}
12                              : $fields->{$_}
13                          );
14                  } keys %$fields;
15 my $model =  { field => 'typenum',
16                type  => 'text',
17                value => sub { $_[0]->hardware_type->model }
18              };
19 my $status = { field => 'statusnum',
20                type  => 'text',
21                value => sub { $_[0]->status_label }
22              };
23 my $note =   { field => 'note',
24                type  => 'text',
25                value => sub { encode_entities($_[0]->note) }
26              };
27 my @fields = ($model, qw( serial hw_addr ip_addr smartcard ), $status, $note );
28 </%init>