From a2d1703dea6fd017bf19b4e43aa1594538ec6b60 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 17 Mar 2008 02:48:15 +0000 Subject: first bits of working FRI! woop! --- fs_selfservice/fri/modules/billing.module | 81 +++++++++++++ fs_selfservice/fri/modules/callmonitor.module | 6 +- fs_selfservice/fri/modules/dashboard.module | 165 ++++++++++++++++++++++++++ fs_selfservice/fri/modules/myaccount.module | 81 +++++++++++++ fs_selfservice/fri/modules/settings.module | 4 +- 5 files changed, 332 insertions(+), 5 deletions(-) create mode 100644 fs_selfservice/fri/modules/billing.module create mode 100644 fs_selfservice/fri/modules/dashboard.module create mode 100644 fs_selfservice/fri/modules/myaccount.module (limited to 'fs_selfservice/fri/modules') diff --git a/fs_selfservice/fri/modules/billing.module b/fs_selfservice/fri/modules/billing.module new file mode 100644 index 000000000..caa28b55a --- /dev/null +++ b/fs_selfservice/fri/modules/billing.module @@ -0,0 +1,81 @@ +" . _("Billing") . "


"; + + return $ret; + } + + /* + * Displays stats page + * + * @param $args + * Common arguments + */ + function display($args) { + + global $ARI_HELP_FEATURE_CODES; + + $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(); + + $ret .= 'Billing goes here'; + + return $ret; + } + +} + +?> diff --git a/fs_selfservice/fri/modules/callmonitor.module b/fs_selfservice/fri/modules/callmonitor.module index 25924d52d..36f5f285a 100644 --- a/fs_selfservice/fri/modules/callmonitor.module +++ b/fs_selfservice/fri/modules/callmonitor.module @@ -33,7 +33,7 @@ class Callmonitor { */ function navMenu($args) { - $ret .= "

" . _("Call Monitor") . "


"; + $ret .= "

" . _("Call History") . "


"; return $ret; } @@ -253,9 +253,9 @@ class Callmonitor { // header if ($_SESSION['ari_user']['admin_callmonitor']) { - $header_text = _("Call Monitor"); + $header_text = _("Call History"); } else { - $header_text = sprintf(_("Call Monitor for %s (%s)"),$displayname,$extension); + $header_text = sprintf(_("Call History for %s (%s)"),$displayname,$extension); } $ret .= $display->displayHeaderText($header_text); $ret .= $display->displaySearchBlock('left',$m,$q,$url_opts,true); diff --git a/fs_selfservice/fri/modules/dashboard.module b/fs_selfservice/fri/modules/dashboard.module new file mode 100644 index 000000000..6fd24e05b --- /dev/null +++ b/fs_selfservice/fri/modules/dashboard.module @@ -0,0 +1,165 @@ +" . _("Dashboard") . "


"; + + return $ret; + } + + /* + * Displays stats page + * + * @param $args + * Common arguments + */ + function display($args) { + + global $ARI_HELP_FEATURE_CODES; + + $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 = _("Dashboard"); + 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(); + $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 .= '
'; + + if ( $fs_info['balance'] > 0 ) { + + // XXX correct URL + $ret .= 'Make a payment

'; + + } + + // XXX count() ??? + if ( count($fs_info['open_invoices']) ) { + + $ret .= ''. + ''; + $link = ''; + $a = ''; + $ret .= + "$td$a". 'Invoice #'. $invoice['invnum']. "$td". + "$td$a". $invoice['date']. "$td". + ''. + ''; + + if ( $col == $col1 ) { + $col = $col2; + } else { + $col = $col1; + } + + } + + $ret .= '
Open Invoices
'. $a. '$'. $invoice['owed']. + '

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

'; + } + + $ret .= 'Received calls (10)

'; + $ret .= 'Placed calls (10)'; + +// if ( @tickets ) { +// $OUT .= ''. +// ''. +// ''. +// ''; +// my $col1 = "ffffff"; +// my $col2 = "dddddd"; +// my $col = $col1; +// +// foreach my $ticket ( @tickets ) { +// my $td = qq!$td". $ticket->{'id'}. "". +// $td. $ticket->{'subject'}. "". +// $td. ($ticket->{'content'} || $ticket->{'priority'}). "". +// $td. $ticket->{'name'}. "". +// $td. $ticket->{'status'}. "". +// ''; +// $col = $col eq $col1 ? $col2 : $col1; +// } +// $OUT .= '
Open Tickets
#SubjectPriorityQueueStatus
!; +// $OUT .= +// "
'; +// } else { +// $OUT .= ''; +// } + + return $ret; + } + +} + +?> diff --git a/fs_selfservice/fri/modules/myaccount.module b/fs_selfservice/fri/modules/myaccount.module new file mode 100644 index 000000000..d8af40073 --- /dev/null +++ b/fs_selfservice/fri/modules/myaccount.module @@ -0,0 +1,81 @@ +" . _("My Account") . "


"; + + return $ret; + } + + /* + * Displays stats page + * + * @param $args + * Common arguments + */ + function display($args) { + + global $ARI_HELP_FEATURE_CODES; + + $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 = _("My Account"); + 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(); + + $ret .= 'My Account goes here'; + + return $ret; + } + +} + +?> diff --git a/fs_selfservice/fri/modules/settings.module b/fs_selfservice/fri/modules/settings.module index 314ce40c5..f20eb0253 100644 --- a/fs_selfservice/fri/modules/settings.module +++ b/fs_selfservice/fri/modules/settings.module @@ -53,7 +53,7 @@ class Settings { // and we are not logged in as admin if ($exten!=$ARI_ADMIN_USERNAME) { - $ret .= "

" . _("Settings") . "


"; + $ret .= "

" . _("Phone Settings") . "


"; } return $ret; @@ -589,7 +589,7 @@ class Settings { // build page content $ret .= checkErrorMessage(); - $headerText = sprintf(_("Settings for %s (%s)"),$displayname,$exten); + $headerText = sprintf(_("Phone Settings for %s (%s)"),$displayname,$exten); $ret .= $display->displayHeaderText($headerText); $ret .= $display->displayLine(); -- cgit v1.2.1