[Vtigercrm-commits] [vtiger-commits] r10650 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 12 05:50:58 EDT 2007


Author: saraj
Date: Thu Apr 12 03:50:51 2007
New Revision: 10650

Log:
* Fixed the issue in export to pdf, ie., got error when we export PO/SO/Quotes/Inovice which are not associated with contact, Fixed #3654

Modified:
    vtigercrm/branches/5.0.3/include/utils/CommonUtils.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 Apr 12 03:50:51 2007
@@ -487,11 +487,15 @@
 	$log->info("in getContactName ".$contact_id);
 
         global $adb;
-        $sql = "select * from vtiger_contactdetails where contactid=".$contact_id;
-        $result = $adb->query($sql);
-        $firstname = $adb->query_result($result,0,"firstname");
-        $lastname = $adb->query_result($result,0,"lastname");
-        $contact_name = $lastname.' '.$firstname;
+	$contact_name = '';
+	if($contact_id != '')
+	{
+        	$sql = "select * from vtiger_contactdetails where contactid=".$contact_id;
+        	$result = $adb->query($sql);
+        	$firstname = $adb->query_result($result,0,"firstname");
+        	$lastname = $adb->query_result($result,0,"lastname");
+        	$contact_name = $lastname.' '.$firstname;
+	}
 	$log->debug("Exiting getContactName method ...");
         return $contact_name;
 }





More information about the vtigercrm-commits mailing list