summaryrefslogtreecommitdiff
path: root/fs_selfservice
diff options
context:
space:
mode:
authorlevinse <levinse>2010-12-14 23:27:19 +0000
committerlevinse <levinse>2010-12-14 23:27:19 +0000
commit123bc067cc9fd8b247fb0b4e9a86066f32e83991 (patch)
tree16f97edf53ad765f2bfb767564b736acf337553e /fs_selfservice
parent88be1de5a77b567c1f610bc510ca386738538488 (diff)
self-service improvements, RT10883
Diffstat (limited to 'fs_selfservice')
-rw-r--r--fs_selfservice/FS-SelfService/cgi/invoices.html27
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount.html4
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount_menu.html1
-rw-r--r--fs_selfservice/FS-SelfService/cgi/selfservice.cgi29
-rw-r--r--fs_selfservice/FS-SelfService/cgi/tktcreate.html38
5 files changed, 97 insertions, 2 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/invoices.html b/fs_selfservice/FS-SelfService/cgi/invoices.html
new file mode 100644
index 000000000..c4eece32a
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/invoices.html
@@ -0,0 +1,27 @@
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('header', 'All Invoices') %>
+
+<%=
+ if ( @invoices ) {
+ $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
+ '<TR><TH BGCOLOR="#ff6666" COLSPAN=4>All Invoices</TH></TR>';
+ my $col1 = "ffffff";
+ my $col2 = "dddddd";
+ my $col = $col1;
+
+ foreach my $invoice ( @invoices ) {
+ my $td = qq!<TD BGCOLOR="#$col">!;
+ my $a=qq!<A HREF="${url}view_invoice;invnum=!. $invoice->{'invnum'}. '">';
+ $OUT .=
+ "<TR>$td${a}Invoice #". $invoice->{'invnum'}. "</A></TD>$td</TD>".
+ "$td$a". $invoice->{'date'}. "</A></TD>$td</TD>".
+ '</TR>';
+ $col = $col eq $col1 ? $col2 : $col1;
+ }
+ $OUT .= '</TABLE><BR>';
+ } else {
+ $OUT .= 'You have no invoices.<BR><BR>';
+ }
+%>
+
+<%= include('footer') %>
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html
index 6b4187f36..db95f339f 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@ -10,6 +10,10 @@ Hello <%= $name %>!<BR><BR>
'';
%>
+<%=
+ $OUT .= qq! <B><A HREF="${url}invoices">View All Invoices</A></B> &nbsp; &nbsp; !;
+%>
+
<%= if ( $balance > 0 ) {
if (scalar(grep $_, @hide_payment_fields)) {
$OUT .= qq! <B><A HREF="${url}make_thirdparty_payment&payby_method=CC">Make a payment</A></B><BR><BR>!;
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
index 9d330361c..1f448a104 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
@@ -59,6 +59,7 @@ if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eve
push @menu,
{ title=>' ' },
{ title=>'View my usage', url=>'view_usage', size=>'+1', },
+ { title=>'Create a ticket', url=>'tktcreate', size=>'+1', },
;
unless ( $access_pkgnum ) {
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index d23e6ba68..25d61aca6 100644
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -16,7 +16,7 @@ use FS::SelfService qw(
part_svc_info provision_acct provision_external
unprovision_svc change_pkg suspend_pkg domainselector
list_svcs list_svc_usage list_cdr_usage list_support_usage
- myaccount_passwd
+ myaccount_passwd list_invoices create_ticket
mason_comp
);
@@ -73,7 +73,7 @@ $session_id = $cgi->param('session');
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
+ /^(myaccount|tktcreate|invoices|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -199,6 +199,31 @@ sub view_invoice {
}
+sub invoices {
+ list_invoices( 'session_id' => $session_id, );
+}
+
+sub tktcreate {
+ my $customer_info = customer_info( 'session_id' => $session_id );
+ return $customer_info if ( $customer_info->{'error'} );
+
+ my $requestor = "";
+ if ( $customer_info->{'invoicing_list'} ) {
+ my @requestor = split( /\s*\,\s*/, $customer_info->{'invoicing_list'} );
+ $requestor = $requestor[0] if scalar(@requestor);
+ }
+
+ return { 'requestor' => $requestor }
+ unless ($cgi->param('subject') && $cgi->param('message') &&
+ length($cgi->param('subject')) && length($cgi->param('message')));
+
+ create_ticket( 'session_id' => $session_id,
+ 'subject' => $cgi->param('subject'),
+ 'message' => $cgi->param('message'),
+ 'requestor' => $requestor,
+ );
+}
+
sub customer_order_pkg {
my $init_data = signup_info( 'customer_session_id' => $session_id );
return $init_data if ( $init_data->{'error'} );
diff --git a/fs_selfservice/FS-SelfService/cgi/tktcreate.html b/fs_selfservice/FS-SelfService/cgi/tktcreate.html
new file mode 100644
index 000000000..de7ff60b8
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/tktcreate.html
@@ -0,0 +1,38 @@
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('header', 'Create a ticket') %>
+
+<%=
+if ( $ticket_id ) {
+ $OUT .= "<B>Created ticket #$ticket_id</B>";
+} else {
+ $OUT .= qq!
+ <div style='font-weight: bold; color: red; margin-bottom: 6px;'> $error </div>
+ Please fill in both the subject and message
+ <br><br>
+ <FORM ACTION="$selfurl" METHOD=POST>
+ <input type="hidden" name="session" value="$session_id">
+ <input type="hidden" name="action" value="tktcreate">
+ <table>
+ <tr>
+ <td>Your e-mail address</td>
+ <td>$requestor</td>
+ </tr>
+ <tr>
+ <td>Subject</td>
+ <td><input type="text" name="subject" size="53"></td>
+ </tr>
+ <tr>
+ <td valign="top">Message</td>
+ <td><textarea name="message" rows="10" cols="60"></textarea></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input type="submit" value="Create"></td>
+ </tr>
+ </table>
+ </form>
+ !;
+}
+%>
+
+<%= include('footer') %>