本文整理汇总了PHP中SugarEmailAddress::getEmailAddressWidgetEditView方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarEmailAddress::getEmailAddressWidgetEditView方法的具体用法?PHP SugarEmailAddress::getEmailAddressWidgetEditView怎么用?PHP SugarEmailAddress::getEmailAddressWidgetEditView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::getEmailAddressWidgetEditView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmailAddressWidget
/**
* Convenience function for MVC (Mystique)
* @param object $focus SugarBean
* @param string $field unused
* @param string $value unused
* @param string $view DetailView or EditView
* @return string
*/
function getEmailAddressWidget($focus, $field, $value, $view, $tabindex = '0')
{
$sea = new SugarEmailAddress();
$sea->setView($view);
if ($view == 'EditView' || $view == 'QuickCreate' || $view == 'ConvertLead') {
$module = $focus->module_dir;
if ($view == 'ConvertLead' && $module == "Contacts") {
$module = "Leads";
}
return $sea->getEmailAddressWidgetEditView($focus->id, $module, false, '', $tabindex);
}
return $sea->getEmailAddressWidgetDetailView($focus);
}
示例2: getEditContact
/**
* Prepares the Edit Contact mini-form via template assignment
* @param string id ID of contact in question
* @param string module Module in focus
* @return array
*/
function getEditContact($id, $module)
{
global $app_strings;
if (!class_exists("Contact")) {
}
$contact = new Contact();
$contact->retrieve($_REQUEST['id']);
$ret = array();
if ($contact->ACLAccess('edit')) {
$contactMeta = array();
$contactMeta['id'] = $contact->id;
$contactMeta['module'] = $contact->module_dir;
$contactMeta['first_name'] = $contact->first_name;
$contactMeta['last_name'] = $contact->last_name;
$this->smarty->assign("app_strings", $app_strings);
$this->smarty->assign("contact_strings", return_module_language($_SESSION['authenticated_user_language'], 'Contacts'));
$this->smarty->assign("contact", $contactMeta);
$ea = new SugarEmailAddress();
$newEmail = $ea->getEmailAddressWidgetEditView($id, $module, true);
$this->smarty->assign("emailWidget", $newEmail['html']);
$ret['form'] = $this->smarty->fetch("modules/Emails/templates/editContact.tpl");
$ret['prefillData'] = $newEmail['prefillData'];
} else {
$id = "";
$ret['form'] = $app_strings['LBL_EMAIL_ERROR_NO_ACCESS'];
$ret['prefillData'] = '{}';
}
$ret['id'] = $id;
$ret['contactName'] = $contact->full_name;
return $ret;
}
示例3: getWideFormBody
//.........这里部分代码省略.........
\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;
}
示例4: getWideFormBody
//.........这里部分代码省略.........
\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)) {
示例5: getEmailAddressWidget
/**
* Convenience function for MVC (Mystique)
* @param object $focus SugarBean
* @param string $field unused
* @param string $value unused
* @param string $view DetailView or EditView
* @return string
*/
function getEmailAddressWidget($focus, $field, $value, $view)
{
$sea = new SugarEmailAddress();
$sea->setView($view);
if ($view == 'EditView' || $view == 'QuickCreate') {
return $sea->getEmailAddressWidgetEditView($focus->id, $focus->module_dir, false);
}
return $sea->getEmailAddressWidgetDetailView($focus);
}