From 9b27a2b16c37b060ef48029581e4196990a9963b Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 2 Jun 2014 17:01:40 -0700 Subject: [PATCH] show MAC address vendors --- FS/FS/Mason.pm | 1 + FS/FS/svc_cable.pm | 2 +- httemplate/view/elements/svc_Common.html | 11 ++++++++--- httemplate/view/svc_broadband.cgi | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index 2e1a2d12d..d1fa3cf43 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -100,6 +100,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 5d281135b..0c0d684e0 100644 --- a/FS/FS/svc_cable.pm +++ b/FS/FS/svc_cable.pm @@ -101,7 +101,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/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index d34ed509a..1818d34cf 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -107,9 +107,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