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') { $bean = $defines['focus']; // 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 = array("parent_id" => $parent_id, "parent_type"=>$parent_type); require_once('modules/Emails/EmailUI.php'); $eUi = new EmailUI(); $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, http_build_query($composeData), false, $defines['focus']); $button = ""; } return $button; } }