diff --git a/core/user_settings/app_defaults.php b/core/user_settings/app_defaults.php
index aafb6b9521..22200b5164 100644
--- a/core/user_settings/app_defaults.php
+++ b/core/user_settings/app_defaults.php
@@ -69,6 +69,13 @@ if ($domains_processed == 1) {
$array[$x]['default_setting_category'] = 'dashboard';
$array[$x]['default_setting_subcategory'] = 'admin';
$array[$x]['default_setting_name'] = 'array';
+ $array[$x]['default_setting_value'] = 'counts';
+ $array[$x]['default_setting_enabled'] = 'true';
+ $array[$x]['default_setting_description'] = 'Enable Dashboard Domain Counts block for users in the admin group.';
+ $x++;
+ $array[$x]['default_setting_category'] = 'dashboard';
+ $array[$x]['default_setting_subcategory'] = 'admin';
+ $array[$x]['default_setting_name'] = 'array';
$array[$x]['default_setting_value'] = 'call_routing';
$array[$x]['default_setting_enabled'] = 'true';
$array[$x]['default_setting_description'] = 'Enable Dashboard Call Routing controls for users in the admin group.';
diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php
index c8dc3ec3c3..3bfa2554e2 100644
--- a/core/user_settings/user_dashboard.php
+++ b/core/user_settings/user_dashboard.php
@@ -748,26 +748,28 @@
}
- //system counts
- if (in_array('counts', $selected_blocks) && permission_exists('xml_cdr_view')) {
+ //system/domain counts
+ if (in_array('counts', $selected_blocks)) {
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
+ $scope = (permission_exists('dialplan_add')) ? 'system' : 'domain';
+
$show_stat = true;
if (permission_exists('domain_view')) {
$onclick = "onclick=\"document.location.href='".PROJECT_PATH."/core/domain_settings/domains.php'\"";
- $hud_stat = $stats['system']['domains']['total'] - $stats['system']['domains']['disabled'];
+ $hud_stat = $stats[$scope]['domains']['total'] - $stats[$scope]['domains']['disabled'];
$hud_stat_title = $text['label-active_domains'];
}
else if (permission_exists('extension_view') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/extensions/")) {
$onclick = "onclick=\"document.location.href='".PROJECT_PATH."/app/extensions/extensions.php'\"";
- $hud_stat = $stats['system']['extensions']['total'] - $stats['system']['extensions']['disabled'];
+ $hud_stat = $stats[$scope]['extensions']['total'] - $stats[$scope]['extensions']['disabled'];
$hud_stat_title = $text['label-active_extensions'];
}
else if ((permission_exists('user_view') || if_group("superadmin")) && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/core/users/")) {
$onclick = "onclick=\"document.location.href='".PROJECT_PATH."/core/users/index.php'\"";
- $hud_stat = $stats['system']['users']['total'] - $stats['system']['users']['disabled'];
+ $hud_stat = $stats[$scope]['users']['total'] - $stats[$scope]['users']['disabled'];
$hud_stat_title = $text['label-active_users'];
}
else {
@@ -794,8 +796,8 @@
$tr_link = "href='".PROJECT_PATH."/core/domain_settings/domains.php'";
$hud[$n]['html'] .= "
\n";
$hud[$n]['html'] .= "| ".$text['label-domains']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['domains']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['domains']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['domains']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['domains']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -805,8 +807,8 @@
$tr_link = "href='".PROJECT_PATH."/app/devices/devices.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-devices']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['devices']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['devices']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['devices']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['devices']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -816,8 +818,8 @@
$tr_link = "href='".PROJECT_PATH."/app/extensions/extensions.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-extensions']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['extensions']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['extensions']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['extensions']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['extensions']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -827,8 +829,8 @@
$tr_link = "href='".PROJECT_PATH."/app/gateways/gateways.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-gateways']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['gateways']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['gateways']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['gateways']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['gateways']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -838,8 +840,8 @@
$tr_link = "href='".PROJECT_PATH."/core/users/index.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-users']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['users']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['users']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['users']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['users']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -849,8 +851,8 @@
$tr_link = "href='".PROJECT_PATH."/app/destinations/destinations.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-destinations']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['destinations']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['destinations']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['destinations']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['destinations']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -860,8 +862,8 @@
$tr_link = "href='".PROJECT_PATH."/app/call_centers/call_center_queues.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-call_center_queues']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['call_center_queues']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['call_center_queues']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['call_center_queues']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['call_center_queues']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -871,8 +873,8 @@
$tr_link = "href='".PROJECT_PATH."/app/ivr_menus/ivr_menus.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-ivr_menus']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['ivr_menus']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['ivr_menus']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['ivr_menus']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['ivr_menus']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -882,8 +884,8 @@
$tr_link = "href='".PROJECT_PATH."/app/ring_groups/ring_groups.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-ring_groups']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['ring_groups']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['ring_groups']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['ring_groups']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['ring_groups']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -893,8 +895,8 @@
$tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemails.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-voicemail']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['voicemails']['disabled']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['voicemails']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['voicemails']['disabled']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['voicemails']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}
@@ -910,8 +912,8 @@
$tr_link = "href='".PROJECT_PATH."/app/voicemails/voicemails.php'";
$hud[$n]['html'] .= "\n";
$hud[$n]['html'] .= "| ".$text['label-messages']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['messages']['new']." | \n";
- $hud[$n]['html'] .= "".$stats['system']['messages']['total']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['messages']['new']." | \n";
+ $hud[$n]['html'] .= "".$stats[$scope]['messages']['total']." | \n";
$hud[$n]['html'] .= "
\n";
$c = ($c) ? 0 : 1;
}