fix fallout from fixing UTF-8 XML-RPC self-service issues, RT#13656
[freeside.git] / FS / FS / svc_broadband.pm
index 5ffe0e4..576684c 100755 (executable)
@@ -70,6 +70,8 @@ customer's router will have the same address for both its internal and external
 interfaces thus saving address space.  This has been found to work on most NAT
 routers available.
 
 interfaces thus saving address space.  This has been found to work on most NAT
 routers available.
 
+=item plan_id
+
 =back
 
 =head1 METHODS
 =back
 
 =head1 METHODS
@@ -105,6 +107,14 @@ sub table_info {
                          'select_label' => 'cidr',
                          'disable_inventory' => 1,
                        },
                          'select_label' => 'cidr',
                          'disable_inventory' => 1,
                        },
+     'plan_id' => 'Service Plan Id',
+     'performance_profile' => 'Peformance Profile',
+     'authkey'      => 'Authentication key',
+     'mac_addr'     => 'MAC address',
+     'latitude'     => 'Latitude',
+     'longitude'    => 'Longitude',
+     'altitude'     => 'Altitude',
+     'vlan_profile' => 'VLAN profile',
     },
   };
 }
     },
   };
 }
@@ -158,7 +168,7 @@ sub search {
   
   #agentnum
   if ( $params->{'agentnum'} =~ /^(\d+)$/ and $1 ) {
   
   #agentnum
   if ( $params->{'agentnum'} =~ /^(\d+)$/ and $1 ) {
-    push @where, "agentnum = $1";
+    push @where, "cust_main.agentnum = $1";
   }
   push @where, $FS::CurrentUser::CurrentUser->agentnums_sql(
     'null_right' => 'View/link unlinked services',
   }
   push @where, $FS::CurrentUser::CurrentUser->agentnums_sql(
     'null_right' => 'View/link unlinked services',
@@ -324,6 +334,10 @@ sub check {
 
   return $x unless ref($x);
 
 
   return $x unless ref($x);
 
+  my $nw_coords = $conf->exists('svc_broadband-require-nw-coordinates');
+  my $lat_lower = $nw_coords ? 1 : -90;
+  my $lon_upper = $nw_coords ? -1 : 180;
+
   my $error =
     $self->ut_numbern('svcnum')
     || $self->ut_numbern('blocknum')
   my $error =
     $self->ut_numbern('svcnum')
     || $self->ut_numbern('blocknum')
@@ -333,10 +347,11 @@ sub check {
     || $self->ut_ipn('ip_addr')
     || $self->ut_hexn('mac_addr')
     || $self->ut_hexn('auth_key')
     || $self->ut_ipn('ip_addr')
     || $self->ut_hexn('mac_addr')
     || $self->ut_hexn('auth_key')
-    || $self->ut_coordn('latitude', -90, 90)
-    || $self->ut_coordn('longitude', -180, 180)
+    || $self->ut_coordn('latitude', $lat_lower, 90)
+    || $self->ut_coordn('longitude', -180, $lon_upper)
     || $self->ut_sfloatn('altitude')
     || $self->ut_textn('vlan_profile')
     || $self->ut_sfloatn('altitude')
     || $self->ut_textn('vlan_profile')
+    || $self->ut_textn('plan_id')
   ;
   return $error if $error;
 
   ;
   return $error if $error;