[freeside-commits] branch master updated. 31272b420c6206e82ce8b622fd14bf469fe1e126

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


The branch, master has been updated
       via  31272b420c6206e82ce8b622fd14bf469fe1e126 (commit)
      from  ba46a6a90321490da78c764657ae19d5c6fd81f8 (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 31272b420c6206e82ce8b622fd14bf469fe1e126
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jun 2 17:01:20 2014 -0700

    show MAC address vendors

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 => \&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 +-
 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(-)




More information about the freeside-commits mailing list