From: ivan Date: Fri, 11 Nov 2011 23:59:51 +0000 (+0000) Subject: DSL status pulling, RT#13656 X-Git-Tag: freeside_2_3_1~166 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=bf3dbb0c455af0fdafbb0e699ed2db343ab40320 DSL status pulling, RT#13656 --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 0af2c3e19..53e67404c 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 1940ca50e..d7528df67 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 3ecff337b..02e159bfa 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -1138,8 +1138,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 92f2017e2..02e068c43 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 d94f7eb48..472a7325e 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 tag, for things like onLoad= - 'head' => '', #included before closing tag - 'nobr' => 0, #1 for no

after the title - } - ); + <& /elements/header-popup.html, + { + 'title' => 'Title', + 'menubar' => \@menubar, + 'etc' => '', #included in tag, for things like onLoad= + 'head' => '', #included before closing tag + 'nobr' => 0, #1 for no

after the title + } + &> #old-style include( '/elements/header.html', 'Title', $menubar, $etc, $head); @@ -29,14 +29,14 @@ Example: > +% if ( $title ) {
<% $title |h %>
- +% } % unless ( $nobr ) {
% } - <%init> my( $title, $menubar, $etc, $head ) = ( '', '', '', '' ); diff --git a/httemplate/view/svc_Status.html b/httemplate/view/svc_Status.html index 4a64d47bc..74fd6bd81 100644 --- a/httemplate/view/svc_Status.html +++ b/httemplate/view/svc_Status.html @@ -4,12 +4,7 @@ 'nobr' => 0, #1 for no

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;