[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.132, 1.133
Erik Levinson
levinse at wavetail.420.am
Wed Jul 13 20:46:19 PDT 2011
- Previous message: [freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi provision_list.html, 1.7, 1.8 provision_svc_phone.html, 1.3, 1.4 selfservice.cgi, 1.58, 1.59
- Next message: [freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi provision_list.html, 1.5.10.2, 1.5.10.3 provision_svc_phone.html, 1.1.2.4, 1.1.2.5 selfservice.cgi, 1.46.2.9, 1.46.2.10
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv11861/FS/FS/ClientAPI
Modified Files:
MyAccount.pm
Log Message:
view/set svc_phone forwardst and email from self-service, RT13622
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -w -d -r1.132 -r1.133
--- MyAccount.pm 8 Jul 2011 22:17:29 -0000 1.132
+++ MyAccount.pm 14 Jul 2011 03:46:17 -0000 1.133
@@ -1050,6 +1050,10 @@
if $context eq 'agent'
&& $conf->exists('agent-showpasswords')
&& $_->part_svc->svcdb eq 'svc_acct';
+ $ref->{svchash} = { $_->svc_x->hash } if
+ $_->part_svc->svcdb eq 'svc_phone';
+ $ref->{svchash}->{svcpart} = $_->part_svc->svcpart
+ if $_->part_svc->svcdb eq 'svc_phone'; # hack
$ref;
} $_->cust_svc
],
@@ -1644,6 +1648,23 @@
my @bulkdid;
@bulkdid = @{$p->{'bulkdid'}} if $p->{'bulkdid'};
+ if($p->{'svcnum'} && $p->{'svcnum'} =~ /^\d+$/){
+ my($context, $session, $custnum) = _custoragent_session_custnum($p);
+ return { 'error' => $session } if $context eq 'error';
+
+ my $svc_phone = qsearchs('svc_phone', { svcnum => $p->{'svcnum'} });
+ return { 'error' => 'service not found' } unless $svc_phone;
+ return { 'error' => 'invalid svcnum' }
+ if $svc_phone && $svc_phone->cust_svc->cust_pkg->custnum != $custnum;
+
+ $svc_phone->email($p->{'email'})
+ if $svc_phone->email ne $p->{'email'} && $p->{'email'} =~ /^([\w\.\d@]+|)$/;
+ $svc_phone->forwarddst($p->{'forwarddst'})
+ if $svc_phone->forwarddst ne $p->{'forwarddst'}
+ && $p->{'forwarddst'} =~ /^(\d+|)$/;
+ return { 'error' => $svc_phone->replace };
+ }
+
# single DID LNP
unless($p->{'lnp'}) {
$p->{'lnp_desired_due_date'} = parse_datetime($p->{'lnp_desired_due_date'});
@@ -1806,7 +1827,7 @@
my $conf = new FS::Conf;
- return {
+ my $ret = {
'svc' => $part_svc->svc,
'svcdb' => $part_svc->svcdb,
'pkgnum' => $pkgnum,
@@ -1825,6 +1846,17 @@
};
+ if ($p->{'svcnum'} && $p->{'svcnum'} =~ /^\d+$/
+ && $ret->{'svcdb'} eq 'svc_phone') {
+ $ret->{'svcnum'} = $p->{'svcnum'};
+ my $svc_phone = qsearchs('svc_phone', { svcnum => $p->{'svcnum'} });
+ if ( $svc_phone && $svc_phone->cust_svc->cust_pkg->custnum == $custnum ) {
+ $ret->{'email'} = $svc_phone->email;
+ $ret->{'forwarddst'} = $svc_phone->forwarddst;
+ }
+ }
+
+ $ret;
}
sub unprovision_svc {
- Previous message: [freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi provision_list.html, 1.7, 1.8 provision_svc_phone.html, 1.3, 1.4 selfservice.cgi, 1.58, 1.59
- Next message: [freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi provision_list.html, 1.5.10.2, 1.5.10.3 provision_svc_phone.html, 1.1.2.4, 1.1.2.5 selfservice.cgi, 1.46.2.9, 1.46.2.10
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list