[freeside-commits] freeside/FS/FS/ClientAPI MasonComponent.pm, 1.2, 1.3 MyAccount.pm, 1.91, 1.92

Ivan,,, ivan at wavetail.420.am
Fri Aug 21 17:22:10 PDT 2009


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

Modified Files:
	MasonComponent.pm MyAccount.pm 
Log Message:
order svc_phone services from self-service too, RT#5085

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- MyAccount.pm	10 Aug 2009 11:50:03 -0000	1.91
+++ MyAccount.pm	22 Aug 2009 00:22:08 -0000	1.92
@@ -1110,7 +1110,7 @@
     my %fields = (
       'svc_acct'     => [ qw( username domsvc _password sec_phrase popnum ) ],
       'svc_domain'   => [ qw( domain ) ],
-      'svc_phone'    => [ qw( phonenum pin sip_password ) ],
+      'svc_phone'    => [ qw( phonenum pin sip_password phone_name ) ],
       'svc_external' => [ qw( id title ) ],
     );
   

Index: MasonComponent.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MasonComponent.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- MasonComponent.pm	25 May 2009 01:49:33 -0000	1.2
+++ MasonComponent.pm	22 Aug 2009 00:22:08 -0000	1.3
@@ -6,8 +6,9 @@
 use FS::Mason qw( mason_interps );
 use FS::Conf;
 use FS::ClientAPI_SessionCache;
-use FS::Record qw(qsearchs);
+use FS::Record qw( qsearch qsearchs );
 use FS::cust_main;
+use FS::part_pkg;
 
 $DEBUG = 0;
 $me = '[FS::ClientAPI::MasonComponent]';
@@ -19,13 +20,17 @@
   /misc/phonenums.cgi
   /misc/states.cgi
   /misc/counties.cgi
+  /misc/svc_acct-domains.cgi
+  /misc/part_svc-columns.cgi
 );
 
 my %session_comps = map { $_=>1 } qw(
   /elements/location.html
+  /edit/cust_main/first_pkg/select-part_pkg.html
 );
 
 my %session_callbacks = (
+
   '/elements/location.html' => sub {
     my( $custnum, $argsref ) = @_;
     my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
@@ -35,6 +40,32 @@
     @$argsref = ( %args );
     return ''; #no error
   },
+
+  '/edit/cust_main/first_pkg/select-part_pkg.html' => sub {
+    my( $custnum, $argsref ) = @_;
+    my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+      or return "unknown custnum $custnum";
+
+    my $pkgpart = $cust_main->agent->pkgpart_hashref;
+
+    #false laziness w/ edit/cust_main/first_pkg.html
+    my @first_svc = ( 'svc_acct', 'svc_phone' );
+
+    my @part_pkg =
+      grep { $_->svcpart(\@first_svc)
+             && ( $pkgpart->{ $_->pkgpart } 
+                  || ( $_->agentnum && $_->agentnum == $cust_main->agentnum )
+                )
+           }
+      qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?
+
+    my %args = @$argsref;
+    $args{part_pkg} = \@part_pkg;
+    @$argsref = ( %args );
+    return ''; #no error
+
+  },
+
 );
 
 my $outbuf;



More information about the freeside-commits mailing list