90 lines
3.3 KiB
PHP
90 lines
3.3 KiB
PHP
<?php /* Smarty version Smarty-3.1.7, created on 2020-01-29 15:49:17
|
|
compiled from "C:\inetpub\wwwroot\sophalcrm\includes\runtime/../../layouts/v7\modules\Potentials\dashboards\PipelinedAmountPerSalesPerson.tpl" */ ?>
|
|
<?php /*%%SmartyHeaderCode:5189703975e31a97dd6e0d3-48863430%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
|
|
$_valid = $_smarty_tpl->decodeProperties(array (
|
|
'file_dependency' =>
|
|
array (
|
|
'194d66c30d68f761d215ec2bf4d404b8a9e55206' =>
|
|
array (
|
|
0 => 'C:\\inetpub\\wwwroot\\sophalcrm\\includes\\runtime/../../layouts/v7\\modules\\Potentials\\dashboards\\PipelinedAmountPerSalesPerson.tpl',
|
|
1 => 1520586670,
|
|
2 => 'file',
|
|
),
|
|
),
|
|
'nocache_hash' => '5189703975e31a97dd6e0d3-48863430',
|
|
'function' =>
|
|
array (
|
|
),
|
|
'variables' =>
|
|
array (
|
|
'MODULE_NAME' => 0,
|
|
),
|
|
'has_nocache_code' => false,
|
|
'version' => 'Smarty-3.1.7',
|
|
'unifunc' => 'content_5e31a97ddd790',
|
|
),false); /*/%%SmartyHeaderCode%%*/?>
|
|
<?php if ($_valid && !is_callable('content_5e31a97ddd790')) {function content_5e31a97ddd790($_smarty_tpl) {?>
|
|
|
|
<div class="dashboardWidgetHeader">
|
|
<?php echo $_smarty_tpl->getSubTemplate (vtemplate_path("dashboards/WidgetHeader.tpl",$_smarty_tpl->tpl_vars['MODULE_NAME']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
|
|
|
|
</div>
|
|
<div class="dashboardWidgetContent">
|
|
<?php echo $_smarty_tpl->getSubTemplate (vtemplate_path("dashboards/DashBoardWidgetContents.tpl",$_smarty_tpl->tpl_vars['MODULE_NAME']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
|
|
|
|
</div>
|
|
<div class="widgeticons dashBoardWidgetFooter">
|
|
<div class="footerIcons pull-right">
|
|
<?php echo $_smarty_tpl->getSubTemplate (vtemplate_path("dashboards/DashboardFooterIcons.tpl",$_smarty_tpl->tpl_vars['MODULE_NAME']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
Vtiger_MultiBarchat_Widget_Js('Vtiger_PipelinedAmountPerSalesPerson_Widget_Js',{},{
|
|
getCharRelatedData : function() {
|
|
var container = this.getContainer();
|
|
var data = container.find('.widgetData').val();
|
|
data = JSON.parse(data);
|
|
var users = new Array();
|
|
var stages = new Array();
|
|
var count = new Array();
|
|
for(var i=0; i<data.length ;i++) {
|
|
if($.inArray(data[i].last_name, users) == -1) {
|
|
users.push(data[i].last_name);
|
|
}
|
|
if($.inArray(data[i].sales_stage, stages) == -1) {
|
|
stages.push(data[i].sales_stage);
|
|
}
|
|
}
|
|
var allLinks = new Array();
|
|
for(j in stages) {
|
|
var salesStageCount = new Array();
|
|
var links = new Array();
|
|
for(i in users) {
|
|
var salesCount = 0;
|
|
for(var k in data) {
|
|
var userData = data[k];
|
|
if(userData.sales_stage == stages[j] && userData.last_name == users[i]) {
|
|
salesCount = parseFloat(userData.amount);
|
|
link = userData.links
|
|
break;
|
|
}
|
|
}
|
|
links.push(link);
|
|
salesStageCount.push(salesCount);
|
|
}
|
|
allLinks.push(links);
|
|
count.push(salesStageCount);
|
|
}
|
|
return {
|
|
'data' : count,
|
|
'ticks' : users,
|
|
'labels' : stages,
|
|
'links' : allLinks
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
<?php }} ?>
|