summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2012-02-09 08:38:24 +0000
committerivan <ivan>2012-02-09 08:38:24 +0000
commitf1bf0c7fa7486b919f527d319afe276ff7f29aea (patch)
tree241d069f62aac152d54aa31803afba0dca4e3388 /FS
parent1a5d9948188d5ebcb2bfb98b37936f5d6670b6ff (diff)
add svc_status_hash to selfservice, RT#15987
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm33
-rw-r--r--FS/FS/ClientAPI_XMLRPC.pm2
2 files changed, 35 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 563bf9cf3..30def4a7f 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -1543,6 +1543,39 @@ sub svc_status_html {
}
+sub svc_status_hash {
+ my $p = shift;
+
+ my($context, $session, $custnum) = _custoragent_session_custnum($p);
+ return { 'error' => $session } if $context eq 'error';
+
+ #XXX only svc_acct for now
+ my $svc_x = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct')
+ or return { 'error' => "Service not found" };
+
+ my ( $html, $hashref ) = $svc_x->export_getstatus;
+ return $hashref;
+
+}
+
+sub set_svc_status_hash {
+ my $p = shift;
+
+ my($context, $session, $custnum) = _custoragent_session_custnum($p);
+ return { 'error' => $session } if $context eq 'error';
+
+ #XXX only svc_acct for now
+ my $svc_x = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct')
+ or return { 'error' => "Service not found" };
+
+ my $error = $svc_x->export_setstatus($p); #$p? returns error?
+ return { 'error' => $error } if $error;
+
+ return {}; #? { 'error' => '' }
+
+}
+
+
sub acct_forward_info {
my $p = shift;
diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm
index f1988bff4..1e068f428 100644
--- a/FS/FS/ClientAPI_XMLRPC.pm
+++ b/FS/FS/ClientAPI_XMLRPC.pm
@@ -121,6 +121,8 @@ sub ss2clientapi {
'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?)
'list_svc_usage' => 'MyAccount/list_svc_usage',
'svc_status_html' => 'MyAccount/svc_status_html',
+ 'svc_status_hash' => 'MyAccount/svc_status_hash',
+ 'set_svc_status_hash' => 'MyAccount/set_svc_status_hash',
'acct_forward_info' => 'MyAccount/acct_forward_info',
'process_acct_forward' => 'MyAccount/process_acct_forward',
'list_dsl_devices' => 'MyAccount/list_dsl_devices',