[Vtigercrm-commits] [vtiger-commits] r7485 - /vtigercrm/trunk/include/utils/DeleteUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sat Jun 24 02:08:55 EDT 2006


Author: mmbrich
Date: Sat Jun 24 00:08:54 2006
New Revision: 7485

Log:
fix to remove entities from campaign related lists

Modified:
    vtigercrm/trunk/include/utils/DeleteUtils.php

Modified: vtigercrm/trunk/include/utils/DeleteUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/DeleteUtils.php (original)
+++ vtigercrm/trunk/include/utils/DeleteUtils.php Sat Jun 24 00:08:54 2006
@@ -27,8 +27,13 @@
 
 	switch($module):
 	case Leads:
-		$sql = 'delete from vtiger_seactivityrel where crmid = '.$record.' and activityid = '.$return_id;
-		$adb->query($sql);
+		if($return_module == "Campaigns") {
+			$sql = 'delete from vtiger_campaignleadrel where leadid='.$record.' and campaignid='.$return_id;
+			$adb->query($sql);
+		} else {
+			$sql = 'delete from vtiger_seactivityrel where crmid = '.$record.' and activityid = '.$return_id;
+			$adb->query($sql);
+		}
 	break;
 	case Accounts:
 		if($return_id!='')
@@ -46,6 +51,10 @@
 		if($return_module == 'Potentials' && $record != '' && $return_id != '')
 		{
 			$sql = 'delete from vtiger_contpotentialrel where contactid='.$record.' and potentialid='.$return_id;
+			$adb->query($sql);
+		}
+		if($return_module == "Campaigns") {
+			$sql = 'delete from vtiger_campaigncontrel where contactid='.$record.' and campaignid='.$return_id;
 			$adb->query($sql);
 		}
 		if($record != '' && $return_id != '')





More information about the vtigercrm-commits mailing list