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


PHP Campaign::load_relationship方法代码示例

本文整理汇总了PHP中Campaign::load_relationship方法的典型用法代码示例。如果您正苦于以下问题:PHP Campaign::load_relationship方法的具体用法?PHP Campaign::load_relationship怎么用?PHP Campaign::load_relationship使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Campaign的用法示例。


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

示例1: EmailMarketing

}
// handle Create $module then Cancel
$ss->assign('CAMPAIGN_ID', $campaign_focus->id);
$seps = get_number_seperators();
$ss->assign("NUM_GRP_SEP", $seps[0]);
$ss->assign("DEC_SEP", $seps[1]);
/**************************** MARKETING UI DIV Stuff *******************/
//$campaign_focus->load_relationship('emailmarketing');
//$mrkt_ids = $campaign_focus->emailmarketing->get();
$mrkt_focus = new EmailMarketing();
//if record param exists and it is not empty, then retrieve this bean
if (isset($_REQUEST['record']) and !empty($_REQUEST['record'])) {
    $mrkt_focus->retrieve($_REQUEST['record']);
} else {
    //check to see if this campaign has an email marketing already attached, and if so, create duplicate
    $campaign_focus->load_relationship('emailmarketing');
    $mrkt_lists = $campaign_focus->emailmarketing->get();
    if (!empty($mrkt_lists)) {
        //reverse array so we always use the most recent one:
        $mrkt_lists = array_reverse($mrkt_lists);
        $mrkt_focus->retrieve($mrkt_lists[0]);
        $mrkt_focus->id = '';
        $mrkt_focus->name = $mod_strings['LBL_COPY_OF'] . ' ' . $mrkt_focus->name;
    }
}
$ss->assign("CALENDAR_LANG", "en");
$ss->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
$ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
$ss->assign("TIME_MERIDIEM", $timedate->AMPMMenu('', $mrkt_focus->time_start));
$ss->assign("MRKT_ID", $mrkt_focus->id);
$ss->assign("MRKT_NAME", $mrkt_focus->name);
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:WizardMarketing.php

示例2: elseif

    }
    //assign the modified dropdown for general campaign creation
    $ss->assign("CAMPAIGN_TYPE_OPTIONS", $type_option_html);
    $ss->assign("SHOULD_TYPE_BE_DISABLED", "select");
} elseif ($campaign_type == 'email') {
    //Assign Email as type of campaign being created an disable the select widget
    $ss->assign("CAMPAIGN_TYPE_OPTIONS", $mod_strings['LBL_EMAIL']);
    $ss->assign("SHOULD_TYPE_BE_DISABLED", "input type='hidden' value='Email'");
} else {
    //Assign NewsLetter as type of campaign being created an disable the select widget
    $ss->assign("CAMPAIGN_TYPE_OPTIONS", $mod_strings['LBL_NEWSLETTER']);
    $ss->assign("SHOULD_TYPE_BE_DISABLED", "input type='hidden' value='NewsLetter'");
}
/***************  TRACKER UI DIV Stuff ***************/
//retrieve the trackers
$focus->load_relationship('tracked_urls');
$trkr_lists = $focus->tracked_urls->get();
$trkr_html = '';
$ss->assign('TRACKER_COUNT', count($trkr_lists));
if (count($trkr_lists) > 0) {
    global $odd_bg, $even_bg, $hilite_bg;
    $trkr_count = 0;
    //create the html to create tracker table
    foreach ($trkr_lists as $trkr_id) {
        $ct_focus = new CampaignTracker();
        $ct_focus->retrieve($trkr_id);
        if (isset($ct_focus->tracker_name) && !empty($ct_focus->tracker_name)) {
            if ($ct_focus->is_optout) {
                $opt = 'checked';
            } else {
                $opt = '';
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:WizardNewsletter.php

示例3: populateFromPost

    $check_notify = FALSE;
}
require_once 'include/formbase.php';
$focus = populateFromPost('', $focus);
//store preformatted dates for 2nd save
$preformat_start_date = $focus->start_date;
$preformat_end_date = $focus->end_date;
//_ppd($preformat_end_date);
$focus->save($check_notify);
$return_id = $focus->id;
$GLOBALS['log']->debug("Saved record with id of " . $return_id);
//copy compaign targets on duplicate
if (!empty($_REQUEST['duplicateSave']) && !empty($_REQUEST['duplicateId'])) {
    $copyFromCompaign = new Campaign();
    $copyFromCompaign->retrieve($_REQUEST['duplicateId']);
    $copyFromCompaign->load_relationship('prospectlists');
    $focus->load_relationship('prospectlists');
    $target_lists = $copyFromCompaign->prospectlists->get();
    if (count($target_lists) > 0) {
        foreach ($target_lists as $prospect_list_id) {
            $focus->prospectlists->add($prospect_list_id);
        }
    }
    $focus->save();
}
//if type is set to newsletter then make sure there are propsect lists attached
if ($focus->campaign_type == 'NewsLetter') {
    //if this is a duplicate, and the "relate_to" and "relate_id" elements are not cleared out,
    //then prospect lists will get related to the original campaign on save of the prospect list, and then
    //will get related to the new newsletter campaign, meaning the same (un)subscription list will belong to
    //two campaigns, which is wrong
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:31,代码来源:Save.php


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