[Vtigercrm-commits] [vtiger-commits] r7436 - /vtigercrm/trunk/modules/Leads/Lead.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Jun 22 23:58:27 EDT 2006


Author: saraj
Date: Thu Jun 22 21:58:24 2006
New Revision: 7436

Log:
changes made to include campaign as lead related list

Modified:
    vtigercrm/trunk/modules/Leads/Lead.php

Modified: vtigercrm/trunk/modules/Leads/Lead.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/Lead.php (original)
+++ vtigercrm/trunk/modules/Leads/Lead.php Thu Jun 22 21:58:24 2006
@@ -19,6 +19,7 @@
 require_once('data/SugarBean.php');
 require_once('data/CRMEntity.php');
 require_once('modules/Activities/Activity.php');
+require_once('modules/Campaigns/Campaign.php');
 require_once('modules/Notes/Note.php');
 require_once('modules/Emails/Email.php');
 require_once('include/ComboUtil.php');
@@ -197,6 +198,28 @@
 	$log->debug("Exiting get_activities method ...");
 	return  GetRelatedList('Leads','Activities',$focus,$query,$button,$returnset);
 }
+
+/** Returns a list of the associated Campaigns
+  * @param $id -- campaign id :: Type Integer
+  * @returns list of campaigns in array format
+  */
+function get_campaigns($id)
+{
+	global $log;
+	$log->debug("Entering get_campaigns(".$id.") method ...");
+	global $mod_strings;
+	$focus = new Campaign();
+	$button = '';
+
+	$returnset = '';
+	$log->info("Campaign Related List for Lead Displayed");
+	$query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0";
+
+	$log->debug("Exiting get_emails method ...");
+	return GetRelatedList('Contacts','Campaigns',$focus,$query,$button,$returnset);
+
+}
+
 
 	/** Returns a list of the associated emails
 	*/





More information about the vtigercrm-commits mailing list