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
- 2
- 3
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- :
- 1
- 2
- 3
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- :
- 1
- 2
- 3
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- :
- 1
- 2
- 3
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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 = 'Status Total ';
- $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 .= "$modulename $modrec_count ";
-
- $total_records += $modrec_count;
- }
- }
- }
- $cnt_table .= '
';
-
- $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="
- Status ";
-
- //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.= "$table_format ";
- }
- $mod_cnt_table .= "Total " ;
-
- //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 .="Total ";
- //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.="$tot ";
- }
- if($graph_for == "productname")
- {
- $cnt_total=array_sum($mod_count_array);
- }
- else
- {
- $cnt_total=array_sum($mod_tot_cnt_array);
- }
-
- $mod_cnt_table.="$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 .= "
-
-
- 1
-
-
-
- ".$mod_strings['LBL_HORZ_BAR_CHART']."
-
-
-
- ";
- if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX')
- {
- $sHTML .= " ";
-
- }else
- {
- $sHTML .= "
-
- ".$mod_strings['VIEWCHART']." :
- 1
- 2
-
-
-
";
- }
- $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 .= "
-
-
-
- ";
-
-$sHTML .= "
-
-
- 2
-
-
-
- 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 .= "
- ";
-
- if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX')
- {
- $sHTML .="
";
- }else
- {
- $sHTML .= " ";
- }
-
-$sHTML .= "
-
-
- 2
-
-
-
- ".$mod_strings['LBL_PIE_CHART']."
-
-
-
- ";
- if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX')
- {
- $sHTML .= " ";
-
- }else
- {
- $sHTML .= "
-
- ".$mod_strings['VIEWCHART']." :
- 1
- 2
-
-
-
";
- }
- $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 .= "
- ";
-
-if(isset($_REQUEST['display_view']) && $_REQUEST['display_view'] == 'MATRIX')
-{
- $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
-
-
-
- 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
-
-
-
- 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
-
-
-
- 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';
-}
-?>
-
-
-
-
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $value)
- {
- if($dashboard_type == $key)
- {
- $dash_board_title = $value;
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $value)
- {
- if($dashboard_type == $key)
- {
- $dash_board_title = $value;
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-