[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi invoices.html, NONE, 1.1 myaccount.html, 1.18, 1.19 myaccount_menu.html, 1.15, 1.16 selfservice.cgi, 1.47, 1.48 tktcreate.html, NONE, 1.1

Erik Levinson levinse at wavetail.420.am
Tue Dec 14 15:27:21 PST 2010


Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv14618/fs_selfservice/FS-SelfService/cgi

Modified Files:
	myaccount.html myaccount_menu.html selfservice.cgi 
Added Files:
	invoices.html tktcreate.html 
Log Message:
self-service improvements, RT10883

--- NEW FILE: tktcreate.html ---
<%= $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') %>

Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -d -r1.47 -r1.48
--- selfservice.cgi	23 Nov 2010 01:39:01 -0000	1.47
+++ selfservice.cgi	14 Dec 2010 23:27:19 -0000	1.48
@@ -16,7 +16,7 @@
   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 @@
 
 #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 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'} );

Index: myaccount.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -w -d -r1.18 -r1.19
--- myaccount.html	22 Sep 2010 19:16:18 -0000	1.18
+++ myaccount.html	14 Dec 2010 23:27:19 -0000	1.19
@@ -10,6 +10,10 @@
     '';
 %>
 
+<%=
+  $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>!;

Index: myaccount_menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -d -r1.15 -r1.16
--- myaccount_menu.html	21 Jan 2010 08:34:01 -0000	1.15
+++ myaccount_menu.html	14 Dec 2010 23:27:19 -0000	1.16
@@ -59,6 +59,7 @@
 push @menu,
   { title=>' ' },
   { title=>'View my usage', url=>'view_usage', size=>'+1', },
+  { title=>'Create a ticket', url=>'tktcreate', size=>'+1', },
 ;
 
 unless ( $access_pkgnum ) {

--- NEW FILE: invoices.html ---
<%= $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') %>



More information about the freeside-commits mailing list