diff options
author | Mark Wells <mark@freeside.biz> | 2012-03-14 13:44:00 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-03-14 13:44:00 -0700 |
commit | a69299c596de60f4b26db7431165f7f3ffe928e2 (patch) | |
tree | 076319cad385baeb8bcf6fe9ce0ac980ccab50c7 /httemplate/view | |
parent | da590709ee5f3e6a661950fcfce39dbbf9d6add4 (diff) |
svc_hardware MAC address input format, #16266
Diffstat (limited to 'httemplate/view')
-rw-r--r-- | httemplate/view/svc_broadband.cgi | 7 | ||||
-rw-r--r-- | httemplate/view/svc_hardware.cgi | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index af2c575b9..131582f1c 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -31,7 +31,7 @@ my @fields = ( 'speed_up', { field => 'ip_addr', value => \&ip_addr }, { field => 'sectornum', value => \§ornum }, - 'mac_addr', + { field => 'mac_addr', value => \&mac_addr }, #'latitude', #'longitude', { field => 'coordinates', value => \&coordinates }, @@ -66,6 +66,11 @@ sub ip_addr { $out; } +sub mac_addr { + my $svc = shift; + join(':', $svc->mac_addr =~ /../g); +} + sub usergroup { my $svc = shift; my $usergroup = $svc->usergroup; diff --git a/httemplate/view/svc_hardware.cgi b/httemplate/view/svc_hardware.cgi index 1d882352b..725358cad 100644 --- a/httemplate/view/svc_hardware.cgi +++ b/httemplate/view/svc_hardware.cgi @@ -6,6 +6,7 @@ %> <%init> +my $conf = new FS::Conf; my $fields = FS::svc_hardware->table_info->{'fields'}; my %labels = map { $_ => ( ref($fields->{$_}) ? $fields->{$_}{'label'} @@ -24,5 +25,22 @@ my $note = { field => 'note', type => 'text', value => sub { encode_entities($_[0]->note) } }; -my @fields = ($model, qw( serial hw_addr ip_addr smartcard ), $status, $note ); +my $hw_addr ={ field => 'hw_addr', + type => 'text', + value => sub { + my $hw_addr = $_[0]->hw_addr; + $conf->exists('svc_hardware-check_mac_addr') ? + join(':', $hw_addr =~ /../g) : $hw_addr + }, + }; + +my @fields = ( + $model, + 'serial', + $hw_addr, + 'ip_addr', + 'smartcard', + $status, + $note, +); </%init> |