From: levinse Date: Tue, 14 Dec 2010 23:27:19 +0000 (+0000) Subject: self-service improvements, RT10883 X-Git-Tag: TORRUS_1_0_9~19 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=123bc067cc9fd8b247fb0b4e9a86066f32e83991 self-service improvements, RT10883 --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 29e374c93..3fc51b37e 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -879,6 +879,7 @@ sub list_invoices { return { 'error' => '', 'invoices' => [ map { { 'invnum' => $_->invnum, '_date' => $_->_date, + 'date' => time2str("%b %o, %Y", $_->_date), } } @cust_bill ] 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 .= ''. + ''; + my $col1 = "ffffff"; + my $col2 = "dddddd"; + my $col = $col1; + + foreach my $invoice ( @invoices ) { + my $td = qq!$td${a}Invoice #". $invoice->{'invnum'}. "$td". + "$td$a". $invoice->{'date'}. "$td". + ''; + $col = $col eq $col1 ? $col2 : $col1; + } + $OUT .= '
All Invoices
!; + my $a=qq!'; + $OUT .= + "

'; + } else { + $OUT .= 'You have no invoices.

'; + } +%> + +<%= 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 %>!

''; %> +<%= + $OUT .= qq! View All Invoices     !; +%> + <%= if ( $balance > 0 ) { if (scalar(grep $_, @hide_payment_fields)) { $OUT .= qq! Make a payment

!; 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 .= "Created ticket #$ticket_id"; +} else { + $OUT .= qq! +
$error
+ Please fill in both the subject and message +

+
+ + + + + + + + + + + + + + + + + + + +
Your e-mail address$requestor
Subject
Message
+
+ !; +} +%> + +<%= include('footer') %>