$opportunityid = "'" . $opportunity->id . "'"; clone_history($lead->db, $lead->id, $opportunity->id, 'Opportunities'); } if (isset($contact)) { //Set relationships to the new contact foreach ($linked_beans as $linked_bean) { foreach ($linked_bean as $bean_val) { $bean_val->load_relationship('contacts'); $bean_val->contacts->add($contact->id); } } } $lead = new Lead(); $mod_strings = return_module_language($current_language, 'Leads'); $lead->retrieve($_REQUEST['record']); $lead->converted_lead("'" . $_REQUEST['record'] . "'", $contactid, $accountid, $opportunityid); if (isset($_POST['selectedLeads']) && sizeof($_POST['selectedLeads']) > 0) { foreach ($_POST['selectedLeads'] as $aLead) { $lead->converted_lead("'" . $aLead . "'", $contactid, $accountid, $opportunityid); } } if (isset($call)) { $call->track_view($current_user->id, 'Calls'); array_push($ROWVALUES, "<LI>" . $mod_strings['LBL_CREATED_CALL'] . " - <a href='index.php?action=DetailView&module=Calls&record=" . $call->id . "'>" . $call->name . "</a>"); } if (isset($meeting)) { $meeting->track_view($current_user->id, 'Meetings'); array_push($ROWVALUES, "<LI>" . $mod_strings['LBL_CREATED_MEETING'] . " - <a href='index.php?action=DetailView&module=Meetings&record=" . $meeting->id . "'>" . $meeting->name . "</a>"); } array_push($ROWVALUES, " "); array_push($ROWVALUES, "<a href='index.php?module=Leads&action=ListView'>{$mod_strings['LBL_BACKTOLEADS']}</a>");