当前位置: 首页>>代码示例>>PHP>>正文


PHP handleRedirect函数代码示例

本文整理汇总了PHP中handleRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP handleRedirect函数的具体用法?PHP handleRedirect怎么用?PHP handleRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了handleRedirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_save

 function action_save()
 {
     $move = false;
     $file = new File();
     $file = populateFromPost('', $file);
     $upload_file = new UploadFile('uploadfile');
     $return_id = '';
     if (isset($_FILES['uploadfile']) && $upload_file->confirm_upload()) {
         $file->filename = $upload_file->get_stored_file_name();
         $file->file_mime_type = $upload_file->mime_type;
         $file->file_ext = $upload_file->file_ext;
         $move = true;
     }
     $return_id = $file->save();
     if ($move) {
         $upload_file->final_move($file->id);
     }
     handleRedirect($return_id, $this->object_name);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:controller.php

示例2: Paperformat

 * WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * All copies of the Covered Code must include on each user interface screen:
 *    (i) the "Powered by SugarCRM" logo and
 *    (ii) the SugarCRM copyright notice
 * in the same form as they appear in the distribution.  See full license for
 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/Paperformat/Paperformat.php';
require_once 'include/formbase.php';
$sugarbean = new Paperformat();
$sugarbean = populateFromPost('', $sugarbean);
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
handleRedirect($return_id, 'Paperformat');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:Save.php

示例3: foreach

    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        $focus->{$field} = $value;
    }
}
foreach ($focus->additional_column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        $focus->{$field} = $value;
    }
}
if (!empty($this->uploadfile)) {
    $this->picture = $this->uploadfile;
}
$focus->save($check_notify);
$return_id = $focus->id;
if (!empty($_POST['uploadfile'])) {
    $file_name = $_FILES['uploadfile']['name'];
    $ext = explode('.', $file_name);
    $img_ext = $ext[count($ext) - 1];
    $image_extension = 'jpg_jpeg_gif_bmp_png';
    $image_extension_arr = explode('_', $image_extension);
    for ($i = 0; $i < count($image_extension_arr); $i++) {
        if ($img_ext != $image_extension_arr[$i]) {
            echo "<script language='javascript'> alert('file ảnh không hợp lệ'); </script>";
        }
    }
    move_uploaded_file($_FILES['uploadfile']['tmp_name'], 'modules/images/' . $_FILES['uploadfile']['tmp_name']);
}
handleRedirect($return_id, 'Destinations');
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:30,代码来源:Save---.php

示例4: while

    $query = "SELECT email_marketing_prospect_lists.id from email_marketing_prospect_lists ";
    $query .= " left join email_marketing on email_marketing.id=email_marketing_prospect_lists.email_marketing_id";
    $query .= " where email_marketing.campaign_id='{$record}'";
    $query .= " and email_marketing_prospect_lists.prospect_list_id='{$linked_id}'";
    $result = $focus->db->query($query);
    while (($row = $focus->db->fetchByAssoc($result)) != null) {
        $del_query = " update email_marketing_prospect_lists set email_marketing_prospect_lists.deleted=1, email_marketing_prospect_lists.date_modified=" . db_convert("'" . gmdate($GLOBALS['timedate']->get_db_date_time_format(), time()) . "'", 'datetime');
        $del_query .= " WHERE  email_marketing_prospect_lists.id='{$row['id']}'";
        $focus->db->query($del_query);
    }
    $focus->db->query($query);
}
if ($bean_name == "Meeting") {
    $focus->retrieve($record);
    $user = new User();
    $user->retrieve($linked_id);
    if (!empty($user->id)) {
        //make sure that record exists. we may have a contact on our hands.
        if ($focus->update_vcal) {
            vCal::cache_sugar_vcal($user);
        }
    }
}
if (!empty($_REQUEST['return_url'])) {
    $_REQUEST['return_url'] = urldecode($_REQUEST['return_url']);
}
$GLOBALS['log']->debug("deleted relationship: bean: {$bean_name}, linked_field: {$linked_field}, linked_id:{$linked_id}");
if (empty($_REQUEST['refresh_page'])) {
    handleRedirect();
}
exit;
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:DeleteRelationship.php

示例5: CampaignTracker

$focus = new CampaignTracker();
$focus->retrieve($_POST['record']);
if (!$focus->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$check_notify = FALSE;
foreach ($focus->column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        $focus->{$field} = $value;
    }
}
foreach ($focus->additional_column_fields as $field) {
    if (isset($_POST[$field])) {
        $value = $_POST[$field];
        $focus->{$field} = $value;
    }
}
//set check box states.
if (isset($_POST['is_optout']) && $_POST['is_optout'] == 'on') {
    $focus->is_optout = 1;
    $focus->tracker_url = 'index.php?entryPoint=removeme';
} else {
    $focus->is_optout = 0;
}
$focus->save($check_notify);
$return_id = $focus->id;
$GLOBALS['log']->debug("Saved record with id of " . $return_id);
handleRedirect('', '');
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:30,代码来源:Save.php

示例6: handleSave


//.........这里部分代码省略.........
                 }
             }
             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'])) {
             $get .= $_POST['return_action'];
         } else {
             $get .= 'Popup';
         }
         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'];
         }
         if (!empty($_POST['to_pdf'])) {
             $get .= '&to_pdf=' . $_POST['to_pdf'];
         }
         $get .= '&name=' . $focus->name;
         $get .= '&query=true';
         header("Location: index.php?{$get}");
         return;
     }
     if ($redirect) {
         handleRedirect($return_id, 'Accounts');
     } else {
         return $focus;
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:AccountFormBase.php

示例7: sugar_cleanup

    sugar_cleanup(true);
}
if (isset($GLOBALS['check_notify'])) {
    $check_notify = $GLOBALS['check_notify'];
} else {
    $check_notify = FALSE;
}
$sugarbean->save($check_notify);
$return_id = $sugarbean->id;
if (isset($_REQUEST['save_type']) || isset($_REQUEST['duplicateSave']) && $_REQUEST['duplicateSave'] === "true") {
    for ($i = 0; $i < count($projectTasks); $i++) {
        if (isset($_REQUEST['save_type']) || isset($_REQUEST['duplicateSave']) && $_REQUEST['duplicateSave'] === "true") {
            $projectTasks[$i]->id = '';
            $projectTasks[$i]->project_id = $sugarbean->id;
        }
        if ($sugarbean->is_template) {
            $projectTasks[$i]->assigned_user_id = '';
        }
        $projectTasks[$i]->team_id = $sugarbean->team_id;
        if (empty($projectTasks[$i]->duration_unit)) {
            $projectTasks[$i]->duration_unit = " ";
        }
        //Since duration_unit cannot be null.
        $projectTasks[$i]->save(false);
    }
}
if ($sugarbean->is_template) {
    header("Location: index.php?action=ProjectTemplatesDetailView&module=Project&record={$return_id}&return_module=Project&return_action=ProjectTemplatesEditView");
} else {
    handleRedirect($return_id, 'Project');
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:31,代码来源:Save.php

示例8: ProductEstimate

 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/ProductEstimate/ProductEstimate.php';
require_once 'modules/Products/Products.php';
require_once 'include/formbase.php';
$sugarbean = new ProductEstimate();
$sugarbean = populateFromPost('', $sugarbean);
$sugarbean->status = "uptodate";
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
$product = new Products();
$product->retrieve($sugarbean->product_id);
//// Status Update
if (isset($_REQUEST['stat_action']) && !empty($_REQUEST['stat_action']) && !is_null($_REQUEST['stat_action'])) {
    $product->status_update('', $product->id, $_REQUEST['stat_action'], '');
} else {
    $product->status_update('', $product->id, '', '');
}
/////////////////
handleRedirect($return_id, 'ProductEstimate');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:Save.php

示例9: ProspectList

        global $mod_strings;
        //if no prospect lists are attached, then lets create a subscription and unsubscription
        //default prospect lists as these are required for newsletters.
        //create subscription list
        $subs = new ProspectList();
        $subs->name = $focus->name . ' ' . $mod_strings['LBL_SUBSCRIPTION_LIST'];
        $subs->assigned_user_id = $current_user->id;
        $subs->list_type = "default";
        $subs->save();
        $focus->prospectlists->add($subs->id);
        //create unsubscription list
        $unsubs = new ProspectList();
        $unsubs->name = $focus->name . ' ' . $mod_strings['LBL_UNSUBSCRIPTION_LIST'];
        $unsubs->assigned_user_id = $current_user->id;
        $unsubs->list_type = "exempt";
        $unsubs->save();
        $focus->prospectlists->add($unsubs->id);
        //create unsubscription list
        $test_subs = new ProspectList();
        $test_subs->name = $focus->name . ' ' . $mod_strings['LBL_TEST_LIST'];
        $test_subs->assigned_user_id = $current_user->id;
        $test_subs->list_type = "test";
        $test_subs->save();
        $focus->prospectlists->add($test_subs->id);
    }
    //save new relationships
    $focus->save();
}
//finish newsletter processing
handleRedirect($focus->id, 'Campaigns');
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:30,代码来源:Save.php

示例10: ProductOperation

 * WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * All copies of the Covered Code must include on each user interface screen:
 *    (i) the "Powered by SugarCRM" logo and
 *    (ii) the SugarCRM copyright notice
 * in the same form as they appear in the distribution.  See full license for
 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/ProductOperations/ProductOperation.php';
require_once 'include/formbase.php';
$sugarbean = new ProductOperation();
$sugarbean = populateFromPost('', $sugarbean);
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
handleRedirect($return_id, 'ProductOperations');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:Save.php

示例11: handleSave


//.........这里部分代码省略.........
         }
     } elseif (empty($focus->id)) {
         //this is not from long form so add assigned and current user automatically as there is no invitee list UI.
         //This call could be through an ajax call from subpanels or shortcut bar
         if (!isset($_POST['user_invitees'])) {
             $_POST['user_invitees'] = '';
         }
         $_POST['user_invitees'] .= ',' . $_POST['assigned_user_id'] . ', ';
         //add current user if the assigned to user is different than current user.
         if ($current_user->id != $_POST['assigned_user_id'] && $_REQUEST['module'] != "Calendar") {
             $_POST['user_invitees'] .= ',' . $current_user->id . ', ';
         }
         //remove any double comma's introduced during appending
         $_POST['user_invitees'] = str_replace(',,', ',', $_POST['user_invitees']);
     }
     if (isset($_POST['isSaveFromDetailView']) && $_POST['isSaveFromDetailView'] == 'true' || (isset($_POST['is_ajax_call']) && !empty($_POST['is_ajax_call']) && !empty($focus->id) || isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer' && !empty($focus->id)) || !isset($_POST['user_invitees'])) {
         $focus->save(true);
         $return_id = $focus->id;
     } else {
         if ($focus->status == 'Held' && $this->isEmptyReturnModuleAndAction() && !$this->isSaveFromDCMenu()) {
             //if we are closing the meeting, and the request does not have a return module AND return action set and it is not a save
             //being triggered by the DCMenu (shortcut bar) then the request is coming from a dashlet or subpanel close icon and there is no
             //need to process user invitees, just save the current values.
             $focus->save(true);
         } else {
             $relate_to = $this->getRelatedModuleName($focus);
             $userInvitees = array();
             $contactInvitees = array();
             $leadInvitees = array();
             $existingUsers = array();
             $existingContacts = array();
             $existingLeads = array();
             if (!empty($_POST['user_invitees'])) {
                 $userInvitees = explode(',', trim($_POST['user_invitees'], ','));
             }
             if (!empty($_POST['existing_invitees'])) {
                 $existingUsers = explode(",", trim($_POST['existing_invitees'], ','));
             }
             if (!empty($_POST['contact_invitees'])) {
                 $contactInvitees = explode(',', trim($_POST['contact_invitees'], ','));
             }
             if (!empty($_POST['existing_contact_invitees'])) {
                 $existingContacts = explode(",", trim($_POST['existing_contact_invitees'], ','));
             }
             if (!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Contacts') {
                 $contactInvitees[] = $_POST['parent_id'];
             }
             if ($relate_to == 'Contacts') {
                 if (!empty($_REQUEST['relate_id']) && !in_array($_REQUEST['relate_id'], $contactInvitees)) {
                     $contactInvitees[] = $_REQUEST['relate_id'];
                 }
             }
             if (!empty($_POST['lead_invitees'])) {
                 $leadInvitees = explode(',', trim($_POST['lead_invitees'], ','));
             }
             if (!empty($_POST['existing_lead_invitees'])) {
                 $existingLeads = explode(",", trim($_POST['existing_lead_invitees'], ','));
             }
             if (!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Leads') {
                 $leadInvitees[] = $_POST['parent_id'];
             }
             if ($relate_to == 'Leads') {
                 if (!empty($_REQUEST['relate_id']) && !in_array($_REQUEST['relate_id'], $leadInvitees)) {
                     $leadInvitees[] = $_REQUEST['relate_id'];
                 }
             }
             // Call the Meeting module's save function to handle saving other fields besides
             // the users and contacts relationships
             $focus->update_vcal = false;
             // Bug #49195 : don't update vcal b/s related users aren't saved yet, create vcal cache below
             $focus->users_arr = $userInvitees;
             $focus->contacts_arr = $contactInvitees;
             $focus->leads_arr = $leadInvitees;
             $focus->save(true);
             $return_id = $focus->id;
             if (empty($return_id)) {
                 //this is to handle the situation where the save fails, most likely because of a failure
                 //in the external api. bug: 42200
                 $_REQUEST['action'] = 'EditView';
                 $_REQUEST['return_action'] = 'EditView';
                 handleRedirect('', 'Meetings');
             }
             $focus->setUserInvitees($userInvitees, $existingUsers);
             $focus->setContactInvitees($contactInvitees, $existingContacts);
             $focus->setLeadInvitees($focus->leads_arr, $existingLeads);
             // Bug #49195 : update vcal
             vCal::cache_sugar_vcal($current_user);
             $this->processRecurring($focus);
         }
     }
     if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] === 'Home') {
         SugarApplication::redirect(buildRedirectURL('', 'Home'));
     } else {
         if ($redirect) {
             handleRedirect($return_id, 'Meetings');
         } else {
             return $focus;
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:MeetingFormBase.php

示例12: RunnableReport

<?php

require_once 'include/formbase.php';
require_once 'modules/ZuckerRunnableReport/RunnableReport.php';
$runnable = new RunnableReport();
if (!empty($_REQUEST['record'])) {
    $runnable->retrieve($_REQUEST['record']);
}
$runnable = populateFromPost("", $runnable);
if (empty($_REQUEST['schedule_interval'])) {
    $runnable->nextrun = "";
} else {
    global $timedate;
    if (empty($_REQUEST['schedule_start'])) {
        $runnable->nextrun = date($timedate->get_date_time_format(), time());
    } else {
        $runnable->nextrun = date($timedate->get_date_time_format(), strtotime($_REQUEST['schedule_start']));
    }
}
$_REQUEST['return_id'] = $runnable->save();
$_REQUEST['return_action'] = "DetailView";
handleRedirect($return_id, "ZuckerRunnableReport");
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:22,代码来源:Save.php

示例13: sugar_cleanup

    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
if (!isset($sugarbean->name) || is_null($sugarbean->name)) {
    $sugarbean->name = $sugarbean->generateName($sugarbean->id);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
$pressLine1 = new Pressline();
$pressLine1->mark_deletedByPressid($return_id);
$count = count($_POST);
$keys = array_keys($_POST);
for ($i = 0; $i < $count; $i++) {
    if (substr_count($keys[$i], "layout_id_") > 0) {
        $index = substr($keys[$i], -1, 1);
        $layout_id = $_POST["layout_id_" . $index];
        $layout_name = $_POST["layout_name_" . $index];
        $part = $_POST["part_" . $index];
        $pressLine = new Pressline();
        $pressLine->layout_id = $layout_id;
        $pressLine->layout_name = $layout_name;
        $pressLine->part = $part;
        $pressLine->press_id = $sugarbean->id;
        $pressLine->save();
    }
}
handleRedirect($return_id, 'Press');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:Save.php

示例14: Pressmachine

 *    (i) the "Powered by SugarCRM" logo and
 *    (ii) the SugarCRM copyright notice
 * in the same form as they appear in the distribution.  See full license for
 * requirements.
 *
 * The Original Code is: SugarCRM Open Source
 * The Initial Developer of the Original Code is SugarCRM, Inc.
 * Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
 * All Rights Reserved.
 * Contributor(s): ______________________________________.
 */
require_once 'modules/Pressmachine/Pressmachine.php';
require_once 'include/formbase.php';
$sugarbean = new Pressmachine();
$sugarbean = populateFromPost('', $sugarbean);
foreach ($sugarbean->column_fields as $field) {
    if (!isset($_REQUEST['active'])) {
        $sugarbean->active = 'off';
    }
}
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
handleRedirect($return_id, 'Pressmachine');
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:Save.php

示例15: handleSave


//.........这里部分代码省略.........
                 $focus->db->query($sql);
             }
             ////	END REMOVE
             ///////////////////////////////////////////////////////////////////////////
             ///////////////////////////////////////////////////////////////////////////
             ////	REBUILD INVITEE RELATIONSHIPS
             $focus->users_arr = array();
             $focus->users_arr = $userInvitees;
             $focus->contacts_arr = array();
             $focus->contacts_arr = $contactInvitees;
             $focus->leads_arr = array();
             $focus->leads_arr = $leadInvitees;
             if (!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Contacts') {
                 $focus->contacts_arr[] = $_POST['parent_id'];
             }
             if (!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Leads') {
                 $focus->leads_arr[] = $_POST['parent_id'];
             }
             // Call the Call module's save function to handle saving other fields besides
             // the users and contacts relationships
             $focus->save(true);
             $return_id = $focus->id;
             // Process users
             $existing_users = array();
             if (!empty($_POST['existing_invitees'])) {
                 $existing_users = explode(",", trim($_POST['existing_invitees'], ','));
             }
             foreach ($focus->users_arr as $user_id) {
                 if (empty($user_id) || isset($existing_users[$user_id]) || isset($deleteUsers[$user_id])) {
                     continue;
                 }
                 if (!isset($acceptStatusUsers[$user_id])) {
                     $focus->load_relationship('users');
                     $focus->users->add($user_id);
                 } else {
                     // update query to preserve accept_status
                     $qU = 'UPDATE calls_users SET deleted = 0, accept_status = \'' . $acceptStatusUsers[$user_id] . '\' ';
                     $qU .= 'WHERE call_id = \'' . $focus->id . '\' ';
                     $qU .= 'AND user_id = \'' . $user_id . '\'';
                     $focus->db->query($qU);
                 }
             }
             // Process contacts
             $existing_contacts = array();
             if (!empty($_POST['existing_contact_invitees'])) {
                 $existing_contacts = explode(",", trim($_POST['existing_contact_invitees'], ','));
             }
             foreach ($focus->contacts_arr as $contact_id) {
                 if (empty($contact_id) || isset($existing_contacts[$contact_id]) || isset($deleteContacts[$contact_id]) && $contact_id != $_POST['parent_id']) {
                     continue;
                 }
                 if (!isset($acceptStatusContacts[$contact_id])) {
                     $focus->load_relationship('contacts');
                     $focus->contacts->add($contact_id);
                 } else {
                     // update query to preserve accept_status
                     $qU = 'UPDATE calls_contacts SET deleted = 0, accept_status = \'' . $acceptStatusContacts[$contact_id] . '\' ';
                     $qU .= 'WHERE call_id = \'' . $focus->id . '\' ';
                     $qU .= 'AND contact_id = \'' . $contact_id . '\'';
                     $focus->db->query($qU);
                 }
             }
             // Process leads
             $existing_leads = array();
             if (!empty($_POST['existing_lead_invitees'])) {
                 $existing_leads = explode(",", trim($_POST['existing_lead_invitees'], ','));
             }
             foreach ($focus->leads_arr as $lead_id) {
                 if (empty($lead_id) || isset($existing_leads[$lead_id]) || isset($deleteLeads[$lead_id]) && $lead_id != $_POST['parent_id']) {
                     continue;
                 }
                 if (!isset($acceptStatusLeads[$lead_id])) {
                     $focus->load_relationship('leads');
                     $focus->leads->add($lead_id);
                 } else {
                     // update query to preserve accept_status
                     $qU = 'UPDATE calls_leads SET deleted = 0, accept_status = \'' . $acceptStatusLeads[$lead_id] . '\' ';
                     $qU .= 'WHERE call_id = \'' . $focus->id . '\' ';
                     $qU .= 'AND lead_id = \'' . $lead_id . '\'';
                     $focus->db->query($qU);
                 }
             }
             // CCL - Comment out call to set $current_user as invitee
             //set organizer to auto-accept
             //$focus->set_accept_status($current_user, 'accept');
             ////	END REBUILD INVITEE RELATIONSHIPS
             ///////////////////////////////////////////////////////////////////////////
         }
     }
     if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Home') {
         $_REQUEST['return_action'] = 'index';
         handleRedirect('', 'Home');
     } else {
         if ($redirect) {
             handleRedirect($return_id, 'Calls');
         } else {
             return $focus;
         }
     }
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:101,代码来源:CallFormBase.php


注:本文中的handleRedirect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。