• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP handleRedirect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: handleSave


//.........这里部分代码省略.........
         $i = preg_replace("/email_attachment(.+)/", '$1', $key);
         $upload_file = new UploadFile($key);
         if (isset($_FILES[$key]) && $upload_file->confirm_upload() && preg_match("/^email_attachment/", $key)) {
             $note->filename = $upload_file->get_stored_file_name();
             $note->file = $upload_file;
             $note->name = $mod_strings['LBL_EMAIL_ATTACHMENT'] . ': ' . $note->file->original_file_name;
             if (isset($_REQUEST['embedded' . $i]) && !empty($_REQUEST['embedded' . $i])) {
                 if ($_REQUEST['embedded' . $i] == 'true') {
                     $note->embed_flag = true;
                 } else {
                     $note->embed_flag = false;
                 }
             }
             array_push($focus->attachments, $note);
         }
     }
     $focus->saved_attachments = array();
     foreach ($focus->attachments as $note) {
         if (!empty($note->id) && $note->new_with_id === FALSE) {
             if (empty($_REQUEST['old_id'])) {
                 array_push($focus->saved_attachments, $note);
             } else {
                 // we're duplicating a template with attachments
                 // dupe the file, create a new note, assign the note to the new template
                 $newNote = new Note();
                 $newNote->retrieve($note->id);
                 $newNote->id = create_guid();
                 $newNote->parent_id = $focus->id;
                 $newNote->new_with_id = true;
                 $newNote->date_modified = '';
                 $newNote->date_entered = '';
                 $newNoteId = $newNote->save();
                 UploadFile::duplicate_file($note->id, $newNoteId, $note->filename);
             }
             continue;
         }
         $note->parent_id = $focus->id;
         $note->parent_type = 'Emails';
         $note->file_mime_type = $note->file->mime_type;
         $note_id = $note->save();
         array_push($focus->saved_attachments, $note);
         $note->id = $note_id;
         if ($note->new_with_id === FALSE) {
             $note->file->final_move($note->id);
         } else {
             $GLOBALS['log']->debug("Not performing final move for note id {$note->id} as it has already been processed");
         }
     }
     ////	END NEW ATTACHMENTS
     ///////////////////////////////////////////////////////////////////////////
     ///////////////////////////////////////////////////////////////////////////
     ////	ATTACHMENTS FROM DOCUMENTS
     $count = '';
     //_pp($_REQUEST);
     //_ppd(count($_REQUEST['document']));
     if (!empty($_REQUEST['document'])) {
         $count = count($_REQUEST['document']);
     } else {
         $count = 10;
     }
     for ($i = 0; $i < $count; $i++) {
         if (isset($_REQUEST['documentId' . $i]) && !empty($_REQUEST['documentId' . $i])) {
             $doc = new Document();
             $docRev = new DocumentRevision();
             $docNote = new Note();
             $doc->retrieve($_REQUEST['documentId' . $i]);
             $docRev->retrieve($doc->document_revision_id);
             array_push($focus->saved_attachments, $docRev);
             $docNote->name = $doc->document_name;
             $docNote->filename = $docRev->filename;
             $docNote->description = $doc->description;
             $docNote->parent_id = $focus->id;
             $docNote->parent_type = 'Emails';
             $docNote->file_mime_type = $docRev->file_mime_type;
             $docId = $docNote = $docNote->save();
             UploadFile::duplicate_file($docRev->id, $docId, $docRev->filename);
         }
     }
     ////	END ATTACHMENTS FROM DOCUMENTS
     ///////////////////////////////////////////////////////////////////////////
     ///////////////////////////////////////////////////////////////////////////
     ////	REMOVE ATTACHMENTS
     if (isset($_REQUEST['remove_attachment']) && !empty($_REQUEST['remove_attachment'])) {
         foreach ($_REQUEST['remove_attachment'] as $noteId) {
             $q = 'UPDATE notes SET deleted = 1 WHERE id = \'' . $noteId . '\'';
             $focus->db->query($q);
         }
     }
     ////	END REMOVE ATTACHMENTS
     ///////////////////////////////////////////////////////////////////////////
     ////	END ATTACHMENT HANDLING
     ///////////////////////////////////////////////////////////////////////////////
     clear_register_value('select_array', $focus->object_name);
     if ($redirect) {
         $GLOBALS['log']->debug("Saved record with id of " . $return_id);
         handleRedirect($return_id, "EmailTemplates");
     } else {
         return $focus;
     }
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:101,代码来源:EmailTemplateFormBase.php


示例17: handleSave


//.........这里部分代码省略.........
             //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;
         }
     }
     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 ($do_save) {
         if (!empty($GLOBALS['check_notify'])) {
             $focus->save($GLOBALS['check_notify']);
         } else {
             $focus->save(FALSE);
         }
     }
     $return_id = $focus->id;
     if (isset($_POST[$prefix . 'prospect_id']) && !empty($_POST[$prefix . 'prospect_id'])) {
         $prospect = new Prospect();
         $prospect->retrieve($_POST[$prefix . 'prospect_id']);
         $prospect->lead_id = $focus->id;
         // Set to keep email in target
         $prospect->in_workflow = true;
         $prospect->save();
         //if prospect id exists, make sure we are coming from prospect detail
         if (strtolower($_POST['return_module']) == 'prospects' && strtolower($_POST['return_action']) == 'detailview') {
             //create campaing_log entry
             if (isset($focus->campaign_id) && $focus->campaign_id != null) {
                 campaign_log_lead_entry($focus->campaign_id, $prospect, $focus, 'lead');
             }
         }
     }
     ///////////////////////////////////////////////////////////////////////////////
     ////	INBOUND EMAIL HANDLING
     ///////////////////////////////////////////////////////////////////////////////
     if (isset($_REQUEST['inbound_email_id']) && !empty($_REQUEST['inbound_email_id'])) {
         if (!isset($current_user)) {
             global $current_user;
         }
         // fake this case like it's already saved.
         $email = new Email();
         $email->retrieve($_REQUEST['inbound_email_id']);
         $email->parent_type = 'Leads';
         $email->parent_id = $focus->id;
         $email->assigned_user_id = $current_user->id;
         $email->status = 'read';
         $email->save();
         $email->load_relationship('leads');
         $email->leads->add($focus->id);
         header("Location: index.php?&module=Emails&action=EditView&type=out&inbound_email_id=" . $_REQUEST['inbound_email_id'] . "&parent_id=" . $email->parent_id . "&parent_type=" . $email->parent_type . '&start=' . $_REQUEST['start']);
         exit;
     }
     ////	END INBOUND EMAIL HANDLING
     ///////////////////////////////////////////////////////////////////////////////
     $GLOBALS['log']->debug("Saved record with id of " . $return_id);
     if ($redirect) {
         handleRedirect($return_id, 'Leads');
     } else {
         return $focus;
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:101,代码来源:LeadFormBase.php


示例18: 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);
     }
     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 ($do_save) {
         if (!empty($GLOBALS['check_notify'])) {
             $focus->save($GLOBALS['check_notify']);
         } else {
             $focus->save(FALSE);
         }
     }
     $return_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP handle_debug函数代码示例发布时间:2022-05-15
下一篇:
PHP handleNormalFlowExceptions函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap