[freeside-commits] branch FREESIDE_3_BRANCH updated. 9b27a2b16c37b060ef48029581e4196990a9963b

Ivan ivan at 420.am
Mon Jun 2 17:01:42 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  9b27a2b16c37b060ef48029581e4196990a9963b (commit)
      from  e1e4c54b07804e5d9c3d9b45f8e82ccdbc902f90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9b27a2b16c37b060ef48029581e4196990a9963b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jun 2 17:01:40 2014 -0700

    show MAC address vendors

diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 2e1a2d1..d1fa3cf 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 5d28113..0c0d684 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 d34ed50..1818d34 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 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 => \&sectornum },
-  { 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 {

-----------------------------------------------------------------------

Summary of changes:
 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(-)




More information about the freeside-commits mailing list