[Vtigercrm-commits] [vtiger-commits] r11017 - in /vtigercrm/branches/5.0.3: include/utils/CommonUtils.php modules/Dashboard/Entity_charts.php modules/Potentials/Charts.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu May 24 09:11:58 EDT 2007


Author: richie
Date: Thu May 24 07:11:32 2007
New Revision: 11017

Log:
fix for Issue on HomePage Dashboard. Fixes #3929 --minnie

Modified:
    vtigercrm/branches/5.0.3/include/utils/CommonUtils.php
    vtigercrm/branches/5.0.3/modules/Dashboard/Entity_charts.php
    vtigercrm/branches/5.0.3/modules/Potentials/Charts.php

Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Thu May 24 07:11:32 2007
@@ -2900,4 +2900,21 @@
 	return $check_mailids;
 }
 
+/**
+ * This function is used to get cvid of default "all" view for any module.
+ * @return a cvid of a module
+ */
+function getCvIdOfAll($module)
+{
+	global $adb,$log;
+	$log->debug("Entering getCvIdOfAll($module)");
+	$qry_res = $adb->query("select cvid from vtiger_customview where viewname='All' and entitytype='".$module."'");
+	$cvid = $adb->query_result($qry_res,0,"cvid");
+	$log->debug("Exiting getCvIdOfAll($module)");
+	return $cvid;
+
+
+}
+
+
 ?>

Modified: vtigercrm/branches/5.0.3/modules/Dashboard/Entity_charts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Dashboard/Entity_charts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Dashboard/Entity_charts.php Thu May 24 07:11:32 2007
@@ -285,13 +285,16 @@
 					if($graph_for == "ticketgroupname" || $graph_for == "groupname") $graph_for = "smownerid";
 
 					if($graph_for == "accountid") $graph_for = "account_id";
+					$cvid = getCvIdOfAll($module);
 					if($module == "Home")
-						$link_val="index.php?module=".$name."&action=ListView&from_homepagedb=true&type=dbrd&query=true&owner=".$current_user->user_name;
+					{
+						$cvid = getCvIdOfAll($name);
+						$link_val="index.php?module=".$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&".$graph_for."=".$id_name;
+						$link_val="index.php?module=".$module."&action=ListView&from_dashboard=true&type=dbrd&query=true&".$graph_for."=".$id_name."&viewname=".$cvid;
 					else
-						$link_val="index.php?module=".$module."&action=index&from_dashboard=true&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar";
-
+						$link_val="index.php?module=".$module."&action=index&from_dashboard=true&search_text=".$name."&search_field=".$graph_for."&searchtype=BasicSearch&query=true&type=entchar&viewname=".$cvid;
 					if($graph_for == "account_id") $graph_for = "accountid";
 
 					//Adding the links to the graph	

Modified: vtigercrm/branches/5.0.3/modules/Potentials/Charts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Potentials/Charts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Potentials/Charts.php Thu May 24 07:11:32 2007
@@ -171,7 +171,8 @@
 							array_push($datax[$stage][$the_id], 0);
 							array_push($aAlts[$stage][$the_id], "");
 						}
-						array_push($aTargets[$stage][$the_id], "index.php?module=Potentials&action=ListView&date_closed=$month&sales_stage=".urlencode($stage)."&query=true&type=dbrd&owner=".$the_user);
+						$cvid = getCvIdOfAll("Potentials");
+						array_push($aTargets[$stage][$the_id], "index.php?module=Potentials&action=ListView&date_closed=$month&sales_stage=".urlencode($stage)."&query=true&type=dbrd&owner=".$the_user."&viewname=".$cvid);
 			  		}
 				}	
 		  	  	array_push($legend,$month);
@@ -500,7 +501,8 @@
 							array_push($datax[$stage][$the_id], 0);
 							array_push($aAlts[$stage][$the_id], "");
 						}
-						array_push($aTargets[$stage][$the_id], "index.php?module=Potentials&action=ListView&leadsource=".urlencode($lead)."&sales_stage=".urlencode($stage)."&query=true&type=dbrd&owner=".$the_user);
+						$cvid = getCvIdOfAll("Potentials");
+						array_push($aTargets[$stage][$the_id], "index.php?module=Potentials&action=ListView&leadsource=".urlencode($lead)."&sales_stage=".urlencode($stage)."&query=true&type=dbrd&owner=".$the_user."&viewname=".$cvid);
 			  		}
 				}	
 			  	array_push($legend,$translation);
@@ -802,7 +804,8 @@
 					array_push($datay[$the_id], 0);
 					array_push($aAlts[$the_id], "");
 				}
-				array_push($aTargets[$the_id], "index.php?module=Potentials&action=ListView&sales_stage=".urlencode($stage_key)."&closingdate_start=".urlencode($date_start)."&closingdate_end=".urlencode($date_end)."&query=true&type=dbrd&owner=".$the_user);
+				$cvid = getCvIdOfAll("Potentials");
+				array_push($aTargets[$the_id], "index.php?module=Potentials&action=ListView&sales_stage=".urlencode($stage_key)."&closingdate_start=".urlencode($date_start)."&closingdate_end=".urlencode($date_end)."&query=true&type=dbrd&owner=".$the_user."&viewname=".$cvid);
 			  }
 			  array_push($legend,$stage_translation);
 			}
@@ -1052,7 +1055,8 @@
 						// put none in if the vtiger_field is blank.
 						array_push($visible_legends, $current_module_strings['NTC_NO_LEGENDS']);
 					}
-					array_push($aTargets, "index.php?module=Potentials&action=ListView&leadsource=".urlencode($lead_source_key)."&query=true&type=dbrd");
+					$cvid = getCvIdOfAll("Potentials");
+					array_push($aTargets, "index.php?module=Potentials&action=ListView&leadsource=".urlencode($lead_source_key)."&query=true&type=dbrd&viewname=".$cvid);
 					array_push($aAlts, $count[$lead_source_key]." ".$current_module_strings['LBL_OPPS_IN_LEAD_SOURCE']." $lead_source_translation	");
 				}
 			}





More information about the vtigercrm-commits mailing list