Skip to content
Snippets Groups Projects
Commit ad55e288 authored by Alan Bell's avatar Alan Bell
Browse files

fix #19 preserve created by and created time on lead conversion

parent 9b95c52a
No related branches found
No related tags found
2 merge requests!34Fix default sort ref #110,!9fix #19 preserve created by and created time on lead conversion
......@@ -280,6 +280,10 @@ function vtws_updateConvertLeadStatus($entityIds, $leadId, $user) {
$tableList = $meta->getEntityTableIndexList();
$tableIndex = $tableList[$tablename];
$adb->pquery("UPDATE $tablename SET isconvertedfromlead = ? WHERE $tableIndex = ?",array(1,$id));
//copy forward the created time and creator of the lead to the converted objects
//from a user perspective, it isn't a new entity, it is a converted entity
$adb->pquery("UPDATE vtiger_crmentity newmod,(select createdtime, smcreatorid from vtiger_crmentity WHERE crmid=?) leadmod set newmod.createdtime=leadmod.createdtime,
newmod.smcreatorid=leadmod.smcreatorid where newmod.crmid=?",array($leadIdComponents[1],$id));
}
}
......
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