Пример #1
0
 public function testlist_view_parse_additional_sections()
 {
     error_reporting(E_ERROR | E_PARSE);
     $campaign = new Campaign();
     //test with attributes preset and verify template variables are set accordingly
     $tpl = new Sugar_Smarty();
     $campaign->list_view_parse_additional_sections($tpl);
     $this->assertEquals('', $tpl->_tpl_vars['ASSIGNED_USER_NAME']);
 }
Пример #2
0
$ss->assign("CAMP_END_DATE", $focus->end_date);
$ss->assign("CAMP_BUDGET", $focus->budget);
$ss->assign("CAMP_ACTUAL_COST", $focus->actual_cost);
$ss->assign("CAMP_EXPECTED_REVENUE", $focus->expected_revenue);
$ss->assign("CAMP_EXPECTED_COST", $focus->expected_cost);
$ss->assign("CAMP_OBJECTIVE", $focus->objective);
$ss->assign("CAMP_CONTENT", $focus->content);
$ss->assign("CAMP_NAME", $focus->name);
$ss->assign("CAMP_RECORD", $focus->id);
$ss->assign("CAMP_IMPRESSIONS", $focus->impressions);
if (empty($focus->assigned_user_id) && empty($focus->id))  $focus->assigned_user_id = $current_user->id;
if (empty($focus->assigned_name) && empty($focus->id))  $focus->assigned_user_name = $current_user->user_name;
$ss->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
//$ss->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);

$focus->list_view_parse_additional_sections($ss);

$ss->assign("ASSIGNED_USER_ID", $focus->assigned_user_id );

if((!isset($focus->status)) && (!isset($focus->id)))
    $ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], 'Planning'));
else
    $ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], $focus->status));

//hide frequency options if this is not a newsletter
if($campaign_type == 'newsletter'){
    $ss->assign("HIDE_FREQUENCY_IF_NEWSLETTER", "Select");
    $ss->assign("FREQUENCY_LABEL", $mod_strings['LBL_CAMPAIGN_FREQUENCY']);
    if((!isset($focus->frequency)) && (!isset($focus->id))){
        $ss->assign("FREQ_OPTIONS", get_select_options_with_id($app_list_strings['newsletter_frequency_dom'], 'Monthly'));
    }else{