module_dir;
$parent_id = $defines['focus']->id;
//martin Bug 19660
$userPref = $current_user->getPreference('email_link_type');
$defaultPref = $sugar_config['email_default_client'];
if($userPref != '') {
$client = $userPref;
} else {
$client = $defaultPref;
}
if($client != 'sugar') {
$class = $beanList[$parent_type];
require_once($beanFiles[$class]);
$bean = new $class();
$bean->retrieve($parent_id);
// awu: Not all beans have emailAddress property, we must account for this
if (isset($bean->emailAddress)){
$to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
$button = "";
}
else{
$button = "";
}
}else
{
//Generate the compose package for the quick create options.
$composeData = "parent_id=$parent_id&parent_type=$parent_type";
require_once('modules/Emails/EmailUI.php');
$eUi = new EmailUI();
$j_quickComposeOptions = $eUi->generateComposePackageForQuickCreateFromComposeUrl($composeData);
$button = "