[Vtigercrm-commits] [vtiger-commits] r10866 - /vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri May 11 09:11:07 EDT 2007


Author: richie
Date: Fri May 11 07:11:02 2007
New Revision: 10866

Log:
fix for In migrated build - got fatal error while selecting contact for Calendar To Do with respect to Trouble Tickets. Fixes #3826 --minnie

Modified:
    vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php

Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Fri May 11 07:11:02 2007
@@ -2844,11 +2844,6 @@
 
 		elseif($relmodule == "Potentials")
 		{
-			/*$query = "select accountid from vtiger_potential where potentialid=".$relmod_recordid;
-			$result = $adb->query($query);
-			$account_id = $adb->query_result($result,0,"accountid");
-			$condition = "and vtiger_contactdetails.accountid= ".$account_id;*/
-
 			$query = "select contactid from vtiger_contpotentialrel where potentialid=".$relmod_recordid;
 			$result = $adb->query($query);
                         $contact_id = $adb->query_result($result,0,"contactid");
@@ -2922,13 +2917,15 @@
 			$query = "select parent_id from vtiger_troubletickets where ticketid =".$relmod_recordid;	
 			$result = $adb->query($query);
 			$parent_id = $adb->query_result($result,0,"parent_id");
-			$crmquery = "select setype from vtiger_crmentity where crmid=".$parent_id;
-			$parentmodule_id = $adb->query($crmquery);
-			$parent_modname = $adb->query_result($parentmodule_id,0,"setype");
-			if($parent_modname == "Accounts")
-				$condition = "and vtiger_contactdetails.accountid= ".$parent_id;
-			if($parent_modname == "Contacts")
-				$condition = "and vtiger_contactdetails.contactid= ".$parent_id;
+			if($parent_id != ""){
+				$crmquery = "select setype from vtiger_crmentity where crmid=".$parent_id;
+				$parentmodule_id = $adb->query($crmquery);
+				$parent_modname = $adb->query_result($parentmodule_id,0,"setype");
+				if($parent_modname == "Accounts")
+					$condition = "and vtiger_contactdetails.accountid= ".$parent_id;
+				if($parent_modname == "Contacts")
+					$condition = "and vtiger_contactdetails.contactid= ".$parent_id;
+			}		
 
 		}
 	}





More information about the vtigercrm-commits mailing list