Skip to content

Fix #6277 - Inline editing of the campaign description field doesn't work #10244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/Campaigns/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Campaign extends SugarBean
public $expected_revenue;
public $campaign_type;
public $objective;
public $content;
public $campaign_content;
public $tracker_key;
public $tracker_text;
public $tracker_count;
Expand Down
36 changes: 18 additions & 18 deletions modules/Campaigns/RoiDetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@

*/
echo getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_MODULE_NAME'],$focus->name), true);

$GLOBALS['log']->info("Campaign detail view");

$smarty = new Sugar_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);

$smarty->assign("THEME", $theme);
$smarty->assign("GRIDLINE", $gridline);
$smarty->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
Expand All @@ -97,18 +97,18 @@
$smarty->assign("TYPE", $app_list_strings['campaign_type_dom'][$focus->campaign_type]);
$smarty->assign("START_DATE", $focus->start_date);
$smarty->assign("END_DATE", $focus->end_date);

$smarty->assign("BUDGET", $focus->budget);
$smarty->assign("ACTUAL_COST", $focus->actual_cost);
$smarty->assign("EXPECTED_COST", $focus->expected_cost);
$smarty->assign("EXPECTED_REVENUE", $focus->expected_revenue);


$smarty->assign("OBJECTIVE", nl2br($focus->objective));
$smarty->assign("CONTENT", nl2br($focus->content));
$smarty->assign("CONTENT", nl2br($focus->campaign_content));
$smarty->assign("DATE_MODIFIED", $focus->date_modified);
$smarty->assign("DATE_ENTERED", $focus->date_entered);

$smarty->assign("CREATED_BY", $focus->created_by_name);
$smarty->assign("MODIFIED_BY", $focus->modified_by_name);
$smarty->assign("TRACKER_URL", $sugar_config['site_url'] . '/campaign_tracker.php?track=' . $focus->tracker_key);
Expand All @@ -121,7 +121,7 @@
$roi_vals['actual_cost']= $focus->actual_cost;
$roi_vals['Expected_Revenue']= $focus->expected_revenue;
$roi_vals['Expected_Cost']= $focus->expected_cost;

//Query for opportunities won, clickthroughs
$campaign_id = $focus->id;
$opp_query1 = "select camp.name, count(*) opp_count,SUM(opp.amount) as Revenue, SUM(camp.actual_cost) as Investment,
Expand All @@ -138,7 +138,7 @@
}

$smarty->assign("OPPORTUNITIES_WON", $opp_data1['opp_count']);

$camp_query1 = "select camp.name, count(*) click_thru_link";
$camp_query1 .= " from campaign_log camp_log";
$camp_query1 .= " right join campaigns camp on camp.id = camp_log.campaign_id";
Expand All @@ -147,7 +147,7 @@
$opp_query1 .= " and deleted=0";
$camp_result1=$focus->db->query($camp_query1);
$camp_data1=$focus->db->fetchByAssoc($camp_result1);

if (unformat_number($focus->impressions) > 0) {
$cost_per_impression= unformat_number($focus->actual_cost)/unformat_number($focus->impressions);
} else {
Expand All @@ -158,15 +158,15 @@
$camp_data1['click_thru_link']=0;
}
$click_thru_links = $camp_data1['click_thru_link'];

if ($click_thru_links >0) {
$cost_per_click_thru= unformat_number($focus->actual_cost)/unformat_number($click_thru_links);
} else {
$cost_per_click_thru = format_number(0);
}
$smarty->assign("COST_PER_CLICK_THROUGH", currency_format_number($cost_per_click_thru));


$currency = BeanFactory::newBean('Currencies');
if (isset($focus->currency_id) && !empty($focus->currency_id)) {
$currency->retrieve($focus->currency_id);
Expand All @@ -187,11 +187,11 @@
// adding custom fields:
$xtpl = $smarty;
require_once('modules/DynamicFields/templates/Files/DetailView.php');









//add chart
$seps = array("-", "/");
$dates = array(date($GLOBALS['timedate']->dbDayFormat), $GLOBALS['timedate']->dbDayFormat);
Expand Down
2 changes: 1 addition & 1 deletion modules/Campaigns/TrackDetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@


$smarty->assign("OBJECTIVE", nl2br($focus->objective));
$smarty->assign("CONTENT", nl2br($focus->content));
$smarty->assign("CONTENT", nl2br($focus->campaign_content));
$smarty->assign("DATE_MODIFIED", $focus->date_modified);
$smarty->assign("DATE_ENTERED", $focus->date_entered);

Expand Down
2 changes: 1 addition & 1 deletion modules/Campaigns/WizardNewsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
$ss->assign("CAMP_EXPECTED_COST", $focus->expected_cost);
$ss->assign("CAMP_OBJECTIVE", $focus->objective);
$ss->assign("OBJECTIVE", $focus->objective);
$ss->assign("CAMP_CONTENT", $focus->content);
$ss->assign("CAMP_CONTENT", $focus->campaign_content);
$ss->assign("CAMP_NAME", $focus->name);
$ss->assign("CAMP_RECORD", $focus->id);
$ss->assign("CAMP_IMPRESSIONS", $focus->impressions);
Expand Down
2 changes: 1 addition & 1 deletion modules/Campaigns/metadata/detailviewdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
array(
0 =>
array(
'name' => 'content',
'name' => 'campaign_content',
'label' => 'LBL_CAMPAIGN_CONTENT',
),
),
Expand Down
2 changes: 1 addition & 1 deletion modules/Campaigns/metadata/editviewdefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function ConvertItems(id) {ldelim}
array(
0 =>
array(
'name' => 'content',
'name' => 'campaign_content',
'displayParams' =>
array(
'rows' => 8,
Expand Down
6 changes: 3 additions & 3 deletions modules/Campaigns/vardefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@
'type' => 'text',
'comment' => 'The objective of the campaign'
),
'content' => array(
'name' => 'content',
'campaign_content' => array(
'name' => 'campaign_content',
'vname' => 'LBL_CAMPAIGN_CONTENT',
'type' => 'text',
'comment' => 'The campaign description',
'inline_edit' => false
'inline_edit' => true
),
'prospectlists' => array(
'name' => 'prospectlists',
Expand Down
2 changes: 1 addition & 1 deletion modules/vCals/HTTP_WebDAV_Server_vCal.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function http_PUT()
}

// set freebusy members and save
$this->vcal_focus->content = $content;
$this->vcal_focus->campaign_content = $content;
$this->vcal_focus->type = 'vfb';
$this->vcal_focus->source = $this->source;
$focus->date_modified = null;
Expand Down
2 changes: 1 addition & 1 deletion modules/vCals/vCal.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static function cache_sugar_vcal_freebusy(&$user_focus)
$focus->retrieve_by_string_fields($arr);


$focus->content = $focus->get_vcal_freebusy($user_focus, false);
$focus->campaign_content = $focus->get_vcal_freebusy($user_focus, false);
$focus->type = 'vfb';
$focus->date_modified = null;
$focus->source = 'sugar';
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/phpunit/modules/Campaigns/CampaignTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ public function testset_notification_body(): void
$campaign->budget = '1000';
$campaign->end_date = '10/01/2015';
$campaign->status = 'Planned';
$campaign->content = 'some text';
$campaign->campaign_content = 'some text';

$result = $campaign->set_notification_body(new Sugar_Smarty(), $campaign);

self::assertEquals($campaign->name, $result->tpl_vars['CAMPAIGN_NAME']->value);
self::assertEquals($campaign->budget, $result->tpl_vars['CAMPAIGN_AMOUNT']->value);
self::assertEquals($campaign->end_date, $result->tpl_vars['CAMPAIGN_CLOSEDATE']->value);
self::assertEquals($campaign->status, $result->tpl_vars['CAMPAIGN_STATUS']->value);
self::assertEquals($campaign->content, $result->tpl_vars['CAMPAIGN_DESCRIPTION']->value);
self::assertEquals($campaign->campaign_content, $result->tpl_vars['CAMPAIGN_DESCRIPTION']->value);
}

public function testtrack_log_leads(): void
Expand Down