[freeside-commits] freeside/fs_selfservice/fri/modules billing.module, 1.1, 1.2 dashboard.module, 1.1, 1.2 myaccount.module, 1.1, 1.2

Ivan,,, ivan at wavetail.420.am
Mon Mar 17 09:24:02 PDT 2008


Update of /home/cvs/cvsroot/freeside/fs_selfservice/fri/modules
In directory wavetail.420.am:/tmp/cvs-serv7672

Modified Files:
	billing.module dashboard.module myaccount.module 
Log Message:
checkpoint

Index: myaccount.module
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/fri/modules/myaccount.module,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- myaccount.module	17 Mar 2008 02:48:15 -0000	1.1
+++ myaccount.module	17 Mar 2008 16:24:00 -0000	1.2
@@ -71,7 +71,21 @@
     $ret .= $display->displayHeaderText($header_text);
     $ret .= $display->displayLine();
 
-    $ret .= 'My Account goes here';
+    $freeside = new FreesideSelfService();
+    $fs_info = $freeside->customer_info( array(
+      'session_id' => $_SESSION['freeside_session_id'],
+    ) );
+    $error = $fs_info['error'];
+    if ( $error ) {
+      //$_SESSION['ari_error'] = _("Incorrect Username or Password");
+      $_SESSION['ari_error'] = $error; #// XXX report as ari_error???!
+    }
+
+    $ret .= $fs_info['small_custview'];
+    $ret .= '<BR>';
+
+
+
 
     return $ret;
   }

Index: dashboard.module
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/fri/modules/dashboard.module,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dashboard.module	17 Mar 2008 02:48:15 -0000	1.1
+++ dashboard.module	17 Mar 2008 16:24:00 -0000	1.2
@@ -46,8 +46,6 @@
    */
   function display($args) {
 
-    global $ARI_HELP_FEATURE_CODES;
-
     $display = new Display();
 
     // args
@@ -86,9 +84,8 @@
     
     if ( $fs_info['balance'] > 0 ) {
   
-      // XXX correct URL
-      $ret .= '<B><A HREF="'. $url.
-              'make_payment">Make a payment</A></B><BR><BR>';
+      $ret .= '<B><A HREF="'. $_SESSION['ARI_ROOT'].
+              '?m=billing&f=make_payment">Make a payment</A></B><BR><BR>';
 
     }
 
@@ -97,7 +94,9 @@
   
       $ret .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
               '<TR><TH BGCOLOR="#ff6666" COLSPAN=5>Open Invoices</TH></TR>';
-      $link = '<A HREF="'. $url. 'myaccount'; // #XXX url
+      $link = '<A HREF="'. $_SESSION['ARI_ROOT'].
+              '?m=billing&f=view_invoice&invnum=';
+      
       $col1 = "eeeeee";
       $col2 = "cccccc";
       $col = $col1;
@@ -107,8 +106,7 @@
         $invoice = $i[value];
   
         $td = '<TD BGCOLOR="#'. $col. '">';
-        $a  = '<A HREF="'. $url. 'view_invoice;invnum='.
-              $invoice['invnum']. '">';
+        $a  = $link. $invoice['invnum']. '">';
         $ret .=
           "<TR>$td$a". 'Invoice #'. $invoice['invnum']. "</A></TD>$td</TD>".
           "$td$a". $invoice['date']. "</A></TD>$td</TD>".

Index: billing.module
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/fri/modules/billing.module,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- billing.module	17 Mar 2008 02:48:15 -0000	1.1
+++ billing.module	17 Mar 2008 16:24:00 -0000	1.2
@@ -46,8 +46,6 @@
    */
   function display($args) {
 
-    global $ARI_HELP_FEATURE_CODES;
-
     $display = new Display();
 
     // args
@@ -71,9 +69,107 @@
     $ret .= $display->displayHeaderText($header_text);
     $ret .= $display->displayLine();
 
+
+    $freeside = new FreesideSelfService();
+    #$fs_info = $freeside->customer_info( array(
+    #  'session_id' => $_SESSION['freeside_session_id'],
+    #) );
+    #$error = $fs_info['error'];
+    #if ( $error ) {
+    #  //$_SESSION['ari_error'] = _("Incorrect Username or Password");
+    #  $_SESSION['ari_error'] = $error; #// XXX report as ari_error???!
+    #}
+
     $ret .= 'Billing goes here';
+    // XXX navigate to make payment, view invoice,
+    // & myaccount change payment info
+
+    return $ret;
+
+  }
+
+  function make_payment($args) {
+
+    $display = new Display();
+
+    // args
+    $m = getArgument($args,'m');
+    $q = getArgument($args,'q');
+
+    $displayname = $_SESSION['ari_user']['displayname'];
+    $extension = $_SESSION['ari_user']['extension'];
+
+    // build page content
+    $ret .= checkErrorMessage();
+
+	$header_text = _("Billing");
+	if (!$_SESSION['ari_user']['admin_help']) {
+		$header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
+	}
+
+    // build page content
+    $ret .= checkErrorMessage();
+
+    $ret .= $display->displayHeaderText($header_text);
+    $ret .= $display->displayLine();
+
+
+    #$freeside = new FreesideSelfService();
+
+    $ret .= 'Make payment goes here';
+
+    return $ret;
+
+  }
+
+  function view_invoice($args) {
+
+    $display = new Display();
+
+    // args
+    $m = getArgument($args,'m');
+    $q = getArgument($args,'q');
+
+    $displayname = $_SESSION['ari_user']['displayname'];
+    $extension = $_SESSION['ari_user']['extension'];
+
+    // build page content
+    $ret .= checkErrorMessage();
+
+	$header_text = _("Billing");
+	if (!$_SESSION['ari_user']['admin_help']) {
+		$header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
+	}
+
+    // build page content
+    $ret .= checkErrorMessage();
+
+    $ret .= $display->displayHeaderText($header_text);
+    #$ret .= $display->displayLine();
+
+    $invnum = getArgument($args, 'invnum');
+
+    $freeside = new FreesideSelfService();
+    $invoice = $freeside->invoice( array(
+      'session_id' => $_SESSION['freeside_session_id'],
+      'invnum'     => $invnum,
+    ) );
+    $error = $invoice['error'];
+    if ( $error ) {
+      //$_SESSION['ari_error'] = _("Incorrect Username or Password");
+      $_SESSION['ari_error'] = $error; // XXX report as ari_error???!
+    }
+
+    $html = $invoice['invoice_html']->scalar;
+    $html = str_replace( "\xA0", '&nbsp;', $html); // XX doh
+    error_log($html);
+
+    $ret .= '<TABLE BGCOLOR="#000000" BORDER=0><TR><TD>'.
+            $html.
+            '</TD></TR></TABLE>';
 
     return $ret;
+
   }
 
 }



More information about the freeside-commits mailing list