本文整理汇总了PHP中SugarChartFactory类 的典型用法代码示例。如果您正苦于以下问题:PHP SugarChartFactory类的具体用法?PHP SugarChartFactory怎么用?PHP SugarChartFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SugarChartFactory类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
public function display()
{
$currency_symbol = $GLOBALS['sugar_config']['default_currency_symbol'];
if ($GLOBALS['current_user']->getPreference('currency')) {
require_once 'modules/Currencies/Currency.php';
$currency = new Currency();
$currency->retrieve($GLOBALS['current_user']->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$this->chartDefName = $this->which_chart[0];
//$chartDef = $this->chartDefs[$this->chartDefName];
$chartDef = array('type' => 'code', 'id' => 'Chart_invoices_by_month', 'label' => 'Invoices by Month', 'chartUnits' => 'Invoice Size in $1K', 'chartType' => 'stacked group by chart', 'groupBy' => array('m', 'state_in_chart'), 'base_url' => array('module' => 'reg_invoices', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search'), 'url_params' => array('state', 'date_closed'));
require_once 'include/SugarCharts/SugarChartFactory.php';
// Special chart config for RegInvoices
$sugarChart = SugarChartFactory::getInstance('Jit', 'RegInvoices');
$sugarChart->setProperties('', translate('LBL_FACT_SIZE', 'reg_invoices') . ' ' . $currency_symbol . '1' . translate('LBL_OPP_THOUSANDS', 'Charts'), $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->is_currency = true;
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
$sugarChart->getData($this->constructQuery());
$this->sortData($sugarChart->data_set);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />';
}
开发者ID:pixprod, 项目名称:Regoluna-Invoices-for-SugarCRM, 代码行数:26, 代码来源:RegInvoicesChartDashlet.php
示例2: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $current_user, $sugar_config;
require "modules/Charts/chartdefs.php";
$chartDef = $chartDefs['lead_source_by_outcome'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->is_currency = true;
$currency_symbol = $sugar_config['default_currency_symbol'];
if ($current_user->getPreference('currency')) {
$currency = new Currency();
$currency->retrieve($current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts');
$sugarChart->setProperties('', $subtitle, $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
if (count($this->lsbo_ids) > 0) {
$sugarChart->url_params['assigned_user_id'] = array_values($this->lsbo_ids);
}
$sugarChart->getData($this->constuctQuery());
$sugarChart->data_set = $sugarChart->sortData($sugarChart->data_set, 'lead_source', true, 'sales_stage', true, true);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
开发者ID:delkyd, 项目名称:sugarcrm_dev, 代码行数:31, 代码来源:OpportunitiesByLeadSourceByOutcomeDashlet.php
示例3: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $current_user, $sugar_config;
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->base_url = array('module' => 'Opportunities', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search');
//fixing bug #27097: The opportunity list is not correct after drill-down
//should send to url additional params: start range value and end range value
$sugarChart->url_params = array('start_range_date_closed' => $this->pbss_date_start, 'end_range_date_closed' => $this->pbss_date_end);
$sugarChart->group_by = $this->constructGroupBy();
$sugarChart->setData($this->getChartData($this->constructQuery()));
$sugarChart->is_currency = true;
$sugarChart->thousands_symbol = translate('LBL_OPP_THOUSANDS', 'Charts');
$currency_symbol = $sugar_config['default_currency_symbol'];
if ($current_user->getPreference('currency')) {
$currency = BeanFactory::getBean('Currencies', $current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts');
$pipeline_total_string = translate('LBL_TOTAL_PIPELINE', 'Charts') . $sugarChart->currency_symbol . format_number($sugarChart->getTotal(), 0, 0, array('convert' => true)) . $sugarChart->thousands_symbol;
if ($this->pbss_chart_type == 'hbar') {
$sugarChart->setProperties($pipeline_total_string, $subtitle, 'horizontal group by chart');
} else {
$sugarChart->setProperties($pipeline_total_string, $subtitle, 'funnel chart 3D');
}
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:32, 代码来源:PipelineBySalesStageDashlet.php
示例4: testConfigChartFactory
public function testConfigChartFactory()
{
global $sugar_config;
$sugar_config['chartEngine'] = 'Jit';
$sugarChart = SugarChartFactory::getInstance();
$name = get_class($sugarChart);
$this->assertEquals('Jit', $name, 'Assert chart engine set in global sugar_config is correct');
}
开发者ID:delkyd, 项目名称:sugarcrm_dev, 代码行数:8, 代码来源:SugarChartFactoryTest.php
示例5: display
/**
* Don't override this method, since it does all the work of actually rendering the chart.
*
* @see DashletGenericChart::display()
*/
public function display()
{
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->setProperties('', $this->subtitle, 'funnel chart 3D');
$sugarChart->base_url = array('module' => !empty($this->_seedName) ? $this->_seedName : 'Home', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search');
$sugarChart->group_by = $this->groupBy;
if (empty($this->urlParams)) {
$this->urlParams = $this->groupBy;
}
$sugarChart->url_params = $this->urlParams;
$sugarChart->setData($this->getDataset());
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
开发者ID:omusico, 项目名称:sugar_work, 代码行数:20, 代码来源:DashletGenericFunnelChart.php
示例6: display
public function display($title, $subTitle, $xmlFile, $chartType, $width = '100%', $height = '480')
{
global $current_user, $sugar_config;
require "modules/Charts/chartdefs.php";
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->is_currency = true;
$currency_symbol = $sugar_config['default_currency_symbol'];
$sugarChart->setProperties($title, $subTitle, $chartType);
if ($current_user->getPreference('currency')) {
$currency = new Currency();
$currency->retrieve($current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, $width, $height, false) . '</div>';
}
开发者ID:jeffcao, 项目名称:fzglsys_v5, 代码行数:16, 代码来源:ReportsDashletChart.php
示例7: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $sugar_config, $current_user, $timedate;
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->base_url = array('module' => 'Opportunities', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search');
$sugarChart->url_params = array('assigned_user_id' => $current_user->id);
$sugarChart->group_by = $this->constructGroupBy();
$currency_symbol = $sugar_config['default_currency_symbol'];
if ($current_user->getPreference('currency')) {
$currency = BeanFactory::getBean('Currencies', $current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$sugarChart->is_currency = true;
$sugarChart->thousands_symbol = translate('LBL_OPP_THOUSANDS', 'Charts');
$subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts');
$query = $this->constructQuery();
if ($this->mypbss_chart_type == 'hbar') {
$dataset = $this->constructCEChartData($this->getChartData($query));
$sugarChart->setData($dataset);
$total = format_number($this->getHorizBarTotal($dataset), 0, 0, array('convert' => true));
$pipeline_total_string = translate('LBL_TOTAL_PIPELINE', 'Charts') . $sugarChart->currency_symbol . $total . $sugarChart->thousands_symbol;
$sugarChart->setProperties($pipeline_total_string, $subtitle, 'horizontal bar chart');
} else {
$sugarChart->setData($this->getChartData($query));
$total = format_number($sugarChart->getTotal(), 0, 0, array('convert' => true));
$pipeline_total_string = translate('LBL_TOTAL_PIPELINE', 'Charts') . $sugarChart->currency_symbol . $total . $sugarChart->thousands_symbol;
$sugarChart->setProperties($pipeline_total_string, $subtitle, 'funnel chart 3D');
}
// Bug #53753 We have to add values for filter based on "Expected Close Date" field
if (!empty($this->mypbss_date_start) && !empty($this->mypbss_date_end)) {
$sugarChart->url_params['date_closed_advanced_range_choice'] = 'between';
$sugarChart->url_params['start_range_date_closed_advanced'] = $timedate->to_display_date($this->mypbss_date_start, false);
$sugarChart->url_params['end_range_date_closed_advanced'] = $timedate->to_display_date($this->mypbss_date_end, false);
} elseif (!empty($this->mypbss_date_start)) {
$sugarChart->url_params['date_closed_advanced_range_choice'] = 'greater_than';
$sugarChart->url_params['range_date_closed_advanced'] = $timedate->to_display_date($this->mypbss_date_start, false);
} elseif (!empty($this->mypbss_date_end)) {
$sugarChart->url_params['date_closed_advanced_range_choice'] = 'less_than';
$sugarChart->url_params['range_date_closed_advanced'] = $timedate->to_display_date($this->mypbss_date_end, false);
}
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:48, 代码来源:MyPipelineBySalesStageDashlet.php
示例8: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
require 'modules/Charts/chartdefs.php';
$chartDef = $chartDefs['opportunities_this_quarter'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->setProperties('', translate('LBL_NUMBER_OF_OPPS', 'Charts'), $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
// get gauge target
$qry = "SELECT * from opportunities WHERE assigned_user_id = '" . $GLOBALS['current_user']->id . "' AND deleted=0";
$result = $this->getSeedBean()->db->query($this->getSeedBean()->create_list_count_query($qry));
$row = $this->getSeedBean()->db->fetchByAssoc($result);
$sugarChart->setDisplayProperty('gaugeTarget', $row['c']);
$sugarChart->getData($this->constructQuery());
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:23, 代码来源:MyOpportunitiesGaugeDashlet.php
示例9: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $db, $app_list_strings;
require "modules/Charts/chartdefs.php";
$chartDef = $chartDefs['my_modules_used_last_30_days'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->setProperties('', translate('LBL_MY_MODULES_USED_SIZE', 'Charts'), $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
$result = $db->query($this->constructQuery());
$dataset = array();
while ($row = $db->fetchByAssoc($result)) {
$dataset[translate($row['module_name'])] = $row['count'];
}
$sugarChart->setData($dataset);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:24, 代码来源:MyModulesUsedChartDashlet.php
示例10: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $db;
require "modules/Charts/chartdefs.php";
$chartDef = $chartDefs['my_team_modules_used_last_30_days'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->forceHideDataGroupLink = true;
$sugarChart->setProperties('', $chartDef['chartUnits'], $chartDef['chartType']);
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
$result = $db->query($this->constructQuery());
$dataset = array();
while ($row = $db->fetchByAssoc($result)) {
$dataset[] = array('user_name' => $row['user_name'], 'module_name' => $row['module_name'], 'total' => $row['count']);
}
$sugarChart->setData($dataset);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:24, 代码来源:MyTeamModulesUsedChartDashlet.php
示例11: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
$currency_symbol = $GLOBALS['sugar_config']['default_currency_symbol'];
if ($GLOBALS['current_user']->getPreference('currency')) {
$currency = BeanFactory::getBean('Currencies', $GLOBALS['current_user']->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
require "modules/Charts/chartdefs.php";
$chartDef = $chartDefs['outcome_by_month'];
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->setProperties('', translate('LBL_OPP_SIZE', 'Charts') . ' ' . $currency_symbol . '1' . translate('LBL_OPP_THOUSANDS', 'Charts'), $chartDef['chartType']);
$sugarChart->base_url = $chartDef['base_url'];
$sugarChart->group_by = $chartDef['groupBy'];
$sugarChart->url_params = array();
$sugarChart->getData($this->constructQuery());
$sugarChart->is_currency = true;
$sugarChart->data_set = $sugarChart->sortData($sugarChart->data_set, 'm', false, 'sales_stage', true, true);
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div>' . $this->processAutoRefresh();
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:25, 代码来源:OutcomeByMonthDashlet.php
示例12: setUp
public function setUp()
{
$GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
$this->sugarChart = SugarChartFactory::getInstance('Jit', 'Reports');
}
开发者ID:delkyd, 项目名称:sugarcrm_dev, 代码行数:5, 代码来源:Bug43574Test.php
示例13: build_report_chart
function build_report_chart()
{
require_once 'include/SugarCharts/SugarChartFactory.php';
$chart = SugarChartFactory::getInstance();
/* echo $resources = $chart->getChartResources();
echo $mySugarResources = $chart->getMySugarChartResources();*/
$chart->setProperties('test', 'sub_test', 'funnel chart 3D');
$chart->group_by = array('Type2', 'Assigned to1');
$result = $this->db->query($this->build_report_query());
$data = array();
while ($row = $this->db->fetchByAssoc($result, false)) {
$row['key'] = $row['Type2'];
$row['value'] = $row['Type2'];
$row['total'] = $row['count0'];
$data[] = $row;
}
$chart->setData($data);
$file = create_cache_directory('modules/AOR_Reports/Charts/') . 'chart.xml';
$chart->saveXMLFile($file, $chart->generateXML());
return $chart->display('test', $file, '100%', '480', false);
}
开发者ID:isrealconsulting, 项目名称:ic-suite, 代码行数:21, 代码来源:AOR_Report.php
示例14: reportCriteriaWithResult
//.........这里部分代码省略.........
$global_json = getJSONobj();
global $ACLAllowedModules;
$ACLAllowedModules = getACLAllowedModules();
$smarty->assign('ACLAllowedModules', $global_json->encode(array_keys($ACLAllowedModules)));
template_reports_filters($smarty, $args);
$smarty->assign('reporter_report_type', $args['reporter']->report_type);
$smarty->assign('current_user_id', $current_user->id);
$smarty->assign('md5_current_user_id', md5($current_user->id));
if (!hasRuntimeFilter($reporter)) {
//$showRunReportButton = false;
$smarty->assign('filterTabStyle', "display:none");
} else {
$smarty->assign('filterTabStyle', "display:''");
}
$smarty->assign('reportResultHeader', $mod_strings['LBL_REPORT_RESULTS']);
$reportDetailsButtonTitle = $mod_strings['LBL_REPORT_HIDE_DETAILS'];
$reportDetailsTableStyle = '';
if (isset($args['reportCache'])) {
$reportCache = $args['reportCache'];
if (!empty($reportCache->report_options_array)) {
if (array_key_exists("showDetails", $reportCache->report_options_array) && !$reportCache->report_options_array['showDetails']) {
$reportDetailsButtonTitle = $mod_strings['LBL_REPORT_SHOW_DETAILS'];
$reportDetailsTableStyle = 'display:none';
}
}
// if
}
// if
$smarty->assign('reportDetailsButtonTitle', $reportDetailsButtonTitle);
$smarty->assign('reportDetailsTableStyle', $reportDetailsTableStyle);
$smarty->assign('cache_path', sugar_cached(''));
template_reports_request_vars_js($smarty, $reporter, $args);
//custom chart code
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$resources = $sugarChart->getChartResources();
$smarty->assign('chartResources', $resources);
$smarty->assign('id', empty($_REQUEST['id']) ? false : $_REQUEST['id']);
//Bug#51609: Create action buttons for report view. Previously existed in _reportCriteriaWithResult.tpl
$buttons = array();
$buttons[] = <<<EOD
<input name="runReportButton" id="runReportButton" type="submit" class="button" accessKey="{$mod_strings['LBL_RUN_REPORT_BUTTON_KEY']}" title="{$mod_strings['LBL_RUN_BUTTON_TITLE']}"
onclick="this.form.to_pdf.value='';this.form.to_csv.value='';this.form.save_report.value='';" value="{$mod_strings['LBL_RUN_REPORT_BUTTON_LABEL']}">
EOD;
$reportName = $args['reporter']->saved_report->name;
$shareButtonCode = "parent.SUGAR.App.bwc.shareRecord('Reports', '{$report_id}', '{$reportName}');";
$buttons[] = <<<EOD
<input type="button" class="button" name="shareReportButton" id="shareReportButton" accessKey="{$app_strings['LBL_SHARE_BUTTON_KEY']}" value="{$app_strings['LBL_SHARE_BUTTON_LABEL']}" title="{$app_strings['LBL_SHARE_BUTTON_TITLE']}"
onclick="{$shareButtonCode}">
EOD;
if ($report_edit_access) {
$buttons[] = <<<EOD
<input type="submit" class="button" name="editReportButton" id="editReportButton" accessKey="{$app_strings['LBL_EDIT_BUTTON_KEY']}" value="{$app_strings['LBL_EDIT_BUTTON_LABEL']}" title="{$app_strings['LBL_EDIT_BUTTON_TITLE']}"
onclick="this.form.to_pdf.value='';this.form.to_csv.value='';this.form.action.value='ReportsWizard';">
EOD;
}
array_push($buttons, $duplicateButtons);
if ($report_edit_access) {
$buttons[] = <<<EOD
<input type="button" class="button" name="scheduleReportButton" id="scheduleReportButton" value="{$mod_strings['LBL_REPORT_SCHEDULE_TITLE']}"
onclick="schedulePOPUP()">
EOD;
}
if ($report_export_access) {
//workaround for SP-1685, Need to clear bwcModel so change confirmation doesn't fire after making a PDF.
$buttons[] = <<<EOD
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:67, 代码来源:templates_reports.php
示例15: getSugarChart
/**
* Return the SugarChart's object with all the values set and ready for display/consumption.
*
* @return JitReports|string
*/
public function getSugarChart()
{
if ($this->canDrawChart()) {
require_once 'include/SugarCharts/SugarChartFactory.php';
/* @var $sugarChart JitReports */
$sugarChart = SugarChartFactory::getInstance('', 'Reports');
$sugarChart->setData($this->chartRows);
global $do_thousands;
$sugarChart->setProperties($this->chartTitle, '', $this->chartType, 'on', 'value', 'on', $do_thousands);
if (isset($this->reporter->report_def['group_defs'])) {
$groupByNames = array();
foreach ($this->reporter->report_def['group_defs'] as $group_def) {
$groupByNames[] = $group_def['name'];
}
$sugarChart->group_by = $groupByNames;
}
return $sugarChart;
} else {
global $current_language;
$mod_strings = return_module_language($current_language, 'Reports');
return $mod_strings['LBL_NO_CHART_DRAWN_MESSAGE'];
}
}
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:28, 代码来源:ChartDisplay.php
示例16: display
function display()
{
global $app_list_strings, $locale;
//add chart
if (isset($_REQUEST['id']) && $_REQUEST['id'] != false) {
$this->bean->is_saved_report = true;
}
// fixing bug #47260: Print PDF Reports
// if chart_type is 'none' we don't need do add any image to pdf
if ($this->bean->chart_type != 'none') {
$chartDisplay = new ChartDisplay();
$xmlFile = $chartDisplay->get_cache_file_name($this->bean);
$sugarChart = SugarChartFactory::getInstance();
if ($sugarChart->supports_image_export) {
$imageFile = $sugarChart->get_image_cache_file_name($xmlFile, "." . $sugarChart->image_export_type);
// check image size is not '0'
if (file_exists($imageFile) && getimagesize($imageFile) > 0) {
$this->AddPage();
list($width, $height) = getimagesize($imageFile);
$imageWidthAsUnits = $this->pixelsToUnits($width);
$imageHeightAsUnits = $this->pixelsToUnits($height);
$dimensions = $this->getPageDimensions();
$pageWidth = $dimensions['wk'];
$pageHeight = $dimensions['hk'];
$marginTop = $dimensions['tm'];
$marginBottom = $dimensions['bm'];
$marginLeft = $dimensions['lm'];
$marginRight = $dimensions['rm'];
$freeWidth = 0.9 * ($pageWidth - $marginLeft - $marginRight);
$freeHeight = 0.9 * ($pageHeight - $marginTop - $marginBottom);
$rate = min($freeHeight / $imageHeightAsUnits, $freeWidth / $imageWidthAsUnits, 2);
$imageWidth = floor($rate * $imageWidthAsUnits);
$imageHeight = floor($rate * $imageHeightAsUnits);
$leftOffset = $this->GetX() + ($freeWidth - $imageWidth) / 2;
$topOffset = $this->GetY() + ($freeHeight - $imageHeight) / 2;
$this->Image($imageFile, $leftOffset, $topOffset, $imageWidth, $imageHeight, "", "", "N", false, 300, "", false, false, 0, true);
if ($sugarChart->print_html_legend_pdf) {
$legend = $sugarChart->buildHTMLLegend($xmlFile);
$this->writeHTML($legend, true, false, false, true, "");
}
}
}
}
$this->AddPage();
//disable paging so we get all results in one pass
$this->bean->enable_paging = false;
$cols = count($this->bean->report_def['display_columns']);
$this->bean->run_summary_combo_query();
$header_row = $this->bean->get_summary_header_row();
$columns_row = $this->bean->get_header_row();
// build options for the writeHTMLTable from options for the writeCellTable
$options = array('header' => array("tr" => array("bgcolor" => $this->options['header']['fill'], "color" => $this->options['header']['textColor']), "td" => array()), 'evencolor' => $this->options['evencolor'], 'oddcolor' => $this->options['oddcolor']);
while (($row = $this->bean->get_summary_next_row()) != 0) {
$item = array();
$count = 0;
for ($i = 0; $i < $this->bean->current_summary_row_count; $i++) {
if (($column_row = $this->bean->get_next_row('result', 'display_columns', false, true)) != 0) {
for ($j = 0; $j < sizeof($columns_row); $j++) {
$label = $columns_row[$j];
$item[$count][$label] = $column_row['cells'][$j];
}
$count++;
} else {
break;
}
}
$this->writeHTMLTable($item, false, $options);
$this->Ln1();
$item = array();
$count = 0;
for ($j = 0; $j < sizeof($row['cells']); $j++) {
if ($j > count($header_row) - 1) {
$label = $header_row[count($header_row) - 1];
} else {
$label = $header_row[$j];
}
if (preg_match('/type.*=.*checkbox/Uis', $row['cells'][$j])) {
// parse out checkboxes
if (preg_match('/checked/i', $row['cells'][$j])) {
$row['cells'][$j] = $app_list_strings['dom_switch_bool']['on'];
} else {
$row['cells'][$j] = $app_list_strings['dom_switch_bool']['off'];
}
}
$value = $row['cells'][$j];
$item[$count][$label] = $value;
}
$this->writeHTMLTable($item, false, $options);
$this->Ln1();
}
$this->bean->clear_results();
if ($this->bean->has_summary_columns()) {
$this->bean->run_total_query();
$total_row = $this->bean->get_summary_total_row();
$item = array();
$count = 0;
for ($j = 0; $j < sizeof($header_row); $j++) {
$label = $header_row[$j];
$value = $total_row['cells'][$j];
$item[$count][$label] = $value;
//.........这里部分代码省略.........
开发者ID:jglaine, 项目名称:sugar761-ent, 代码行数:101, 代码来源:sugarpdf.summary_combo.php
示例17: display
/**
* @see DashletGenericChart::display()
*/
public function display()
{
global $sugar_config, $current_user;
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->base_url = array('module' => 'Opportunities', 'action' => 'index', 'query' => 'true', 'searchFormTab' => 'advanced_search');
$sugarChart->url_params = array('assigned_user_id' => $current_user->id);
$sugarChart->group_by = $this->constructGroupBy();
$currency_symbol = $sugar_config['default_currency_symbol'];
if ($current_user->getPreference('currency')) {
$currency = new Currency();
$currency->retrieve($current_user->getPreference('currency'));
$currency_symbol = $currency->symbol;
}
$sugarChart->is_currency = true;
$sugarChart->thousands_symbol = translate('LBL_OPP_THOUSANDS', 'Charts');
$subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts');
$query = $this->constructQuery();
$dataset = $this->constructCEChartData($this->getChartData($query));
$sugarChart->setData($dataset);
$total = format_number($this->getHorizBarTotal($dataset), 0, 0, array('convert' => true));
$pipeline_total_string = translate('LBL_TOTAL_PIPELINE', 'Charts') . $sugarChart->currency_symbol . $total . $sugarChart->thousands_symbol;
$sugarChart->setProperties($pipeline_total_string, $subtitle, 'horizontal bar chart');
$xmlFile = $sugarChart->getXMLFileName($this->id);
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $this->getTitle('') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />' . $this->processAutoRefresh();
}
开发者ID:netconstructor, 项目名称:sugarcrm_dev, 代码行数:30, 代码来源:MyPipelineBySalesStageDashlet.php
示例18: displayScript
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
public function displayScript()
{
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
return $sugarChart->getDashletScript($this->id);
}
开发者ID:thsonvt, 项目名称:sugarcrm_dev, 代码行数:11, 代码来源:DashletGenericChart.php
示例19: campaign_response_roi
function campaign_response_roi($datay = array(), $targets = array(), $campaign_id, $cache_file_name = 'a_file', $refresh = false, $marketing_id = '', $is_dashlet = false, $dashlet_id = '')
{
global $app_strings, $mod_strings, $current_module_strings, $charset, $lang, $app_list_strings, $current_language, $sugar_config;
$not_empty = false;
if ($is_dashlet) {
$mod_strings = return_module_language($current_language, 'Campaigns');
}
if (!file_exists($cache_file_name) || $refresh == true) {
$GLOBALS['log']->debug("datay is:");
$GLOBALS['log']->debug($datay);
$GLOBALS['log']->debug("user_id is: ");
$GLOBALS['log']->debug("cache_file_name is: {$cache_file_name}");
$focus = new Campaign();
$focus->retrieve($campaign_id);
$opp_count = 0;
$opp_query = "select count(*) opp_count,sum(" . db_convert("amount_usdollar", "IFNULL", array(0)) . ") total_value";
$opp_query .= " from opportunities";
$opp_query .= " where campaign_id='{$campaign_id}'";
$opp_query .= " and sales_stage='Prospecting'";
$opp_query .= " and deleted=0";
$opp_result = $focus->db->query($opp_query);
$opp_data = $focus->db->fetchByAssoc($opp_result);
// if (empty($opp_data['opp_count'])) $opp_data['opp_count']=0;
if (empty($opp_data['total_value'])) {
$opp_data['total_value'] = 0;
}
//report query
$opp_query1 = "select SUM(opp.amount) as revenue";
$opp_query1 .= " from opportunities opp";
$opp_query1 .= " right join campaigns camp on camp.id = opp.campaign_id";
$opp_query1 .= " where opp.sales_stage = 'Closed Won'and camp.id='{$campaign_id}' and opp.deleted=0";
$opp_query1 .= " group by camp.name";
$opp_result1 = $focus->db->query($opp_query1);
$opp_data1 = $focus->db->fetchByAssoc($opp_result1);
//if (empty($opp_data1[]))
if (empty($opp_data1['revenue'])) {
$opp_data1[$mod_strings['LBL_ROI_CHART_REVENUE']] = 0;
unset($opp_data1['revenue']);
} else {
$opp_data1[$mod_strings['LBL_ROI_CHART_REVENUE']] = $opp_data1['revenue'];
unset($opp_data1['revenue']);
$not_empty = true;
}
$camp_query1 = "select camp.name, SUM(camp.actual_cost) as investment,SUM(camp.budget) as budget,SUM(camp.expected_revenue) as expected_revenue";
$camp_query1 .= " from campaigns camp";
$camp_query1 .= " where camp.id='{$campaign_id}'";
$camp_query1 .= " group by camp.name";
$camp_result1 = $focus->db->query($camp_query1);
$camp_data1 = $focus->db->fetchByAssoc($camp_result1);
//query needs to be lowercase, but array keys need to be propercased, as these are used in
//chart to display legend
if (empty($camp_data1['investment'])) {
$camp_data1['investment'] = 0;
} else {
$not_empty = true;
}
if (empty($camp_data1['budget'])) {
$camp_data1['budget'] = 0;
} else {
$not_empty = true;
}
if (empty($camp_data1['expected_revenue'])) {
$camp_data1['expected_revenue'] = 0;
} else {
$not_empty = true;
}
$opp_data1[$mod_strings['LBL_ROI_CHART_INVESTMENT']] = $camp_data1['investment'];
$opp_data1[$mod_strings['LBL_ROI_CHART_BUDGET']] = $camp_data1['budget'];
$opp_data1[$mod_strings['LBL_ROI_CHART_EXPECTED_REVENUE']] = $camp_data1['expected_revenue'];
$query = "SELECT activity_type,target_type, count(*) hits ";
$query .= " FROM campaign_log ";
$query .= " WHERE campaign_id = '{$campaign_id}' AND archived=0 AND deleted=0";
//if $marketing id is specified, then lets filter the chart by the value
if (!empty($marketing_id)) {
$query .= " AND marketing_id ='{$marketing_id}'";
}
$query .= " GROUP BY activity_type, target_type";
$query .= " ORDER BY activity_type, target_type";
$result = $focus->db->query($query);
$leadSourceArr = array();
$total = 0;
$total_targeted = 0;
}
global $current_user;
$user_id = $current_user->id;
$width = '100%';
$return = '';
if (!$is_dashlet) {
$return .= '<br />';
}
$currency_id = $focus->currency_id;
$currency_symbol = $sugar_config['default_currency_symbol'];
if (!empty($currency_id)) {
$cur = new Currency();
$cur->retrieve($currency_id);
$currency_symbol = $cur->symbol;
}
$sugarChart = SugarChartFactory::getInstance();
$sugarChart->is_currency = true;
$sugarChart->currency_symbol = $currency_symbol;
//.........这里部分代码省略.........
开发者ID:NALSS, 项目名称:SuiteCRM, 代码行数:101, 代码来源:Charts.php
GitbookIO/gitbook:
阅读:956| 2022-08-17
juleswhite/mobile-cloud-asgn1
阅读:1032| 2022-08-30
Delphi的FireDAC连接管理与配置过程:使用FireDAC技术连接数据库,主要是使用 TFDCon
阅读:884| 2022-07-18
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:926| 2022-08-17
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:656| 2022-11-06
Authenticated (admin or higher user role) Reflected Cross-Site Scripting (XSS) v
阅读:1037| 2022-07-29
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:582| 2022-08-18
Karumi/MaxibonKataKotlin: Maxibon kata for Kotlin Developers. The main goal is t
阅读:623| 2022-08-13
mathjax/MathJax-i18n: MathJax localization
阅读:388| 2022-08-16
众所周知,我们的身份证号码里面包含的信息有很多,如出生日期、性别和识别码等,如果
阅读:252| 2022-11-06
请发表评论