summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-11-11 23:59:50 +0000
committerivan <ivan>2011-11-11 23:59:50 +0000
commit0ee87ce2f12ab1ba734f6d2b60c60469c07f9b8c (patch)
tree5f9a3319673abfb713a71b93cd9292165e753e25
parent898abe13b00b7dec565740cede15a92810335349 (diff)
DSL status pulling, RT#13656
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm15
-rw-r--r--FS/FS/ClientAPI_XMLRPC.pm1
-rw-r--r--FS/FS/svc_Common.pm19
-rw-r--r--fs_selfservice/FS-SelfService/SelfService.pm1
-rw-r--r--httemplate/elements/header-popup.html22
-rw-r--r--httemplate/view/svc_Status.html7
6 files changed, 48 insertions, 17 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 0af2c3e..53e6740 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -1521,6 +1521,21 @@ sub _customer_svc_x {
}
+sub svc_status_html {
+ my $p = shift;
+
+ my($context, $session, $custnum) = _custoragent_session_custnum($p);
+ return { 'error' => $session } if $context eq 'error';
+
+ my $svc_x = _customer_svc_x( $custnum, $p->{'svcnum'})
+ or return { 'error' => "Service not found" };
+
+ my $html = $svc_x->getstatus_html;
+
+ return { 'html' => $html };
+
+}
+
sub list_dsl_devices {
my $p = shift;
diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm
index 1940ca5..d7528df 100644
--- a/FS/FS/ClientAPI_XMLRPC.pm
+++ b/FS/FS/ClientAPI_XMLRPC.pm
@@ -120,6 +120,7 @@ sub ss2clientapi {
'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?)
'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?)
'list_svc_usage' => 'MyAccount/list_svc_usage',
+ 'svc_status_html' => 'MyAccount/svc_status_html',
'list_dsl_devices' => 'MyAccount/list_dsl_devices',
'add_dsl_device' => 'MyAccount/add_dsl_device',
'delete_dsl_device' => 'MyAccount/delete_dsl_device',
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm
index 28f759a..7a93bc4 100644
--- a/FS/FS/svc_Common.pm
+++ b/FS/FS/svc_Common.pm
@@ -1148,8 +1148,27 @@ sub find_duplicates {
return grep { $conflict_svcparts{$_->cust_svc->svcpart} } @dup;
}
+=item getstatus_html
+=cut
+
+sub getstatus_html {
+ my $self = shift;
+
+ my $part_svc = $self->cust_svc->part_svc;
+
+ my $html = '';
+
+ foreach my $export ( grep $_->can('export_getstatus'), $part_svc->part_export ) {
+ my $export_html = '';
+ my %hash = ();
+ $export->export_getstatus( $self, \$export_html, \%hash );
+ $html .= $export_html;
+ }
+ $html;
+
+}
=back
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 92f2017..02e068c 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -52,6 +52,7 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?)
'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?)
'list_svc_usage' => 'MyAccount/list_svc_usage',
+ 'svc_status_html' => 'MyAccount/svc_status_html',
'list_dsl_devices' => 'MyAccount/list_dsl_devices',
'add_dsl_device' => 'MyAccount/add_dsl_device',
'delete_dsl_device' => 'MyAccount/delete_dsl_device',
diff --git a/httemplate/elements/header-popup.html b/httemplate/elements/header-popup.html
index d94f7eb..472a732 100644
--- a/httemplate/elements/header-popup.html
+++ b/httemplate/elements/header-popup.html
@@ -2,15 +2,15 @@
Example:
- include( '/elements/header-popup.html',
- {
- 'title' => 'Title',
- 'menubar' => \@menubar,
- 'etc' => '', #included in <BODY> tag, for things like onLoad=
- 'head' => '', #included before closing </HEAD> tag
- 'nobr' => 0, #1 for no <BR><BR> after the title
- }
- );
+ <& /elements/header-popup.html,
+ {
+ 'title' => 'Title',
+ 'menubar' => \@menubar,
+ 'etc' => '', #included in <BODY> tag, for things like onLoad=
+ 'head' => '', #included before closing </HEAD> tag
+ 'nobr' => 0, #1 for no <BR><BR> after the title
+ }
+ &>
#old-style
include( '/elements/header.html', 'Title', $menubar, $etc, $head);
@@ -29,14 +29,14 @@ Example:
</HEAD>
<BODY <% $etc %>>
<link href="<%$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet">
+% if ( $title ) {
<FONT SIZE=6>
<CENTER><% $title |h %></CENTER>
</FONT>
-
+% }
% unless ( $nobr ) {
<BR><!--<BR>-->
% }
-
<%init>
my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
diff --git a/httemplate/view/svc_Status.html b/httemplate/view/svc_Status.html
index 4a64d47..74fd6bd 100644
--- a/httemplate/view/svc_Status.html
+++ b/httemplate/view/svc_Status.html
@@ -4,12 +4,7 @@
'nobr' => 0, #1 for no <BR><BR> after the title
}
&>
-% foreach my $export ( grep $_->can('export_getstatus'), $part_svc->part_export ) {
-% my $html = '';
-% my %hash = ();
-% $export->export_getstatus( $svc_x, \$html, \%hash );
<% $html %>
-% }
<%init>
$cgi->param('svcnum') =~ /^(\d+)$/ or die 'illegal svcnum';
@@ -19,6 +14,6 @@ my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
die "Unknown svcnum" unless $cust_svc;
my $svc_x = $cust_svc->svc_x;
-my $part_svc = $cust_svc->part_svc;
+my $html = $svc_x->getstatus_html;
</%init>