[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.171, 1.172

Ivan,,, ivan at wavetail.420.am
Tue Nov 29 13:57:43 PST 2011


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

Modified Files:
	MyAccount.pm 
Log Message:
add forward and spam setting to inter.net portal, RT#13656

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -w -d -r1.171 -r1.172
--- MyAccount.pm	29 Nov 2011 21:50:15 -0000	1.171
+++ MyAccount.pm	29 Nov 2011 21:57:40 -0000	1.172
@@ -1560,8 +1560,6 @@
 
 sub process_acct_forward {
   my $p = shift;
-  warn Dumper($p);
-
   my($context, $session, $custnum) = _custoragent_session_custnum($p);
   return { 'error' => $session } if $context eq 'error';
 
@@ -1569,7 +1567,6 @@
                              { 'srcsvc' => $p->{'svcnum'} },
                              'svc_forward',
                            );
-  warn $old;
 
   if ( $p->{'dst'} eq '' ) {
     if ( $old ) {
@@ -1585,20 +1582,21 @@
 
   my $error;
   if ( $old ) {
-    warn "old: $old\n";
     $new->svcnum($old->svcnum);
     my $cust_svc = $old->cust_svc;
     $new->svcpart($old->svcpart);
     $new->pkgnuym($old->pkgnum);
     $error = $new->replace($old);
   } else {
-    warn "new: $new\n";
     my $conf = new FS::Conf;
     $new->svcpart($conf->config('selfservice-svc_forward_svcpart'));
-    $new->pkgnum($old->cust_svc->pkgnum);
-    warn Dumper($new);
+
+    my $svc_acct = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct' )
+      or return { 'error' => 'No service' }; #how would we even get here?
+
+    $new->pkgnum( $svc_acct->cust_svc->pkgnum );
+
     $error = $new->insert;
-    warn $error;
   }
 
   return { 'error' => $error };



More information about the freeside-commits mailing list