[freeside-commits] freeside/FS/FS/ClientAPI Signup.pm,1.60,1.61

Mark Wells mark at wavetail.420.am
Tue Sep 28 22:40:14 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv10362/FS/FS/ClientAPI

Modified Files:
	Signup.pm 
Log Message:
svc_pbx in signup server, RT#9380

Index: Signup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/Signup.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -w -d -r1.60 -r1.61
--- Signup.pm	28 Sep 2010 23:12:51 -0000	1.60
+++ Signup.pm	29 Sep 2010 05:40:11 -0000	1.61
@@ -451,6 +451,9 @@
       unless $packet->{'popnum'} || !scalar(qsearch('svc_acct_pop',{} ));
 
   }
+  elsif ( $svc_x eq 'svc_pbx' ) {
+    #possibly some validation will be needed
+  }
 
   my $agentnum;
   if ( exists $packet->{'session_id'} ) {
@@ -585,17 +588,22 @@
     }
     $svc->child_objects( \@acct_snarf );
 
-    push @svc, $svc;
 
   } elsif ( $svc_x eq 'svc_phone' ) {
 
-    my $svc = new FS::svc_phone ( {
+    push @svc, new FS::svc_phone ( {
       'svcpart' => $svcpart,
        map { $_ => $packet->{$_} }
          qw( countrycode phonenum sip_password pin ),
     } );
 
-    push @svc, $svc;
+  } elsif ( $svc_x eq 'svc_pbx' ) {
+
+    push @svc, new FS::svc_pbx ( {
+        'svcpart' => $svcpart,
+        map { $_ => $packet->{$_} } 
+          qw( id title ),
+        } );
 
   } else {
     die "unknown signup service $svc_x";
@@ -722,14 +730,20 @@
 
   my %return = ( 'error'          => '',
                  'signup_service' => $svc_x,
+                 'svcnum'         => $svc[0]->svcnum,
+                 'custnum'        => $cust_main->custnum,
                );
 
   if ( $svc_x eq 'svc_acct' ) {
     $return{$_} = $svc[0]->$_() for qw( username _password );
   } elsif ( $svc_x eq 'svc_phone' ) {
     $return{$_} = $svc[0]->$_() for qw( countrycode phonenum sip_password pin );
+  } elsif ( $svc_x eq 'svc_pbx' ) {
+    #$return{$_} = $svc[0]->$_() for qw( ) #nothing yet
   } else {
-    die "unknown signup service $svc_x";
+    return { 'error' => "configuration error: unknown signup service $svc_x" };
+    #die "unknown signup service $svc_x";
+    # return an error that's visible to someone somewhere
   }
 
   return \%return;



More information about the freeside-commits mailing list