I just found the file "modules/Charts/code/Chart_pipeline_by_sales_stage.hp" but it looks ok.
I can't find any error here.
I tried to print out my name and check where the php goes and stop, but I couldn't see it printed anywhere.
I tried it inside the php code and outside on the html code, but I got nothing.
Any help?
Code:
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once("include/charts/Charts.php");
require_once("modules/Charts/code/Chart_pipeline_by_sales_stage.php");
...
...
<?php
echo get_validate_chart_js();
function gen_xml_pipeline_by_sales_stage($datax=array('foo','bar'), $date_start='2071-10-15', $date_end='2071-10-15', $user_id=array('1'), $cache_file_name='a_file', $refresh=false,$chart_size='hBarF',$current_module_strings) {
global $app_strings, $charset, $lang, $barChartColors, $current_user;
$kDelim = $current_user->getPreference('num_grp_sep');
global $timedate;
if (!file_exists($cache_file_name) || $refresh == true) {
$GLOBALS['log']->debug("starting pipeline chart");
$GLOBALS['log']->debug("datax is:");
$GLOBALS['log']->debug($datax);
$GLOBALS['log']->debug("user_id is: ");
$GLOBALS['log']->debug($user_id);
$GLOBALS['log']->debug("cache_file_name is: $cache_file_name");
$opp = new Opportunity;
$where="";
//build the where clause for the query that matches $user
$count = count($user_id);
$id = array();
$user_list = get_user_array(false);
foreach ($user_id as $key) {
$new_ids[$key] = $user_list[$key];
}
if ($count>0) {
foreach ($new_ids as $the_id=>$the_name) {
$id[] = "'".$the_id."'";
}
$ids = join(",",$id);
$where .= "opportunities.assigned_user_id IN ($ids) ";
}
//build the where clause for the query that matches $datax
$count = count($datax);
$dataxArr = array();
if ($count>0) {
foreach ($datax as $key=>$value) {
$dataxArr[] = "'".$key."'";
}
$dataxArr = join(",",$dataxArr);
$where .= "AND opportunities.sales_stage IN ($dataxArr) ";
}
//build the where clause for the query that matches $date_start and $date_end
$where .= " AND opportunities.date_closed >= ". db_convert("'".$date_start."'",'date'). "
AND opportunities.date_closed <= ".db_convert("'".$date_end."'",'date') ;
echo db_convert("'".$date_start."'",'date');
$where .= " AND opportunities.assigned_user_id = users.id AND opportunities.deleted=0 ";
//Now do the db queries
//query for opportunity data that matches $datax and $user
$query = " SELECT opportunities.sales_stage,
users.user_name,
opportunities.assigned_user_id,
count( * ) AS opp_count,
sum(amount_usdollar/1000) AS total
FROM users,opportunities ";
$opp->add_team_security_where_clause($query);
$query .= "WHERE " .$where;
$query .= " GROUP BY opportunities.sales_stage,users.user_name,opportunities.assigned_user_id";
$result = $opp->db->query($query)
or sugar_die("Error selecting sugarbean: ".mysql_error());
?>
Bookmarks