[*] BO : Added Customer Service KPIs

This commit is contained in:
Damien Metzger
2013-09-25 15:24:19 +02:00
parent 875120f145
commit b80b363a2e
3 changed files with 112 additions and 1 deletions
@@ -466,6 +466,53 @@ class AdminCustomerThreadsControllerCore extends AdminController
die;
}
public function renderKpis()
{
$time = time();
$kpis = array();
/* The data generation is located in AdminStatsControllerCore */
$helper = new HelperKpi();
$helper->id = 'box-pending-messages';
$helper->icon = 'icon-envelope';
$helper->color = 'color1';
$helper->title = $this->l('Pending Messages');
if (ConfigurationKPI::get('PENDING_MESSAGES') !== false)
$helper->value = ConfigurationKPI::get('PENDING_MESSAGES');
if (ConfigurationKPI::get('PENDING_MESSAGES_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=pending_messages';
$kpis[] = $helper->generate();
$helper = new HelperKpi();
$helper->id = 'box-age';
$helper->icon = 'icon-time';
$helper->color = 'color2';
$helper->title = $this->l('Average Response Time');
$helper->subtitle = $this->l('30 days');
if (ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME') !== false)
$helper->value = ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME');
if (ConfigurationKPI::get('AVG_MSG_RESPONSE_TIME_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=avg_msg_response_time';
$kpis[] = $helper->generate();
$helper = new HelperKpi();
$helper->id = 'box-messages-per-thread';
$helper->icon = 'icon-copy';
$helper->color = 'color3';
$helper->title = $this->l('Messages per Thread');
$helper->subtitle = $this->l('30 day');
if (ConfigurationKPI::get('MESSAGES_PER_THREAD') !== false)
$helper->value = ConfigurationKPI::get('MESSAGES_PER_THREAD');
if (ConfigurationKPI::get('MESSAGES_PER_THREAD_EXPIRE') < $time)
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=messages_per_thread';
$kpis[] = $helper->generate();
$helper = new HelperKpiRow();
$helper->kpis = $kpis;
return $helper->generate();
}
public function renderView()
{
if (!$id_customer_thread = (int)Tools::getValue('id_customer_thread'))