Skip to content

Commit

Permalink
fixing travis error
Browse files Browse the repository at this point in the history
  • Loading branch information
gymad committed Jul 30, 2019
1 parent c058136 commit a205b4f
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Api/Core/Config/ApiConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ApiConfig

const OAUTH2_PRIVATE_KEY = 'Api/V8/OAuth2/private.key';
const OAUTH2_PUBLIC_KEY = 'Api/V8/OAuth2/public.key';
const OAUTH2_ENCRYPTION_KEY = '';
const OAUTH2_ENCRYPTION_KEY = 'YDYMf29FrB1KlDUIC5ZKpJEARIomtRLBxew5WpLVo4w=';

/**
*
Expand Down
6 changes: 5 additions & 1 deletion include/Dashlets/DashletGenericChart.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ public function displayScript()
{
require_once('include/SugarCharts/SugarChartFactory.php');
$sugarChart = SugarChartFactory::getInstance();
return $sugarChart->getDashletScript($this->id);
if ($sugarChart) {
return $sugarChart->getDashletScript($this->id);
} else {
return null;
}
}

/**
Expand Down
11 changes: 7 additions & 4 deletions include/MySugar/retrieve_dash_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,18 @@
//custom chart code
require_once('include/SugarCharts/SugarChartFactory.php');
$sugarChart = SugarChartFactory::getInstance();
$resources = $sugarChart->getChartResources();
$mySugarResources = $sugarChart->getMySugarChartResources();
$sugar_smarty->assign('chartResources', $resources);
$sugar_smarty->assign('mySugarChartResources', $mySugarResources);
if ($sugarChart) {
$resources = $sugarChart->getChartResources();
$mySugarResources = $sugarChart->getMySugarChartResources();
$sugar_smarty->assign('chartResources', $resources);
$sugar_smarty->assign('mySugarChartResources', $mySugarResources);
}
if (file_exists("custom/include/MySugar/tpls/MySugar2.tpl")) {
echo $sugar_smarty->fetch('custom/include/MySugar/tpls/MySugar2.tpl');
} else {
echo $sugar_smarty->fetch('include/MySugar/tpls/MySugar2.tpl');
}


//init the quickEdit listeners after the dashlets have loaded on home page the first time
echo"<script>if(typeof(qe_init) != 'undefined'){qe_init();}</script>";
16 changes: 12 additions & 4 deletions include/SugarCharts/SugarChartFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,21 @@ public static function getInstance(
if (file_exists($file)) {
require_once($file);
} else {
$GLOBALS['log']->debug("using default engine include/SugarCharts/".$defaultEngine."/".$defaultEngine.$module.".php");
require_once("include/SugarCharts/".$defaultEngine."/".$defaultEngine.$module.".php");
$chartEngine = $defaultEngine;
$defaultFile = "include/SugarCharts/".$defaultEngine."/".$defaultEngine.$module.".php";
$GLOBALS['log']->debug("using default engine $defaultFile");
if (file_exists($defaultFile)) {
require_once($defaultFile);
$chartEngine = $defaultEngine;
}
}
}

$className = $chartEngine.$module;
return new $className();
if (class_exists($className)) {
return new $className();
} else {
LoggerManager::getLogger()->fatal('Chart class not found.');
return null;
}
}
}
9 changes: 9 additions & 0 deletions modules/Campaigns/Charts.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public function campaign_response_by_activity_type($datay= array(), $targets=arr

if ($campaign_id) {
$sugarChart = SugarChartFactory::getInstance('', 'Reports');
if (!$sugarChart) {
return false;
}
$xmlFile = $sugarChart->getXMLFileName($campaign_id);

if (!file_exists($xmlFile) || $refresh == true) {
Expand Down Expand Up @@ -332,6 +335,9 @@ public function campaign_response_by_activity_type($datay= array(), $targets=arr


$sugarChart = SugarChartFactory::getInstance();
if (!$sugarChart) {
return false;
}
$sugarChart->is_currency = true;
$sugarChart->currency_symbol = $currency_symbol;

Expand Down Expand Up @@ -485,6 +491,9 @@ public function campaign_response_roi_data($datay= array(), $targets=array(), $c


$sugarChart = SugarChartFactory::getInstance();
if (!$sugarChart) {
return false;
}
$sugarChart->is_currency = true;
$sugarChart->currency_symbol = $currency_symbol;

Expand Down
6 changes: 4 additions & 2 deletions modules/Campaigns/RoiDetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@
//custom chart code
require_once('include/SugarCharts/SugarChartFactory.php');
$sugarChart = SugarChartFactory::getInstance();
$resources = $sugarChart->getChartResources();
$smarty->assign('chartResources', $resources);
if ($sugarChart) {
$resources = $sugarChart->getChartResources();
$smarty->assign('chartResources', $resources);
}

echo $smarty->fetch('modules/Campaigns/RoiDetailView.tpl');
6 changes: 4 additions & 2 deletions modules/Campaigns/TrackDetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@
//custom chart code
require_once('include/SugarCharts/SugarChartFactory.php');
$sugarChart = SugarChartFactory::getInstance();
$resources = $sugarChart->getChartResources();
$smarty->assign('chartResources', $resources);
if ($sugarChart) {
$resources = $sugarChart->getChartResources();
$smarty->assign('chartResources', $resources);
}

echo $smarty->fetch('modules/Campaigns/TrackDetailView.tpl');

Expand Down
2 changes: 1 addition & 1 deletion modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function displayScript()
$reporter->saved_report_id = $chartReport->id;
$xmlFile = get_cache_file_name($reporter);

$str = $sugarChart->getDashletScript($this->id, $xmlFile);
$str = $sugarChart ? $sugarChart->getDashletScript($this->id, $xmlFile) : '';
return $str;
}
}
Expand Down
10 changes: 6 additions & 4 deletions modules/Home/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,12 @@

require_once('include/SugarCharts/SugarChartFactory.php');
$sugarChart = SugarChartFactory::getInstance();
$resources = $sugarChart->getChartResources();
$mySugarResources = $sugarChart->getMySugarChartResources();
$sugar_smarty->assign('chartResources', $resources);
$sugar_smarty->assign('mySugarChartResources', $mySugarResources);
if ($sugarChart) {
$resources = $sugarChart->getChartResources();
$mySugarResources = $sugarChart->getMySugarChartResources();
$sugar_smarty->assign('chartResources', $resources);
$sugar_smarty->assign('mySugarChartResources', $mySugarResources);
}

if (file_exists('custom/themes/' . $theme . '/tpls/MySugar.tpl')) {
echo $sugar_smarty->fetch('custom/themes/' . $theme . '/tpls/MySugar.tpl');
Expand Down

0 comments on commit a205b4f

Please sign in to comment.