}
+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;
'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',
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
'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',
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);
</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 ) = ( '', '', '', '' );
'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';
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>