Ejemplo n.º 1
0
$sugar_smarty->assign("MODULE", $_REQUEST['module']);
if ($error_msg != '') {
    $sugar_smarty->assign("ERROR", $error_msg);
}
if (isset($_POST['handle']) && $_POST['handle'] == 'Save') {
    require_once 'modules/Contacts/ContactFormBase.php';
    $contactForm = new ContactFormBase();
    require_once 'modules/Accounts/AccountFormBase.php';
    $accountForm = new AccountFormBase();
    require_once 'modules/Opportunities/OpportunityFormBase.php';
    $oppForm = new OpportunityFormBase();
    require_once 'modules/Leads/LeadFormBase.php';
    $leadForm = new LeadFormBase();
    $lead = new Lead();
    $lead->retrieve($_REQUEST['record']);
    $linked_beans[] = $lead->get_linked_beans('calls', 'Call');
    $linked_beans[] = $lead->get_linked_beans('meetings', 'Meeting');
    $linked_beans[] = $lead->get_linked_beans('emails', 'Email');
    $GLOBALS['check_notify'] = FALSE;
    foreach ($_POST as $k => $v) {
        if (is_array($v)) {
            $val = encodeMultienumValue($_POST[$k]);
            $_POST[$k] = $val;
        }
    }
    $formbody = array();
    $sugar_smarty->assign('SAVE_BUTTON_DISPLAY', 'style="display:none;"');
    $sugar_smarty->assign('CANCEL_BUTTON_DISPLAY', 'style="display:none;"');
    if (!isset($_POST['selectedContact']) && !isset($_POST['ContinueContact'])) {
        $duplicateContacts = $contactForm->checkForDuplicates('Contacts');
        if (isset($duplicateContacts)) {