diff --git a/agent/dashboard.php b/agent/dashboard.php index f9b393cfe..5352ec870 100644 --- a/agent/dashboard.php +++ b/agent/dashboard.php @@ -1,1242 +1,628 @@ 'dark', 'High' => 'danger', 'Medium' => 'warning', 'Low' => 'info']; + +// One plain sentence on the state of the day, under the greeting +$summary = 'It\'s ' . date('l, F j') . '.'; +if ($my_tickets !== null) { + $open = $my_tickets['total']; + if ($open === 0) { + $summary .= ' No open tickets are assigned to you.'; + } else { + $summary .= " You have $open open ticket" . ($open === 1 ? '' : 's'); + $breached = $my_tickets['breached']; + $summary .= $breached ? ', ' . ($breached === $open ? ($open === 1 ? 'and it is' : 'all') : "$breached of them") . ' past SLA.' : '.'; + } } -// Fetch User Dashboard Settings -$sql_user_dashboard_settings = mysqli_query($mysqli, "SELECT user_config_dashboard_financial_enable, user_config_dashboard_technical_enable FROM user_settings WHERE user_id = $session_user_id"); -$row = mysqli_fetch_assoc($sql_user_dashboard_settings); -$user_config_dashboard_financial_enable = intval($row['user_config_dashboard_financial_enable']); -$user_config_dashboard_technical_enable = intval($row['user_config_dashboard_technical_enable']); +// Light text colours for the severity of each attention item +$tone_text = ['danger' => 'text-danger-emphasis', 'warning' => 'text-warning-emphasis', 'info' => 'text-info-emphasis', 'secondary' => 'text-body', 'success' => 'text-success-emphasis']; -// Get unique years from expenses, payments, invoices, revenues, tickets, clients, and users -$sql_years_select = mysqli_query($mysqli, " - SELECT YEAR(expense_date) AS all_years FROM expenses - UNION DISTINCT SELECT YEAR(payment_date) FROM payments - UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues - UNION DISTINCT SELECT YEAR(invoice_date) FROM invoices - UNION DISTINCT SELECT YEAR(ticket_created_at) FROM tickets - UNION DISTINCT SELECT YEAR(client_created_at) FROM clients - UNION DISTINCT SELECT YEAR(user_created_at) FROM users - ORDER BY all_years DESC -"); ?> - - +
= escapeHtml($summary) ?>
+Unbilled Ticket 1 || $unbilled_tickets == 0) { echo "s"; } ?>
+Recurring Invoices Added
+New Leads
+| = $account_name ?> | - -= numfmt_format_currency($currency_format, $balance, "$session_company_currency") ?> | -
| Date | -Customer | -Invoice | -Amount | -
|---|---|---|---|
| = $payment_date ?> | -= $client_name ?> | -= "$invoice_prefix$invoice_number" ?> | -= numfmt_format_currency($currency_format, $payment_amount, "$session_company_currency") ?> | -
| Date | -Vendor | -Category | -Amount | -
|---|---|---|---|
| = $expense_date ?> | -= $vendor_name ?> | -= $category_name ?> | -= numfmt_format_currency($currency_format, $expense_amount, "$session_company_currency") ?> | -
New Clients
+New Contacts
+ + ++ Lighter bars are expected: what's still owed on unpaid invoices, by due date, plus recurring invoices and expenses in the month they next run. Overdue invoices aren't counted. +
+ +Expiring Domains 30 Day
+| Number | -Subject | -Client | -Contact | -Priority | -Status | -Last Response | -
|---|---|---|---|---|---|---|
| - ">= "$ticket_prefix$ticket_number" ?> - - | -">= $ticket_subject ?> | -= $client_name ?> | -= $contact_display ?> | -= $ticket_priority ?> | -= $ticket_status_name ?> | -= $ticket_updated_at_display ?> | -