Skip to content
Snippets Groups Projects
Commit 529d7ea0 authored by Prasad's avatar Prasad
Browse files

Merge branch 'add_lead_convert_event' into 'master'

Add lead convert event

we need to know when a lead is converted so we can take various custom actions, but there isn't an event triggered ref #108

See merge request !32
parents d35031aa 8bbba066
No related branches found
No related tags found
No related merge requests found
......@@ -271,6 +271,12 @@ function vtws_updateConvertLeadStatus($entityIds, $leadId, $user) {
$leadModifiedTime = $adb->formatDate(date('Y-m-d H:i:s'), true);
$crmentityUpdateSql = "UPDATE vtiger_crmentity SET modifiedtime=?, modifiedby=? WHERE crmid=?";
$adb->pquery($crmentityUpdateSql, array($leadModifiedTime, $user->id, $leadIdComponents[1]));
//raise an event so that modules can take their actions on lead conversion
require_once("include/events/include.inc");
$em = new VTEventsManager($adb);
$em->initTriggerCache();
$entityData = VTEntityData::fromEntityId($adb, $leadIdComponents[1]);
$em->triggerEvent("vtiger.entity.leadconverted", $entityData);
}
$moduleArray = array('Accounts','Contacts','Potentials');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment