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 $display = new Display();
52 $m = getArgument($args,'m');
53 $q = getArgument($args,'q');
55 $displayname = $_SESSION['ari_user']['displayname'];
56 $extension = $_SESSION['ari_user']['extension'];
59 $ret .= checkErrorMessage();
61 $header_text = _("Dashboard");
62 if (!$_SESSION['ari_user']['admin_help']) {
63 $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
67 $ret .= checkErrorMessage();
69 $ret .= $display->displayHeaderText($header_text);
70 $ret .= $display->displayLine();
72 $freeside = new FreesideSelfService();
73 $fs_info = $freeside->customer_info( array(
74 'session_id' => $_SESSION['freeside_session_id'],
76 $error = $fs_info['error'];
78 //$_SESSION['ari_error'] = _("Incorrect Username or Password");
79 $_SESSION['ari_error'] = $error; #// XXX report as ari_error???!
82 $ret .= $fs_info['small_custview'];
85 if ( $fs_info['balance'] > 0 ) {
87 #$ret .= '<B><A HREF="'. $_SESSION['ARI_ROOT'].
88 # '?m=billing&f=make_payment">Make a payment</A></B><BR><BR>';
89 $ret .= '<B><A HREF="/selfservice/selfservice.cgi?session='.
90 $_SESSION['freeside_session_id'].
91 ';action=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="'. $_SESSION['ARI_ROOT'].
101 '?m=billing&f=view_invoice&invnum=';
107 while ( $i = each($fs_info['open_invoices']) ) {
109 $invoice = $i[value];
111 $td = '<TD BGCOLOR="#'. $col. '">';
112 $a = $link. $invoice['invnum']. '">';
114 "<TR>$td$a". 'Invoice #'. $invoice['invnum']. "</A></TD>$td</TD>".
115 "$td$a". $invoice['date']. "</A></TD>$td</TD>".
116 '<TD BGCOLOR="#'. $col. '" ALIGN="right">'. $a. '$'. $invoice['owed'].
120 if ( $col == $col1 ) {
128 $ret .= '</TABLE><BR>';
130 $ret .= 'You have no outstanding invoices.<BR><BR>';
133 #$ret .= 'Received calls (10)<br><br>';
134 #$ret .= 'Placed calls (10)';
137 // $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
138 // '<TR><TH BGCOLOR="#ff6666" COLSPAN=5>Open Tickets</TH></TR>'.
139 // '<TR><TH>#</TH><TH>Subject</TH><TH>Priority</TH><TH>Queue</TH>'.
140 // '<TH>Status</TH></TR>';
141 // my $col1 = "ffffff";
142 // my $col2 = "dddddd";
145 // foreach my $ticket ( @tickets ) {
146 // my $td = qq!<TD BGCOLOR="#$col">!;
148 // "<TR>$td". $ticket->{'id'}. "</TD>".
149 // $td. $ticket->{'subject'}. "</TD>".
150 // $td. ($ticket->{'content'} || $ticket->{'priority'}). "</TD>".
151 // $td. $ticket->{'name'}. "</TD>".
152 // $td. $ticket->{'status'}. "</TD>".
154 // $col = $col eq $col1 ? $col2 : $col1;
156 // $OUT .= '</TABLE>';