[Vtigercrm-commits] [vtiger-commits] r10410 - in /vtigercrm/branches/5.0.3/modules: Dashboard/HomepageDB.php Potentials/ListView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 12 09:20:45 EDT 2007


Author: saraj
Date: Mon Mar 12 07:20:39 2007
New Revision: 10410

Log:
Top potentials shows closed one in homepage dashboard. Fixes #2264

Modified:
    vtigercrm/branches/5.0.3/modules/Dashboard/HomepageDB.php
    vtigercrm/branches/5.0.3/modules/Potentials/ListView.php

Modified: vtigercrm/branches/5.0.3/modules/Dashboard/HomepageDB.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Dashboard/HomepageDB.php (original)
+++ vtigercrm/branches/5.0.3/modules/Dashboard/HomepageDB.php Mon Mar 12 07:20:39 2007
@@ -10,9 +10,9 @@
  ********************************************************************************/
 require_once("modules/Dashboard/Entity_charts.php");
 
-	global $current_user,$user_id,$date_start,$end_date,$tmp_dir,$mod_strings;
+	global $current_user,$user_id,$date_start,$end_date,$tmp_dir,$mod_strings,$app_strings;
 	$type='recordsforuser';
-	$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 where se.deleted=0 and (le.converted=0 or le.converted 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 ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id;
+	$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 ('Accounts','Contacts','Leads','Potentials','Quotes','Invoice','PurchaseOrder', 'SalesOrder','Calendar','HelpDesk','Campaigns') and se.deleted=0 and se.smownerid=".$current_user->id;
 	$graph_by="setype";
 	$graph_title=$mod_strings['recordsforuser'].' '.$current_user->user_name;
 	$module="Home";
@@ -46,7 +46,7 @@
         }
 	else
 	{
-		echo $mod_strings[LBL_NO_DATA];	
+		echo $mod_strings['LBL_NO_DATA'];	
 	}
 
 

Modified: vtigercrm/branches/5.0.3/modules/Potentials/ListView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Potentials/ListView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Potentials/ListView.php Mon Mar 12 07:20:39 2007
@@ -26,7 +26,7 @@
 require_once('include/DatabaseUtil.php');
 
 
-global $app_strings,$list_max_entries_per_page;
+global $app_strings,$list_max_entries_per_page,$mod_strings;
 
 $log = LoggerManager::getLogger('potential_list');
 
@@ -134,11 +134,12 @@
 	$list_query = getListQuery("Potentials");
 }
 //<<<<<<<<customview>>>>>>>>>
-
 if(isset($where) && $where != '')
 {
 	if(isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard'] == 'true')
-		$list_query .= " AND vtiger_potential.sales_stage = 'Closed Won' AND ".$where;
+		$list_query .= " AND vtiger_potential.sales_stage = '".$mod_strings['Closed Won']."' AND ".$where;
+	elseif(isset($_REQUEST['from_homepagedb']) && $_REQUEST['from_homepagedb'] == 'true')
+		$list_query .= " AND vtiger_potential.sales_stage not in( '".$mod_strings['Closed Won']."' , '".$mod_strings['Closed Lost']."' )AND ".$where;
 	else
 		$list_query .= " AND ".$where;
 }





More information about the vtigercrm-commits mailing list