本文整理汇总了PHP中SugarEmailAddress::getFormBaseURL方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarEmailAddress::getFormBaseURL方法的具体用法?PHP SugarEmailAddress::getFormBaseURL怎么用?PHP SugarEmailAddress::getFormBaseURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarEmailAddress
的用法示例。
在下文中一共展示了SugarEmailAddress::getFormBaseURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleSave
function handleSave($prefix, $redirect = true, $useRequired = false)
{
require_once 'include/formbase.php';
$focus = new Account();
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
$focus = populateFromPost($prefix, $focus);
if (isset($GLOBALS['check_notify'])) {
$check_notify = $GLOBALS['check_notify'];
} else {
$check_notify = FALSE;
}
if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
$duplicateAccounts = $this->checkForDuplicates($prefix);
if (isset($duplicateAccounts)) {
$location = 'module=Accounts&action=ShowDuplicates';
$get = '';
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field) {
if (!empty($focus->{$field}) && !is_object($focus->{$field})) {
$get .= "&Accounts{$field}=" . urlencode($focus->{$field});
}
}
foreach ($focus->additional_column_fields as $field) {
if (!empty($focus->{$field})) {
$get .= "&Accounts{$field}=" . urlencode($focus->{$field});
}
}
if ($focus->hasCustomFields()) {
foreach ($focus->field_defs as $name => $field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields') {
$get .= "&Accounts{$name}=" . urlencode($focus->{$name});
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate account id's in redirect get string
$i = 0;
foreach ($duplicateAccounts as $account) {
$get .= "&duplicate[{$i}]=" . $account['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= '&return_module=';
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= 'Accounts';
}
$get .= '&return_action=';
if (!empty($_POST['return_action'])) {
$get .= $_POST['return_action'];
}
//else $get .= 'DetailView';
if (!empty($_POST['return_id'])) {
$get .= '&return_id=' . $_POST['return_id'];
}
if (!empty($_POST['popup'])) {
$get .= '&popup=' . $_POST['popup'];
}
if (!empty($_POST['create'])) {
$get .= '&create=' . $_POST['create'];
}
//now redirect the post to modules/Accounts/ShowDuplicates.php
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
$json = getJSONobj();
echo $json->encode(array('status' => 'dupe', 'get' => $get));
} else {
if (!empty($_POST['to_pdf'])) {
$location .= '&to_pdf=' . $_POST['to_pdf'];
}
$_SESSION['SHOW_DUPLICATES'] = $get;
header("Location: index.php?{$location}");
}
return null;
}
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->save($check_notify);
$return_id = $focus->id;
$GLOBALS['log']->debug("Saved record with id of " . $return_id);
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
$json = getJSONobj();
echo $json->encode(array('status' => 'success', 'get' => ''));
return null;
}
if (isset($_POST['popup']) && $_POST['popup'] == 'true') {
$get = '&module=';
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= 'Accounts';
}
$get .= '&action=';
if (!empty($_POST['return_action'])) {
//.........这里部分代码省略.........
示例2: handleSave
function handleSave($prefix, $redirect = true, $useRequired = false, $do_save = true, $exist_lead = null)
{
require_once 'modules/Campaigns/utils.php';
require_once 'include/formbase.php';
if (empty($exist_lead)) {
$focus = new Lead();
} else {
$focus = $exist_lead;
}
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
$focus = populateFromPost($prefix, $focus);
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
//Check for duplicate Leads
if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
$duplicateLeads = $this->checkForDuplicates($prefix);
if (isset($duplicateLeads)) {
//Set the redirect location to call the ShowDuplicates action. This will map to view.showduplicates.php
$location = 'module=Leads&action=ShowDuplicates';
$get = '';
if (isset($_POST['inbound_email_id']) && !empty($_POST['inbound_email_id'])) {
$get .= '&inbound_email_id=' . $_POST['inbound_email_id'];
}
if (isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
$get .= '&Leadsrelate_to=' . $_POST['relate_to'];
}
if (isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
$get .= '&Leadsrelate_id=' . $_POST['relate_id'];
}
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field) {
if (!empty($focus->{$field}) && !is_object($focus->{$field})) {
$get .= "&Leads{$field}=" . urlencode($focus->{$field});
}
}
foreach ($focus->additional_column_fields as $field) {
if (!empty($focus->{$field})) {
$get .= "&Leads{$field}=" . urlencode($focus->{$field});
}
}
if ($focus->hasCustomFields()) {
foreach ($focus->field_defs as $name => $field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields') {
$get .= "&Leads{$name}=" . urlencode($focus->{$name});
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate lead ids in redirect get string
$i = 0;
foreach ($duplicateLeads as $lead) {
$get .= "&duplicate[{$i}]=" . $lead['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= "&return_module=";
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= "Leads";
}
$get .= "&return_action=";
if (!empty($_POST['return_action'])) {
$get .= $_POST['return_action'];
}
if (!empty($_POST['return_id'])) {
$get .= "&return_id=" . $_POST['return_id'];
}
if (!empty($_POST['popup'])) {
$get .= '&popup=' . $_POST['popup'];
}
if (!empty($_POST['create'])) {
$get .= '&create=' . $_POST['create'];
}
// for InboundEmail flow
if (!empty($_POST['start'])) {
$get .= '&start=' . $_POST['start'];
}
$_SESSION['SHOW_DUPLICATES'] = $get;
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
ob_clean();
$json = getJSONobj();
echo $json->encode(array('status' => 'dupe', 'get' => $location));
} else {
if (!empty($_REQUEST['ajax_load'])) {
echo "<script>SUGAR.ajaxUI.loadContent('index.php?{$location}');</script>";
} else {
if (!empty($_POST['to_pdf'])) {
$location .= '&to_pdf=' . $_POST['to_pdf'];
}
header("Location: index.php?{$location}");
}
}
return null;
}
//.........这里部分代码省略.........
示例3: handleSave
function handleSave($prefix, $redirect = true, $useRequired = false)
{
global $theme, $current_user;
require_once 'include/formbase.php';
global $timedate;
$focus = new Contact();
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
if (!empty($_POST[$prefix . 'new_reports_to_id'])) {
$focus->retrieve($_POST[$prefix . 'new_reports_to_id']);
$focus->reports_to_id = $_POST[$prefix . 'record'];
} else {
$focus = populateFromPost($prefix, $focus);
if (!empty($focus->portal_password) && $focus->portal_password != $_POST[$prefix . 'old_portal_password']) {
$focus->portal_password = md5($focus->portal_password);
}
if (!isset($_POST[$prefix . 'email_opt_out'])) {
$focus->email_opt_out = 0;
}
if (!isset($_POST[$prefix . 'do_not_call'])) {
$focus->do_not_call = 0;
}
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if ($_REQUEST['action'] != 'BusinessCard' && $_REQUEST['action'] != 'ConvertLead' && $_REQUEST['action'] != 'ConvertProspect') {
if (!empty($_POST[$prefix . 'sync_contact'])) {
$focus->contacts_users_id = $current_user->id;
} else {
if (!isset($focus->users)) {
$focus->load_relationship('user_sync');
}
$focus->contacts_users_id = null;
$focus->user_sync->delete($focus->id, $current_user->id);
}
}
if (isset($GLOBALS['check_notify'])) {
$check_notify = $GLOBALS['check_notify'];
} else {
$check_notify = FALSE;
}
if (empty($_POST['dup_checked'])) {
$duplicateContacts = $this->checkForDuplicates($prefix);
if (isset($duplicateContacts)) {
$location = 'module=Contacts&action=ShowDuplicates';
$get = '';
if (isset($_POST['inbound_email_id']) && !empty($_POST['inbound_email_id'])) {
$get .= '&inbound_email_id=' . $_POST['inbound_email_id'];
}
// Bug 25311 - Add special handling for when the form specifies many-to-many relationships
if (isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
$get .= '&Contactsrelate_to=' . $_POST['relate_to'];
}
if (isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
$get .= '&Contactsrelate_id=' . $_POST['relate_id'];
}
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field) {
if (!empty($focus->{$field}) && !is_object($focus->{$field})) {
$get .= "&Contacts{$field}=" . urlencode($focus->{$field});
}
}
foreach ($focus->additional_column_fields as $field) {
if (!empty($focus->{$field})) {
$get .= "&Contacts{$field}=" . urlencode($focus->{$field});
}
}
if ($focus->hasCustomFields()) {
foreach ($focus->field_defs as $name => $field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields') {
$get .= "&Contacts{$name}=" . urlencode($focus->{$name});
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate contact id's in redirect get string
$i = 0;
foreach ($duplicateContacts as $contact) {
$get .= "&duplicate[{$i}]=" . $contact['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= "&return_module=";
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= "Contacts";
}
$get .= "&return_action=";
if (!empty($_POST['return_action'])) {
$get .= $_POST['return_action'];
}
//else $get .= "DetailView";
if (!empty($_POST['return_id'])) {
$get .= "&return_id=" . $_POST['return_id'];
}
//.........这里部分代码省略.........
示例4: handleSave
function handleSave($prefix, $redirect = true, $useRequired = false)
{
require_once 'include/formbase.php';
$focus = new xVendor();
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
$focus = populateFromPost($prefix, $focus);
if (isset($GLOBALS['check_notify'])) {
$check_notify = $GLOBALS['check_notify'];
} else {
$check_notify = FALSE;
}
if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
$duplicatexVendors = $this->checkForDuplicates($prefix);
if (isset($duplicatexVendors)) {
$location = 'module=xVendors&action=ShowDuplicates';
$get = '';
// Bug 25311 - Add special handling for when the form specifies many-to-many relationships
if (isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
$get .= '&xVendorsrelate_to=' . $_POST['relate_to'];
}
if (isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
$get .= '&xVendorsrelate_id=' . $_POST['relate_id'];
}
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field) {
if (!empty($focus->{$field}) && !is_object($focus->{$field})) {
$get .= "&xVendors{$field}=" . urlencode($focus->{$field});
}
}
foreach ($focus->additional_column_fields as $field) {
if (!empty($focus->{$field})) {
$get .= "&xVendors{$field}=" . urlencode($focus->{$field});
}
}
if ($focus->hasCustomFields()) {
foreach ($focus->field_defs as $name => $field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields') {
$get .= "&xVendors{$name}=" . urlencode($focus->{$name});
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate xvendor id's in redirect get string
$i = 0;
foreach ($duplicatexVendors as $xvendor) {
$get .= "&duplicate[{$i}]=" . $xvendor['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= '&return_module=';
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= 'xVendors';
}
$get .= '&return_action=';
if (!empty($_POST['return_action'])) {
$get .= $_POST['return_action'];
}
//else $get .= 'DetailView';
if (!empty($_POST['return_id'])) {
$get .= '&return_id=' . $_POST['return_id'];
}
if (!empty($_POST['popup'])) {
$get .= '&popup=' . $_POST['popup'];
}
if (!empty($_POST['create'])) {
$get .= '&create=' . $_POST['create'];
}
$_SESSION['SHOW_DUPLICATES'] = $get;
//now redirect the post to modules/xVendors/ShowDuplicates.php
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
ob_clean();
$json = getJSONobj();
echo $json->encode(array('status' => 'dupe', 'get' => $location));
} else {
if (!empty($_REQUEST['ajax_load'])) {
echo "<script>SUGAR.ajaxUI.loadContent('index.php?{$location}');</script>";
} else {
if (!empty($_POST['to_pdf'])) {
$location .= '&to_pdf=' . $_POST['to_pdf'];
}
header("Location: index.php?{$location}");
}
}
return null;
}
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->save($check_notify);
$return_id = $focus->id;
$GLOBALS['log']->debug("Saved record with id of " . $return_id);
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
$json = getJSONobj();
//.........这里部分代码省略.........
示例5: handleSave
function handleSave($prefix, $redirect = true, $useRequired = false)
{
global $theme, $current_user;
require_once 'include/formbase.php';
$galleria = $_POST['galleria_c'];
$focus = new Realty();
if (!empty($_POST[$prefix . 'new_reports_to_id'])) {
$focus->retrieve($_POST[$prefix . 'new_reports_to_id']);
$focus->reports_to_id = $_POST[$prefix . 'record'];
} else {
$focus = populateFromPost($prefix, $focus);
}
if (isset($galleria)) {
$focus->galleria_c = $galleria;
}
if ($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (isset($GLOBALS['check_notify'])) {
$check_notify = $GLOBALS['check_notify'];
} else {
$check_notify = FALSE;
}
if (empty($_POST['dup_checked'])) {
$duplicateRealty = $this->checkForDuplicates($prefix);
if (isset($duplicateRealty)) {
$focus->possible_duplicate = 1;
$_SESSION['duplicateRealty'] = $duplicateRealty;
$location = 'module=Realty&action=ShowDuplicates&record=' . $_POST['record'];
$get = '';
if (isset($_POST['inbound_email_id']) && !empty($_POST['inbound_email_id'])) {
$get .= '&inbound_email_id=' . $_POST['inbound_email_id'];
}
// Bug 25311 - Add special handling for when the form specifies many-to-many relationships
if (isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
$get .= '&Realtyrelate_to=' . $_POST['relate_to'];
}
if (isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
$get .= '&Realtyrelate_id=' . $_POST['relate_id'];
}
//add all of the post fields to redirect get string
foreach ($focus->column_fields as $field) {
if (!empty($focus->{$field}) && !is_object($focus->{$field})) {
$get .= "&Realty{$field}=" . urlencode($focus->{$field});
}
}
foreach ($focus->additional_column_fields as $field) {
if (!empty($focus->{$field})) {
$get .= "&Realty{$field}=" . urlencode($focus->{$field});
}
}
if ($focus->hasCustomFields()) {
foreach ($focus->field_defs as $name => $field) {
if (!empty($field['source']) && $field['source'] == 'custom_fields') {
$get .= "&Realty{$name}=" . urlencode($focus->{$name});
}
}
}
$emailAddress = new SugarEmailAddress();
$get .= $emailAddress->getFormBaseURL($focus);
//create list of suspected duplicate realty id's in redirect get string
$i = 0;
foreach ($duplicateRealty as $realty) {
$get .= "&duplicate[{$i}]=" . $realty['id'];
$i++;
}
//add return_module, return_action, and return_id to redirect get string
$get .= "&return_module=";
if (!empty($_POST['return_module'])) {
$get .= $_POST['return_module'];
} else {
$get .= "Realty";
}
$get .= "&return_action=";
if (!empty($_POST['return_action'])) {
$get .= 'EditView';
}
//else $get .= "DetailView";
if (!empty($_POST['return_id'])) {
$get .= "&return_id=" . $_POST['return_id'];
}
if (!empty($_POST['popup'])) {
$get .= '&popup=' . $_POST['popup'];
}
if (!empty($_POST['create'])) {
$get .= '&create=' . $_POST['create'];
}
// for InboundEmail flow
if (!empty($_POST['start'])) {
$get .= '&start=' . $_POST['start'];
}
$_SESSION['SHOW_DUPLICATES'] = $get;
//now redirect the post to modules/Realty/ShowDuplicates.php
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
ob_clean();
$json = getJSONobj();
//.........这里部分代码省略.........