Update KPIs on applicable pages at back office
This commit is contained in:
@@ -508,7 +508,8 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$time = time();
|
||||
$kpis = array();
|
||||
|
||||
/* The data generation is located in AdminStatsControllerCore */
|
||||
$statsController = new AdminStatsController();
|
||||
$this->context->controller = $this;
|
||||
|
||||
$helper = new HelperKpi();
|
||||
$helper->id = 'box-pending-messages';
|
||||
@@ -518,6 +519,8 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$helper->title = $this->l('Pending Discussion Threads', null, null, false);
|
||||
if (ConfigurationKPI::get('PENDING_MESSAGES') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('PENDING_MESSAGES');
|
||||
} else {
|
||||
$helper->value = $statsController->getLatestKpiValue('pending_messages');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=pending_messages';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('PENDING_MESSAGES_EXPIRE') < $time);
|
||||
@@ -531,6 +534,8 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$helper->subtitle = $this->l('30 days', null, null, false);
|
||||
if (ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME');
|
||||
} else {
|
||||
$helper->value = $statsController->getLatestKpiValue('avg_msg_response_time');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=avg_msg_response_time';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME_EXPIRE') < $time);
|
||||
@@ -544,6 +549,8 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$helper->subtitle = $this->l('30 day', null, null, false);
|
||||
if (ConfigurationKPI::get('MESSAGES_PER_THREAD') !== false) {
|
||||
$helper->value = ConfigurationKPI::get('MESSAGES_PER_THREAD');
|
||||
} else {
|
||||
$helper->value = $statsController->getLatestKpiValue('messages_per_thread');
|
||||
}
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=messages_per_thread';
|
||||
$helper->refresh = (bool)(ConfigurationKPI::get('MESSAGES_PER_THREAD_EXPIRE') < $time);
|
||||
|
||||
Reference in New Issue
Block a user