5 * Functions for the interface to the help page
14 * rank (for prioritizing modules)
29 * Adds menu item to nav menu
34 function navMenu($args) {
36 $ret .= "<p><small><small><a href='" . $_SESSION['ARI_ROOT'] . "?m=dashboard&f=display'>" . _("Dashboard") . "</a></small></small></p><br>";
47 function display($args) {
49 global $ARI_HELP_FEATURE_CODES;
51 $display = new Display();
54 $m = getArgument($args,'m');
55 $q = getArgument($args,'q');
57 $displayname = $_SESSION['ari_user']['displayname'];
58 $extension = $_SESSION['ari_user']['extension'];
61 $ret .= checkErrorMessage();
63 $header_text = _("Dashboard");
64 if (!$_SESSION['ari_user']['admin_help']) {
65 $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
69 $ret .= checkErrorMessage();
71 $ret .= $display->displayHeaderText($header_text);
72 $ret .= $display->displayLine();
74 $freeside = new FreesideSelfService();
75 $fs_info = $freeside->customer_info( array(
76 'session_id' => $_SESSION['freeside_session_id'],
78 $error = $fs_info['error'];
80 //$_SESSION['ari_error'] = _("Incorrect Username or Password");
81 $_SESSION['ari_error'] = $error; #// XXX report as ari_error???!
84 $ret .= $fs_info['small_custview'];
87 if ( $fs_info['balance'] > 0 ) {
90 $ret .= '<B><A HREF="'. $url.
91 'make_payment">Make a payment</A></B><BR><BR>';
96 if ( count($fs_info['open_invoices']) ) {
98 $ret .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
99 '<TR><TH BGCOLOR="#ff6666" COLSPAN=5>Open Invoices</TH></TR>';
100 $link = '<A HREF="'. $url. 'myaccount'; // #XXX url
105 while ( $i = each($fs_info['open_invoices']) ) {
107 $invoice = $i[value];
109 $td = '<TD BGCOLOR="#'. $col. '">';
110 $a = '<A HREF="'. $url. 'view_invoice;invnum='.
111 $invoice['invnum']. '">';
113 "<TR>$td$a". 'Invoice #'. $invoice['invnum']. "</A></TD>$td</TD>".
114 "$td$a". $invoice['date']. "</A></TD>$td</TD>".
115 '<TD BGCOLOR="#'. $col. '" ALIGN="right">'. $a. '$'. $invoice['owed'].
119 if ( $col == $col1 ) {
127 $ret .= '</TABLE><BR>';
129 $ret .= 'You have no outstanding invoices.<BR><BR>';
132 $ret .= 'Received calls (10)<br><br>';
133 $ret .= 'Placed calls (10)';
136 // $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
137 // '<TR><TH BGCOLOR="#ff6666" COLSPAN=5>Open Tickets</TH></TR>'.
138 // '<TR><TH>#</TH><TH>Subject</TH><TH>Priority</TH><TH>Queue</TH>'.
139 // '<TH>Status</TH></TR>';
140 // my $col1 = "ffffff";
141 // my $col2 = "dddddd";
144 // foreach my $ticket ( @tickets ) {
145 // my $td = qq!<TD BGCOLOR="#$col">!;
147 // "<TR>$td". $ticket->{'id'}. "</TD>".
148 // $td. $ticket->{'subject'}. "</TD>".
149 // $td. ($ticket->{'content'} || $ticket->{'priority'}). "</TD>".
150 // $td. $ticket->{'name'}. "</TD>".
151 // $td. $ticket->{'status'}. "</TD>".
153 // $col = $col eq $col1 ? $col2 : $col1;
155 // $OUT .= '</TABLE>';