/** * @group bug42279 */ public function testEmailAddressInFetchedRow() { $sea = new SugarEmailAddress(); // this will populate contact->email1 $sea->populateLegacyFields($this->contact); $email1 = $this->contact->email1; // this should set fetched_row['email1'] to contatc->email1 $sea->handleLegacyRetrieve($this->contact); $this->assertEquals($email1, $this->contact->fetched_row['email1']); }
function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '') { if (!ACLController::checkAccess('Accounts', 'edit', true)) { return ''; } if (empty($contact)) { $contact = new Contact(); } global $mod_strings; $temp_strings = $mod_strings; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } global $app_strings; global $current_user; $account = new Account(); $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL']; $lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME']; $lbl_phone = $mod_strings['LBL_PHONE']; $lbl_website = $mod_strings['LBL_WEBSITE']; if (isset($contact->assigned_user_id)) { $user_id = $contact->assigned_user_id; } else { $user_id = $current_user->id; } //Retrieve Email address and set email1, email2 $sugarEmailAddress = new SugarEmailAddress(); $sugarEmailAddress->handleLegacyRetrieve($contact); if (!isset($contact->email1)) { $contact->email1 = ''; } if (!isset($contact->email2)) { $contact->email2 = ''; } if (!isset($contact->email_opt_out)) { $contact->email_opt_out = ''; } $form = ""; $default_desc = ""; if (!empty($contact->description)) { $default_desc = $contact->description; } $form .= <<<EOQ \t\t<input type="hidden" name="{$prefix}record" value=""> \t\t<input type="hidden" name="{$prefix}phone_fax" value="{$contact->phone_fax}"> \t\t<input type="hidden" name="{$prefix}phone_other" value="{$contact->phone_other}"> \t\t<input type="hidden" name="{$prefix}email1" value="{$contact->email1}"> \t\t<input type="hidden" name="{$prefix}email2" value="{$contact->email2}"> \t\t<input type='hidden' name='{$prefix}billing_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='{$prefix}billing_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='{$prefix}billing_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='{$prefix}billing_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='{$prefix}billing_address_country' value='{$contact->primary_address_country}'> \t\t<input type='hidden' name='{$prefix}shipping_address_street' value='{$contact->alt_address_street}'><input type='hidden' name='{$prefix}shipping_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='{$prefix}shipping_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='{$prefix}shipping_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='{$prefix}shipping_address_country' value='{$contact->alt_address_country}'> \t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'> \t\t<input type='hidden' name='{$prefix}do_not_call' value='{$contact->do_not_call}'> \t\t<input type='hidden' name='{$prefix}email_opt_out' value='{$contact->email_opt_out}'> \t\t<table width='100%' border="0" cellpadding="0" cellspacing="0"> \t\t<tr> \t\t<td width="20%" nowrap scope="row">{$lbl_account_name} <span class="required">{$lbl_required_symbol}</span></td> \t\t<TD width="80%" nowrap scope="row">{$mod_strings['LBL_DESCRIPTION']}</TD> \t\t</tr> \t\t<tr> \t\t<td nowrap ><input name='{$prefix}name' type="text" value="{$contact->account_name}"></td> \t\t<TD rowspan="5" ><textarea name='{$prefix}description' rows='6' cols='50' >{$default_desc}</textarea></TD> \t\t</tr> \t\t<tr> \t\t<td nowrap scope="row">{$lbl_phone}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap ><input name='{$prefix}phone_office' type="text" value="{$contact->phone_work}"></td> \t\t</tr> \t\t<tr> \t\t<td nowrap scope="row">{$lbl_website}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap ><input name='{$prefix}website' type="text" value="http://"></td> \t\t</tr> EOQ; //carry forward custom lead fields common to accounts during Lead Conversion $tempAccount = new Account(); if (method_exists($contact, 'convertCustomFieldsForm')) { $contact->convertCustomFieldsForm($form, $tempAccount, $prefix); } unset($tempAccount); $form .= <<<EOQ \t\t</TABLE> EOQ; $javascript = new javascript(); $javascript->setFormName($formname); $javascript->setSugarBean(new Account()); $javascript->addRequiredFields($prefix); $form .= $javascript->getScript(); $mod_strings = $temp_strings; return $form; }
function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '', $portal = true) { if (!ACLController::checkAccess('Contacts', 'edit', true)) { return ''; } if (empty($contact)) { $contact = new Contact(); } global $mod_strings; $temp_strings = $mod_strings; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } global $app_strings; global $current_user; global $app_list_strings; $primary_address_country_options = get_select_options_with_id($app_list_strings['countries_dom'], $contact->primary_address_country); $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL']; $lbl_first_name = $mod_strings['LBL_FIRST_NAME']; $lbl_last_name = $mod_strings['LBL_LAST_NAME']; $lbl_phone = $mod_strings['LBL_OFFICE_PHONE']; $lbl_address = $mod_strings['LBL_PRIMARY_ADDRESS']; if (isset($contact->assigned_user_id)) { $user_id = $contact->assigned_user_id; } else { $user_id = $current_user->id; } //Retrieve Email address and set email1, email2 $sugarEmailAddress = new SugarEmailAddress(); $sugarEmailAddress->handleLegacyRetrieve($contact); if (!isset($contact->email1)) { $contact->email1 = ''; } if (!isset($contact->email2)) { $contact->email2 = ''; } if (!isset($contact->email_opt_out)) { $contact->email_opt_out = ''; } $lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS']; $salutation_options = get_select_options_with_id($app_list_strings['salutation_dom'], $contact->salutation); if (isset($contact->lead_source)) { $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], $contact->lead_source); } else { $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], ''); } $form = ""; if ($formname == 'ConvertProspect') { $lead_source_label = "<td scope='row'> </td>"; $lead_source_field = "<td > </td>"; } else { $lead_source_label = "<td scope='row' nowrap>{$mod_strings['LBL_LEAD_SOURCE']}</td>"; $lead_source_field = "<td ><select name='{$prefix}lead_source'>{$lead_source_options}</select></td>"; } global $timedate; $birthdate = ''; if (!empty($_REQUEST['birthdate'])) { $birthdate = $_REQUEST['birthdate']; } $jsCalendarImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif'); $ntc_date_format = $timedate->get_user_date_format(); $cal_dateformat = $timedate->get_cal_date_format(); $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL']; $form .= <<<EOQ \t\t<input type="hidden" name="{$prefix}record" value=""> \t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'> \t\t<table border='0' celpadding="0" cellspacing="0" width='100%'> \t\t<tr> \t\t<td nowrap scope='row'>{$lbl_first_name}</td> \t\t<td scope='row'>{$lbl_last_name} <span class="required">{$lbl_required_symbol}</span></td> \t\t<td scope='row' nowrap>{$mod_strings['LBL_TITLE']}</td> \t\t<td scope='row' nowrap>{$mod_strings['LBL_DEPARTMENT']}</td> \t\t</tr> \t\t<tr> \t\t<td ><select name='{$prefix}salutation'>{$salutation_options}</select> <input name="{$prefix}first_name" type="text" value="{$contact->first_name}"></td> \t\t<td ><input name='{$prefix}last_name' type="text" value="{$contact->last_name}"></td> \t\t<td nowrap><input name='{$prefix}title' type="text" value="{$contact->title}"></td> \t\t<td nowrap><input name='{$prefix}department' type="text" value="{$contact->department}"></td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' scope='row'>{$lbl_address}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' ><textarea cols='80' rows='2' name='{$prefix}primary_address_street'>{$contact->primary_address_street}</textarea></td> \t\t</tr> \t\t<tr> \t\t<td scope='row'>{$mod_strings['LBL_CITY']}</td> \t\t<td scope='row'>{$mod_strings['LBL_STATE']}</td> \t\t<td scope='row'>{$mod_strings['LBL_POSTAL_CODE']}</td> \t\t<td scope='row'>{$mod_strings['LBL_COUNTRY']}</td> \t\t</tr> \t\t<tr> \t\t<td ><input name='{$prefix}primary_address_city' maxlength='100' value='{$contact->primary_address_city}'></td> \t\t<td ><input name='{$prefix}primary_address_state' maxlength='100' value='{$contact->primary_address_state}'></td> \t\t<td ><input name='{$prefix}primary_address_postalcode' maxlength='100' value='{$contact->primary_address_postalcode}'></td> \t\t<td ><input name='{$prefix}primary_address_country' maxlength='100' value='{$contact->primary_address_country}'></td> \t\t</tr> \t\t<tr> \t\t<td nowrap scope='row'>{$lbl_phone}</td> \t\t<td nowrap scope='row'>{$mod_strings['LBL_MOBILE_PHONE']}</td> \t\t<td nowrap scope='row'>{$mod_strings['LBL_FAX_PHONE']}</td> \t\t<td nowrap scope='row'>{$mod_strings['LBL_HOME_PHONE']}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap ><input name='{$prefix}phone_work' type="text" value="{$contact->phone_work}"></td> \t\t<td nowrap ><input name='{$prefix}phone_mobile' type="text" value="{$contact->phone_mobile}"></td> \t\t<td nowrap ><input name='{$prefix}phone_fax' type="text" value="{$contact->phone_fax}"></td> \t\t<td nowrap ><input name='{$prefix}phone_home' type="text" value="{$contact->phone_home}"></td> \t\t</tr> \t\t<tr> \t\t<td scope='row' nowrap>{$mod_strings['LBL_OTHER_PHONE']}</td> \t\t{$lead_source_label} \t\t<td scope="row">{$mod_strings['LBL_BIRTHDATE']} </td> \t\t</tr> \t\t<tr> \t\t<td nowrap><input name='{$prefix}phone_other' type="text" value="{$contact->phone_other}"></td> \t\t{$lead_source_field} \t\t<td nowrap> \t\t\t<input name='{$prefix}birthdate' onblur="parseDate(this, '{$cal_dateformat}');" size='12' maxlength='10' id='{$prefix}jscal_field' type="text" value="{$birthdate}"> \t\t\t<img src="{$jsCalendarImage}" alt="{$app_strings['LBL_ENTER_DATE']}" id="{$prefix}jscal_trigger" align="absmiddle"> \t\t</td>\t\t \t\t</tr> EOQ; $form .= $sugarEmailAddress->getEmailAddressWidgetEditView($contact->id, $_REQUEST['action'] == 'ConvertLead' ? 'Leads' : 'Contacts', false, 'include/SugarEmailAddress/templates/forWideFormBodyView.tpl'); require_once 'include/SugarFields/Fields/Text/SugarFieldText.php'; $sugarfield = new SugarFieldText('Text'); $description_text = $sugarfield->getClassicEditView('description', $contact->description, $prefix, true); $form .= <<<EOQ \t\t<tr> \t\t<td nowrap colspan='4' scope='row'>{$mod_strings['LBL_DESCRIPTION']}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' >{$description_text}</td> \t\t</tr> EOQ; //carry forward custom lead fields common to contacts during Lead Conversion $tempContact = new Contact(); if (method_exists($contact, 'convertCustomFieldsForm')) { $contact->convertCustomFieldsForm($form, $tempContact, $prefix); } unset($tempContact); $form .= <<<EOQ \t\t</table> \t\t \t\t<input type='hidden' name='{$prefix}alt_address_street' value='{$contact->alt_address_street}'> \t\t<input type='hidden' name='{$prefix}alt_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='{$prefix}alt_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='{$prefix}alt_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='{$prefix}alt_address_country' value='{$contact->alt_address_country}'> \t\t<input type='hidden' name='{$prefix}do_not_call' value='{$contact->do_not_call}'> \t\t<input type='hidden' name='{$prefix}email_opt_out' value='{$contact->email_opt_out}'> EOQ; if ($portal == true) { if (isset($contact->portal_name)) { $form .= "<input type='hidden' name='{$prefix}portal_name' value='{$contact->portal_name}'>"; } else { $form .= "<input type='hidden' name='{$prefix}portal_name' value=''>"; } if (isset($contact->portal_app)) { $form .= "<input type='hidden' name='{$prefix}portal_app' value='{$contact->portal_app}'>"; } else { $form .= "<input type='hidden' name='{$prefix}portal_app' value=''>"; } if (!empty($contact->portal_name) && !empty($contact->portal_app)) { $form .= "<input name='{$prefix}portal_active' type='hidden' size='25' value='1' >"; } if (isset($contact->portal_password)) { $form .= "<input type='password' name='{$prefix}portal_password1' value='{$contact->portal_password}'>"; $form .= "<input type='password' name='{$prefix}portal_password' value='{$contact->portal_password}'>"; $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25' value='{$contact->portal_password}' >"; } else { $form .= "<input type='password' name='{$prefix}portal_password1' value=''>"; $form .= "<input type='password' name='{$prefix}portal_password' value=''>"; $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25' value='' >"; } } $form .= <<<EOQ \t\t\t<script type="text/javascript"> \t\t\t\tCalendar.setup ({ \t\t\t\tinputField : "{$prefix}jscal_field", daFormat : "{$cal_dateformat}", ifFormat : "{$cal_dateformat}", showsTime : false, button : "{$prefix}jscal_trigger", singleClick : true, step : 1, weekNumbers:false \t\t\t\t}); \t\t\t</script> EOQ; $javascript = new javascript(); $javascript->setFormName($formname); $javascript->setSugarBean(new Contact()); $javascript->addField('email1', 'false', $prefix); $javascript->addField('email2', 'false', $prefix); $javascript->addRequiredFields($prefix); $form .= $javascript->getScript(); $mod_strings = $temp_strings; return $form; }
require_once $beanFiles[$class_name]; $contact = new $class_name(); if ($contact->retrieve($_REQUEST['load_id'])) { $link_id = $class_name . '_id'; $focus->{$link_id} = $_REQUEST['load_id']; $focus->contact_name = isset($contact->full_name) ? $contact->full_name : $contact->name; $focus->to_addrs_names = $focus->contact_name; $focus->to_addrs_ids = $_REQUEST['load_id']; //Retrieve the email address. //If Opportunity or Case then Oppurtinity/Case->Accounts->(email_addr_bean_rel->email_addresses) //If Contacts, Leads etc.. then Contact->(email_addr_bean_rel->email_addresses) $sugarEmailAddress = new SugarEmailAddress(); if ($class_name == 'Opportunity' || $class_name == 'aCase') { $account = new Account(); if ($contact->account_id != null && $account->retrieve($contact->account_id)) { $sugarEmailAddress->handleLegacyRetrieve($account); if (isset($account->email1)) { $focus->to_addrs_emails = $account->email1; $focus->to_addrs = "{$focus->contact_name} <{$account->email1}>"; } } } else { $sugarEmailAddress->handleLegacyRetrieve($contact); if (isset($contact->email1)) { $focus->to_addrs_emails = $contact->email1; $focus->to_addrs = "{$focus->contact_name} <{$contact->email1}>"; } } if (!empty($_REQUEST['parent_type']) && empty($app_list_strings['record_type_display'][$_REQUEST['parent_type']])) { if (!empty($app_list_strings['record_type_display'][$_REQUEST['load_module']])) { $_REQUEST['parent_type'] = $_REQUEST['load_module'];
function getWideFormBody($prefix, $mod = '', $formname = '', $contact = '', $portal = true) { if (!ACLController::checkAccess('Contacts', 'edit', true)) { return ''; } if (empty($contact)) { $contact = new Contact(); } global $mod_strings; $temp_strings = $mod_strings; if (!empty($mod)) { global $current_language; $mod_strings = return_module_language($current_language, $mod); } global $app_strings; global $current_user; global $app_list_strings; $primary_address_country_options = get_select_options_with_id($app_list_strings['countries_dom'], $contact->primary_address_country); $lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL']; $lbl_first_name = $mod_strings['LBL_FIRST_NAME']; $lbl_last_name = $mod_strings['LBL_LAST_NAME']; $lbl_phone = $mod_strings['LBL_OFFICE_PHONE']; $lbl_address = $mod_strings['LBL_PRIMARY_ADDRESS']; if (isset($contact->assigned_user_id)) { $user_id = $contact->assigned_user_id; } else { $user_id = $current_user->id; } //Retrieve Email address and set email1, email2 $sugarEmailAddress = new SugarEmailAddress(); $sugarEmailAddress->handleLegacyRetrieve($contact); if (!isset($contact->email1)) { $contact->email1 = ''; } if (!isset($contact->email2)) { $contact->email2 = ''; } if (!isset($contact->email_opt_out)) { $contact->email_opt_out = ''; } $lbl_email_address = $mod_strings['LBL_EMAIL_ADDRESS']; $salutation_options = get_select_options_with_id($app_list_strings['salutation_dom'], $contact->salutation); if (isset($contact->lead_source)) { $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], $contact->lead_source); } else { $lead_source_options = get_select_options_with_id($app_list_strings['lead_source_dom'], ''); } $form = ""; if ($formname == 'ConvertProspect') { $lead_source_label = "<td class='dataLabel'> </td>"; $lead_source_field = "<td class='dataField'> </td>"; } else { $lead_source_label = "<td class='dataLabel' nowrap>{$mod_strings['LBL_LEAD_SOURCE']}</td>"; $lead_source_field = "<td class='dataField'><select name='{$prefix}lead_source'>{$lead_source_options}</select></td>"; } $form .= <<<EOQ \t\t<input type="hidden" name="{$prefix}record" value=""> \t\t<input type="hidden" name="{$prefix}assigned_user_id" value='{$user_id}'> \t\t<table border='0' celpadding="0" cellspacing="0" width='100%'> \t\t<tr> \t\t<td nowrap class='dataLabel'>{$lbl_first_name}</td> \t\t<td class='dataLabel'>{$lbl_last_name} <span class="required">{$lbl_required_symbol}</span></td> \t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_TITLE']}</td> \t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_DEPARTMENT']}</td> \t\t</tr> \t\t<tr> \t\t<td class='dataField'><select name='{$prefix}salutation'>{$salutation_options}</select> <input name="{$prefix}first_name" type="text" value="{$contact->first_name}"></td> \t\t<td class='dataField'><input name='{$prefix}last_name' type="text" value="{$contact->last_name}"></td> \t\t<td class='dataField' nowrap><input name='{$prefix}title' type="text" value="{$contact->title}"></td> \t\t<td class='dataField' nowrap><input name='{$prefix}department' type="text" value="{$contact->department}"></td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' class='dataLabel'>{$lbl_address}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' class='dataField'><textarea cols='80' rows='2' name='{$prefix}primary_address_street'>{$contact->primary_address_street}</textarea></td> \t\t</tr> \t\t<tr> \t\t<td class='dataLabel'>{$mod_strings['LBL_CITY']}</td> \t\t<td class='dataLabel'>{$mod_strings['LBL_STATE']}</td> \t\t<td class='dataLabel'>{$mod_strings['LBL_POSTAL_CODE']}</td> \t\t<td class='dataLabel'>{$mod_strings['LBL_COUNTRY']}</td> \t\t</tr> \t\t<tr> \t\t<td class='dataField'><input name='{$prefix}primary_address_city' maxlength='100' value='{$contact->primary_address_city}'></td> \t\t<td class='dataField'><input name='{$prefix}primary_address_state' maxlength='100' value='{$contact->primary_address_state}'></td> \t\t<td class='dataField'><input name='{$prefix}primary_address_postalcode' maxlength='100' value='{$contact->primary_address_postalcode}'></td> \t\t<td class='dataField'><select name='{$prefix}primary_address_country' size='1' selected='{$contact->primary_address_country}'>{$primary_address_country_options}</select></td> \t\t</tr> \t\t<tr> \t\t<td nowrap class='dataLabel'>{$lbl_phone}</td> \t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_MOBILE_PHONE']}</td> \t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_FAX_PHONE']}</td> \t\t<td nowrap class='dataLabel'>{$mod_strings['LBL_HOME_PHONE']}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap class='dataField'><input name='{$prefix}phone_work' type="text" value="{$contact->phone_work}"></td> \t\t<td nowrap class='dataField'><input name='{$prefix}phone_mobile' type="text" value="{$contact->phone_mobile}"></td> \t\t<td nowrap class='dataField'><input name='{$prefix}phone_fax' type="text" value="{$contact->phone_fax}"></td> \t\t<td nowrap class='dataField'><input name='{$prefix}phone_home' type="text" value="{$contact->phone_home}"></td> \t\t</tr> \t\t<tr> \t\t<td class='dataLabel' nowrap>{$mod_strings['LBL_OTHER_PHONE']}</td> \t\t{$lead_source_label} \t\t</tr> \t\t<tr> \t\t<td class='dataField' nowrap><input name='{$prefix}phone_other' type="text" value="{$contact->phone_other}"></td> \t\t{$lead_source_field} \t\t</tr> EOQ; $form .= $sugarEmailAddress->getEmailAddressWidgetEditView($contact->id, $_REQUEST['action'] == 'ConvertLead' ? 'Leads' : 'Contacts', false, 'include/SugarEmailAddress/templates/forWideFormBodyView.tpl'); $form .= <<<EOQ \t\t<tr> \t\t<td nowrap colspan='4' class='dataLabel'>{$mod_strings['LBL_DESCRIPTION']}</td> \t\t</tr> \t\t<tr> \t\t<td nowrap colspan='4' class='dataField'><textarea cols='80' rows='4' name='{$prefix}description' >{$contact->description}</textarea></td> \t\t</tr> EOQ; //carry forward custom lead fields common to contacts during Lead Conversion $tempContact = new Contact(); if (method_exists($contact, 'convertCustomFieldsForm')) { $contact->convertCustomFieldsForm($form, $tempContact, $prefix); } unset($tempContact); $form .= <<<EOQ \t\t</table> \t\t<input type='hidden' name='{$prefix}alt_address_street' value='{$contact->alt_address_street}'> \t\t<input type='hidden' name='{$prefix}alt_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='{$prefix}alt_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='{$prefix}alt_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='{$prefix}alt_address_country' value='{$contact->alt_address_country}'> \t\t<input type='hidden' name='{$prefix}do_not_call' value='{$contact->do_not_call}'> \t\t<input type='hidden' name='{$prefix}email_opt_out' value='{$contact->email_opt_out}'> EOQ; if ($portal == true) { if (isset($contact->portal_name)) { $form .= "<input type='hidden' name='{$prefix}portal_name' value='{$contact->portal_name}'>"; } else { $form .= "<input type='hidden' name='{$prefix}portal_name' value=''>"; } if (isset($contact->portal_app)) { $form .= "<input type='hidden' name='{$prefix}portal_app' value='{$contact->portal_app}'>"; } else { $form .= "<input type='hidden' name='{$prefix}portal_app' value=''>"; } if (!empty($contact->portal_name) && !empty($contact->portal_app)) { $form .= "<input name='{$prefix}portal_active' type='hidden' size='25' value='1' >"; } if (isset($contact->portal_password)) { $form .= "<input type='password' name='{$prefix}portal_password1' value='{$contact->portal_password}'>"; $form .= "<input type='password' name='{$prefix}portal_password' value='{$contact->portal_password}'>"; $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25' value='{$contact->portal_password}' >"; } else { $form .= "<input type='password' name='{$prefix}portal_password1' value=''>"; $form .= "<input type='password' name='{$prefix}portal_password' value=''>"; $form .= "<input name='{$prefix}old_portal_password' type='hidden' size='25' value='' >"; } } $javascript = new javascript(); $javascript->setFormName($formname); $javascript->setSugarBean(new Contact()); $javascript->addField('email1', 'false', $prefix); $javascript->addField('email2', 'false', $prefix); $javascript->addRequiredFields($prefix); $form .= $javascript->getScript(); $mod_strings = $temp_strings; return $form; }
/** * Populate email address fields here instead of retrieve() so that they are properly available for logic hooks * * @see parent::fill_in_relationship_fields() */ public function fill_in_relationship_fields() { parent::fill_in_relationship_fields(); $this->emailAddress->handleLegacyRetrieve($this); }