本文整理汇总了PHP中Report::has_summary_columns方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::has_summary_columns方法的具体用法?PHP Report::has_summary_columns怎么用?PHP Report::has_summary_columns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::has_summary_columns方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSavedReportChartById
/**
* Retrieves a saved report and chart data, given a report ID in the args
*
* @param $api ServiceBase The API class of the request
* @param $args array The arguments array passed in from the API
* @return array
*/
public function getSavedReportChartById($api, $args)
{
require_once "include/SugarCharts/ChartDisplay.php";
$chartReport = $this->getSavedReportById($args['reportId']);
if (isset($args['filter_id']) && $args['filter_id'] !== 'all_records') {
$chartReport->content = $this->updateFilterDef($chartReport->content, $args['filter_id']);
}
if (!empty($chartReport)) {
if (!$chartReport->ACLAccess('view')) {
throw new SugarApiExceptionNotAuthorized('No access to view this report');
}
$returnData = array();
$this->title = $chartReport->name;
require_once "modules/Reports/Report.php";
$reporter = new Report($chartReport->content);
$reporter->saved_report_id = $chartReport->id;
if ($reporter && !$reporter->has_summary_columns()) {
return '';
}
// build report data since it isn't a SugarBean
$reportData = array();
$reportData['name'] = $reporter->name;
$reportData['id'] = $reporter->saved_report_id;
$reportData['summary_columns'] = $reporter->report_def['summary_columns'];
$reportData['group_defs'] = $reporter->report_def['group_defs'];
// add reportData to returnData
$returnData['reportData'] = $reportData;
$chartDisplay = new ChartDisplay();
$chartDisplay->setReporter($reporter);
$chart = $chartDisplay->getSugarChart();
$json = json_decode($chart->buildJson($chart->generateXML()));
$returnData['chartData'] = $json;
return $returnData;
}
}
示例2: legacyDisplay
/**
* Method for displaying the old legacy way that was done.
*
* @param $id ID use for the guid
* @param bool $is_dashlet Are we displaying a dashlet or not
* @return JitReports|string Return the HTML
*/
public function legacyDisplay($id, $is_dashlet = false)
{
if ($is_dashlet) {
$width = '100%';
$height = '480';
$guid = $id;
} else {
$width = '100%';
$height = '480';
$guid = $this->reporter->saved_report_id;
}
// Bug #57213 : Reports with data series removed render charts inconsistently
if ($this->reporter && !$this->reporter->has_summary_columns()) {
global $current_language;
$mod_strings = return_module_language($current_language, 'Reports');
return $mod_strings['LBL_CANNOT_DISPLAY_CHART_MESSAGE'];
}
$sugarChart = $this->getSugarChart();
if (is_object($sugarChart)) {
$sugarChart->reporter = $this->reporter;
$xmlFile = $this->get_cache_file_name();
$sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML());
return $sugarChart->display($guid, $xmlFile, $width, $height);
}
return $sugarChart;
}
示例3: displayScript
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript()
{
require_once "modules/Reports/Report.php";
require_once "include/SugarCharts/ChartDisplay.php";
$chartReport = BeanFactory::getBean('Reports', $this->report_id, array("encode" => false));
if (!empty($chartReport)) {
$this->title = $chartReport->name;
require_once "modules/Reports/templates/templates_chart.php";
require_once 'include/SugarCharts/SugarChartFactory.php';
$sugarChart = SugarChartFactory::getInstance();
$reporter = new Report($chartReport->content);
$reporter->is_saved_report = true;
$reporter->saved_report_id = $chartReport->id;
// Bug #57213 : Reports with data series removed render charts inconsistently
if ($reporter && !$reporter->has_summary_columns()) {
return '';
}
$chartDisplay = new ChartDisplay();
$xmlFile = $chartDisplay->get_cache_file_name($reporter);
$str = $sugarChart->getDashletScript($this->id, $xmlFile);
return $str;
}
}