From 31272b420c6206e82ce8b622fd14bf469fe1e126 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 2 Jun 2014 17:01:20 -0700 Subject: show MAC address vendors --- FS/FS/Mason.pm | 1 + FS/FS/svc_cable.pm | 2 +- FS/FS/svc_video.pm | 2 +- httemplate/view/elements/svc_Common.html | 11 ++++++++--- httemplate/view/elements/svc_devices.html | 4 +++- httemplate/view/svc_broadband.cgi | 4 ++-- 6 files changed, 16 insertions(+), 8 deletions(-) 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