From: Ivan Kohler Date: Tue, 3 Jun 2014 00:01:20 +0000 (-0700) Subject: show MAC address vendors X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=31272b420c6206e82ce8b622fd14bf469fe1e126 show MAC address vendors --- diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index 7d0a3f5e9..4b50e9780 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -98,6 +98,7 @@ if ( -e $addl_handler_use_file ) { use Business::CreditCard 0.30; #for mask-aware cardtype() use NetAddr::IP; + use Net::MAC::Vendor; use Net::Ping; use Net::Ping::External; #if CPAN #7815 ever gets fixed# if ( $Net::Ping::External::VERSION <= 0.12 ) diff --git a/FS/FS/svc_cable.pm b/FS/FS/svc_cable.pm index 12a1dbba5..4dd454351 100644 --- a/FS/FS/svc_cable.pm +++ b/FS/FS/svc_cable.pm @@ -98,7 +98,7 @@ sub table_info { type => 'input-mac_addr', value_callback => sub { my $svc = shift; - join(':', $svc->mac_addr =~ /../g); + $svc->mac_addr_formatted('U',':'); }, }, ; diff --git a/FS/FS/svc_video.pm b/FS/FS/svc_video.pm index 999b87c66..6db27c705 100644 --- a/FS/FS/svc_video.pm +++ b/FS/FS/svc_video.pm @@ -92,7 +92,7 @@ sub table_info { type => 'input-mac_addr', value_callback => sub { my $svc = shift; - join(':', $svc->mac_addr =~ /../g); + $svc->mac_addr_formatted('U',':'); }, }, 'duration' => { label => 'Duration (days)', diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 65f373cb6..b12d2ddcd 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -105,9 +105,14 @@ function areyousure(href) { %> -% $value = time2str($date_format,$value) if ( $type eq 'date' && $value ); -% $value = time2str("$date_format %H:%M",$value) if ( $type eq 'datetime' && $value ); -% $value = $value eq 'Y' ? emt('Yes') : emt('No') if ( $type eq 'checkbox' ); +% $value = time2str($date_format,$value) +% if $type eq 'date' && $value; +% $value = time2str("$date_format %H:%M",$value) +% if $type eq 'datetime' && $value; +% $value = $value eq 'Y' ? emt('Yes') : emt('No') +% if $type eq 'checkbox'; +% $value .= ' ('. (Net::MAC::Vendor::lookup($value))->[0]. ')' +% if $type =~ /mac_addr$/ && $value =~ /\w/i; % #eventually more options for