diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-06-02 17:01:20 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-06-02 17:01:20 -0700 |
commit | 31272b420c6206e82ce8b622fd14bf469fe1e126 (patch) | |
tree | 53560a7c5cba6736342f6d2e77c9923259b86ed7 | |
parent | ba46a6a90321490da78c764657ae19d5c6fd81f8 (diff) |
show MAC address vendors
Notes
Notes:
RT#29346
-rw-r--r-- | FS/FS/Mason.pm | 1 | ||||
-rw-r--r-- | FS/FS/svc_cable.pm | 2 | ||||
-rw-r--r-- | FS/FS/svc_video.pm | 2 | ||||
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 11 | ||||
-rw-r--r-- | httemplate/view/elements/svc_devices.html | 4 | ||||
-rw-r--r-- | 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 7d0a3f5..4b50e97 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 12a1dbb..4dd4543 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 999b87c..6db27c7 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 65f373c..b12d2dd 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -105,9 +105,14 @@ function areyousure(href) { %> </TD> -% $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 <SELECT>, etc. fields <TD BGCOLOR="#ffffff"><% $value %><TD> diff --git a/httemplate/view/elements/svc_devices.html b/httemplate/view/elements/svc_devices.html index c9f5eda..899e6aa 100644 --- a/httemplate/view/elements/svc_devices.html +++ b/httemplate/view/elements/svc_devices.html @@ -62,7 +62,9 @@ % if ( $table eq 'phone_device' || $svc_x->isa('FS::device_Common') ) { <% $td %><% $device->part_device->devicename |h %></TD> % } - <% $td %><% $device->mac_addr_pretty %></TD> + <% $td %><% $device->mac_addr_pretty %> + (<% (Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':')))->[0] %>) + </TD> <% $td %><% $export_links %></TD> <% $td %>( % unless ( $opt{'no_edit'} ) { diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 3325416..ec73c6d 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -32,7 +32,7 @@ my @fields = ( 'speed_up', { field => 'ip_addr', value_callback => \&ip_addr }, { field => 'sectornum', value_callback => \§ornum }, - { field => 'mac_addr', value_callback => \&mac_addr }, + { field => 'mac_addr', type=>'mac_addr', value_callback => \&mac_addr }, #'latitude', #'longitude', { field => 'coordinates', value_callback => \&coordinates }, @@ -78,7 +78,7 @@ sub ip_addr { sub mac_addr { my $svc = shift; - join(':', $svc->mac_addr =~ /../g); + $svc->mac_addr_formatted('U',':'); } sub usergroup { |