Files
crm.e5.pl/modules/EcmCalls/chart/EcmCallsChart.php
2024-04-27 09:23:34 +02:00

40 lines
1.1 KiB
PHP
Executable File

<?php
require_once('include/Sugar_Smarty.php');
require_once('include/SugarCharts/SugarChart.php');
class EcmCallsChart extends SugarChart {
function display($name, $xmlFile, $width='320', $height='480', $resize=false){
require_once('include/Sugar_Smarty.php');
// generate strings for chart if it does not exist
global $current_language, $theme;
$chartStringsXML = 'cache/xml/chart_strings.' . $current_language .'.lang.xml';
if (!file_exists($chartStringsXML)){
$this->generateChartStrings($chartStringsXML);
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign("chartName", $name);
$sugar_smarty->assign("chartXMLFile", $xmlFile);
$sugar_smarty->assign("chartStringsXML", $chartStringsXML);
// chart styles and color definitions
$sugar_smarty->assign("chartStyleCSS", chartStyle());
$sugar_smarty->assign("chartColorsXML", chartColors());
$sugar_smarty->assign("width", $width);
$sugar_smarty->assign("height", $height);
$sugar_smarty->assign("resize", $resize);
return $sugar_smarty->fetch('modules/EcmCalls/chart/chart.tpl');
}
}
?>