diff options
-rw-r--r-- | FS/FS/Mason.pm | 1 | ||||
-rw-r--r-- | FS/FS/svc_cable.pm | 2 | ||||
-rw-r--r-- | httemplate/view/elements/svc_Common.html | 11 | ||||
-rw-r--r-- | 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) { %> </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/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 3325416b8..ec73c6d52 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 { |