Dashboard - Call Forward: Updates for PHP 8.1

This commit is contained in:
fusionate
2023-05-10 23:05:51 +00:00
parent 26595860cc
commit c3e0a845d1

View File

@@ -39,7 +39,7 @@
do_not_disturb
from
v_extensions ";
if ($_GET['show'] == "all" && permission_exists('call_forward_all')) {
if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('call_forward_all')) {
$sql .= "where true ";
}
else {
@@ -63,13 +63,17 @@
$sql .= "and extension = 'disabled' ";
}
}
$sql .= order_by($order_by, $order, 'extension', 'asc');
$sql .= order_by($order_by ?? null, $order ?? null, 'extension', 'asc');
$database = new database;
$extensions = $database->select($sql, $parameters, 'all');
unset($parameters);
//determine keys and stats
unset($stats);
//set defaults
$stats['dnd'] = $stats['follow_me'] = $stats['call_forward'] = $stats['active'] = 0;
$show_stat = false;
if (is_array($extensions) && @sizeof($extensions) != 0) {
foreach ($extensions as $row) {
@@ -92,12 +96,6 @@
//begin widget
echo "<div class='hud_box'>\n";
//set defaults
if ($stats['dnd'] == null) { $stats['dnd'] = 0; }
if ($stats['follow_me'] == null) { $stats['follow_me'] = 0; }
if ($stats['call_forward'] == null) { $stats['call_forward'] = 0; }
if ($stats['active'] == null) { $stats['active'] = 0; }
//doughnut chart
echo "<div style='display: flex; flex-wrap: wrap; justify-content: center; padding-bottom: 20px;' onclick=\"$('#hud_call_forward_details').slideToggle('fast');\">\n";
echo " <div style='width: 275px; height: 175px;'><canvas id='call_forward_chart'></canvas></div>\n";
@@ -230,9 +228,9 @@
echo "</table>\n";
echo "</div>";
$n++;
//$n++;
echo "<span class='hud_expander' onclick=\"$('#hud_call_forward_details').slideToggle('fast');\"><span class='fas fa-ellipsis-h'></span></span>\n";
echo "</div>\n";
?>
?>