} );
}
+sub skin_info {
+ #my $p = shift;
+
+ my $conf = new FS::Conf;
+
+ my %skin = (
+ 'head' => join("\n", $conf->config('selfservice-head') ),
+ 'body_header' => join("\n", $conf->config('selfservice-body_header') ),
+ 'body_footer' => join("\n", $conf->config('selfservice-body_footer') ),
+ 'body_bgcolor' => scalar( $conf->config('selfservice-body_bgcolor') ),
+ 'box_bgcolor' => scalar( $conf->config('selfservice-box_bgcolor') ),
+
+ 'company_name' => scalar($conf->config('company_name')),
+ );
+
+ \%skin;
+
+}
+
sub login_info {
my $p = shift;
'unprovision_svc' => 'MyAccount/unprovision_svc',
'myaccount_passwd' => 'MyAccount/myaccount_passwd',
'signup_info' => 'Signup/signup_info',
+ 'skin_info' => 'MyAccount/skin_info',
'domain_select_hash' => 'Signup/domain_select_hash', # expose?
'new_customer' => 'Signup/new_customer',
'capture_payment' => 'Signup/capture_payment',
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Payment results</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your payment: $error</FONT>!;
} else {
$OUT .= 'Your payment was processed successfully. Thank you.';
} %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee">
-<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Edit billing address</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
<INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ? "Apply Changes" : "Add Customer" %>">
<BR>
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Change password</FONT><BR><BR>
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee">
-<script language="JavaScript"><!--
- var mywindow = -1;
- function myopen(filename,windowname,properties) {
- myclose();
- mywindow = window.open(filename,windowname,properties);
- }
- function myclose() {
- if ( mywindow != -1 )
- mywindow.close();
- mywindow = -1
- }
-//--></script>
-<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Change payment information</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
)->html;
%>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee">
-<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Edit service address</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT><BR><BR>!;
<INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ? "Apply Changes" : "Add Customer" %>">
<BR>
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<%= include('change_pkg') %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<%= include('order_pkg') %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!;
$OUT .= "<FONT SIZE=4>$svc removed.</FONT>";
} %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HR>
-<FONT SIZE="-2">powered by <a href="http://www.freeside.biz/freeside">freeside</a></FONT>
+</TD></TR></TABLE>
+<%= $body_footer %>
</BODY></HTML>
<HTML>
<HEAD>
- <TITLE>MyAccount</TITLE>
+ <TITLE><%= $title || 'MyAccount' %></TITLE>
+ <%= $head %>
</HEAD>
- <BODY BGCOLOR="#eeeeee">
- <FONT SIZE=5>MyAccount</FONT>
+ <BODY BGCOLOR="<%= $body_bgcolor || '#eeeeee' %>">
+ <script language="JavaScript"><!--
+ var mywindow = -1;
+ function myopen(filename,windowname,properties) {
+ myclose();
+ mywindow = window.open(filename,windowname,properties);
+ }
+ function myclose() {
+ if ( mywindow != -1 )
+ mywindow.close();
+ mywindow = -1
+ }
+ //--></script>
+ <%= $body_header %>
+ <FONT SIZE=5><%= $title || 'MyAccount' %></FONT>
<BR><BR>
<%= include('myaccount_menu') %>
<TD VALIGN="top">
-<HTML><HEAD><TITLE>Login</TITLE></HEAD>
-<BODY BGCOLOR="#e8e8e8"><FONT SIZE=5>Login</FONT><BR><BR>
+<HTML>
+ <HEAD>
+ <TITLE>Login</TITLE>
+ <%= $head %>
+ </HEAD>
+ <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>">
+ <%= $body_header %>
+
+<FONT SIZE=5>Login</FONT><BR><BR>
<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
<FORM ACTION="<%= $self_url %>" METHOD=POST>
<INPUT TYPE="hidden" NAME="session" VALUE="login">
-<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+<TABLE BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>" BORDER=0 CELLSPACING=2 CELLPADDING=0>
<TR>
<TH ALIGN="right">Username </TH>
if ( $phone_login ) {
+ $box_bgcolor ||= '#c0c0c0';
+
$OUT .= qq(
<B>OR</B><BR><BR>
<FORM ACTION="$self_url" METHOD=POST>
<INPUT TYPE="hidden" NAME="session" VALUE="login">
- <TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+ <TABLE BGCOLOR="$box_bgcolor" BORDER=0 CELLSPACING=2 CELLPADDING=0>
<TR>
<TH ALIGN="right">Phone number </TH>
<TD>
%>
-</BODY></HTML>
+<%= $body_footer %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<HTML>
+ <HEAD>
+ <TITLE>MyAccount</TITLE>
+ <%= $head %>
+ </HEAD>
+ <BODY BGCOLOR="<%= $body_bgcolor || '#e8e8e8' %>">
+ <%= $body_header %>
+
+ <FONT SIZE=5>MyAccount</FONT><BR><BR>
You have been logged out.
-</BODY></HTML>
+
+<%= $body_footer %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee">
-<script language="JavaScript"><!--
- var mywindow = -1;
- function myopen(filename,windowname,properties) {
- myclose();
- mywindow = window.open(filename,windowname,properties);
- }
- function myclose() {
- if ( mywindow != -1 )
- mywindow.close();
- mywindow = -1
- }
-//--></script>
-<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Make a payment</FONT><BR><BR>
<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true">
<INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>">
<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>">
<INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee">
-<script language="JavaScript"><!--
- var mywindow = -1;
- function myopen(filename,windowname,properties) {
- myclose();
- mywindow = window.open(filename,windowname,properties);
- }
- function myclose() {
- if ( mywindow != -1 )
- mywindow.close();
- mywindow = -1
- }
-//--></script>
-<FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Make a payment</FONT><BR><BR>
<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true">
<INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>">
<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>">
<INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
Hello <%= $name %>!<BR><BR>
<%= $small_custview %>
}
%>
-</TD></TR></TABLE>
<%= include('footer') %>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<TABLE BORDER=0><TR>
-<TD VALIGN="top" HEIGHT="100%" BGCOLOR="#dddddd">
+<TD VALIGN="top" HEIGHT="100%" BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>">
<TABLE CELLSPACING=0 BORDER=0 HEIGHT="100%">
$OUT .= '<TR><TD';
if ( exists $item->{'url'} && $action eq $item->{'url'} ) {
- $OUT .= ' BGCOLOR="#eeeeee" '.
+ $OUT .= ' BGCOLOR="'. ( $body_bgcolor || '#eeeeee' ). '" '.
' STYLE="border-top: 1px solid black;'.
' border-left: 1px solid black;'.
' border-bottom: 1px solid black"';
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Payment results</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your payment: $error</FONT>!;
} else {
$OUT .= 'Your payment was processed successfully. Thank you.';
} %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Information updated successfully.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Password changed for <%= $value %> <%= $label %>.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Information updated successfully.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Package change successful.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Information updated successfully.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Package order successful.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4><%= $svc %> recharged successfully.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4><%= $svc %> setup successfully.</FONT>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<%= include('provision_list') %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<%= include('svc_acct') %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Recharge with prepaid card</FONT><BR><BR>
<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true">
<INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>">
<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>">
<INPUT TYPE="submit" NAME="process" VALUE="Recharge"> <!-- onClick="this.disabled=true"> -->
</FORM>
-</TD></TR></TABLE>
+
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
+
<FONT SIZE=4>Recharge results</FONT><BR><BR>
<%= if ( $error ) {
$OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your prepaid card: $error</FONT>!;
$OUT .= 'Thank you.';
} %>
-</TD></TR></TABLE>
+
<%= include('footer') %>
use HTML::Entities;
use Date::Format;
use Number::Format 1.50;
-use FS::SelfService qw( login_info login customer_info edit_info invoice
- payment_info process_payment realtime_collect
- process_prepay
- list_pkgs order_pkg signup_info order_recharge
- part_svc_info provision_acct provision_external
- unprovision_svc change_pkg domainselector
- list_svcs
- list_svc_usage list_cdr_usage list_support_usage
- myaccount_passwd
- );
+use FS::SelfService qw(
+ skin_info login_info login customer_info edit_info invoice
+ payment_info process_payment realtime_collect process_prepay
+ list_pkgs order_pkg signup_info order_recharge
+ part_svc_info provision_acct provision_external
+ unprovision_svc change_pkg domainselector
+ list_svcs list_svc_usage list_cdr_usage list_support_usage
+ myaccount_passwd
+);
$template_dir = '.';
$fill_in->{'selfurl'} = $cgi->self_url;
$fill_in->{'cgi'} = \$cgi;
+ my $skin_info = skin_info();
+ $fill_in->{$_} = $skin_info->{$_} foreach keys %$skin_info;
+
my $source = "$template_dir/$name.html";
#warn "creating template for $source\n";
my $template = new Text::Template( TYPE => 'FILE',
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<%= $invoice_html %>
-</TD></TR></TABLE>
<%= include('footer') %>
-<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
-<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('myaccount_menu') %>
-<TD VALIGN="top">
+<%= include('header') %>
<FONT SIZE=4>Service usage details for
<%= Date::Format::time2str('%b %o %Y', $beginning) %> -
</TABLE>
<BR>
-</TD></TR></TABLE>
<%= include('footer') %>