diff --git a/oss/vtiger/trunk/modules/Dashboard/Chart_lead_source_by_outcome.php b/oss/vtiger/trunk/modules/Dashboard/Chart_lead_source_by_outcome.php deleted file mode 100644 index 12ffec0f..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Chart_lead_source_by_outcome.php +++ /dev/null @@ -1,160 +0,0 @@ -id.'.php'); -require('user_privileges/user_privileges_'.$current_user->id.'.php'); - -// Get _dom arrays from Database -$comboFieldNames = Array('leadsource'=>'lead_source_dom'); -$comboFieldArray = getComboArray($comboFieldNames); - -$log = LoggerManager::getLogger('lead_source_by_outcome'); - -if (isset($_REQUEST['lsbo_refresh'])) { $refresh = $_REQUEST['lsbo_refresh']; } -else { $refresh = false; } - -// added for auto refresh -$refresh = true; -// - -$tempx = array(); -$datax = array(); -//get list of sales stage keys to display -if (isset($_SESSION['lsbo_lead_sources']) && count($_SESSION['lsbo_lead_sources']) > 0 && !isset($_REQUEST['lsbo_lead_sources'])) { - $tempx = $_SESSION['lsbo_lead_sources']; - $log->debug("_SESSION['lsbo_lead_sources'] is:"); - $log->debug($_SESSION['lsbo_lead_sources']); -} -elseif (isset($_REQUEST['lsbo_lead_sources']) && count($_REQUEST['lsbo_lead_sources']) > 0) { - $tempx = $_REQUEST['lsbo_lead_sources']; - $current_user->setPreference('lsbo_lead_sources', $_REQUEST['lsbo_lead_sources']); - $log->debug("_REQUEST['lsbo_lead_sources'] is:"); - $log->debug($_REQUEST['lsbo_lead_sources']); - $log->debug("_SESSION['lsbo_lead_sources'] is:"); - $log->debug($_SESSION['lsbo_lead_sources']); -} - -//set $datax using selected sales stage keys -if (count($tempx) > 0) { - foreach ($tempx as $key) { - $datax[$key] = $comboFieldArray['lead_source_dom'][$key]; - } -} -else { - $datax = $comboFieldArray['lead_source_dom']; -} -$log->debug("datax is:"); -$log->debug($datax); - -$ids = array(); -//get list of user ids for which to display data -if (isset($_SESSION['lsbo_ids']) && count($_SESSION['lsbo_ids']) != 0 && !isset($_REQUEST['lsbo_ids'])) { - $ids = $_SESSION['lsbo_ids']; - $log->debug("_SESSION['lsbo_ids'] is:"); - $log->debug($_SESSION['lsbo_ids']); -} -elseif (isset($_REQUEST['lsbo_ids']) && count($_REQUEST['lsbo_ids']) > 0) { - $ids = $_REQUEST['lsbo_ids']; - $current_user->setPreference('lsbo_ids', $_REQUEST['lsbo_ids']); - $log->debug("_REQUEST['lsbo_ids'] is:"); - $log->debug($_REQUEST['lsbo_ids']); - $log->debug("_SESSION['lsbo_ids'] is:"); - $log->debug($_SESSION['lsbo_ids']); -} -else { - $ids = get_user_array(false); - $ids = array_keys($ids); -} - -//create unique prefix based on selected vtiger_users for image vtiger_files -$id_hash = ''; -if (isset($ids)) { - sort($ids); - $id_hash = crc32(implode('',$ids)); -} -$log->debug("ids is:"); -$log->debug($ids); - -$cache_file_name = $id_hash."_lead_source_by_outcome_".$current_language."_".crc32(implode('',$datax)).".png"; -$log->debug("cache file name is: $cache_file_name"); - -if(isPermitted('Potentials','index')=="yes") -{ -$draw_this = new jpgraph(); -$width = 850; -$height = 500; -if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') -{ - $width = 350; - $height = 250; -} - -echo $draw_this->lead_source_by_outcome($datax, $ids, $tmp_dir.$cache_file_name, $refresh,$width,$height); -echo "

".$current_module_strings['LBL_LEAD_SOURCE_BY_OUTCOME_DESC']."

"; -if (isset($_REQUEST['lsbo_edit']) && $_REQUEST['lsbo_edit'] == 'true') { -?> -
- - - - - - - - - - - - - - - - - -

-
- -
- -[] -[] -
- \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/Chart_my_pipeline_by_sales_stage.php b/oss/vtiger/trunk/modules/Dashboard/Chart_my_pipeline_by_sales_stage.php deleted file mode 100644 index a1fc62ed..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Chart_my_pipeline_by_sales_stage.php +++ /dev/null @@ -1,184 +0,0 @@ -'sales_stage_dom'); -$comboFieldArray = getComboArray($comboFieldNames); - -//get the dates to display -if (isset($_SESSION['mypbss_date_start']) && $_SESSION['mypbss_date_start'] != '' && !isset($_REQUEST['mypbss_date_start'])) { - $date_start = $_SESSION['mypbss_date_start']; - $log->debug("_SESSION['mypbss_date_start'] is:"); - $log->debug($_SESSION['mypbss_date_start']); -} -elseif (isset($_REQUEST['mypbss_date_start']) && $_REQUEST['mypbss_date_start'] != '') { - $date_start = $_REQUEST['mypbss_date_start']; - $current_user->setPreference('mypbss_date_start', $_REQUEST['mypbss_date_start']); - $log->debug("_REQUEST['mypbss_date_start'] is:"); - $log->debug($_REQUEST['mypbss_date_start']); - $log->debug("_SESSION['mypbss_date_start'] is:"); - $log->debug($_SESSION['mypbss_date_start']); -} -else { - $date_start = date("Y-m-d", time()); -} - -if (isset($_SESSION['mypbss_date_end']) && $_SESSION['mypbss_date_end'] != '' && !isset($_REQUEST['mypbss_date_end'])) { - $date_end = $_SESSION['mypbss_date_end']; - $log->debug("_SESSION['mypbss_date_end'] is:"); - $log->debug($_SESSION['mypbss_date_end']); -} -elseif (isset($_REQUEST['mypbss_date_end']) && $_REQUEST['mypbss_date_end'] != '') { - $date_end = $_REQUEST['mypbss_date_end']; - $current_user->setPreference('mypbss_date_end', $_REQUEST['mypbss_date_end']); - $log->debug("_REQUEST['mypbss_date_end'] is:"); - $log->debug($_REQUEST['mypbss_date_end']); - $log->debug("_SESSION['mypbss_date_end'] is:"); - $log->debug($_SESSION['mypbss_date_end']); -} -else { - $date_end = '2100-01-01'; -} - -$tempx = array(); -$datax = array(); -//get list of sales stage keys to display -if (isset($_SESSION['mypbss_sales_stages']) && count($_SESSION['mypbss_sales_stages']) > 0 && !isset($_REQUEST['mypbss_sales_stages'])) { - $tempx = $_SESSION['mypbss_sales_stages']; - $log->debug("_SESSION['mypbss_sales_stages'] is:"); - $log->debug($_SESSION['mypbss_sales_stages']); -} -elseif (isset($_REQUEST['mypbss_sales_stages']) && count($_REQUEST['mypbss_sales_stages']) > 0) { - $tempx = $_REQUEST['mypbss_sales_stages']; - $current_user->setPreference('mypbss_sales_stages', $_REQUEST['mypbss_sales_stages']); - $log->debug("_REQUEST['mypbss_sales_stages'] is:"); - $log->debug($_REQUEST['mypbss_sales_stages']); - $log->debug("_SESSION['mypbss_sales_stages'] is:"); - $log->debug($_SESSION['mypbss_sales_stages']); -} - -//set $datax using selected sales stage keys -if (count($tempx) > 0) { - foreach ($tempx as $key) { - $datax[$key] = $comboFieldArray['sales_stage_dom'][$key];//$app_list_strings['sales_stage_dom'][$key]; - } -} -else { - $datax = $comboFieldArray['sales_stage_dom'];//app_list_strings['sales_stage_dom']; -} -$log->debug("datax is:"); -$log->debug($datax); - -$ids = array($current_user->id); -//create unique prefix based on selected vtiger_users for image vtiger_files -$id_hash = ''; -if (isset($ids)) { - sort($ids); - $id_hash = crc32(implode('',$ids)); -} -$log->debug("ids is:"); -$log->debug($ids); - -$cache_file_name = $id_hash."_pipeline_".$current_language."_".crc32(implode('',$datax)).$date_start.$date_end.".png"; -$log->debug("cache file name is: $cache_file_name"); - -if (substr(phpversion(), 0, 1) == "5") { // php5 } - echo "Charts not supported in PHP 5."; -} -else { -$draw_this = new jpgraph(); -echo $draw_this->pipeline_by_sales_stage($datax, $date_start, $date_end, $ids, $tmp_dir.$cache_file_name, $refresh); -echo "

".$current_module_strings['LBL_PIPELINE_FORM_TITLE_DESC']."

"; -if (isset($_REQUEST['mypbss_edit']) && $_REQUEST['mypbss_edit'] == 'true') { - $cal_lang = "en"; - $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']); - $cal_dateformat = '%Y-%m-%d'; // fix providedd by Jlee for date bug in Dashboard - - -?> - - - - -
- - - - - - - - - - - - - - - - - -

'>

'>

-
- - - -
- -[] -[] -
- diff --git a/oss/vtiger/trunk/modules/Dashboard/Chart_outcome_by_month.php b/oss/vtiger/trunk/modules/Dashboard/Chart_outcome_by_month.php deleted file mode 100644 index fc16aa6d..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Chart_outcome_by_month.php +++ /dev/null @@ -1,197 +0,0 @@ -id.'.php'); -require('user_privileges/user_privileges_'.$current_user->id.'.php'); - -$log = LoggerManager::getLogger('outcome_by_month'); - -if (isset($_REQUEST['obm_refresh'])) { $refresh = $_REQUEST['obm_refresh']; } -else { $refresh = false; } - -// added for auto refresh -$refresh = true; -// - -$date_start = array(); -$datax = array(); -//get the dates to display -//added to fix the issue4307 -if(isset($_REQUEST['obm_date_start']) && $_REQUEST['obm_date_start'] == '') -{ - $_SESSION['obm_date_start'] = ""; -} -elseif(isset($_REQUEST['obm_date_start']) && $_REQUEST['obm_date_start'] != '') - $_SESSION['obm_date_start'] = $_REQUEST['obm_date_start']; -if(isset($_REQUEST['obm_date_end']) && $_REQUEST['obm_date_end'] == '') -{ - $_SESSION['obm_date_end'] = ""; -} -elseif(isset($_REQUEST['obm_date_end']) && $_REQUEST['obm_date_end'] != '') - $_SESSION['obm_date_end'] = $_REQUEST['obm_date_end']; -if (isset($_SESSION['obm_date_start']) && $_SESSION['obm_date_start'] != '' && !isset($_REQUEST['obm_date_start'])) { - $date_start = $_SESSION['obm_date_start']; - $log->debug("_SESSION['obm_date_start'] is:"); - $log->debug($_SESSION['obm_date_start']); -} -elseif (isset($_REQUEST['obm_date_start']) && $_REQUEST['obm_date_start'] != '') { - $date_start = $_REQUEST['obm_date_start']; - $current_user->setPreference('obm_date_start', $_REQUEST['obm_date_start']); - $log->debug("_REQUEST['obm_date_start'] is:"); - $log->debug($_REQUEST['obm_date_start']); - $log->debug("_SESSION['obm_date_start'] is:"); - $log->debug($_SESSION['obm_date_start']); -} -else { - $date_start = '2000-01-01'; -} - -if (isset($_SESSION['obm_date_end']) && $_SESSION['obm_date_end'] != '' && !isset($_REQUEST['obm_date_end'])) { - $date_end = $_SESSION['obm_date_end']; - $log->debug("_SESSION['obm_date_end'] is:"); - $log->debug($_SESSION['obm_date_end']); -} -elseif (isset($_REQUEST['obm_date_end']) && $_REQUEST['obm_date_end'] != '') { - $date_end = $_REQUEST['obm_date_end']; - $current_user->setPreference('obm_date_end', $_REQUEST['obm_date_end']); - $log->debug("_REQUEST['obm_date_end'] is:"); - $log->debug($_REQUEST['obm_date_end']); - $log->debug("_SESSION['obm_date_end'] is:"); - $log->debug($_SESSION['obm_date_end']); -} -else { - $date_end = '2100-01-01'; -} - -$ids = array(); -//get list of user ids for which to display data -if (isset($_SESSION['obm_ids']) && count($_SESSION['obm_ids']) != 0 && !isset($_REQUEST['obm_ids'])) { - $ids = $_SESSION['obm_ids']; - $log->debug("_SESSION['obm_ids'] is:"); - $log->debug($_SESSION['obm_ids']); -} -elseif (isset($_REQUEST['obm_ids']) && count($_REQUEST['obm_ids']) > 0) { - $ids = $_REQUEST['obm_ids']; - $current_user->setPreference('obm_ids', $_REQUEST['obm_ids']); - $log->debug("_REQUEST['obm_ids'] is:"); - $log->debug($_REQUEST['obm_ids']); - $log->debug("_SESSION['obm_ids'] is:"); - $log->debug($_SESSION['obm_ids']); -} -else { - $ids = get_user_array(false); - $ids = array_keys($ids); -} - -//create unique prefix based on selected vtiger_users for image vtiger_files -$id_hash = ''; -if (isset($ids)) { - sort($ids); - $id_hash = crc32(implode('',$ids)); -} -$log->debug("ids is:"); -$log->debug($ids); - -$cache_file_name = $id_hash."_outcome_by_month_".$current_language."_".crc32($date_start.$date_end).".png"; -$log->debug("cache file name is: $cache_file_name"); - -if(isPermitted('Potentials','index')=="yes") -{ -$draw_this = new jpgraph(); -$width = 850; -$height = 500; -if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') -{ - $width = 350; - $height = 250; -} - -echo $draw_this->outcome_by_month($date_start, $date_end, $ids, $tmp_dir.$cache_file_name, $refresh,$width,$height); -echo "

".$current_module_strings['LBL_MONTH_BY_OUTCOME_DESC']."

"; -if (isset($_REQUEST['obm_edit']) && $_REQUEST['obm_edit'] == 'true') { - $cal_lang = "en"; - $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']); - $cal_dateformat = '%Y-%m-%d'; // fix providedd by Jlee for date bug in Dashboard - -?> - - - - -
- - - - - - - - - - - - - - - - - - - - - -

'>

'>

-
- - - -
- -[] -[] -
- \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_lead_source.php b/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_lead_source.php deleted file mode 100644 index eb38df6b..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_lead_source.php +++ /dev/null @@ -1,161 +0,0 @@ -id.'.php'); -require('user_privileges/user_privileges_'.$current_user->id.'.php'); - -// Get _dom arrays from Database -$comboFieldNames = Array('leadsource'=>'lead_source_dom'); -$comboFieldArray = getComboArray($comboFieldNames); - -$log = LoggerManager::getLogger('CSIM_pipeline_by_lead_source'); - -if (isset($_REQUEST['pbls_refresh'])) { $refresh = $_REQUEST['pbls_refresh']; } -else { $refresh = false; } - -// added for auto refresh -$refresh = true; -// - -$tempx = array(); -$datax = array(); -//get list of sales stage keys to display -if (isset($_SESSION['pbls_lead_sources']) && count($_SESSION['pbls_lead_sources']) > 0 && !isset($_REQUEST['pbls_lead_sources'])) { - $tempx = $_SESSION['pbls_lead_sources']; - $log->debug("_SESSION['pbls_lead_sources'] is:"); - $log->debug($_SESSION['pbls_lead_sources']); -} -elseif (isset($_REQUEST['pbls_lead_sources']) && count($_REQUEST['pbls_lead_sources']) > 0) { - $tempx = $_REQUEST['pbls_lead_sources']; - $current_user->setPreference('pbls_lead_sources', $_REQUEST['pbls_lead_sources']); - $log->debug("_REQUEST['pbls_lead_sources'] is:"); - $log->debug($_REQUEST['pbls_lead_sources']); - $log->debug("_SESSION['pbls_lead_sources'] is:"); - $log->debug($_SESSION['pbls_lead_sources']); -} - -//set $datax using selected sales stage keys -if (count($tempx) > 0) { - foreach ($tempx as $key) { - $datax[$key] = $comboFieldArray['lead_source_dom'][$key]; - } -} -else { - $datax = $comboFieldArray['lead_source_dom']; -} -$log->debug("datax is:"); -$log->debug($datax); - -$ids = array(); -//get list of user ids for which to display data -if (isset($_SESSION['pbls_ids']) && count($_SESSION['pbls_ids']) != 0 && !isset($_REQUEST['pbls_ids'])) { - $ids = $_SESSION['pbls_ids']; - $log->debug("_SESSION['pbls_ids'] is:"); - $log->debug($_SESSION['pbls_ids']); -} -elseif (isset($_REQUEST['pbls_ids']) && count($_REQUEST['pbls_ids']) > 0) { - $ids = $_REQUEST['pbls_ids']; - $current_user->setPreference('pbls_ids', $ids); - $log->debug("_REQUEST['pbls_ids'] is:"); - $log->debug($_REQUEST['pbls_ids']); - $log->debug("_SESSION['pbls_ids'] is:"); - $log->debug($_SESSION['pbls_ids']); -} -else { - $ids = get_user_array(false); - $ids = array_keys($ids); -} - -//create unique prefix based on selected vtiger_users for image vtiger_files -$id_hash = ''; -if (isset($ids)) { - sort($ids); - $id_hash = crc32(implode('',$ids)); -} -$log->debug("ids is:"); -$log->debug($ids); - -$cache_file_name = $id_hash."_pipeline_by_lead_source_".$current_language."_".crc32(implode('',$datax)).".png"; -$log->debug("cache file name is: $cache_file_name"); - -if(isPermitted('Potentials','index')=="yes") -{ -$draw_this = new jpgraph(); -$width = 850; -$height = 500; -if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') -{ - $width = 350; - $height = 250; -} - - -echo $draw_this->pipeline_by_lead_source($datax, $ids, $tmp_dir.$cache_file_name, $refresh,$width,$height); -echo "

".$current_module_strings['LBL_LEAD_SOURCE_FORM_DESC']."

"; -if (isset($_REQUEST['pbls_edit']) && $_REQUEST['pbls_edit'] == 'true') { -?> -
- - - - - - - - - - - - - - - - - -

-
- -
- -[] -[] -
- \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_sales_stage.php b/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_sales_stage.php deleted file mode 100644 index 6ddb86b7..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Chart_pipeline_by_sales_stage.php +++ /dev/null @@ -1,235 +0,0 @@ -id.'.php'); -require('user_privileges/user_privileges_'.$current_user->id.'.php'); -$log = LoggerManager::getLogger('pipeline_by_sales_stage'); - -if (isset($_REQUEST['pbss_refresh'])) { $refresh = $_REQUEST['pbss_refresh']; } -else { $refresh = false; } - -// added for auto refresh -$refresh = true; -// - -// Get _dom Arrays from Database -$comboFieldNames = Array('sales_stage'=>'sales_stage_dom'); -$comboFieldArray = getComboArray($comboFieldNames); -//added to fix the issue 4307 -if(isset($_REQUEST['pbss_date_start']) && $_REQUEST['pbss_date_start'] == '') -{ - $_SESSION['pbss_date_start'] = ""; -} -elseif(isset($_REQUEST['pbss_date_start']) && $_REQUEST['pbss_date_start'] != '') - $_SESSION['pbss_date_start']=$_REQUEST['pbss_date_start']; -if(isset($_REQUEST['pbss_date_end']) && $_REQUEST['pbss_date_end'] == '') -{ - $_SESSION['pbss_date_end'] = ""; -} -elseif(isset($_REQUEST['pbss_date_start']) && $_REQUEST['pbss_date_end'] != '') - $_SESSION['pbss_date_end'] = $_REQUEST['pbss_date_end']; -//get the dates to display -if (isset($_SESSION['pbss_date_start']) && $_SESSION['pbss_date_start'] != '' && !isset($_REQUEST['pbss_date_start'])) { - $date_start = $_SESSION['pbss_date_start']; - $log->debug("_SESSION['pbss_date_start'] is:"); - $log->debug($_SESSION['pbss_date_start']); -} -elseif (isset($_REQUEST['pbss_date_start']) && $_REQUEST['pbss_date_start'] != '') { - $date_start = $_REQUEST['pbss_date_start']; - $current_user->setPreference('pbss_date_start', $_REQUEST['pbss_date_start']); - $log->debug("_REQUEST['pbss_date_start'] is:"); - $log->debug($_REQUEST['pbss_date_start']); - $log->debug("_SESSION['pbss_date_start'] is:"); - $log->debug($_SESSION['pbss_date_start']); -} -else { - $date_start = "2001-01-01"; -} - -if (isset($_SESSION['pbss_date_end']) && $_SESSION['pbss_date_end'] != '' && !isset($_REQUEST['pbss_date_end'])) { - $date_end = $_SESSION['pbss_date_end']; - $log->debug("_SESSION['pbss_date_end'] is:"); - $log->debug($_SESSION['pbss_date_end']); -} -elseif (isset($_REQUEST['pbss_date_end']) && $_REQUEST['pbss_date_end'] != '') { - $date_end = $_REQUEST['pbss_date_end']; - $current_user->setPreference('pbss_date_end', $_REQUEST['pbss_date_end']); - $log->debug("_REQUEST['pbss_date_end'] is:"); - $log->debug($_REQUEST['pbss_date_end']); - $log->debug("_SESSION['pbss_date_end'] is:"); - $log->debug($_SESSION['pbss_date_end']); -} -else { - $date_end = '2100-01-01'; -} - -$tempx = array(); -$datax = array(); -//get list of sales stage keys to display -if (isset($_SESSION['pbss_sales_stages']) && count($_SESSION['pbss_sales_stages']) > 0 && !isset($_REQUEST['pbss_sales_stages'])) { - $tempx = $_SESSION['pbss_sales_stages']; - $log->debug("_SESSION['pbss_sales_stages'] is:"); - $log->debug($_SESSION['pbss_sales_stages']); -} -elseif (isset($_REQUEST['pbss_sales_stages']) && count($_REQUEST['pbss_sales_stages']) > 0) { - $tempx = $_REQUEST['pbss_sales_stages']; - $current_user->setPreference('pbss_sales_stages', $_REQUEST['pbss_sales_stages']); - $log->debug("_REQUEST['pbss_sales_stages'] is:"); - $log->debug($_REQUEST['pbss_sales_stages']); - $log->debug("_SESSION['pbss_sales_stages'] is:"); - $log->debug($_SESSION['pbss_sales_stages']); -} - -//set $datax using selected sales stage keys -if (count($tempx) > 0) { - foreach ($tempx as $key) { - $datax[$key] = $comboFieldArray['sales_stage_dom'][$key]; - } -} -else { - $datax = $comboFieldArray['sales_stage_dom']; -} -$log->debug("datax is:"); -$log->debug($datax); - -$ids = array(); -//get list of user ids for which to display data -if (isset($_SESSION['pbss_ids']) && count($_SESSION['pbss_ids']) != 0 && !isset($_REQUEST['pbss_ids'])) { - $ids = $_SESSION['pbss_ids']; - $log->debug("_SESSION['pbss_ids'] is:"); - $log->debug($_SESSION['pbss_ids']); -} -elseif (isset($_REQUEST['pbss_ids']) && count($_REQUEST['pbss_ids']) > 0) { - $ids = $_REQUEST['pbss_ids']; - $current_user->setPreference('pbss_ids', $_REQUEST['pbss_ids']); - $log->debug("_REQUEST['pbss_ids'] is:"); - $log->debug($_REQUEST['pbss_ids']); - $log->debug("_SESSION['pbss_ids'] is:"); - $log->debug($_SESSION['pbss_ids']); -} -else { - $ids = get_user_array(false); - $ids = array_keys($ids); -} - -//create unique prefix based on selected users for image files -$id_hash = ''; -if (isset($ids)) { - sort($ids); - $id_hash = crc32(implode('',$ids)); -} -$log->debug("ids is:"); -$log->debug($ids); - -$cache_file_name = $id_hash."_pipeline_".$current_language."_".crc32(implode('',$datax)).$date_start.$date_end.".png"; -$log->debug("cache file name is: $cache_file_name"); - -if(isPermitted('Potentials','index')=="yes") -{ -$draw_this = new jpgraph(); -$width = 850; -$height = 500; -if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') -{ - $width = 350; - $height = 250; -} - - -echo $draw_this->pipeline_by_sales_stage($datax, $date_start, $date_end, $ids, $tmp_dir.$cache_file_name, $refresh,$width,$height); -echo "

".$current_module_strings['LBL_SALES_STAGE_FORM_DESC']."

"; -if (isset($_REQUEST['pbss_edit']) && $_REQUEST['pbss_edit'] == 'true') { - $cal_lang = "en"; - $cal_dateformat = parse_calendardate($app_strings['NTC_DATE_FORMAT']); - $cal_dateformat = '%Y-%m-%d'; // fix providedd by Jlee for date bug in Dashboard - -?> - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

'>

'>

-
- - - -
- -[] -[] -
- diff --git a/oss/vtiger/trunk/modules/Dashboard/DashboardAjax.php b/oss/vtiger/trunk/modules/Dashboard/DashboardAjax.php deleted file mode 100644 index 3dfc7b7a..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/DashboardAjax.php +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/oss/vtiger/trunk/modules/Dashboard/DashboardHome.php b/oss/vtiger/trunk/modules/Dashboard/DashboardHome.php deleted file mode 100644 index ca8984e9..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/DashboardHome.php +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
1  
- -
- - - - - - - - - -
: 1234
-
 
- - - - - - - - -
2  
-
- - - - - - - - - -
: 1234
-
 
- - - - - - - - -
3  
-
- - - - - - - - - -
: 1234
-
 
- - - - - - - - -
4  
-
- - - - - - - - - -
: 1234
-
 
- diff --git a/oss/vtiger/trunk/modules/Dashboard/DashboardHome_matrix.php b/oss/vtiger/trunk/modules/Dashboard/DashboardHome_matrix.php deleted file mode 100644 index c1786a8e..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/DashboardHome_matrix.php +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - - -
1  
-
-
- - - - - - - -
- - - - - - - - -
2  
-
-

- - - - - - - - -
- - - - - - - - -
3  
-
-
- - - - - - - -
- - - - - - - - -
4  
-
-

- diff --git a/oss/vtiger/trunk/modules/Dashboard/Entity_charts.php b/oss/vtiger/trunk/modules/Dashboard/Entity_charts.php deleted file mode 100644 index faff1768..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Entity_charts.php +++ /dev/null @@ -1,849 +0,0 @@ -pquery($acc_qry, array($acc_id)); - $no_acc_rows=$adb->num_rows($acc_result); - - if($no_acc_rows!=0) - { - while($acc_row = $adb->fetch_array($acc_result)) - { - $name_val=$acc_row['accountname']; - } - $name=$name_val; - } - else - $name=""; - return $name; -} - - -/** - * Performance Optimization: Module Chart for Home Page Dashboard - */ -function module_Chart_HomePageDashboard($userinfo) { - - global $adb, $app_strings; - - $user_id = $userinfo->id; - - $graph_details = Array(); - $modrecords = Array(); - - // List of modules which needs to be considered for chart - $module_list = Array('Accounts','Potentials','Contacts','Leads','Quotes','SalesOrder','PurchaseOrder','Invoice','HelpDesk','Calendar','Campaigns'); - // List of special module to handle - $spl_modules = Array('Leads', 'HelpDesk', 'Potentials', 'Calendar'); - - // Leads module - $leadcountres = $adb->query("SELECT count(*) as count FROM vtiger_crmentity se INNER JOIN vtiger_leaddetails le on le.leadid = se.crmid - WHERE se.deleted = 0 AND se.smownerid = $user_id AND (le.converted = 0 OR le.converted IS NULL)"); - $modrecords['Leads'] = $adb->query_result($leadcountres, 0, 'count'); - - // HelpDesk module - $helpdeskcountres = $adb->query("SELECT count(*) as count FROM vtiger_crmentity se INNER JOIN vtiger_troubletickets tt ON tt.ticketid = se.crmid - WHERE se.deleted = 0 AND se.smownerid = $user_id AND (tt.status != 'Closed' OR tt.status IS NULL)"); - $modrecords['HelpDesk']=$adb->query_result($helpdeskcountres,0,'count'); - - // Potentials module - $potcountres = $adb->query("SELECT count(*) as count FROM vtiger_crmentity se INNER JOIN vtiger_potential pot ON pot.potentialid = se.crmid - WHERE se.deleted = 0 AND se.smownerid = $user_id AND (pot.sales_stage NOT IN ('".$app_strings['LBL_CLOSE_WON']."','". - $app_strings['LBL_CLOSE_LOST']."') OR pot.sales_stage IS NULL)"); - $modrecords['Potentials']= $adb->query_result($potcountres,0,'count'); - - // Calendar moudule - $calcountres = $adb->query("SELECT count(*) as count FROM vtiger_crmentity se INNER JOIN vtiger_activity act ON act.activityid = se.crmid - WHERE se.deleted = 0 AND se.smownerid = $user_id AND ((act.status!='Completed' AND act.status!='Deferred') OR act.status IS NULL) - AND ((act.eventstatus!='Held' AND act.eventstatus!='Not Held') OR act.eventstatus IS NULL)"); - $modrecords['Calendar']= $adb->query_result($calcountres,0,'count'); - - // Ignore the special module - $nor_modules = array_diff($module_list, $spl_modules); - // Prepare module string to use in SQL (check permission) - $inmodulestr = ''; - foreach($nor_modules as $modulename) { - if(isPermitted("$modulename","index",'') == 'yes') { - if($inmodulestr != '') $inmodulestr .= ",'$modulename'"; - else $inmodulestr = "'$modulename'"; - } - } - - // Get count for module that needs special conditions - $query = "SELECT setype, count(setype) setype_count FROM vtiger_crmentity se WHERE - se.deleted = 0 AND se.smownerid=$user_id AND se.setype in ($inmodulestr) GROUP BY se.setype"; - $queryres = $adb->query($query); - while($resrow = $adb->fetch_array($queryres)) { - $modrecords[$resrow['setype']] = $resrow['setype_count']; - } - - // Get module custom filter info - $cvidres = $adb->query("SELECT cvid,entitytype FROM vtiger_customview WHERE viewname='All' AND entitytype in ('". - implode("','", array_keys($modrecords)). "')"); - - $cvidinfo = Array(); - while($cvidrow = $adb->fetch_array($cvidres)) { - $cvidinfo[$cvidrow['entitytype']] = $cvidrow['cvid']; - } - - $name_val = ''; - $cnt_val = ''; - $target_val = ''; - $urlstring = ''; - $cnt_table = ''; - $test_target_val=''; - - $total_records= 0; - foreach($module_list as $modulename) { - if(isset($modrecords[$modulename])) { - $modrec_count = $modrecords[$modulename]; - if($modrec_count > 0) { - if($name_val != '') $name_val .= '::'; - $name_val .= $modulename; - - if($cnt_val != '') $cnt_val .= '::'; - $cnt_val .= $modrec_count; - - $modviewid = $cvidinfo[$modulename]; - if($target_val!= '') $target_val.= '::'; - $target_val.= urlencode("index.php?module=$modulename&action=ListView&from_homepagedb=true&type=dbrd&query=true&owner=$userinfo->user_name&viewname=$modviewid"); - if($test_target_val!='') $test_target_val.= 'K'; - $test_target_val.=urlencode("index.php?module=$modulename&action=ListView&from_homepagedb=true&type=dbrd&query=true&owner=$userinfo->user_name&viewname=$modviewid"); - - $urlstring .= 'K'; - $cnt_table .= ""; - - $total_records += $modrec_count; - } - } - } - $cnt_table .= '
StatusTotal
$modulename$modrec_count
'; - - $graph_details[] = $name_val; - $graph_details[] = $cnt_val; - $graph_details[] = " $userinfo->user_name : $total_records "; - $graph_details[] = $target_val; - $graph_details[] = ''; - $graph_details[] = $urlstring; - $graph_details[] = $cnt_table; - $graph_details[] = $test_target_val; - - return $graph_details; -} -/** END **/ - -/* Function returns the values to render the graph for a particular type - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. - * Contributor(s): ______________________________________.. -*/ - -// TO get the Values for a particular graph type -function module_Chart($user_id,$date_start="2000-01-01",$end_date="2017-01-01",$query,$graph_for,$title,$added_qry="",$module="",$graph_type) -{ - - global $adb,$current_user,$mod_strings, $default_charset; - global $days,$date_array,$period_type; - - if($added_qry!="") - $query.=$added_qry; - - $result=$adb->query($query); - - $no_of_rows=$adb->num_rows($result); - $mod_count_array=array(); - $search_str_array=array(); - $mod_name_array=array(); - $count_by_date[]=array(); - $mod_tot_cnt_array=array(); - - $mod_name_val=""; - $mod_cnt_crtd_date=""; - $target_val=""; - $bar_target_val=""; - $test_target_val=""; - - if($no_of_rows!=0) - { - while($row = $adb->fetch_array($result)) - { - if($graph_for == 'sostatus'||$graph_for == 'leadsource'||$graph_for == 'leadstatus'||$graph_for == 'industry'||$graph_for == 'productcategory'||$graph_for =='postatus'||$graph_for == 'invoicestatus'||$graph_for == 'ticketstatus'||$graph_for == 'priority'||$graph_for == 'category'||$graph_for == 'quotestage'||$graph_for == 'salesstage') - { - $mod_name= getTranslatedString($row[$graph_for]); - $search_str = $row[$graph_for]; - } - else - { - $mod_name= $row[$graph_for]; - $search_str = $row[$graph_for]; - } - if($mod_name=="") - { - $mod_name=$mod_strings["Un Assigned"]; - $search_str = " "; - } - $crtd_time=$row['createdtime']; - $crtd_time_array=explode(" ",$crtd_time); - $crtd_date=$crtd_time_array[0]; - if(!isset($mod_tot_cnt_array[$crtd_date])) - $mod_tot_cnt_array[$crtd_date]=0; - - $mod_tot_cnt_array[$crtd_date]+=1; - - if (in_array($mod_name,$mod_name_array) == false) - { $uniqueid[$mod_name]='0'; - array_push($mod_name_array,$mod_name); // getting all the unique Names into the array - if($graph_for == "productname") - { - if($row['qtyinstock'] =='') - $mod_count_array[$mod_name] = 1; - else - $mod_count_array[$mod_name]=$row['qtyinstock']; - } - } - else - { - if($graph_for == "productname") - { - $uniqueid[$mod_name]=$uniqueid[$mod_name]+1; $mod_name=$mod_name.'['.$uniqueid[$mod_name].']'; array_push($mod_name_array,$mod_name); // getting all the unique Names into the array - - if($row['qtyinstock'] =='') - $mod_count_array[$mod_name] = 1; - else - $mod_count_array[$mod_name]=$row['qtyinstock']; - } - } - if (in_array($search_str,$search_str_array) == false) - { - array_push($search_str_array,$search_str); - } - - //Counting the number of values for a type of graph - if($graph_for == "productname") - { - if($row['qtyinstock'] =='') - $mod_count_array[$mod_name] = 1; - else - $mod_count_array[$mod_name]=$row['qtyinstock']; - - } - else - { - if(!isset($mod_count_array[$mod_name])) - $mod_count_array[$mod_name]=0; - $mod_count_array[$mod_name]++; - } - - //Counting the number of values for a type of graph for a particular date - if(!isset($count_by_date[$mod_name][$crtd_date])) - $count_by_date[$mod_name][$crtd_date]=0; - - $count_by_date[$mod_name][$crtd_date]+=1; - } - $mod_by_mod_cnt=count($mod_name_array); - - if($mod_by_mod_cnt!=0) - { - $url_string=""; - - $mod_cnt_table=" - "; - - //Assigning the Header values to the vtiger_table and giving the dates as graphformat - for($i=0; $i<$days; $i++) - { - $tdate=$date_array[$i]; - $values=Graph_n_table_format($period_type,$tdate); - $graph_format=$values[0]; - $table_format=$values[1]; - $mod_cnt_table.= ""; - } - $mod_cnt_table .= "" ; - - //For all type of the array - for ($i=0;$ipquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"productname"); - if($name_val!="") - { - $mod_name=$name_val; - $search_str=$name_val; - } - } - if($graph_for =="purchaseorderid") - { - $query = "SELECT subject FROM vtiger_purchaseorder WHERE purchaseorderid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"subject"); - $id_name = $mod_name; - if($name_val!="") - { - $mod_name=$name_val; - $search_str=$name_val; - } - } - if($graph_for =="quoteid") - { - $query = "SELECT subject FROM vtiger_quotes WHERE quoteid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"subject"); - $id_name = $mod_name; - if($name_val!="") - { - $mod_name=$name_val; - $search_str=$name_val; - } - } - if($graph_for =="invoiceid") - { - $query = "SELECT subject FROM vtiger_invoice WHERE invoiceid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"subject"); - $id_name = $mod_name; - if($name_val!="") - { - $mod_name=$name_val; - $search_str=$name_val; - } - } - if($graph_for =="campaignid") - { - //this will return the list of the names of the campaign``:w for the y-axis - $query = "SELECT campaignname FROM vtiger_campaign WHERE campaignid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"campaignname"); - $id_name = $mod_name; - if($name_val!="") - { - $mod_name=$name_val; - $search_str=$name_val; - } - } - if($graph_for =="parent_id" || $graph_for =="related_to") - { - $seType = getSalesEntityType($mod_name); - if($seType == 'Contacts') { - $query = "SELECT lastname, firstname FROM vtiger_contactdetails - WHERE contactid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"lastname"); - if($name_val!="") { - if(getFieldVisibilityPermission('Contacts', $current_user->id, - 'firstname') == '0') { - $first_name = $adb->query_result($result,0,"firstname"); - if($first_name != '') { - $name_val .= " ".$first_name; - } - } - } - } else { - $query = "SELECT accountname FROM vtiger_account WHERE accountid=?"; - $result = $adb->pquery($query, array($mod_name)); - $name_val = $adb->query_result($result,0,"accountname"); - } - $mod_name=$name_val; - $search_str=$name_val; - } - //Passing name to graph - $mod_name = str_replace(":", ":", $mod_name); - if($mod_name_val!="") $mod_name_val.="::$mod_name"; - else $mod_name_val="$mod_name"; - - - //Passing count to graph - if($mod_cnt_val!="") $mod_cnt_val.="::$mod_count_val"; - else $mod_cnt_val="$mod_count_val"; - if($module!="") - { - //Check for Ticket Priority - if(($graph_type=="ticketsbypriority")) - { - $graph_for="ticketpriorities"; - } - - //added to get valid url in dashbord for tickets by team - if($graph_for == "smownerid"){ - $searchField = "assigned_user_id"; - } elseif($graph_for == 'category') { - $searchField = 'ticketcategories'; - } elseif($graph_for == 'priority') { - $searchField = 'ticketpriorities'; - } elseif($graph_for == "accountid") { - $searchField = "account_id"; - } else{ - $searchField = $graph_for; - } - $cvid = getCvIdOfAll($module); - if($module == "Home") - { - $cvid = getCvIdOfAll($mod_name); - $link_val="index.php?module=".$mod_name."&action=ListView&from_homepagedb=true&type=dbrd&query=true&owner=".$current_user->user_name."&viewname=".$cvid; - } - else if($module == "Contacts" || ($module=="Products" && ($graph_for == "quoteid" || $graph_for == "invoiceid" || $graph_for == "purchaseorderid"))) - $link_val="index.php?module=".$module."&action=ListView&from_dashboard=true&type=dbrd&query=true&".$searchField."=".$id_name."&viewname=".$cvid; - else { - $esc_search_str = urlencode($search_str); - //$esc_search_str = htmlentities($search_str, ENT_QUOTES, $default_charset); - $link_val="index.php?module=".$module."&action=index&from_dashboard=true&search_text=".$esc_search_str."&search_field=".$searchField."&searchtype=BasicSearch&query=true&type=entchar&operator=e&viewname=".$cvid; - } - - //Adding the links to the graph - $link_val = str_replace(':', ':', $link_val); - if($i==0) - $bar_target_val .=$link_val; - else - $bar_target_val .="::".$link_val; - } - //The data as per given date - if($i==0) - $urlstring .=$mod_cnt_crtd_date; - else - $urlstring .="K".$mod_cnt_crtd_date; - - if($i==0) - $test_target_val.=$link_val; - else - $test_target_val.="K".$link_val; - } - $mod_cnt_table .=""; - //For all Days getting the vtiger_table - for($k=0; $k<$days;$k++) - { - $tdate=$date_array[$k]; - if(!isset($mod_tot_cnt_array[$tdate])) - $mod_tot_cnt_array[$tdate]="0"; - $tot= $mod_tot_cnt_array[$tdate]; - if($period_type!="yday") - $mod_cnt_table.=""; - } - if($graph_for == "productname") - { - $cnt_total=array_sum($mod_count_array); - } - else - { - $cnt_total=array_sum($mod_tot_cnt_array); - } - - $mod_cnt_table.="
Status $table_formatTotal
Total$tot$cnt_total
"; - $mod_cnt_table.=""; - $title_of_graph="$title : $cnt_total"; - $bar_target_val=urlencode($bar_target_val); - $test_target_val=urlencode($test_target_val); - - - $Prod_mod_val=array($mod_name_val,$mod_cnt_val,$title_of_graph,$bar_target_val,$mod_graph_date,$urlstring,$mod_cnt_table,$test_target_val); - return $Prod_mod_val; - } - else - { - $data=0; - - } - - } - else - { - $data=0; - return "

The data is not available with the specified time period

"; - } - return $data; -} - - -/** Saving the images of the graph in the /cache/images - * otherwise it will render the graph with the given details - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. - * Contributor(s): ______________________________________.. -*/ - - -function save_image_map($filename,$image_map) -{ - - - global $log; - - if (!$handle = fopen($filename, 'w')) { - $log->debug(" Cannot open file ($filename)"); - return; - } - - // Write $somecontent to our opened file. - if (fwrite($handle, $image_map) === FALSE) { - $log->debug(" Cannot write to file ($filename)"); - return false; - } - - fclose($handle); - return true; -} - -function get_graph_by_type($graph_by,$graph_title,$module,$where,$query,$width=900,$height=900,$frompage='') -{ - global $user_id,$date_start,$end_date,$type,$mod_strings; - $time = time(); - //Giving the Cached image name - $cache_file_name=abs(crc32($user_id))."_".$type."_".crc32($date_start.$end_date).$time.".png"; - $html_imagename=$graph_by; //Html image name for the graph - - $graph_details=module_Chart($user_id,$date_start,$end_date,$query,$graph_by,$graph_title,$where,$module,$type); - if($graph_details!=0) - { - $name_val=$graph_details[0]; - $cnt_val=$graph_details[1]; - $graph_title=$graph_details[2]; - $target_val=$graph_details[3]; - $graph_date=$graph_details[4]; - $urlstring=$graph_details[5]; - $cnt_table=$graph_details[6]; - $test_target_val=$graph_details[7]; - - if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') - { - $width = 250; - $height = 250; - }else - { - $width = 850; - $height = 500; - } - - $top=20; - $left=140; - $bottom=120; - $title=$graph_title; - if($frompage != '') - { - //echo $width.'------'.$height.'------'.$left.'------'.$right.'------'.$top.'------'.$bottom.'------'.$title.'------'.$test_target_val.'------'.$date_start.'------'.$end_date; - //die; - return get_graph_homepg($cache_file_name,$html_imagename,$cnt_val,$name_val,280,285,$left,$right,$top,$bottom,$title,$target_val,$graph_date,$urlstring,$test_target_val,$date_start,$end_date); - - }else - { - return get_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_date,$urlstring,$test_target_val,$date_start,$end_date); - } - } - else - { - sleep(1); - echo '

'.$mod_strings['LBL_NO_DATA'].'

'; - } - -} - -/** Returns the Horizontal,vertical, pie graphs and Accumulated Graphs -for the details -* Portions created by vtiger are Copyright (C) vtiger. -* All Rights Reserved. -* Contributor(s): ______________________________________.. -*/ - - -// Function for get graphs -function get_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_date,$urlstring,$test_target_val,$date_start,$end_date) -{ - - global $tmp_dir; - global $graph_title, $mod_strings; - global $theme; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - - $val=explode(":",$title); - $display_title=$val[0]; - - if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') - { - $sHTML .=""; - } - -$sHTML .= " - - - - - - - - - "; - -$sHTML .= " - - - - - "; - - if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') - { - $sHTML .="
- - - - - - - -
1".$display_title."
".$mod_strings['LBL_HORZ_BAR_CHART']."
-
"; - if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') - { - $sHTML .= " "; - - }else - { - $sHTML .= " - - - - - - -
".$mod_strings['VIEWCHART']." : 12
"; - } - $sHTML .="
"; - - - $sHTML .= render_graph($tmp_dir."hor_".$cache_file_name,$html_imagename."_hor",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"horizontal"); -//Commented by Minnie -- same content displayed in two graphs -/*$sHTML .= "

- - - - - - - -
2".$graph_title."
Vertical Bar Chart
-
"; - - $sHTML .= render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical");*/ - -$sHTML .= "
"; - }else - { - $sHTML .= ""; - } - -$sHTML .= " - - - - - - "; - -if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') -{ - $sHTML .="
 
- - - - - - - -
2".$graph_title."
".$mod_strings['LBL_PIE_CHART']."
-
"; - if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX') - { - $sHTML .= " "; - - }else - { - $sHTML .= " - - - - - - -
".$mod_strings['VIEWCHART']." : 12
"; - } - $sHTML .="
"; - - $sHTML .= render_graph($tmp_dir."pie_".$cache_file_name,$html_imagename."_pie",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"pie"); - -$sHTML .= "
"; -} -$sHTML .= " "; - - -return $sHTML; -} - -/** Returns graph, if the cached image is present it'll display that image, -otherwise it will render the graph with the given details -* Portions created by vtiger are Copyright (C) vtiger. -* All Rights Reserved. -* Contributor(s): ______________________________________.. -*/ - -// Function to get the chached image if exists -function render_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_type) -{ - - //Checks whether the cached image is present or not - if(file_exists($cache_file_name)) - { - @unlink($cache_file_name); - } - if(file_exists($cache_file_name.'.map')) - { - @unlink($cache_file_name.'.map'); - } - if (!file_exists($cache_file_name) || !file_exists($cache_file_name.'.map')) - { - //If the Cached image is not present - if($graph_type=="horizontal") - { - return horizontal_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - } - else if($graph_type=="vertical") - { - return vertical_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - } - else if($graph_type=="pie") - { - return pie_chart($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - - } - } - else - { - //Getting the cached image - $imgMap_fp = fopen($cache_file_name.'.map', "rb"); - $imgMap = fread($imgMap_fp, filesize($cache_file_name.'.map')); - fclose($imgMap_fp); - $base_name_cache_file=basename($cache_file_name); - $ccc="cache/images/".$base_name_cache_file; - $return = "\n$imgMap\n"; - $return .= ""; - return $return; - } -} -function get_graph_homepg($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_date,$urlstring,$test_target_val,$date_start,$end_date) -{ - global $tmp_dir; - global $graph_title, $mod_strings; - global $theme; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - - $val=explode(":",$title); - $display_title=$val[0]; - $type = $_REQUEST[Chart_Type]; - if($type == 'horizontalbarchart') - $sHTML .= render_graph($tmp_dir."hor_".$cache_file_name,$html_imagename."_hor",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"horizontal"); - elseif($type == 'verticalbarchart') - $sHTML .= render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical"); - elseif($type == 'piechart') - $sHTML .= render_graph($tmp_dir."pie_".$cache_file_name,$html_imagename."_pie",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"pie"); - return $sHTML; -} -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/Forms.php b/oss/vtiger/trunk/modules/Dashboard/Forms.php deleted file mode 100644 index 74089889..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/Forms.php +++ /dev/null @@ -1,166 +0,0 @@ - - - - -EOQ; - -return $the_script; -} - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/HomepageDB.php b/oss/vtiger/trunk/modules/Dashboard/HomepageDB.php deleted file mode 100644 index 97fc4a95..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/HomepageDB.php +++ /dev/null @@ -1,69 +0,0 @@ -id.'.php'); - -global $current_user,$user_id,$date_start,$end_date,$tmp_dir,$mod_strings,$app_strings; -$type='recordsforuser'; - -// Performance Optimization: Using new API to generate dashboard chart -/* -$module_arr = Array ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns'); -foreach ($module_arr as $key => $mod_name){ - if(isPermitted("$mod_name","index",'') == 'yes'){ - - $permitted_mod_list[$key] = $mod_name; - } -} - -if(is_array($permitted_mod_list)){ - $moduleList = implode("','",$permitted_mod_list); -} - -$homepagedb_query = "select * from vtiger_crmentity se left join vtiger_leaddetails le on le.leadid=se.crmid left join vtiger_troubletickets tt on tt.ticketid=se.crmid left join vtiger_activity act on act.activityid=se.crmid left join vtiger_potential pot on pot.potentialid=se.crmid where se.deleted=0 and (le.converted=0 or le.converted is null) and (pot.sales_stage not in('".$app_strings['LBL_CLOSE_WON']."','".$app_strings['LBL_CLOSE_LOST']."') or pot.sales_stage is null) and (tt.status!='Closed' or tt.status is null) and ((act.status!='Completed' and act.status!='Deferred') or act.status is null) and ((act.eventstatus!='Held' and act.eventstatus!='Not Held') or act.eventstatus is null) and setype in ('".$moduleList."') and se.deleted=0 and se.smownerid=".$current_user->id; -$graph_by="setype"; -$graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name; -$module="Home"; -$where=""; -$query=$homepagedb_query; - -//Giving the Cached image name -$cache_file_name=abs(crc32($current_user->id))."_".$type."_".crc32($date_start.$end_date).".png"; - $html_imagename=$graph_by; //Html image name for the graph -$graph_details=module_Chart($current_user->id,$date_start,$end_date,$query,$graph_by,$graph_title,$where,$module,$type); -*/ - -// Performance Optimization -$graph_details = module_Chart_HomePageDashboard($current_user); - -if (!empty($graph_details) && $graph_details[1] != 0) { // END - $name_val=$graph_details[0]; - $cnt_val=$graph_details[1]; - $graph_title=$graph_details[2]; - $target_val=$graph_details[3]; - $graph_date=$graph_details[4]; - $urlstring=$graph_details[5]; - $cnt_table=$graph_details[6]; - $test_target_val=$graph_details[7]; - - $width=560; - $height=225; - $top=30; - $left=140; - $bottom=120; - $title=$graph_title; - $sHTML = render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical"); - echo $sHTML; -}else{ - echo $mod_strings['LBL_NO_DATA']; -} - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/ReportsCharts.php b/oss/vtiger/trunk/modules/Dashboard/ReportsCharts.php deleted file mode 100644 index 19de9172..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/ReportsCharts.php +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - -
1".$graph_title."
Horizontal Bar Chart
- - - - "; - - $sHTML .= render_graph($tmp_dir."hor_".$cache_file_name,$html_imagename."_hor",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"horizontal"); -//Commented by Minnie -- same content displayed in to graphs -/*$sHTML .= " - - -
- "; - -$sHTML .= " - - - - - - - - -
2".$graph_title."
Vertical Bar Chart
- - - - "; - - $sHTML .= render_graph($tmp_dir."vert_".$cache_file_name,$html_imagename."_vert",$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,"vertical");*/ - -$sHTML .= " - - -
- "; - -$sHTML .= " - - - - - - - - -
2".$graph_title."
Pie Chart
- - - - "; - - $sHTML .= render_graph($tmp_dir."pie_".$cache_file_name,$html_imagename."_pie",$cnt_val,$name_val,$width,$height,40,$right,$top,$bottom,$title,$target_val,"pie"); - -$sHTML .= " - - -
- "; - - return $sHTML; -} - -/** Returns graph, if the cached image is present it'll display that image, -otherwise it will render the graph with the given details -* Portions created by vtiger are Copyright (C) vtiger. -* All Rights Reserved. -* Contributor(s): ______________________________________.. -*/ - -// Function to get the chached image if exists -function render_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_type) -{ - - //Checks whether the cached image is present or not - if(file_exists($cahce_file_name)) - { - unlink($cache_file_name); - } - if(file_exists($cache_file_name.'.map')) - { - unlink($cache_file_name.'.map'); - } - if (!file_exists($cache_file_name) || !file_exists($cache_file_name.'.map')) - { - //If the Cached image is not present - if($graph_type=="horizontal") - { - return horizontal_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - } - else if($graph_type=="vertical") - { - return vertical_graph($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - } - else if($graph_type=="pie") - { - return pie_chart($cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_imagename); - - } - } - else - { - //Getting the cached image - $imgMap_fp = fopen($cache_file_name.'.map', "rb"); - $imgMap = fread($imgMap_fp, vtiger_filesize($cache_file_name.'.map')); - fclose($imgMap_fp); - $base_name_cache_file=basename($cache_file_name); - $ccc="cache/images/".$base_name_cache_file; - $return = "\n$imgMap\n"; - $return .= ""; - return $return; - } -} -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/accumulated_bargraph.php b/oss/vtiger/trunk/modules/Dashboard/accumulated_bargraph.php deleted file mode 100644 index ad567efc..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/accumulated_bargraph.php +++ /dev/null @@ -1,88 +0,0 @@ -SetScale("textlin"); - -$graph->SetShadow(); - - -// Create the lines of the Graph -for($i=0;$iSetFillColor($color_array[$i]); - $bplot[$i]->SetWidth(10); - - $bplot[$i]->value->Show(); - $bplot[$i]->value->SetFont(FF_FONT1,FS_NORMAL,8); - $bplot[$i]->value->SetColor("black"); - $bplot[$i]->value->SetFormat('%d'); - $bplot[$i]->SetValuePos('max'); - -} - -$gbplot = new AccBarPlot($bplot); -$gbplot->SetWidth(0.7); - -// Add the bar to the graph -$graph->Add($gbplot); - -$graph->xaxis->SetTickLabels($datax); - -$graph->title->Set($title); - -$graph->Set90AndMargin($left,$right,$top,$bottom); -//$graph->SetFrame(false); -$graph->title->SetFont(FF_FONT1,FS_BOLD); -$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); -$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); - -$graph->SetColor("#7D9CB8"); -$graph->SetMarginColor("#3D6A93"); - -// Display the graph -$graph->Stroke(); - -?> - diff --git a/oss/vtiger/trunk/modules/Dashboard/display_charts.php b/oss/vtiger/trunk/modules/Dashboard/display_charts.php deleted file mode 100644 index c2a2b1b3..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/display_charts.php +++ /dev/null @@ -1,825 +0,0 @@ -id.'.php'); -global $current_language; -$mod_strings = return_module_language($current_language, 'Dashboard'); - - -$period=($_REQUEST['period'])?$_REQUEST['period']:"tmon"; // Period >> lmon- Last Month, tmon- This Month, lweek-LastWeek, tweek-ThisWeek; lday- Last Day -$type=($_REQUEST['type'])?$_REQUEST['type']:"leadsource"; -$dates_values=start_end_dates($period); //To get the stating and End dates for a given period -$date_start=$dates_values[0]; //Starting date -$end_date=$dates_values[1]; // Ending Date -$period_type=$dates_values[2]; //Period type as MONTH,WEEK,LDAY -$width=$dates_values[3]; -$height=$dates_values[4]; - -//It gives all the dates in between the starting and ending dates and also gives the number of days,declared in utils.php -$no_days_dates=get_days_n_dates($date_start,$end_date); -$days=$no_days_dates[0]; -$date_array=$no_days_dates[1]; //Array containig all the dates -$user_id=$current_user->id; - -// Query for Leads -$leads_query="select vtiger_crmentity.crmid,vtiger_crmentity.createdtime, vtiger_leaddetails.*, vtiger_crmentity.smownerid, vtiger_leadscf.* from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid inner join vtiger_leadsubdetails on vtiger_leadsubdetails.leadsubscriptionid=vtiger_leaddetails.leadid inner join vtiger_leadaddress on vtiger_leadaddress.leadaddressid=vtiger_leadsubdetails.leadsubscriptionid inner join vtiger_leadscf on vtiger_leaddetails.leadid = vtiger_leadscf.leadid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 and vtiger_leaddetails.converted=0 "; - - -//Query for Accounts -$account_query="select vtiger_crmentity.*, vtiger_account.*, vtiger_accountscf.* from vtiger_account inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid inner join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid inner join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid inner join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - -//Query for Products by PO -$probyPO = "select vtiger_purchaseorder.*,vtiger_crmentity.* from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid inner join vtiger_inventoryproductrel on vtiger_purchaseorder.purchaseorderid = vtiger_inventoryproductrel.id LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid where vtiger_inventoryproductrel.id=vtiger_purchaseorder.purchaseorderid and vtiger_crmentity.deleted=0"; - -//Query for Products by Quotes -$probyQ = "select vtiger_quotes.*,vtiger_crmentity.* from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid inner join vtiger_inventoryproductrel on vtiger_quotes.quoteid = vtiger_inventoryproductrel.id LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid where vtiger_inventoryproductrel.id=vtiger_quotes.quoteid and vtiger_crmentity.deleted=0"; - -//Query for Products by Invoices -$probyInv = "select vtiger_invoice.*,vtiger_crmentity.* from vtiger_invoice inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid inner join vtiger_inventoryproductrel on vtiger_invoice.invoiceid = vtiger_inventoryproductrel.id LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid where vtiger_inventoryproductrel.id=vtiger_invoice.invoiceid and vtiger_crmentity.deleted=0"; - -//Query For Products qty in stock -$products_query="select distinct(vtiger_crmentity.crmid),vtiger_crmentity.createdtime,vtiger_products.* from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_products.productid left join vtiger_inventoryproductrel on vtiger_products.productid = vtiger_inventoryproductrel.id where vtiger_crmentity.deleted=0 and vtiger_products.qtyinstock > 0"; - -//Query for Potential -$potential_query= "select vtiger_crmentity.*,vtiger_account.accountname, vtiger_potential.*, vtiger_potentialscf.*, vtiger_groups.groupname from vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid left join vtiger_account on vtiger_potential.related_to = vtiger_account.accountid inner join vtiger_potentialscf on vtiger_potentialscf.potentialid = vtiger_potential.potentialid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - -//Query for Sales Order -$so_query="select vtiger_crmentity.*,vtiger_salesorder.*,vtiger_account.accountid,vtiger_quotes.quoteid from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid inner join vtiger_sobillads on vtiger_salesorder.salesorderid=vtiger_sobillads.sobilladdressid inner join vtiger_soshipads on vtiger_salesorder.salesorderid=vtiger_soshipads.soshipaddressid left join vtiger_salesordercf on vtiger_salesordercf.salesorderid = vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - - -//Query for Purchase Order - -$po_query="select vtiger_crmentity.*,vtiger_purchaseorder.* from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid inner join vtiger_pobillads on vtiger_purchaseorder.purchaseorderid=vtiger_pobillads.pobilladdressid inner join vtiger_poshipads on vtiger_purchaseorder.purchaseorderid=vtiger_poshipads.poshipaddressid left join vtiger_purchaseordercf on vtiger_purchaseordercf.purchaseorderid = vtiger_purchaseorder.purchaseorderid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - -// Query for Quotes -$quotes_query="select vtiger_crmentity.*,vtiger_quotes.* from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid inner join vtiger_quotesbillads on vtiger_quotes.quoteid=vtiger_quotesbillads.quotebilladdressid inner join vtiger_quotesshipads on vtiger_quotes.quoteid=vtiger_quotesshipads.quoteshipaddressid left join vtiger_quotescf on vtiger_quotes.quoteid = vtiger_quotescf.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_quotes.accountid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - -//Query for Invoice -$invoice_query="select vtiger_crmentity.*,vtiger_invoice.* from vtiger_invoice inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_invoice.invoiceid inner join vtiger_invoicebillads on vtiger_invoice.invoiceid=vtiger_invoicebillads.invoicebilladdressid inner join vtiger_invoiceshipads on vtiger_invoice.invoiceid=vtiger_invoiceshipads.invoiceshipaddressid left outer join vtiger_salesorder on vtiger_salesorder.salesorderid=vtiger_invoice.salesorderid inner join vtiger_invoicecf on vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_crmentity.deleted=0 "; - -//Query for tickets -$helpdesk_query=" select vtiger_troubletickets.status AS ticketstatus, vtiger_groups.groupname AS ticketgroupname, vtiger_troubletickets.*,vtiger_crmentity.* from vtiger_troubletickets inner join vtiger_ticketcf on vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_contactdetails on vtiger_troubletickets.parent_id=vtiger_contactdetails.contactid left join vtiger_account on vtiger_account.accountid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id and vtiger_troubletickets.ticketid = vtiger_ticketcf.ticketid where vtiger_crmentity.deleted=0"; - - -//Query for Contacts by Campaign -$contByCampaign = "select crmid from vtiger_contactdetails inner join vtiger_campaigncontrel on vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0 "; -$cont_Q = getDashboardQuery($contByCampaign,"Contacts"); - -$result = $adb->pquery($cont_Q, array()); -$num_conts = $adb->num_rows($result); -$cont_Array = array(); -for($z=0;$z<$num_conts;$z++) -{ - $cont_ID=$adb->query_result($result,$z,'crmid'); - if(!in_array($cont_ID, $cont_Array)) - array_push($cont_Array, $cont_ID); -} -$cont_checkQ = " and vtiger_crmentityContacts.crmid in(0)"; -if(count($cont_Array) > 0) - $cont_checkQ = " and vtiger_crmentityContacts.crmid in(".implode(", ", $cont_Array).")"; - -$campaign_query="select vtiger_campaign.*,vtiger_crmentity.* from vtiger_campaign inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_campaign.campaignid inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_campaigncontrel.contactid left join vtiger_crmentity as vtiger_crmentityContacts on vtiger_crmentityContacts.crmid = vtiger_contactdetails.contactid where vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid and vtiger_crmentity.deleted=0 and vtiger_crmentityContacts.deleted=0".$cont_checkQ; - - -//Query for tickets by account -$tickets_by_account="select vtiger_troubletickets.*, vtiger_groups.groupname AS ticketgroupname, vtiger_crmentity.*, vtiger_account.* from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid inner join vtiger_account on vtiger_account.accountid=vtiger_troubletickets.parent_id left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0"; - -//Query for tickets by contact -$tickets_by_contact="select vtiger_troubletickets.*, vtiger_groups.groupname AS ticketgroupname, vtiger_crmentity.*, vtiger_contactdetails.* from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_crmentity.deleted=0"; - -//Query for product by category - -$product_category = "select vtiger_products.*,vtiger_crmentity.deleted from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid where vtiger_crmentity.deleted=0"; - -$graph_array = Array( - "DashboardHome" => $mod_strings['DashboardHome'], - "leadsource" => $mod_strings['leadsource'], - "leadstatus" => $mod_strings['leadstatus'], - "leadindustry" => $mod_strings['leadindustry'], - "salesbyleadsource" => $mod_strings['salesbyleadsource'], - "salesbyaccount" => $mod_strings['salesbyaccount'], - "salesbyuser" => $mod_strings['salesbyuser'], - "salesbyteam" => $mod_strings['salesbyteam'], - "accountindustry" => $mod_strings['accountindustry'], - "productcategory" => $mod_strings['productcategory'], - "productbyqtyinstock" => $mod_strings['productbyqtyinstock'], - "productbypo" => $mod_strings['productbypo'], - "productbyquotes" => $mod_strings['productbyquotes'], - "productbyinvoice" => $mod_strings['productbyinvoice'], - "sobyaccounts" => $mod_strings['sobyaccounts'], - "sobystatus" => $mod_strings['sobystatus'], - "pobystatus" => $mod_strings['pobystatus'], - "quotesbyaccounts" => $mod_strings['quotesbyaccounts'], - "quotesbystage" => $mod_strings['quotesbystage'], - "invoicebyacnts" => $mod_strings['invoicebyacnts'], - "invoicebystatus" => $mod_strings['invoicebystatus'], - "ticketsbystatus" => $mod_strings['ticketsbystatus'], - "ticketsbypriority" => $mod_strings['ticketsbypriority'], - "ticketsbycategory" => $mod_strings['ticketsbycategory'], - "ticketsbyuser" => $mod_strings['ticketsbyuser'], - "ticketsbyteam" => $mod_strings['ticketsbyteam'], - "ticketsbyproduct"=> $mod_strings['ticketsbyproduct'], - "contactbycampaign"=> $mod_strings['contactbycampaign'], - "ticketsbyaccount"=> $mod_strings['ticketsbyaccount'], - "ticketsbycontact"=> $mod_strings['ticketsbycontact'], - ); - if(isset($_REQUEST['from_page']) && $_REQUEST['from_page'] == 'HomePage') - { - - //Charts for Lead Source - if($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadsource") && (getFieldVisibilityPermission('Leads',$user_id,'leadsource') == "0")) - { - $graph_by="leadsource"; - $graph_title= $mod_strings['leadsource']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - - } - // To display the charts for Lead status - elseif ($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadstatus")&& (getFieldVisibilityPermission('Leads',$user_id,'leadstatus') == "0")) - { - $graph_by="leadstatus"; - $graph_title= $mod_strings['leadstatus']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - if(!$is_admin) - $query .= ' and vtiger_leaddetails.leadsource '.picklist_check($module,$graph_by); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Lead Industry - elseif ($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadindustry") && (getFieldVisibilityPermission('Leads',$user_id,'industry') == "0")) - { - $graph_by="industry"; - $graph_title=$mod_strings['leadindustry']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Sales by Lead Source - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyleadsource")&& (getFieldVisibilityPermission('Potentials',$user_id,'leadsource') == "0")) - { - $graph_by="leadsource"; - $graph_title=$mod_strings['salesbyleadsource']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like '%Closed Won%' "; - $query=getDashboardQuery($potential_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Sales by Account - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyaccount") && (getFieldVisibilityPermission('Potentials',$user_id,'related_to') == "0")) - { - $graph_by="related_to"; - $graph_title=$mod_strings['salesbyaccount']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like '%Closed Won%' "; - $query=getDashboardQuery($potential_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Sales by User - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyuser")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['salesbyuser']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like '%Closed Won%' and (vtiger_groups.groupname is NULL)"; - $query=getDashboardQuery($potential_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Sales by team - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyteam")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['salesbyteam']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like '%Closed Won%' and (vtiger_groups.groupname != NULL || vtiger_groups.groupname != '')"; - $query=getDashboardQuery($potential_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Account by Industry - elseif ($profileTabsPermission[getTabid("Accounts")] == 0 && ($type == "accountindustry") && (getFieldVisibilityPermission('Accounts',$user_id,'industry') == "0")) - { - $graph_by="industry"; - $graph_title=$mod_strings['accountindustry']; - $module="Accounts"; - $where=""; - $query=getDashboardQuery($account_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Products by Category - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productcategory") && (getFieldVisibilityPermission('Products',$user_id,'productcategory') == "0")) - { - $graph_by="productcategory"; - $graph_title=$mod_strings['productcategory']; - $module="Products"; - $where=""; - $query=getDashboardQuery($product_category, $module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Products by Quantity in stock - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyqtyinstock") && (getFieldVisibilityPermission('Products',$user_id,'qtyinstock') == "0")) - { - $graph_by="productname"; - $graph_title=$mod_strings['productbyqtyinstock']; - $module="Products"; - $where=""; - $query=getDashboardQuery($products_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Products by PO - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbypo") && $profileTabsPermission[getTabid("PurchaseOrder")] == 0) - { - $graph_by="purchaseorderid"; - $graph_title=$mod_strings['productbypo']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyPO,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Products by Quotes - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyquotes") && $profileTabsPermission[getTabid("Quotes")] == 0) - { - $graph_by="quoteid"; - $graph_title=$mod_strings['productbyquotes']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyQ, $module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Charts for Products by Invoice - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyinvoice") && $profileTabsPermission[getTabid("Invoice")] == 0) - { - $graph_by="invoiceid"; - $graph_title=$mod_strings['productbyinvoice']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyInv, $module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - - // Sales Order by Accounts - elseif ($profileTabsPermission[getTabid("SalesOrder")] == 0 && ($type == "sobyaccounts") && (getFieldVisibilityPermission('SalesOrder',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title=$mod_strings['sobyaccounts']; - $module="SalesOrder"; - $where=""; - $query=getDashboardQuery($so_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Sales Order by Status - elseif ($profileTabsPermission[getTabid("SalesOrder")] == 0 && ($type == "sobystatus") && (getFieldVisibilityPermission('SalesOrder',$user_id,'sostatus') == "0")) - { - $graph_by="sostatus"; - $graph_title=$mod_strings['sobystatus']; - $module="SalesOrder"; - $where=""; - $query=getDashboardQuery($so_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Purchase Order by Status - elseif ($profileTabsPermission[getTabid("PurchaseOrder")] == 0 && ($type == "pobystatus") && (getFieldVisibilityPermission('PurchaseOrder',$user_id,'postatus') == "0")) - { - $graph_by="postatus"; - $graph_title=$mod_strings['pobystatus']; - $module="PurchaseOrder"; - $where=""; - $query=getDashboardQuery($po_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Quotes by Accounts - elseif ($profileTabsPermission[getTabid("Quotes")] == 0 && ($type == "quotesbyaccounts") && (getFieldVisibilityPermission('Quotes',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title= $mod_strings['quotesbyaccounts']; - $module="Quotes"; - $where=""; - $query=getDashboardQuery($quotes_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Quotes by Stage - elseif ($profileTabsPermission[getTabid("Quotes")] == 0 && ($type == "quotesbystage") && (getFieldVisibilityPermission('Quotes',$user_id,'quotestage') == "0")) - { - $graph_by="quotestage"; - $graph_title=$mod_strings['quotesbystage']; - $module="Quotes"; - $where=""; - $query=getDashboardQuery($quotes_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Invoice by Accounts - elseif ($profileTabsPermission[getTabid("Invoice")] == 0 && ($type == "invoicebyacnts") && (getFieldVisibilityPermission('Invoice',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title=$mod_strings['invoicebyacnts']; - $module="Invoice"; - $where=""; - $query=getDashboardQuery($invoice_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Invoices by status - elseif ($profileTabsPermission[getTabid("Invoice")] == 0 && ($type == "invoicebystatus") && (getFieldVisibilityPermission('Invoice',$user_id,'invoicestatus') == "0")) - { - $graph_by="invoicestatus"; - $graph_title=$mod_strings['invoicebystatus']; - $module="Invoice"; - $where=""; - $query=getDashboardQuery($invoice_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Status - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbystatus") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketstatus') == "0")) - { - $graph_by="ticketstatus"; - $graph_title=$mod_strings['ticketsbystatus']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Priority - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbypriority") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketpriorities') == "0")) - { - $graph_by="priority"; - $graph_title=$mod_strings['ticketsbypriority']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Category - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbycategory") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketcategories') == "0")) - { - $graph_by="category"; - $graph_title=$mod_strings['ticketsbycategory']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by User - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyuser")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['ticketsbyuser']; - $module="HelpDesk"; - $where=" and (vtiger_groups.groupname is NULL)"; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Team - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyteam")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['ticketsbyteam']; - $module="HelpDesk"; - $where=" and (vtiger_groups.groupname != NULL || vtiger_groups.groupname != ' ')"; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Product - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyproduct") && (getFieldVisibilityPermission('HelpDesk',$user_id,'product_id') == "0")) - { - $graph_by="product_id"; - $graph_title=$mod_strings['ticketsbyproduct']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Campaigns by Contact - elseif ($profileTabsPermission[getTabid("Contacts")] == 0 && ($type == "contactbycampaign") && $profileTabsPermission[getTabid("Campaigns")] == 0) - { - $graph_by="campaignid"; - $graph_title=$mod_strings['contactbycampaign']; - $module="Contacts"; - $where=""; - $query=getDashboardQuery($campaign_query,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Account - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyaccount") && (getFieldVisibilityPermission('HelpDesk',$user_id,'parent_id') == "0")) - { - $graph_by="parent_id"; - $graph_title=$mod_strings['ticketsbyaccount']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($tickets_by_account,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - //Tickets by Contact - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbycontact") && (getFieldVisibilityPermission('HelpDesk',$user_id,'parent_id') == "0")) - { - $graph_by="parent_id"; - $graph_title=$mod_strings['ticketsbycontact']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($tickets_by_contact,$module); - return get_graph_by_type($graph_by,$graph_title,$module,$where,$query,"210","210","forhomepage"); - } - else - { - //echo $mod_strings['LBL_NO_PERMISSION_FIELD']; - sleep(1); - return '

'.$mod_strings['LBL_NO_PERMISSION_FIELD'].'

'; - } - } - else - { - $html=''; - //Charts for Lead Source - if($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadsource") && (getFieldVisibilityPermission('Leads',$user_id,'leadsource') == "0")) - { - $graph_by="leadsource"; - $graph_title= $mod_strings['leadsource']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - //$html .= get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - // To display the charts for Lead status - elseif ($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadstatus")&& (getFieldVisibilityPermission('Leads',$user_id,'leadstatus') == "0")) - { - $graph_by="leadstatus"; - $graph_title= $mod_strings['leadstatus']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - if(!$is_admin) - $query .= ' and vtiger_leaddetails.leadstatus '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Lead Industry - elseif ($profileTabsPermission[getTabid("Leads")] == 0 && ($type == "leadindustry") && (getFieldVisibilityPermission('Leads',$user_id,'industry') == "0")) - { - $graph_by="industry"; - $graph_title=$mod_strings['leadindustry']; - $module="Leads"; - $where=""; - $query=getDashboardQuery($leads_query,$module); - if(!$is_admin) - $query .= ' and vtiger_leaddetails.industry '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Sales by Lead Source - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyleadsource")&& (getFieldVisibilityPermission('Potentials',$user_id,'leadsource') == "0")) - { - $graph_by="leadsource"; - $graph_title=$mod_strings['salesbyleadsource']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like 'Closed Won' "; - $query=getDashboardQuery($potential_query,$module); - if(!$is_admin) - $query .= ' and vtiger_potential.leadsource '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Sales by Account - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyaccount") && (getFieldVisibilityPermission('Potentials',$user_id,'related_to') == "0")) - { - $graph_by="related_to"; - $graph_title=$mod_strings['salesbyaccount']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like 'Closed Won' "; - $query=getDashboardQuery($potential_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Sales by User - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyuser")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['salesbyuser']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like 'Closed Won' and (vtiger_groups.groupname is NULL)"; - $query=getDashboardQuery($potential_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Sales by team - elseif ($profileTabsPermission[getTabid("Potentials")] == 0 && ($type == "salesbyteam")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['salesbyteam']; - $module="Potentials"; - $where=" and vtiger_potential.sales_stage like 'Closed Won' and (vtiger_groups.groupname != NULL || vtiger_groups.groupname != '')"; - $query=getDashboardQuery($potential_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Account by Industry - elseif ($profileTabsPermission[getTabid("Accounts")] == 0 && ($type == "accountindustry") && (getFieldVisibilityPermission('Accounts',$user_id,'industry') == "0")) - { - $graph_by="industry"; - $graph_title=$mod_strings['accountindustry']; - $module="Accounts"; - $where=""; - $query=getDashboardQuery($account_query,$module); - if(!$is_admin) - $query .= ' and vtiger_account.industry '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Products by Category - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productcategory") && (getFieldVisibilityPermission('Products',$user_id,'productcategory') == "0")) - { - $graph_by="productcategory"; - $graph_title=$mod_strings['productcategory']; - $module="Products"; - $where=""; - $query=getDashboardQuery($product_category,$module); - if(!$is_admin) - $query .= ' and vtiger_products.productcategory '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Products by Quantity in stock - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyqtyinstock") && (getFieldVisibilityPermission('Products',$user_id,'qtyinstock') == "0")) - { - $graph_by="productname"; - $graph_title=$mod_strings['productbyqtyinstock']; - $module="Products"; - $where=""; - $query=getDashboardQuery($products_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Products by PO - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbypo") && $profileTabsPermission[getTabid("PurchaseOrder")] == 0) - { - $graph_by="purchaseorderid"; - $graph_title=$mod_strings['productbypo']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyPO,"PurchaseOrder"); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Products by Quotes - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyquotes") && $profileTabsPermission[getTabid("Quotes")] == 0) - { - $graph_by="quoteid"; - $graph_title=$mod_strings['productbyquotes']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyQ,"Quotes"); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Charts for Products by Invoice - elseif ($profileTabsPermission[getTabid("Products")] == 0 && ($type == "productbyinvoice") && $profileTabsPermission[getTabid("Invoice")] == 0) - { - $graph_by="invoiceid"; - $graph_title=$mod_strings['productbyinvoice']; - $module="Products"; - $where=""; - $query=getDashboardQuery($probyInv,"Invoice"); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - - // Sales Order by Accounts - elseif ($profileTabsPermission[getTabid("SalesOrder")] == 0 && ($type == "sobyaccounts") && (getFieldVisibilityPermission('SalesOrder',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title=$mod_strings['sobyaccounts']; - $module="SalesOrder"; - $where=""; - $query=getDashboardQuery($so_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Sales Order by Status - elseif ($profileTabsPermission[getTabid("SalesOrder")] == 0 && ($type == "sobystatus") && (getFieldVisibilityPermission('SalesOrder',$user_id,'sostatus') == "0")) - { - $graph_by="sostatus"; - $graph_title=$mod_strings['sobystatus']; - $module="SalesOrder"; - $where=""; - $query=getDashboardQuery($so_query,$module); - if(!$is_admin) - $query .= ' and vtiger_salesorder.sostatus '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Purchase Order by Status - elseif ($profileTabsPermission[getTabid("PurchaseOrder")] == 0 && ($type == "pobystatus") && (getFieldVisibilityPermission('PurchaseOrder',$user_id,'postatus') == "0")) - { - $graph_by="postatus"; - $graph_title=$mod_strings['pobystatus']; - $module="PurchaseOrder"; - $where=""; - $query=getDashboardQuery($po_query,$module); - if(!$is_admin) - $query .= ' and vtiger_purchaseorder.postatus '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Quotes by Accounts - elseif ($profileTabsPermission[getTabid("Quotes")] == 0 && ($type == "quotesbyaccounts") && (getFieldVisibilityPermission('Quotes',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title= $mod_strings['quotesbyaccounts']; - $module="Quotes"; - $where=""; - $query=getDashboardQuery($quotes_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Quotes by Stage - elseif ($profileTabsPermission[getTabid("Quotes")] == 0 && ($type == "quotesbystage") && (getFieldVisibilityPermission('Quotes',$user_id,'quotestage') == "0")) - { - $graph_by="quotestage"; - $graph_title=$mod_strings['quotesbystage']; - $module="Quotes"; - $where=""; - $query=getDashboardQuery($quotes_query,$module); - if(!$is_admin) - $query .= ' and vtiger_quotes.quotestage '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Invoice by Accounts - elseif ($profileTabsPermission[getTabid("Invoice")] == 0 && ($type == "invoicebyacnts") && (getFieldVisibilityPermission('Invoice',$user_id,'account_id') == "0")) - { - $graph_by="accountid"; - $graph_title=$mod_strings['invoicebyacnts']; - $module="Invoice"; - $where=""; - $query=getDashboardQuery($invoice_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Invoices by status - elseif ($profileTabsPermission[getTabid("Invoice")] == 0 && ($type == "invoicebystatus") && (getFieldVisibilityPermission('Invoice',$user_id,'invoicestatus') == "0")) - { - $graph_by="invoicestatus"; - $graph_title=$mod_strings['invoicebystatus']; - $module="Invoice"; - $where=""; - $query=getDashboardQuery($invoice_query,$module); - if(!$is_admin) - $query .= ' and vtiger_invoice.invoicestatus '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Status - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbystatus") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketstatus') == "0")) - { - $graph_by="ticketstatus"; - $graph_title=$mod_strings['ticketsbystatus']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - if(!$is_admin) - $query .= ' and vtiger_troubletickets.status '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Priority - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbypriority") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketpriorities') == "0")) - { - $graph_by="priority"; - $graph_title=$mod_strings['ticketsbypriority']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - if(!$is_admin) - $query .= ' and vtiger_troubletickets.priority '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Category - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbycategory") && (getFieldVisibilityPermission('HelpDesk',$user_id,'ticketcategories') == "0")) - { - $graph_by="category"; - $graph_title=$mod_strings['ticketsbycategory']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - if(!$is_admin) - $query .= ' and vtiger_troubletickets.category '.picklist_check($module,$graph_by); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by User - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyuser")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['ticketsbyuser']; - $module="HelpDesk"; - $where=" and (vtiger_groups.groupname is NULL)"; - $query=getDashboardQuery($helpdesk_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Team - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyteam")) - { - $graph_by="smownerid"; - $graph_title=$mod_strings['ticketsbyteam']; - $module="HelpDesk"; - $where=" and (vtiger_groups.groupname != NULL || vtiger_groups.groupname != ' ')"; - $query=getDashboardQuery($helpdesk_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Product - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyproduct") && (getFieldVisibilityPermission('HelpDesk',$user_id,'product_id') == "0")) - { - $graph_by="product_id"; - $graph_title=$mod_strings['ticketsbyproduct']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($helpdesk_query,$module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Campaigns by Contact - elseif ($profileTabsPermission[getTabid("Contacts")] == 0 && ($type == "contactbycampaign") && $profileTabsPermission[getTabid("Campaigns")] == 0) - { - $graph_by="campaignid"; - $graph_title=$mod_strings['contactbycampaign']; - $module="Contacts"; - $where=""; - $query=getDashboardQuery($campaign_query,"Campaigns"); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Account - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbyaccount") && (getFieldVisibilityPermission('HelpDesk',$user_id,'parent_id') == "0")) - { - $graph_by="parent_id"; - $graph_title=$mod_strings['ticketsbyaccount']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($tickets_by_account, $module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - //Tickets by Contact - elseif ($profileTabsPermission[getTabid("HelpDesk")] == 0 && ($type == "ticketsbycontact") && (getFieldVisibilityPermission('HelpDesk',$user_id,'parent_id') == "0")) - { - $graph_by="parent_id"; - $graph_title=$mod_strings['ticketsbycontact']; - $module="HelpDesk"; - $where=""; - $query=getDashboardQuery($tickets_by_contact, $module); - echo get_graph_by_type($graph_by,$graph_title,$module,$where,$query); - } - else - { - //echo $mod_strings['LBL_NO_PERMISSION_FIELD']; - sleep(1); - echo '

'.$mod_strings['LBL_NO_PERMISSION_FIELD'].'

'; - } - } -} - -/**This function generates the security parameters for a given module based on the assigned profile -*Param $module - module name -*Returns an string value -*/ - -function getDashboardQuery($query, $module) { - global $current_user; - $secQuery = getNonAdminAccessControlQuery($module, $current_user); - if(strlen($secQuery) > 1) { - $query = appendFromClauseToQuery($query, $secQuery); - } - return $query; -} - -/**This function generates the security parameters for a given user base picklist values -*Param $graph - name of the graph -*Returns an string value -*/ - -function picklist_check($module,$graph_by) -{ - global $current_user,$adb; - $pick_query = ''; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - $roleid=$current_user->roleid; - $subrole = getRoleSubordinates($roleid); - if(count($subrole)> 0) - { - $roleids = $subrole; - array_push($roleids, $roleid); - } - else - { - $roleids = $roleid; - } - if($graph_by == 'sostatus' || $graph_by == 'leadsource' || $graph_by == 'leadstatus' ||$graph_by == 'industry' || $graph_by == 'productcategory' || $graph_by == 'postatus' || $graph_by == 'invoicestatus' || $graph_by == 'ticketstatus' || $graph_by == 'priority' || $graph_by == 'category' || $graph_by == 'quotestage') - { - $temp_fieldname = $graph_by; - if($graph_by == 'priority') - $temp_fieldname = 'ticketpriorities'; - if($graph_by == 'category') - $temp_fieldname = 'ticketcategories'; - - if(count($roleids) > 1) - $pick_query = " in (select distinct $temp_fieldname from vtiger_".$temp_fieldname." inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_".$temp_fieldname.".picklist_valueid where roleid in (\"". implode($roleids,"\",\"") ."\")) "; - else - $pick_query = " in (select distinct $temp_fieldname from vtiger_".$temp_fieldname." inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_".$temp_fieldname.".picklist_valueid where roleid in ('$roleids')) "; - } - return $pick_query; -} -?> - diff --git a/oss/vtiger/trunk/modules/Dashboard/homestuff.php b/oss/vtiger/trunk/modules/Dashboard/homestuff.php deleted file mode 100644 index 8a8ff3e9..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/homestuff.php +++ /dev/null @@ -1,90 +0,0 @@ - $mod_strings['leadsource'], - "leadstatus" => $mod_strings['leadstatus'], - "leadindustry" => $mod_strings['leadindustry'], - "salesbyleadsource" => $mod_strings['salesbyleadsource'], - "salesbyaccount" => $mod_strings['salesbyaccount'], - "salesbyuser" => $mod_strings['salesbyuser'], - "salesbyteam" => $mod_strings['salesbyteam'], - "accountindustry" => $mod_strings['accountindustry'], - "productcategory" => $mod_strings['productcategory'], - "productbyqtyinstock" => $mod_strings['productbyqtyinstock'], - "productbypo" => $mod_strings['productbypo'], - "productbyquotes" => $mod_strings['productbyquotes'], - "productbyinvoice" => $mod_strings['productbyinvoice'], - "sobyaccounts" => $mod_strings['sobyaccounts'], - "sobystatus" => $mod_strings['sobystatus'], - "pobystatus" => $mod_strings['pobystatus'], - "quotesbyaccounts" => $mod_strings['quotesbyaccounts'], - "quotesbystage" => $mod_strings['quotesbystage'], - "invoicebyacnts" => $mod_strings['invoicebyacnts'], - "invoicebystatus" => $mod_strings['invoicebystatus'], - "ticketsbystatus" => $mod_strings['ticketsbystatus'], - "ticketsbypriority" => $mod_strings['ticketsbypriority'], - "ticketsbycategory" => $mod_strings['ticketsbycategory'], - "ticketsbyuser" => $mod_strings['ticketsbyuser'], - "ticketsbyteam" => $mod_strings['ticketsbyteam'], - "ticketsbyproduct"=> $mod_strings['ticketsbyproduct'], - "contactbycampaign"=> $mod_strings['contactbycampaign'], - "ticketsbyaccount"=> $mod_strings['ticketsbyaccount'], - "ticketsbycontact"=> $mod_strings['ticketsbycontact'], - ); - - $log = LoggerManager::getLogger('dashboard'); - if(isset($type) && $type != '') - { - $dashboard_type = $type; - }else - { - $dashboard_type = 'DashboardHome'; - } - - if(!isset($type)) - { - }else - { - require_once('modules/Dashboard/display_charts.php'); - $_REQUEST['type'] = $type; - $_REQUEST['Chart_Type'] = $Chart_Type; - $_REQUEST['from_page'] = 'HomePage'; - $dashval=dashBoardDisplayChart(); - return $dashval; - } -} - -?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/horizontal_bargraph.php b/oss/vtiger/trunk/modules/Dashboard/horizontal_bargraph.php deleted file mode 100644 index 14ba624f..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/horizontal_bargraph.php +++ /dev/null @@ -1,246 +0,0 @@ -=14) - $name=substr($name, 0, 44); - if($pos>=2) - { - $val=explode(" ",$name); - $n=count($val)-1; - - $x=""; - for($j=0;$j $width, 'height' => $height, 'usemap' => true)); - $imagemap = $canvas->getImageMap(); - $graph =& Image_Graph::factory('graph', $canvas); - $font =& $graph->addNew('font', calculate_font_name($lang_crm)); - // set the font size to 12 - $font->setSize(8); - - if($theme == "blue") - { - $font_color = "#212473"; - } - else - { - $font_color = "#000000"; - } - $font->setColor($font_color); - - $graph->setFont($font); - $titlestr =& Image_Graph::factory('title', array($title,8)); - $plotarea =& Image_Graph::factory('plotarea',array( - 'axis', - 'axis', - 'horizontal' - )); - $graph->add( - Image_Graph::vertical($titlestr, - $plotarea, - 5 - ) - ); - - - // Now create a bar plot - $max=0; - // To create unique lables we need to keep track of lable name and its count - $uniquex = array(); - - $xlabels = array(); - $dataset = & Image_Graph::factory('dataset'); - if($theme == 'woodspice') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED, '#804000', 'white')); - elseif($theme == 'bluelagoon') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED, 'blue', 'white')); - elseif($theme == 'softed') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED, 'blue', 'white')); - else - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED, 'black', 'white')); - - for($i=0;$i=$max) $max=$datay[$i]; - $dataset->addPoint( - $x, - $datay[$i], - array( - 'url' => $target[$i], - 'alt' => $alts[$i] - ) - ); - // build the xaxis label array to allow intermediate ticks - - $xlabels[$x] = $datax[$i]; - $xlabels[$x+1] = ''; - - // To have unique names even in case of duplicates let us add the id - $datax_appearance = $uniquex[$datax[$i]]; - if($datax_appearance == null) { - $uniquex[$datax[$i]] = 1; - } else { - $xlabels[$x] = $datax[$i] .' ['. $datax_appearance.']'; - $uniquex[$datax[$i]] = $datax_appearance + 1; - } - } - - $bplot = & $plotarea->addNew('bar', $dataset); - $bplot->setFillStyle($fill); - - //You can change the width of the bars if you like - $bplot->setBarWidth(50/count($datax),"%"); - $bplot->setPadding(array('top'=>10)); - - // We want to display the value of each bar at the top - //$bplot->value->Show(); - //$bplot->value->SetFont(FF_FONT2,FS_BOLD,12); - //$bplot->value->SetAlign('left','center'); - //$bplot->value->SetColor("black","gray4"); - //$bplot->value->SetFormat('%d'); - - //$graph->SetBackgroundGradient('#E5E5E5','white',GRAD_VER,BGRAD_PLOT); - $bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', 'white'))); - //$bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', '#E5E5E5'))); - //$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDVER); - - //$graph->SetFrame(false); - //$graph->SetMarginColor('cadetblue2'); - //$graph->ygrid->SetFill(true,'azure1','azure2'); - //$graph->xgrid->Show(); - - // Add the bar to the graph - //$graph->Add($bplot); - - // Setup title - //$titlestr->setText($title); - - // Setup X-axis - $xaxis =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_X); - $yaxis =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_Y); - $yaxis->setFontSize(10); - - // Invert X-axis and put Y-axis at bottom - $xaxis->setInverted(true); - $yaxis->setAxisIntersection('max'); - - // set grid - $gridY =& $plotarea->addNew('line_grid', IMAGE_GRAPH_AXIS_Y); - $gridY->setLineColor('#FFFFFF@0.5'); - $gridY2 =& $plotarea->addNew('bar_grid', null, IMAGE_GRAPH_AXIS_Y); - $gridY2->setFillColor('#FFFFFF@0.2'); - - - // Add some grace to y-axis so the bars doesn't go - // all the way to the end of the plot area - $yaxis->forceMaximum(round(($max * 1.1) + 0.5)); - $ticks = get_tickspacing(round(($max * 1.1) + 0.5)); - - // First make the labels look right - $yaxis->setLabelInterval($ticks[0]); - $yaxis->setTickOptions(-5,0); - $yaxis->setLabelInterval($ticks[1],2); - $yaxis->setTickOptions(-2,0,2); - - // Create the xaxis labels - $array_data =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', - array($xlabels) - ); - - // The fix the tick marks - $xaxis->setDataPreprocessor($array_data); - $xaxis->forceMinimum(0); - $xaxis->forceMaximum(2*count($datay)); - $xaxis->setLabelInterval(1); - $xaxis->setTickOptions(0,0); - $xaxis->setLabelInterval(2,2); - $xaxis->setTickOptions(5,0,2); - - // set markers - $marker =& $graph->addNew('value_marker', IMAGE_GRAPH_VALUE_Y); - $marker->setFillColor('000000@0.0'); - $marker->setBorderColor('000000@0.0'); - $marker->setFontSize(10); - // shift markers 10 pix right - $marker_pointing =& $graph->addNew('Image_Graph_Marker_Pointing', array(40,0,& $marker)); - $marker_pointing->setLineColor('000000@0.0'); - $bplot->setMarker($marker_pointing); - - - //Getting the graph in the form of html page - $img = $graph->done( - array( - 'tohtml' => true, - 'border' => 0, - 'filename' => $cache_file_name, - 'filepath' => '', - 'urlpath' => '' - )); - save_image_map($cache_file_name.'.map', $img); - - return $img; -} - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/index.php b/oss/vtiger/trunk/modules/Dashboard/index.php deleted file mode 100644 index 79fb3ee2..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/index.php +++ /dev/null @@ -1,393 +0,0 @@ - $mod_strings['DashboardHome'], - "leadsource" => $mod_strings['leadsource'], - "leadstatus" => $mod_strings['leadstatus'], - "leadindustry" => $mod_strings['leadindustry'], - "salesbyleadsource" => $mod_strings['salesbyleadsource'], - "salesbyaccount" => $mod_strings['salesbyaccount'], - "salesbyuser" => $mod_strings['salesbyuser'], - "salesbyteam" => $mod_strings['salesbyteam'], - "accountindustry" => $mod_strings['accountindustry'], - "productcategory" => $mod_strings['productcategory'], - "productbyqtyinstock" => $mod_strings['productbyqtyinstock'], - "productbypo" => $mod_strings['productbypo'], - "productbyquotes" => $mod_strings['productbyquotes'], - "productbyinvoice" => $mod_strings['productbyinvoice'], - "sobyaccounts" => $mod_strings['sobyaccounts'], - "sobystatus" => $mod_strings['sobystatus'], - "pobystatus" => $mod_strings['pobystatus'], - "quotesbyaccounts" => $mod_strings['quotesbyaccounts'], - "quotesbystage" => $mod_strings['quotesbystage'], - "invoicebyacnts" => $mod_strings['invoicebyacnts'], - "invoicebystatus" => $mod_strings['invoicebystatus'], - "ticketsbystatus" => $mod_strings['ticketsbystatus'], - "ticketsbypriority" => $mod_strings['ticketsbypriority'], - "ticketsbycategory" => $mod_strings['ticketsbycategory'], - "ticketsbyuser" => $mod_strings['ticketsbyuser'], - "ticketsbyteam" => $mod_strings['ticketsbyteam'], - "ticketsbyproduct"=> $mod_strings['ticketsbyproduct'], - "contactbycampaign"=> $mod_strings['contactbycampaign'], - "ticketsbyaccount"=> $mod_strings['ticketsbyaccount'], - "ticketsbycontact"=> $mod_strings['ticketsbycontact'], - ); - -$log = LoggerManager::getLogger('dashboard'); -if(isset($_REQUEST['type']) && $_REQUEST['type'] != '') -{ - $dashboard_type = $_REQUEST['type']; -}else -{ - $dashboard_type = 'DashboardHome'; -} -?> - -
- - - - - - - - - - - - -
> - - - - - -
- - - - - -
-
-
  - - - - - - - - - - - - - -
<?php echo $app_strings['LBL_CALENDAR_ALT']; ?><?php echo $app_strings['LBL_CLOCK_ALT']; ?><?php echo $app_strings['LBL_CALCULATOR_ALT']; ?><?php echo $app_strings['LBL_CHAT_ALT']; ?> - - <?php echo $app_strings['LBL_LAST_VIEWED']; ?>
-
  - - - - - -
-
  - - - - -
<?php echo $app_strings['LBL_ALL_MENU_ALT']; ?>
-
- - - - - -
- - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
  - - - - -
- -
- -
 
- -
 
  - - - - - -
- > > - <?php echo $mod_strings['NORMALVIEW'];?> | <?php echo $mod_strings['GRIDVIEW'];?>
-
 
 
- - - - - - - -
  -
- - - - - - -
- - -  
- - -
 
 
- - - - - - - - - -
  - - - -
-
  
- -
- - - - - - -
 
-
- -
-
- - - - - - - - diff --git a/oss/vtiger/trunk/modules/Dashboard/language/en_us.lang.php b/oss/vtiger/trunk/modules/Dashboard/language/en_us.lang.php deleted file mode 100644 index b96b89e5..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/language/en_us.lang.php +++ /dev/null @@ -1,191 +0,0 @@ -'Pipeline By Sales Stage', -'LBL_SALES_STAGE_FORM_DESC'=>'Shows cumulative opportunity amounts by selected sales stages for selected users where the expected closed date is within the specificed date range.', -'LBL_MONTH_BY_OUTCOME'=>'Pipeline By Month By Outcome', -'LBL_MONTH_BY_OUTCOME_DESC'=>'Shows cumulative opportunity amounts by month by outcome for selected users where the expected closed date is within the specificed date range. Outcome is based on whether the sales stage is Closed Won, Closed Lost or any other value.', -'LBL_LEAD_SOURCE_FORM_TITLE'=>'All Opportunities By Lead Source', -'LBL_LEAD_SOURCE_FORM_DESC'=>'Shows cumulative opportunity amounts by selected lead source for selected users.', -'LBL_LEAD_SOURCE_BY_OUTCOME'=>'All Opportunities By Lead Source By Outcome', -'LBL_LEAD_SOURCE_BY_OUTCOME_DESC'=>'Shows cumulative opportunity amounts by selected lead source by outcome for selected users where the expected closed date is within the specificed date range. Outcome is based on whether the sales stage is Closed Won, Closed Lost or any other value.', -'LBL_PIPELINE_FORM_TITLE_DESC'=>'Shows cumulative amounts by selected sales stages for your opportunities where the expected closed date is within the specificed date range.', -'LBL_DATE_RANGE'=>'Date range is', -'LBL_DATE_RANGE_TO'=>'to', -'ERR_NO_OPPS'=>'Please create some Opportunities to see Opportunity graphs.', -'LBL_TOTAL_PIPELINE'=>'Pipeline total is ', -'LBL_ALL_OPPORTUNITIES'=>'Total amount of all opportunities is ', -'LBL_OPP_SIZE'=>'Opportunity size in ', -'LBL_OPP_SIZE_VALUE'=>'1K', -'NTC_NO_LEGENDS'=>'None', -'LBL_LEAD_SOURCE_OTHER'=>'Other', -'LBL_EDIT'=>'Edit', -'LBL_REFRESH'=>'Refresh', -'LBL_CREATED_ON'=>'Last run on ', -'LBL_OPPS_IN_STAGE'=>'opportunities where sales stage is', -'LBL_OPPS_IN_LEAD_SOURCE'=>'opportunities where lead source is', -'LBL_OPPS_OUTCOME'=>'opportunities where outcome is', -'LBL_USERS'=>'Users:', -'LBL_SALES_STAGES'=>'Sales Stages:', -'LBL_LEAD_SOURCES'=>'Lead Sources:', -'LBL_DATE_START'=>'Begin Date:', -'LBL_DATE_END'=>'End Date:', -//Added for 5.0 -'LBL_NO_PERMISSION'=>'Sorry, you don\'t have access to view the Graph for this module', -'LBL_NO_PERMISSION_FIELD'=>'Sorry, you don\'t have access to view the Graph for this module or for the Field', - -"leadsource" => "Leads By Source", -"leadstatus" => "Leads By Status", -"leadindustry" => "Leads By Industry", -"salesbyleadsource" => "Sales by LeadSource", -"salesbyaccount" => "Sales by Accounts", -"salesbyuser" => "Sales by User", -"salesbyteam"=>"Sales by Team", -"accountindustry" => "Account By Industry", -"productcategory" => "Products by Category", -"productbyqtyinstock" => "Products by Quantity in stock", -"productbypo" => "Products by PurchaseOrder", -"productbyquotes" => "Products by Quotes", -"productbyinvoice" => "Products by Invoice", -"sobyaccounts" => "Sales Order by Accounts", -"sobystatus" => "Sales Order by Status", -"pobystatus" => "Purchase Order by Status", -"quotesbyaccounts" => "Quotes by Accounts", -"quotesbystage" => "Quotes by Stage", -"invoicebyacnts" => "Invoices by Accounts", -"invoicebystatus" => "Invoices by Status", -"ticketsbystatus" => "Tickets by Status", -"ticketsbypriority" => "Tickets by Priority", -"ticketsbycategory" => "Tickets by Category", -"ticketsbyuser"=>"Tickets by User", -"ticketsbyteam"=>"Tickets by Team", -"ticketsbyproduct"=>"Tickets by Product", -"contactbycampaign"=>"Contacts by Campaign", -"ticketsbyaccount"=>"Tickets by Account", -"ticketsbycontact"=>"Tickets by Contact", - -'LBL_DASHBRD_HOME'=>'Dashboard Home', -'LBL_HORZ_BAR_CHART'=>'Horizontal Bar Chart', -'LBL_VERT_BAR_CHART'=>'Vertical Bar Chart', -'LBL_PIE_CHART'=>'Pie Chart', -'LBL_NO_DATA'=>'No data available', -'DashboardHome'=>'Dashboard Home', -'GRIDVIEW'=>'Grid view', -'NORMALVIEW'=>'Normal view', -'VIEWCHART'=>'View Chart', -'LBL_DASHBOARD'=>'Dashboard', - -// Added/Updated for vtiger CRM 5.0.4 -"Approved"=>"Approved", -"Created"=>"Created", -"Cancelled"=>"Cancelled", -"Delivered"=>"Delivered", -"Received Shipment"=>"Received Shipments", -"Sent"=>"Sent", -"Credit Invoice"=>"Credit Invoice", -"Paid"=>"Paid", -"Un Assigned"=>"Un Assigned", -"Cold Call"=>"Cold Call", -"Existing Customer"=>"Existing Customer", -"Self Generated"=>"Self Generated", -"Employee"=>"Employee", -"Partner"=>"Partner", -"Public Relations"=>"Public Relations", -"Direct Mail"=>"Direct Mail", -"Conference"=>"Conference", -"Trade Show"=>"Trade Show", -"Web Site"=>"Web Site", -"Word of mouth"=>"Word of mouth", -"Other"=>"Other", -"--None--"=>"None", -"Attempted to Contact"=>"Attempted to Contact", -"Cold"=>"Cold", -"Contact in Future"=>"Contact in Future", -"Contacted"=>"Contacted", -"Hot"=>"Hot", -"Junk Lead"=>"Junk Lead", -"Lost Lead"=>"Lost Lead", -"Not Contacted"=>"Not Contacted", -"Pre Qualified"=>"Pre Qualified", -"Qualified"=>"Qualified", -"Warm"=>"Warm", -"Apparel"=>"Apparel", -"Banking"=>"Banking", -"Biotechnology"=>"Biotechnology", -"Chemicals"=>"Chemicals", -"Communications"=>"Communications", -"Construction"=>"Constructions", -"Consulting"=>"Consulting", -"Education"=>"Education", -"Electronics"=>"Electronics", -"Energy"=>"Energy", -"Engineering"=>"Engineering", -"Entertainment"=>"Entertainment", -"Environmental"=>"Environmental", -"Finance"=>"Finance", -"Food & Beverage"=>"Food & Beverage", -"Government"=>"Government", -"Healthcare"=>"Healthcare", -"Hospitality"=>"Hospitality", -"Insurance"=>"Insurance", -"Machinery"=>"Machinery", -"Manufacturing"=>"Manufacturing", -"Media"=>"Media", -"Not For Profit"=>"Not For Profit", -"Recreation"=>"Recreation", -"Retail"=>"Retail", -"Shipping"=>"Shipping", -"Technology"=>"Technology", -"Telecommunications"=>"Telecommunications", -"Transportation"=>"Transportation", -"Utilities"=>"Utilities", -"Hardware"=>"Hardware", -"Software"=>"Software", -"CRM Applications"=>"CRM Applications", -"Open"=>"Open", -"In Progress"=>"In Progress", -"Wait For Response"=>"Wait For Response", -"Closed"=>"Closed", -"Low"=>"Low", -"Normal"=>"Normal", -"High"=>"High", -"Urgent"=>"Urgent", -"Big Problem"=>"Big Problem", -"Small Problem"=>"Small Problem", -"Other Problem"=>"Other Problem", -"Accepted"=>"Accepted", -"Rejected"=>"Rejected", -"Prospecting"=>"Prospecting", -"Qualification"=>"Qualifications", -"Needs Analysis"=>"Needs Analysis", -"Value Proposition"=>"Value Propositions", -"Id. Decision Makers"=>"Id. Decision Makers", -"Perception Analysis"=>"Perception Analysis", -"Proposal/Price Quote"=>"Proposal/Price Quotes", -"Negotiation/Review"=>"Negotiation/Review", -"Closed Won"=>"Closed Won", -"Closed Lost"=>"Closed Lost", - -); - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/language/zh_cn.lang.php b/oss/vtiger/trunk/modules/Dashboard/language/zh_cn.lang.php deleted file mode 100644 index d7712319..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/language/zh_cn.lang.php +++ /dev/null @@ -1,192 +0,0 @@ - '销售策略统计', -'LBL_SALES_STAGE_FORM_DESC' =>'显示选择的客服策略、使用者累计客服数量在指定期间内预期要结案.', -'LBL_MONTH_BY_OUTCOME'=>'月客服统计', -'LBL_MONTH_BY_OUTCOME_DESC' => '显示选取使用者于指定期间的对外按月累计潜在案件,对外指的是根据客服策略判断优劣.', -'LBL_LEAD_SOURCE_FORM_TITLE' => '经由接触来源的潜在案件', -'LBL_LEAD_SOURCE_FORM_DESC' => '显示选取使用者潜在客户来源的累计潜在案件数量.', -'LBL_LEAD_SOURCE_BY_OUTCOME' => '由潜在客户来源显示所有对外潜在案件', -'LBL_LEAD_SOURCE_BY_OUTCOME_DESC' => '显示选取潜在客户来源于指定期间的对外按月累计潜在案件,对外指的是根据销售策略判断优劣.', -'LBL_PIPELINE_FORM_TITLE_DESC' => '显示预期在指定期间结案的销售策略潜在案件数量.', -'LBL_DATE_RANGE' => '日期范围从', -'LBL_DATE_RANGE_TO' => '到', -'ERR_NO_OPPS' => '请新增潜在案件,然后才能看见潜在案件图.', -'LBL_TOTAL_PIPELINE' => '总处理数 ', -'LBL_ALL_OPPORTUNITIES' => '潜在案件总数', -'LBL_OPP_SIZE' => '预算在1万元以下的潜在案件', -'LBL_OPP_SIZE_VALUE' => '1K', -'NTC_NO_LEGENDS' => '无', -'LBL_LEAD_SOURCE_OTHER' => '其它', -'LBL_EDIT' => '编辑', -'LBL_REFRESH' => '更新画面', -'LBL_CREATED_ON' => '最后执行 ', -'LBL_OPPS_IN_STAGE' => '潜在案件的客服场地', -'LBL_OPPS_IN_LEAD_SOURCE' => '潜在案件的接触来源', -'LBL_OPPS_OUTCOME' => '该潜在案件的处理结果', -'LBL_USERS' => '使用者:', -'LBL_SALES_STAGES' => '客服场地:', -'LBL_LEAD_SOURCES' => '接触来源:', -'LBL_DATE_START' => '开始日期:', -'LBL_DATE_END' => '结束日期:', -//Added for 5.0 -'LBL_NO_PERMISSION'=>'您没有检视这个模块图形的权限', -'LBL_NO_PERMISSION_FIELD'=>'您没有检视这个模块或字段图形的权限', - -"leadsource" => "依照来源显示潜在客户", -"leadstatus" => "依照状态显示潜在客户", -"leadindustry" => "依照行业显示潜在客户", -"salesbyleadsource" => "按照潜在客户来源显示销售情况", -"salesbyaccount" => "按照客户显示销售情况", -"salesbyuser" => "按照用户显示销售情况", -"salesbyteam"=>"按照团队显示销售情况", -"accountindustry" => "依照产业显示客户", -"productcategory" => "依照类别显示产品", -"productbyqtyinstock" => "依照库存数量显示产品", -"productbypo" => "依照采购订单显示产品", -"productbyquotes" => "依照报价单显示产品", -"productbyinvoice" => "依照税单显示产品", -"sobyaccounts" => "依照客户显示销售订单", -"sobystatus" => "依照状态显示销售订单", -"pobystatus" => "依照状态显示采购订单", -"quotesbyaccounts" => "依照客户显示报价单", -"quotesbystage" => "依照销售策略显示报价单", -"invoicebyacnts" => "依照公司显示税单", -"invoicebystatus" => "依照状态显示税单", -"ticketsbystatus" => "依照状态显示服务请求", -"ticketsbypriority" => "依照优先级显示服务请求", -"ticketsbycategory" => "依照类别显示服务请求", -"ticketsbyuser"=>"依照用户显示服务请求", -"ticketsbyteam"=>"依照团队显示服务请求", -"ticketsbyproduct"=>"依照产品显示服务请求t", -"contactbycampaign"=>"依照活动显示联络人", -"ticketsbyaccount"=>"依照客户显示服务请求", -"ticketsbycontact"=>"依照联系显示服务请求", - -'LBL_DASHBRD_HOME'=>'统计图表', -'LBL_HORZ_BAR_CHART'=>'水平柱状图', -'LBL_VERT_BAR_CHART'=>'垂直柱状图', -'LBL_PIE_CHART'=>'饼图', -'LBL_NO_DATA'=>'无可用数据', -'DashboardHome'=>'统计图表', -'GRIDVIEW'=>'网格视图', -'NORMALVIEW'=>'正常视图', -'VIEWCHART'=>'查看图表', -'LBL_DASHBOARD'=>'图表', - -// Added/Updated for vtiger CRM 5.0.4 -"Approved"=>"批准", -"Created"=>"创造", -"Cancelled"=>"取消", -"Delivered"=>"交付", -"Received Shipment"=>"被接受的发货", -"Sent"=>"发送", -"Credit Invoice"=>"信用发货票", -"Paid"=>"有偿", -"Un Assigned"=>"没有被分配", -"Cold Call"=>"备用电话", -"Existing Customer"=>"现有的客户", -"Self Generated"=>"自己引起的", -"Employee"=>"员工", -"Partner"=>"合作者", -"Public Relations"=>"公共关系", -"Direct Mail"=>"直接邮件", -"Conference"=>"会议", -"Trade Show"=>"商业展览", -"Web Site"=>"网站", -"Word of mouth"=>"口述", -"Other"=>"其他", -"--None--"=>"无", -"Attempted to Contact"=>"试图接触", -"Cold"=>"冷淡", -"Contact in Future"=>"以后联系", -"Contacted"=>"联系中", -"Hot"=>"关系火热", -"Junk Lead"=>"不好的潜在客户", -"Lost Lead"=>"丢失的潜在客户", -"Not Contacted"=>"没有联系", -"Pre Qualified"=>"基本合格", -"Qualified"=>"合格", -"Warm"=>"很好", -"Apparel"=>"服装", -"Banking"=>"银行业务", -"Biotechnology"=>"生物工艺", -"Chemicals"=>"化学制品", -"Communications"=>"通信", -"Construction"=>"建筑", -"Consulting"=>"咨询", -"Education"=>"教育", -"Electronics"=>"电子", -"Energy"=>"能源", -"Engineering"=>"工程", -"Entertainment"=>"娱乐", -"Environmental"=>"环保", -"Finance"=>"财务", -"Food & Beverage"=>"食品、饮料", -"Government"=>"政府", -"Healthcare"=>"医疗保健", -"Hospitality"=>"好客", -"Insurance"=>"保险", -"Machinery"=>"机械", -"Manufacturing"=>"制造业", -"Media"=>"媒介", -"Not For Profit"=>"非盈利", -"Recreation"=>"休闲", -"Retail"=>"零售业", -"Shipping"=>"航运", -"Technology"=>"技术", -"Telecommunications"=>"电信", -"Transportation"=>"交通运输", -"Utilities"=>"公共事业", -"Hardware"=>"硬件", -"Software"=>"软件", -"CRM Applications"=>"CRM 应用", -"Open"=>"开放", -"In Progress"=>"进展中", -"Wait For Response"=>"等待中", -"Closed"=>"未完成", -"Low"=>"低", -"Normal"=>"正常", -"High"=>"高", -"Urgent"=>"紧急", -"Big Problem"=>"大问题", -"Small Problem"=>"小问题", -"Other Problem"=>"其他问题", -"Accepted"=>"接受", -"Rejected"=>"拒绝", -"Prospecting"=>"勘察", -"Qualification"=>"资格", -"Needs Analysis"=>"需要分析", -"Value Proposition"=>"已提价", -"Id. Decision Makers"=>"Id. 决策者", -"Perception Analysis"=>"感性分析", -"Proposal/Price Quote"=>"建议/价格行情", -"Negotiation/Review"=>"交涉/回顾", -"Closed Won"=>"成功结单", -"Closed Lost"=>"丢失", - - -); - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/line_graph.php b/oss/vtiger/trunk/modules/Dashboard/line_graph.php deleted file mode 100644 index 88dfd67d..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/line_graph.php +++ /dev/null @@ -1,104 +0,0 @@ -SetMarginColor('white'); -$graph->SetScale("textlin"); -$graph->SetMargin($left,$right,$top,$bottom); -$graph->tabtitle->Set($title ); -$graph->tabtitle->SetFont(FF_FONT2,FS_BOLD,13); -$graph->yaxis->HideZeroLabel(); -$graph->xgrid->Show(); - -$thick=6; -// Create the lines of the Graph -for($i=0;$iSetColor($color_val); - $$temp->SetLegend($name); - - $x_thick=$thick-$i; - if($x_thick<=1) - $x_thick=1; - - $$temp->SetWeight($x_thick); - $graph->Add($$temp); - - $max=0; - for($j=0;$j=$max) - $max=$x; - else - $max=$max; - } -} - - -if($max>=5) -{ - $graph->yaxis->SetLabelFormat('%d'); -} -$graph->legend->Pos(0,0.4,"right","center"); - -// Set some other color then the boring default -$graph->SetColor("#6F96FF"); -//$graph->SetColor("#CCDFCC"); -$graph->SetMarginColor("#2447A7"); -//$graph->SetMarginColor("#98C098"); -$graph->xaxis->SetTickLabels($datax); -$graph->xaxis->SetLabelAngle(90); - -// Output line -$graph->Stroke(); - - - -?> diff --git a/oss/vtiger/trunk/modules/Dashboard/loadDashBoard.php b/oss/vtiger/trunk/modules/Dashboard/loadDashBoard.php deleted file mode 100644 index 96b535cb..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/loadDashBoard.php +++ /dev/null @@ -1,13 +0,0 @@ - \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Dashboard/pie_graph.php b/oss/vtiger/trunk/modules/Dashboard/pie_graph.php deleted file mode 100644 index 60a36662..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/pie_graph.php +++ /dev/null @@ -1,191 +0,0 @@ -=14) - $name=substr($name, 0, 34); - if($pos>=2) - { - $val=explode(" ",$name); - $n=count($val)-1; - - $x=""; - for($j=0;$j $width, 'height' => $height, 'usemap' => true)); - $imagemap = $canvas->getImageMap(); - $graph =& Image_Graph::factory('graph', $canvas); - $font =& $graph->addNew('font', calculate_font_name($lang_crm)); - // set the font size to 11 pixels - $font->setSize(8); - $font->setColor($font_color); - - $graph->setFont($font); - // create the plotarea layout - $title =& Image_Graph::factory('title', array($title,10)); - $plotarea =& Image_Graph::factory('plotarea',array( - 'category', - 'axis' - )); - $footer =& Image_Graph::factory('title', array('Footer',8)); - $legend_box =& Image_Graph::factory('legend'); - $graph->add( - Image_Graph::vertical($title, - $plotarea, - 5 - ) - ); - - // To create unique lables we need to keep track of lable name and its count - $uniquex = array(); - - - // Generate colours - $colors = color_generator(count($datay),'#33DDFF','#3322FF'); - $dataset = & Image_Graph::factory('dataset'); - $fills =& Image_Graph::factory('Image_Graph_Fill_Array'); - $sum = 0; - for($i=0;$iaddPoint( - $datalabel, - $datay[$i], - array( - 'url' => $target[$i], - 'alt' => $alts[$i] - ) - ); - $sum += $datay[$i]; - $fills->addColor($colors[$i]); - } - - // create an array with % values - $pcvalues = array(); - for($i=0;$iaddNew('pie', $dataset); - $plotarea->setPadding(array('top'=>20,'bottom'=>0,'left'=>0,'right'=>50)); - $plotarea->hideAxis(); - $gbplot->setFillStyle($fills); - - // format the data values - $marker_array =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', array($pcvalues)); - - // set markers - $marker =& $graph->addNew('value_marker', IMAGE_GRAPH_VALUE_Y); - $marker->setDataPreprocessor($marker_array); - $marker->setFillColor('#FFFFFF'); - $marker->setBorderColor($font_color); - $marker->setFontColor($font_color); - $marker->setFontSize(8); - $pointingMarker =& $graph->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$marker)); - $gbplot->setMarker($pointingMarker); - - // set legend - $legend_box =& $plotarea->addNew('legend'); - $legend_box->setPadding(array('top'=>20,'bottom'=>0,'left'=>0,'right'=>0)); - $legend_box->setFillColor('#F5F5F5'); - $legend_box->showShadow(); - - $img = $graph->done( - array( - 'tohtml' => true, - 'border' => 0, - 'filename' => $cache_file_name, - 'filepath' => '', - 'urlpath' => '' - )); - save_image_map($cache_file_name.'.map', $img); - - return $img; - -} -?> - diff --git a/oss/vtiger/trunk/modules/Dashboard/vertical_bargraph.php b/oss/vtiger/trunk/modules/Dashboard/vertical_bargraph.php deleted file mode 100644 index f854174c..00000000 --- a/oss/vtiger/trunk/modules/Dashboard/vertical_bargraph.php +++ /dev/null @@ -1,222 +0,0 @@ -=15) - $name=substr($name, 0, 15); - if($pos>=2) - { - $val=explode(" ",$name); - $n=count($val)-1; - - $x=""; - for($j=0;$j $width, 'height' => $height, 'usemap' => true)); - $imagemap = $canvas->getImageMap(); - $graph =& Image_Graph::factory('graph', $canvas); - $font =& $graph->addNew('font', calculate_font_name($lang_crm)); - // set the font size to 12 - $font->setSize(8); - - if($theme == "blue") - { - $font_color = "#212473"; - } - else - { - $font_color = "#000000"; - } - $font->setColor($font_color); - - $graph->setFont($font); - $titlestr =& Image_Graph::factory('title', array($title,10)); - $plotarea =& Image_Graph::factory('plotarea',array( - 'axis', - 'axis', - 'vertical' - )); - $graph->add( - Image_Graph::vertical($titlestr, - $plotarea, - 5 - ) - ); - - - // Now create a bar plot - $max=0; - $xlabels = array(); - $dataset = & Image_Graph::factory('dataset'); - if($theme == 'woodspice') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, '#804000', 'white')); - elseif($theme == 'bluelagoon') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, 'blue', 'white')); - elseif($theme == 'softed') - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, 'blue', 'white')); - else - $fill =& Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, 'black', 'white')); - - - for($i=0;$i=$max) $max=$datay[$i]; - $dataset->addPoint( - $x, - $datay[$i], - array( - 'url' => $target[$i], - 'alt' => $alts[$i] - ) - ); - // build the xaxis label array to allow intermediate ticks - $xlabels[$x] = $datax[$i]; - $xlabels[$x+1] = ''; - } - - - //$bplot = new BarPlot($datay); - $bplot = & $plotarea->addNew('bar', $dataset); - $bplot->setFillStyle($fill); - - //You can change the width of the bars if you like - $bplot->setBarWidth(50/count($datax),"%"); - $bplot->setPadding(array('top'=>20)); - - $bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_VERTICAL, 'white', 'white'))); - - // Setup X-axis - $xaxis =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_X); - $yaxis =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_Y); - $yaxis->setFontSize(10); - - // set grid - $gridY =& $plotarea->addNew('line_grid', IMAGE_GRAPH_AXIS_Y); - $gridY->setLineColor('#FFFFFF@0.5'); - $gridY2 =& $plotarea->addNew('bar_grid', null, IMAGE_GRAPH_AXIS_Y); - $gridY2->setFillColor('#FFFFFF@0.2'); - - - // Add some grace to y-axis so the bars doesn't go - // all the way to the end of the plot area - if($max<=10) - $yaxis->forceMaximum(round(($max * 1.1) + 1.5)); - elseif($max>10 && $max<=100) - $yaxis->forceMaximum(round(($max * 1.1) + 1.5)); - elseif($max>100 && $max<=1000) - $yaxis->forceMaximum(round(($max * 1.1) + 10.5)); - else - $yaxis->forceMaximum(round(($max * 1.1) + 100.5)); - $ticks = get_tickspacing(round(($max * 1.1) + 2.0)); - - // First make the labels look right - $yaxis->setLabelInterval($ticks[0]); - $yaxis->setTickOptions(5,0); - $yaxis->setLabelInterval($ticks[1],2); - $yaxis->setTickOptions(2,0,2); - - // Create the xaxis labels - $array_data =& Image_Graph::factory('Image_Graph_DataPreprocessor_Array', - array($xlabels) - ); - - // Then fix the tick marks - $xaxis->setDataPreprocessor($array_data); - $xaxis->forceMinimum(0); - $xaxis->forceMaximum(2*count($datay)); - $xaxis->setFontAngle('vertical'); - $xaxis->setLabelInterval(1); - $xaxis->setTickOptions(0,0); - $xaxis->setLabelInterval(2,2); - $xaxis->setTickOptions(5,0,2); - - // set markers - $marker =& $graph->addNew('value_marker', IMAGE_GRAPH_VALUE_Y); - $marker->setFillColor('000000@0.0'); - $marker->setBorderColor('000000@0.0'); - $marker->setFontSize(10); - // shift markers 10 pix right - $marker_pointing =& $graph->addNew('Image_Graph_Marker_Pointing', array(0,-10,& $marker)); - $marker_pointing->setLineColor('000000@0.0'); - $bplot->setMarker($marker_pointing); - - - //Getting the graph in the form of html page - $img = $graph->done( - array( - 'tohtml' => true, - 'border' => 0, - 'filename' => $cache_file_name, - 'filepath' => '', - 'urlpath' => '' - )); - save_image_map($cache_file_name.'.map', $img); - - return $img; -} - -?>