@@ -79,46 +79,46 @@ |
||
79 | 79 | //$opp_query1 .= " and deleted=0"; |
80 | 80 | $opp_result1=$campaign->db->query($opp_query1); |
81 | 81 | $opp_data1=$campaign->db->fetchByAssoc($opp_result1); |
82 | - //get the click-throughs |
|
83 | - $query_click = "SELECT count(*) hits "; |
|
84 | - $query_click.= " FROM campaign_log "; |
|
85 | - $query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
82 | + //get the click-throughs |
|
83 | + $query_click = "SELECT count(*) hits "; |
|
84 | + $query_click.= " FROM campaign_log "; |
|
85 | + $query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
86 | 86 | |
87 | 87 | //if $marketing id is specified, then lets filter the chart by the value |
88 | 88 | if (!empty($marketing_id)){ |
89 | 89 | $query_click.= " AND marketing_id ='$marketing_id'"; |
90 | 90 | } |
91 | 91 | |
92 | - $query_click.= " GROUP BY activity_type, target_type"; |
|
93 | - $query_click.= " ORDER BY activity_type, target_type"; |
|
94 | - $result = $campaign->db->query($query_click); |
|
92 | + $query_click.= " GROUP BY activity_type, target_type"; |
|
93 | + $query_click.= " ORDER BY activity_type, target_type"; |
|
94 | + $result = $campaign->db->query($query_click); |
|
95 | 95 | |
96 | 96 | |
97 | - $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']); |
|
98 | - $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']); |
|
99 | - $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']); |
|
100 | - $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']); |
|
97 | + $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']); |
|
98 | + $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']); |
|
99 | + $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']); |
|
100 | + $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | - $currency = new Currency(); |
|
105 | + $currency = new Currency(); |
|
106 | 106 | if(isset($focus->currency_id) && !empty($focus->currency_id)) |
107 | 107 | { |
108 | - $currency->retrieve($focus->currency_id); |
|
109 | - if( $currency->deleted != 1){ |
|
110 | - $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
|
111 | - }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
108 | + $currency->retrieve($focus->currency_id); |
|
109 | + if( $currency->deleted != 1){ |
|
110 | + $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
|
111 | + }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
112 | 112 | }else{ |
113 | 113 | |
114 | - $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
114 | + $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | 118 | global $current_user; |
119 | 119 | if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){ |
120 | 120 | |
121 | - $xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
121 | + $xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -65,60 +65,60 @@ discard block |
||
65 | 65 | |
66 | 66 | $GLOBALS['log']->info("Campaign detail view"); |
67 | 67 | |
68 | -$xtpl=new XTemplate ('modules/Campaigns/PopupCampaignRoi.html'); |
|
68 | +$xtpl = new XTemplate('modules/Campaigns/PopupCampaignRoi.html'); |
|
69 | 69 | |
70 | 70 | //_pp($_REQUEST['id']); |
71 | -$campaign_id=$_REQUEST['id']; |
|
71 | +$campaign_id = $_REQUEST['id']; |
|
72 | 72 | $campaign = new Campaign(); |
73 | -$opp_query1 = "select camp.name, camp.actual_cost,camp.budget,camp.expected_revenue,count(*) opp_count,SUM(opp.amount) as Revenue, SUM(camp.actual_cost) as Investment, |
|
73 | +$opp_query1 = "select camp.name, camp.actual_cost,camp.budget,camp.expected_revenue,count(*) opp_count,SUM(opp.amount) as Revenue, SUM(camp.actual_cost) as Investment, |
|
74 | 74 | ROUND((SUM(opp.amount) - SUM(camp.actual_cost))/(SUM(camp.actual_cost)), 2)*100 as ROI"; |
75 | 75 | $opp_query1 .= " from opportunities opp"; |
76 | 76 | $opp_query1 .= " right join campaigns camp on camp.id = opp.campaign_id"; |
77 | 77 | $opp_query1 .= " where opp.sales_stage = 'Closed Won' and camp.id='$campaign_id'"; |
78 | 78 | $opp_query1 .= " group by camp.name"; |
79 | 79 | //$opp_query1 .= " and deleted=0"; |
80 | - $opp_result1=$campaign->db->query($opp_query1); |
|
81 | - $opp_data1=$campaign->db->fetchByAssoc($opp_result1); |
|
80 | + $opp_result1 = $campaign->db->query($opp_query1); |
|
81 | + $opp_data1 = $campaign->db->fetchByAssoc($opp_result1); |
|
82 | 82 | //get the click-throughs |
83 | 83 | $query_click = "SELECT count(*) hits "; |
84 | - $query_click.= " FROM campaign_log "; |
|
85 | - $query_click.= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
84 | + $query_click .= " FROM campaign_log "; |
|
85 | + $query_click .= " WHERE campaign_id = '$campaign_id' AND activity_type='link' AND related_type='CampaignTrackers' AND archived=0 AND deleted=0"; |
|
86 | 86 | |
87 | 87 | //if $marketing id is specified, then lets filter the chart by the value |
88 | - if (!empty($marketing_id)){ |
|
89 | - $query_click.= " AND marketing_id ='$marketing_id'"; |
|
88 | + if (!empty($marketing_id)) { |
|
89 | + $query_click .= " AND marketing_id ='$marketing_id'"; |
|
90 | 90 | } |
91 | 91 | |
92 | - $query_click.= " GROUP BY activity_type, target_type"; |
|
93 | - $query_click.= " ORDER BY activity_type, target_type"; |
|
92 | + $query_click .= " GROUP BY activity_type, target_type"; |
|
93 | + $query_click .= " ORDER BY activity_type, target_type"; |
|
94 | 94 | $result = $campaign->db->query($query_click); |
95 | 95 | |
96 | 96 | |
97 | 97 | $xtpl->assign("OPP_COUNT", $opp_data1['opp_count']); |
98 | - $xtpl->assign("ACTUAL_COST",$opp_data1['actual_cost']); |
|
99 | - $xtpl->assign("PLANNED_BUDGET",$opp_data1['budget']); |
|
100 | - $xtpl->assign("EXPECTED_REVENUE",$opp_data1['expected_revenue']); |
|
98 | + $xtpl->assign("ACTUAL_COST", $opp_data1['actual_cost']); |
|
99 | + $xtpl->assign("PLANNED_BUDGET", $opp_data1['budget']); |
|
100 | + $xtpl->assign("EXPECTED_REVENUE", $opp_data1['expected_revenue']); |
|
101 | 101 | |
102 | 102 | |
103 | 103 | |
104 | 104 | |
105 | - $currency = new Currency(); |
|
106 | -if(isset($focus->currency_id) && !empty($focus->currency_id)) |
|
105 | + $currency = new Currency(); |
|
106 | +if (isset($focus->currency_id) && !empty($focus->currency_id)) |
|
107 | 107 | { |
108 | 108 | $currency->retrieve($focus->currency_id); |
109 | - if( $currency->deleted != 1){ |
|
110 | - $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
|
111 | - }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
112 | -}else{ |
|
109 | + if ($currency->deleted != 1) { |
|
110 | + $xtpl->assign("CURRENCY", $currency->iso4217.' '.$currency->symbol); |
|
111 | + } else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217().' '.$currency->getDefaultCurrencySymbol()); |
|
112 | +} else { |
|
113 | 113 | |
114 | - $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
114 | + $xtpl->assign("CURRENCY", $currency->getDefaultISO4217().' '.$currency->getDefaultCurrencySymbol()); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
118 | 118 | global $current_user; |
119 | -if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){ |
|
119 | +if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) { |
|
120 | 120 | |
121 | - $xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif',$mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
121 | + $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action']."&from_module=".$_REQUEST['module']."&record=".$_REQUEST['record']."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 | |
@@ -171,23 +171,23 @@ discard block |
||
171 | 171 | */ |
172 | 172 | |
173 | 173 | //add chart |
174 | -$seps = array("-", "/"); |
|
175 | -$dates = array(date($GLOBALS['timedate']->dbDayFormat), $GLOBALS['timedate']->dbDayFormat); |
|
176 | -$dateFileNameSafe = str_replace($seps, "_", $dates); |
|
177 | -$cache_file_name_roi = $current_user->getUserPrivGuid()."_campaign_response_by_roi_".$dateFileNameSafe[0]."_".$dateFileNameSafe[1].".xml"; |
|
178 | -$chart= new campaign_charts(); |
|
174 | +$seps = array("-", "/"); |
|
175 | +$dates = array(date($GLOBALS['timedate']->dbDayFormat), $GLOBALS['timedate']->dbDayFormat); |
|
176 | +$dateFileNameSafe = str_replace($seps, "_", $dates); |
|
177 | +$cache_file_name_roi = $current_user->getUserPrivGuid()."_campaign_response_by_roi_".$dateFileNameSafe[0]."_".$dateFileNameSafe[1].".xml"; |
|
178 | +$chart = new campaign_charts(); |
|
179 | 179 | |
180 | 180 | //ob_start(); |
181 | 181 | |
182 | 182 | //if marketing id has been selected, then set "latest_marketing_id" to the selected value |
183 | 183 | //latest marketing id will be passed in to filter the charts and subpanels |
184 | 184 | |
185 | - if(!empty($selected_marketing_id)){$latest_marketing_id = $selected_marketing_id;} |
|
186 | - if(empty($latest_marketing_id) || $latest_marketing_id === 'all'){ |
|
187 | - $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") . $cache_file_name_roi,true)); |
|
188 | - }else{ |
|
185 | + if (!empty($selected_marketing_id)) {$latest_marketing_id = $selected_marketing_id; } |
|
186 | + if (empty($latest_marketing_id) || $latest_marketing_id === 'all') { |
|
187 | + $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'], $app_list_strings['roi_type_dom'], $campaign_id, sugar_cached("xml/").$cache_file_name_roi, true)); |
|
188 | + } else { |
|
189 | 189 | |
190 | - $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") .$cache_file_name_roi,true)); |
|
190 | + $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'], $app_list_strings['roi_type_dom'], $campaign_id, sugar_cached("xml/").$cache_file_name_roi, true)); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | //$output_html .= ob_get_contents(); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -108,8 +110,10 @@ discard block |
||
108 | 110 | $currency->retrieve($focus->currency_id); |
109 | 111 | if( $currency->deleted != 1){ |
110 | 112 | $xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol ); |
111 | - }else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
112 | -}else{ |
|
113 | + } else { |
|
114 | + $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
|
115 | + } |
|
116 | + } else{ |
|
113 | 117 | |
114 | 118 | $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() ); |
115 | 119 | |
@@ -185,7 +189,7 @@ discard block |
||
185 | 189 | if(!empty($selected_marketing_id)){$latest_marketing_id = $selected_marketing_id;} |
186 | 190 | if(empty($latest_marketing_id) || $latest_marketing_id === 'all'){ |
187 | 191 | $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") . $cache_file_name_roi,true)); |
188 | - }else{ |
|
192 | + } else{ |
|
189 | 193 | |
190 | 194 | $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") .$cache_file_name_roi,true)); |
191 | 195 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | //perform this if the option to create new mail box has been checked |
86 | 86 | if(isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox']=='1')){ |
87 | 87 | |
88 | - //Populate the Request variables that inboundemail expects |
|
88 | + //Populate the Request variables that inboundemail expects |
|
89 | 89 | $_REQUEST['mark_read'] = 1; |
90 | 90 | $_REQUEST['only_since'] = 1; |
91 | 91 | $_REQUEST['mailbox_type'] = 'bounce'; |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | function clean_up_post($prefix){ |
115 | 115 | |
116 | 116 | foreach ($_REQUEST as $key => $val) { |
117 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
118 | - $newkey =substr($key, strlen($prefix)) ; |
|
119 | - $_REQUEST[$newkey] = $val; |
|
120 | - } |
|
117 | + if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
118 | + $newkey =substr($key, strlen($prefix)) ; |
|
119 | + $_REQUEST[$newkey] = $val; |
|
120 | + } |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | foreach ($_POST as $key => $val) { |
124 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
125 | - $newkey =substr($key, strlen($prefix)) ; |
|
126 | - $_POST[$newkey] = $val; |
|
124 | + if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
125 | + $newkey =substr($key, strlen($prefix)) ; |
|
126 | + $_POST[$newkey] = $val; |
|
127 | 127 | |
128 | - } |
|
128 | + } |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -60,22 +60,22 @@ discard block |
||
60 | 60 | //name is used as key in post, it is also used in creation of summary page for wizard, |
61 | 61 | //so let's clean up the posting so we can reuse the save functionality for inbound emails and |
62 | 62 | //from existing save.php's |
63 | - foreach($camp_steps as $step){ |
|
63 | + foreach ($camp_steps as $step) { |
|
64 | 64 | clean_up_post($step); |
65 | 65 | } |
66 | 66 | /**************************** Save general Email Setup *****************************/ |
67 | 67 | |
68 | 68 | //we do not need to track location if location type is not set |
69 | -if(isset($_POST['tracking_entities_location_type'])) { |
|
69 | +if (isset($_POST['tracking_entities_location_type'])) { |
|
70 | 70 | if ($_POST['tracking_entities_location_type'] != '2') { |
71 | 71 | unset($_POST['tracking_entities_location']); |
72 | 72 | unset($_POST['tracking_entities_location_type']); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | //if the check box is empty, then set it to 0 |
76 | -if(!isset($_POST['mail_smtpauth_req'])) { $_POST['mail_smtpauth_req'] = 0; } |
|
76 | +if (!isset($_POST['mail_smtpauth_req'])) { $_POST['mail_smtpauth_req'] = 0; } |
|
77 | 77 | //default ssl use to false |
78 | -if(!isset($_POST['mail_smtpssl'])) { $_POST['mail_smtpssl'] = 0; } |
|
78 | +if (!isset($_POST['mail_smtpssl'])) { $_POST['mail_smtpssl'] = 0; } |
|
79 | 79 | //reuse existing saveconfig functionality |
80 | 80 | $focus->saveConfig(); |
81 | 81 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | /**************************** Add New Monitored Box *****************************/ |
85 | 85 | //perform this if the option to create new mail box has been checked |
86 | -if(isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox']=='1')){ |
|
86 | +if (isset($_REQUEST['wiz_new_mbox']) && ($_REQUEST['wiz_new_mbox'] == '1')) { |
|
87 | 87 | |
88 | 88 | //Populate the Request variables that inboundemail expects |
89 | 89 | $_REQUEST['mark_read'] = 1; |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | require_once('modules/InboundEmail/Save.php'); |
97 | 97 | |
98 | 98 | } |
99 | - if (!empty($_REQUEST['error'])){ |
|
99 | + if (!empty($_REQUEST['error'])) { |
|
100 | 100 | //an error was found during inbound save. This means the save was allowed but the inbound box had problems, return user to wizard |
101 | 101 | //and display error message |
102 | 102 | header("Location: index.php?action=WizardEmailSetup&module=Campaigns&error=true"); |
103 | - }else{ |
|
103 | + } else { |
|
104 | 104 | //set navigation details |
105 | 105 | header("Location: index.php?action=index&module=Campaigns"); |
106 | 106 | } |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | * which does not expect the prefix, and still use the generic create summary functionality in wizard, which |
112 | 112 | * does expect the prefix. |
113 | 113 | */ |
114 | -function clean_up_post($prefix){ |
|
114 | +function clean_up_post($prefix) { |
|
115 | 115 | |
116 | 116 | foreach ($_REQUEST as $key => $val) { |
117 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
118 | - $newkey =substr($key, strlen($prefix)) ; |
|
117 | + if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) { |
|
118 | + $newkey = substr($key, strlen($prefix)); |
|
119 | 119 | $_REQUEST[$newkey] = $val; |
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | 123 | foreach ($_POST as $key => $val) { |
124 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
125 | - $newkey =substr($key, strlen($prefix)) ; |
|
124 | + if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) { |
|
125 | + $newkey = substr($key, strlen($prefix)); |
|
126 | 126 | $_POST[$newkey] = $val; |
127 | 127 | |
128 | 128 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -100,7 +102,7 @@ discard block |
||
100 | 102 | //an error was found during inbound save. This means the save was allowed but the inbound box had problems, return user to wizard |
101 | 103 | //and display error message |
102 | 104 | header("Location: index.php?action=WizardEmailSetup&module=Campaigns&error=true"); |
103 | - }else{ |
|
105 | + } else{ |
|
104 | 106 | //set navigation details |
105 | 107 | header("Location: index.php?action=index&module=Campaigns"); |
106 | 108 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $campaign_focus = populateFromPost('', $campaign_focus); |
62 | 62 | |
63 | 63 | foreach($camp_steps as $step){ |
64 | - $campaign_focus = populate_wizard_bean_from_request($campaign_focus,$step); |
|
64 | + $campaign_focus = populate_wizard_bean_from_request($campaign_focus,$step); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | //save here so we can link relationships |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | //require_once('modules/Campaigns/WizardMarketing.php'); |
221 | 221 | $header_URL = "Location: index.php?return_module=Campaigns&module=Campaigns&action=".$action."&campaign_id=".$campaign_focus->id."&return_action=WizardNewsLetter&return_id=".$campaign_focus->id; |
222 | 222 | $GLOBALS['log']->debug("about to post header URL of: $header_URL"); |
223 | - header($header_URL); |
|
223 | + header($header_URL); |
|
224 | 224 | |
225 | 225 | |
226 | 226 | |
@@ -230,15 +230,15 @@ discard block |
||
230 | 230 | */ |
231 | 231 | function populate_wizard_bean_from_request($bean,$prefix){ |
232 | 232 | foreach($_REQUEST as $key=> $val){ |
233 | - $key = trim($key); |
|
234 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
235 | - $field =substr($key, strlen($prefix)) ; |
|
236 | - if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key])){ |
|
237 | - //echo "prefix is $prefix, field is $field, key is $key, and value is $val<br>"; |
|
238 | - $value = $_REQUEST[$key]; |
|
239 | - $bean->$field = $value; |
|
240 | - } |
|
241 | - } |
|
233 | + $key = trim($key); |
|
234 | + if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
235 | + $field =substr($key, strlen($prefix)) ; |
|
236 | + if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key])){ |
|
237 | + //echo "prefix is $prefix, field is $field, key is $key, and value is $val<br>"; |
|
238 | + $value = $_REQUEST[$key]; |
|
239 | + $bean->$field = $value; |
|
240 | + } |
|
241 | + } |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | return $bean; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | if($pl_subs->name == $_REQUEST['wiz_step3_subscription_name']){ |
265 | 265 | $pl_list[] = $pl_subs; |
266 | 266 | $create_new = false; |
267 | - } |
|
267 | + } |
|
268 | 268 | |
269 | 269 | } |
270 | 270 | //create new bio if one was not retrieved successfully |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | if($pl_un_subs->name == $_REQUEST['wiz_step3_unsubscription_name']){ |
293 | 293 | $pl_list[] = $pl_un_subs; |
294 | 294 | $create_new = false; |
295 | - } |
|
295 | + } |
|
296 | 296 | |
297 | 297 | } |
298 | 298 | //create new bean if one was not retrieved successfully |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | |
52 | 52 | //create new campaign bean and populate |
53 | 53 | $campaign_focus = new Campaign(); |
54 | - if(isset($_REQUEST['record']) && $_REQUEST['record'] && !(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id'])) { |
|
54 | + if (isset($_REQUEST['record']) && $_REQUEST['record'] && !(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id'])) { |
|
55 | 55 | $campaign_focus->retrieve($_REQUEST['record']); |
56 | 56 | } |
57 | - else if(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id']) { |
|
57 | + else if (isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id']) { |
|
58 | 58 | $campaign_focus->retrieve($_REQUEST['campaign_id']); |
59 | 59 | } |
60 | 60 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | |
64 | 64 | $campaign_focus = populateFromPost('', $campaign_focus); |
65 | 65 | |
66 | - foreach($camp_steps as $step){ |
|
67 | - $campaign_focus = populate_wizard_bean_from_request($campaign_focus,$step); |
|
66 | + foreach ($camp_steps as $step) { |
|
67 | + $campaign_focus = populate_wizard_bean_from_request($campaign_focus, $step); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | //save here so we can link relationships |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | //process prospect lists |
75 | 75 | |
76 | 76 | //process subscription lists if this is a newsletter |
77 | - if($campaign_focus->campaign_type =='NewsLetter'){ |
|
77 | + if ($campaign_focus->campaign_type == 'NewsLetter') { |
|
78 | 78 | $pl_list = process_subscriptions_from_request($campaign_focus->name); |
79 | 79 | |
80 | 80 | $campaign_focus->load_relationship('prospectlists'); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $ui_ids = array(); |
83 | 83 | |
84 | 84 | //for each list returned, add the list to the relationship |
85 | - foreach($pl_list as $pl){ |
|
85 | + foreach ($pl_list as $pl) { |
|
86 | 86 | $campaign_focus->prospectlists->add($pl->id); |
87 | 87 | //populate array with id's from UI' |
88 | 88 | $ui_ids[] = $pl->id; |
@@ -90,36 +90,36 @@ discard block |
||
90 | 90 | |
91 | 91 | //now remove the lists that may have existed before, but were not specified in UI. |
92 | 92 | //this will enforce that Newsletters only have 3 available target lists. |
93 | - foreach($existing_pls as $pl_del){ |
|
94 | - if (!in_array($pl_del, $ui_ids)){ |
|
93 | + foreach ($existing_pls as $pl_del) { |
|
94 | + if (!in_array($pl_del, $ui_ids)) { |
|
95 | 95 | $campaign_focus->prospectlists->delete($campaign_focus->id, $pl_del); |
96 | 96 | } |
97 | 97 | } |
98 | - }else{ |
|
98 | + } else { |
|
99 | 99 | //process target lists if this is not a newsletter |
100 | 100 | //remove Target Lists if defined |
101 | 101 | |
102 | - if(isset($_REQUEST['wiz_remove_target_list'])){ |
|
102 | + if (isset($_REQUEST['wiz_remove_target_list'])) { |
|
103 | 103 | |
104 | 104 | $remove_target_strings = explode(",", $_REQUEST['wiz_remove_target_list']); |
105 | - foreach($remove_target_strings as $remove_trgt_string){ |
|
106 | - if(!empty($remove_trgt_string)){ |
|
105 | + foreach ($remove_target_strings as $remove_trgt_string) { |
|
106 | + if (!empty($remove_trgt_string)) { |
|
107 | 107 | //load relationship and add to the list |
108 | 108 | $campaign_focus->load_relationship('prospectlists'); |
109 | - $campaign_focus->prospectlists->delete($campaign_focus->id,$remove_trgt_string); |
|
109 | + $campaign_focus->prospectlists->delete($campaign_focus->id, $remove_trgt_string); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | 114 | |
115 | 115 | //create new campaign tracker and save if defined |
116 | - if(isset($_REQUEST['wiz_list_of_targets'])){ |
|
116 | + if (isset($_REQUEST['wiz_list_of_targets'])) { |
|
117 | 117 | $target_strings = explode(",", $_REQUEST['wiz_list_of_targets']); |
118 | - foreach($target_strings as $trgt_string){ |
|
118 | + foreach ($target_strings as $trgt_string) { |
|
119 | 119 | $target_values = explode("@@", $trgt_string); |
120 | - if(count($target_values)==3){ |
|
120 | + if (count($target_values) == 3) { |
|
121 | 121 | |
122 | - if(!empty($target_values[0])){ |
|
122 | + if (!empty($target_values[0])) { |
|
123 | 123 | //this is a selected target, as the id is already populated, retrieve and link |
124 | 124 | $trgt_focus = new ProspectList(); |
125 | 125 | $trgt_focus->retrieve($target_values[0]); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | //load relationship and add to the list |
128 | 128 | $campaign_focus->load_relationship('prospectlists'); |
129 | 129 | $campaign_focus->prospectlists->add($trgt_focus ->id); |
130 | - }else{ |
|
130 | + } else { |
|
131 | 131 | |
132 | 132 | //this is a new target, as the id is not populated, need to create and link |
133 | 133 | $trgt_focus = new ProspectList(); |
@@ -152,27 +152,27 @@ discard block |
||
152 | 152 | |
153 | 153 | |
154 | 154 | //remove campaign trackers if defined |
155 | - if(isset($_REQUEST['wiz_remove_tracker_list'])){ |
|
155 | + if (isset($_REQUEST['wiz_remove_tracker_list'])) { |
|
156 | 156 | |
157 | 157 | $remove_tracker_strings = explode(",", $_REQUEST['wiz_remove_tracker_list']); |
158 | - foreach($remove_tracker_strings as $remove_trkr_string){ |
|
159 | - if(!empty($remove_trkr_string)){ |
|
158 | + foreach ($remove_tracker_strings as $remove_trkr_string) { |
|
159 | + if (!empty($remove_trkr_string)) { |
|
160 | 160 | //load relationship and add to the list |
161 | 161 | $campaign_focus->load_relationship('tracked_urls'); |
162 | - $campaign_focus->tracked_urls->delete($campaign_focus->id,$remove_trkr_string); |
|
162 | + $campaign_focus->tracked_urls->delete($campaign_focus->id, $remove_trkr_string); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
167 | 167 | |
168 | 168 | //save campaign trackers and save if defined |
169 | - if(isset($_REQUEST['wiz_list_of_existing_trackers'])){ |
|
169 | + if (isset($_REQUEST['wiz_list_of_existing_trackers'])) { |
|
170 | 170 | $tracker_strings = explode(",", $_REQUEST['wiz_list_of_existing_trackers']); |
171 | - foreach($tracker_strings as $trkr_string){ |
|
171 | + foreach ($tracker_strings as $trkr_string) { |
|
172 | 172 | $tracker_values = explode("@@", $trkr_string); |
173 | 173 | $ct_focus = new CampaignTracker(); |
174 | 174 | $ct_focus->retrieve($tracker_values[0]); |
175 | - if(!empty($ct_focus->tracker_name)){ |
|
175 | + if (!empty($ct_focus->tracker_name)) { |
|
176 | 176 | $ct_focus->tracker_name = $tracker_values[1]; |
177 | 177 | $ct_focus->is_optout = $tracker_values[2]; |
178 | 178 | $ct_focus->tracker_url = $tracker_values[3]; |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | |
188 | 188 | |
189 | 189 | //create new campaign tracker and save if defined |
190 | - if(isset($_REQUEST['wiz_list_of_trackers'])){ |
|
190 | + if (isset($_REQUEST['wiz_list_of_trackers'])) { |
|
191 | 191 | $tracker_strings = explode(",", $_REQUEST['wiz_list_of_trackers']); |
192 | - foreach($tracker_strings as $trkr_string){ |
|
192 | + foreach ($tracker_strings as $trkr_string) { |
|
193 | 193 | $tracker_values = explode("@@", $trkr_string); |
194 | - if(count($tracker_values)==3){ |
|
194 | + if (count($tracker_values) == 3) { |
|
195 | 195 | $ct_focus = new CampaignTracker(); |
196 | 196 | $ct_focus->tracker_name = $tracker_values[0]; |
197 | 197 | $ct_focus->is_optout = $tracker_values[1]; |
@@ -212,19 +212,19 @@ discard block |
||
212 | 212 | $_REQUEST['return_module'] = $campaign_focus->module_dir; |
213 | 213 | $_REQUEST['return_action'] = "WizardNewsLetter"; |
214 | 214 | $_REQUEST['action'] = "WizardMarketing"; |
215 | -$_REQUEST['record'] = $campaign_focus->id;; |
|
215 | +$_REQUEST['record'] = $campaign_focus->id; ; |
|
216 | 216 | |
217 | 217 | $action = ''; |
218 | 218 | $redirectToTargetList = ''; |
219 | -if(isset($_REQUEST['wiz_direction'])){ |
|
220 | - if($_REQUEST['wiz_direction']== 'continue') { |
|
219 | +if (isset($_REQUEST['wiz_direction'])) { |
|
220 | + if ($_REQUEST['wiz_direction'] == 'continue') { |
|
221 | 221 | $action = 'WizardMarketing'; |
222 | 222 | } |
223 | - else if($_REQUEST['wiz_direction'] == 'continue_targetList') { |
|
223 | + else if ($_REQUEST['wiz_direction'] == 'continue_targetList') { |
|
224 | 224 | $action = 'WizardMarketing'; |
225 | 225 | $redirectToTargetList = '&redirectToTargetList=1'; |
226 | 226 | } |
227 | -}else{ |
|
227 | +} else { |
|
228 | 228 | $action = 'WizardHome&record='.$campaign_focus->id; |
229 | 229 | } |
230 | 230 | //require_once('modules/Campaigns/WizardMarketing.php'); |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | * This function will populate the passed in bean with the post variables |
239 | 239 | * that contain the specified prefix |
240 | 240 | */ |
241 | -function populate_wizard_bean_from_request($bean,$prefix){ |
|
242 | - foreach($_REQUEST as $key=> $val){ |
|
241 | +function populate_wizard_bean_from_request($bean, $prefix) { |
|
242 | + foreach ($_REQUEST as $key=> $val) { |
|
243 | 243 | $key = trim($key); |
244 | - if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){ |
|
245 | - $field =substr($key, strlen($prefix)) ; |
|
246 | - if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key])){ |
|
244 | + if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) { |
|
245 | + $field = substr($key, strlen($prefix)); |
|
246 | + if (isset($_REQUEST[$key]) && !empty($_REQUEST[$key])) { |
|
247 | 247 | //echo "prefix is $prefix, field is $field, key is $key, and value is $val<br>"; |
248 | 248 | $value = $_REQUEST[$key]; |
249 | 249 | $bean->$field = $value; |
@@ -260,34 +260,34 @@ discard block |
||
260 | 260 | * If no prospect lists have been specified, then it will create one for you. A total of 3 prospect lists |
261 | 261 | * will be created for you (Subscription, Unsubscription, and test) |
262 | 262 | */ |
263 | -function process_subscriptions_from_request($campaign_name){ |
|
263 | +function process_subscriptions_from_request($campaign_name) { |
|
264 | 264 | global $mod_strings; |
265 | 265 | $pl_list = array(); |
266 | 266 | |
267 | 267 | //process default target list |
268 | 268 | $create_new = true; |
269 | 269 | $pl_subs = new ProspectList($campaign_name); |
270 | - if(!empty($_REQUEST['wiz_step3_subscription_list_id'])){ |
|
270 | + if (!empty($_REQUEST['wiz_step3_subscription_list_id'])) { |
|
271 | 271 | //if subscription list is specified then attach |
272 | 272 | $pl_subs->retrieve($_REQUEST['wiz_step3_subscription_list_id']); |
273 | 273 | //check to see name matches the bean, if not, then the user has chosen to create new bean |
274 | - if($pl_subs->name == $_REQUEST['wiz_step3_subscription_name']){ |
|
274 | + if ($pl_subs->name == $_REQUEST['wiz_step3_subscription_name']) { |
|
275 | 275 | $pl_list[] = $pl_subs; |
276 | 276 | $create_new = false; |
277 | 277 | } |
278 | 278 | |
279 | 279 | } |
280 | 280 | //create new bio if one was not retrieved successfully |
281 | - if($create_new){ |
|
281 | + if ($create_new) { |
|
282 | 282 | //use default name if one has not been specified |
283 | - $name = $campaign_name . " ".$mod_strings['LBL_SUBSCRIPTION_LIST']; |
|
284 | - if(isset($_REQUEST['wiz_step3_subscription_name']) && !empty($_REQUEST['wiz_step3_subscription_name'])){ |
|
283 | + $name = $campaign_name." ".$mod_strings['LBL_SUBSCRIPTION_LIST']; |
|
284 | + if (isset($_REQUEST['wiz_step3_subscription_name']) && !empty($_REQUEST['wiz_step3_subscription_name'])) { |
|
285 | 285 | $name = $_REQUEST['wiz_step3_subscription_name']; |
286 | 286 | } |
287 | 287 | //if subscription list is not specified then create and attach default one |
288 | 288 | $pl_subs->name = $name; |
289 | 289 | $pl_subs->list_type = 'default'; |
290 | - $pl_subs->assigned_user_id= $GLOBALS['current_user']->id; |
|
290 | + $pl_subs->assigned_user_id = $GLOBALS['current_user']->id; |
|
291 | 291 | $pl_subs->save(); |
292 | 292 | $pl_list[] = $pl_subs; |
293 | 293 | } |
@@ -295,27 +295,27 @@ discard block |
||
295 | 295 | //process exempt target list |
296 | 296 | $create_new = true; |
297 | 297 | $pl_un_subs = new ProspectList(); |
298 | - if(!empty($_REQUEST['wiz_step3_unsubscription_list_id'])){ |
|
298 | + if (!empty($_REQUEST['wiz_step3_unsubscription_list_id'])) { |
|
299 | 299 | //if unsubscription list is specified then attach |
300 | 300 | $pl_un_subs->retrieve($_REQUEST['wiz_step3_unsubscription_list_id']); |
301 | 301 | //check to see name matches the bean, if not, then the user has chosen to create new bean |
302 | - if($pl_un_subs->name == $_REQUEST['wiz_step3_unsubscription_name']){ |
|
302 | + if ($pl_un_subs->name == $_REQUEST['wiz_step3_unsubscription_name']) { |
|
303 | 303 | $pl_list[] = $pl_un_subs; |
304 | 304 | $create_new = false; |
305 | 305 | } |
306 | 306 | |
307 | 307 | } |
308 | 308 | //create new bean if one was not retrieved successfully |
309 | - if($create_new){ |
|
309 | + if ($create_new) { |
|
310 | 310 | //use default name if one has not been specified |
311 | - $name = $campaign_name . " ".$mod_strings['LBL_UNSUBSCRIPTION_LIST']; |
|
312 | - if(isset($_REQUEST['wiz_step3_unsubscription_name']) && !empty($_REQUEST['wiz_step3_unsubscription_name'])){ |
|
311 | + $name = $campaign_name." ".$mod_strings['LBL_UNSUBSCRIPTION_LIST']; |
|
312 | + if (isset($_REQUEST['wiz_step3_unsubscription_name']) && !empty($_REQUEST['wiz_step3_unsubscription_name'])) { |
|
313 | 313 | $name = $_REQUEST['wiz_step3_unsubscription_name']; |
314 | 314 | } |
315 | 315 | //if unsubscription list is not specified then create and attach default one |
316 | 316 | $pl_un_subs->name = $name; |
317 | 317 | $pl_un_subs->list_type = 'exempt'; |
318 | - $pl_un_subs->assigned_user_id= $GLOBALS['current_user']->id; |
|
318 | + $pl_un_subs->assigned_user_id = $GLOBALS['current_user']->id; |
|
319 | 319 | $pl_un_subs->save(); |
320 | 320 | $pl_list[] = $pl_un_subs; |
321 | 321 | } |
@@ -323,26 +323,26 @@ discard block |
||
323 | 323 | //process test target list |
324 | 324 | $pl_test = new ProspectList(); |
325 | 325 | $create_new = true; |
326 | - if(!empty($_REQUEST['wiz_step3_test_list_id'])){ |
|
326 | + if (!empty($_REQUEST['wiz_step3_test_list_id'])) { |
|
327 | 327 | //if test list is specified then attach |
328 | 328 | $pl_test->retrieve($_REQUEST['wiz_step3_test_list_id']); |
329 | 329 | //check to see name matches the bean, if not, then the user has chosen to create new bean |
330 | - if($pl_test->name == $_REQUEST['wiz_step3_test_name']){ |
|
330 | + if ($pl_test->name == $_REQUEST['wiz_step3_test_name']) { |
|
331 | 331 | $pl_list[] = $pl_test; |
332 | 332 | $create_new = false; |
333 | 333 | } |
334 | 334 | } |
335 | 335 | //create new bio if one was not retrieved successfully |
336 | - if($create_new){ |
|
336 | + if ($create_new) { |
|
337 | 337 | //use default name if one has not been specified |
338 | - $name = $campaign_name . " ".$mod_strings['LBL_TEST_LIST']; |
|
339 | - if(isset($_REQUEST['wiz_step3_test_name']) && !empty($_REQUEST['wiz_step3_test_name'])){ |
|
338 | + $name = $campaign_name." ".$mod_strings['LBL_TEST_LIST']; |
|
339 | + if (isset($_REQUEST['wiz_step3_test_name']) && !empty($_REQUEST['wiz_step3_test_name'])) { |
|
340 | 340 | $name = $_REQUEST['wiz_step3_test_name']; |
341 | 341 | } |
342 | 342 | //if test list is not specified then create and attach default one |
343 | 343 | $pl_test->name = $name; |
344 | 344 | $pl_test->list_type = 'test'; |
345 | - $pl_test->assigned_user_id= $GLOBALS['current_user']->id; |
|
345 | + $pl_test->assigned_user_id = $GLOBALS['current_user']->id; |
|
346 | 346 | $pl_test->save(); |
347 | 347 | $pl_list[] = $pl_test; |
348 | 348 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -53,8 +55,7 @@ discard block |
||
53 | 55 | $campaign_focus = new Campaign(); |
54 | 56 | if(isset($_REQUEST['record']) && $_REQUEST['record'] && !(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id'])) { |
55 | 57 | $campaign_focus->retrieve($_REQUEST['record']); |
56 | - } |
|
57 | - else if(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id']) { |
|
58 | + } else if(isset($_REQUEST['campaign_id']) && $_REQUEST['campaign_id']) { |
|
58 | 59 | $campaign_focus->retrieve($_REQUEST['campaign_id']); |
59 | 60 | } |
60 | 61 | |
@@ -95,7 +96,7 @@ discard block |
||
95 | 96 | $campaign_focus->prospectlists->delete($campaign_focus->id, $pl_del); |
96 | 97 | } |
97 | 98 | } |
98 | - }else{ |
|
99 | + } else{ |
|
99 | 100 | //process target lists if this is not a newsletter |
100 | 101 | //remove Target Lists if defined |
101 | 102 | |
@@ -127,7 +128,7 @@ discard block |
||
127 | 128 | //load relationship and add to the list |
128 | 129 | $campaign_focus->load_relationship('prospectlists'); |
129 | 130 | $campaign_focus->prospectlists->add($trgt_focus ->id); |
130 | - }else{ |
|
131 | + } else{ |
|
131 | 132 | |
132 | 133 | //this is a new target, as the id is not populated, need to create and link |
133 | 134 | $trgt_focus = new ProspectList(); |
@@ -219,12 +220,11 @@ discard block |
||
219 | 220 | if(isset($_REQUEST['wiz_direction'])){ |
220 | 221 | if($_REQUEST['wiz_direction']== 'continue') { |
221 | 222 | $action = 'WizardMarketing'; |
222 | - } |
|
223 | - else if($_REQUEST['wiz_direction'] == 'continue_targetList') { |
|
223 | + } else if($_REQUEST['wiz_direction'] == 'continue_targetList') { |
|
224 | 224 | $action = 'WizardMarketing'; |
225 | 225 | $redirectToTargetList = '&redirectToTargetList=1'; |
226 | 226 | } |
227 | -}else{ |
|
227 | +} else{ |
|
228 | 228 | $action = 'WizardHome&record='.$campaign_focus->id; |
229 | 229 | } |
230 | 230 | //require_once('modules/Campaigns/WizardMarketing.php'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $mod_strings = return_module_language($sugar_config['default_language'], 'Leads'); |
49 | 49 | |
50 | -$app_list_strings['record_type_module'] = array('Contact'=>'Contacts', 'Account'=>'Accounts', 'Opportunity'=>'Opportunities', 'Case'=>'Cases', 'Note'=>'Notes', 'Call'=>'Calls', 'Email'=>'Emails', 'Meeting'=>'Meetings', 'Task'=>'Tasks', 'Lead'=>'Leads','Bug'=>'Bugs', |
|
50 | +$app_list_strings['record_type_module'] = array('Contact'=>'Contacts', 'Account'=>'Accounts', 'Opportunity'=>'Opportunities', 'Case'=>'Cases', 'Note'=>'Notes', 'Call'=>'Calls', 'Email'=>'Emails', 'Meeting'=>'Meetings', 'Task'=>'Tasks', 'Lead'=>'Leads', 'Bug'=>'Bugs', |
|
51 | 51 | |
52 | 52 | ); |
53 | 53 | |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | if (isset($_POST['campaign_id']) && !empty($_POST['campaign_id'])) { |
62 | 62 | //adding the client ip address |
63 | 63 | $_POST['client_id_address'] = query_client_ip(); |
64 | - $campaign_id=$_POST['campaign_id']; |
|
64 | + $campaign_id = $_POST['campaign_id']; |
|
65 | 65 | $campaign = new Campaign(); |
66 | 66 | $camp_query = "select name,id from campaigns where id='$campaign_id'"; |
67 | 67 | $camp_query .= " and deleted=0"; |
68 | - $camp_result=$campaign->db->query($camp_query); |
|
68 | + $camp_result = $campaign->db->query($camp_query); |
|
69 | 69 | $camp_data = $campaign->db->fetchByAssoc($camp_result); |
70 | 70 | // Bug 41292 - have to select marketing_id for new lead |
71 | 71 | $db = DBManagerFactory::getInstance(); |
72 | 72 | $marketing = new EmailMarketing(); |
73 | 73 | $marketing_query = $marketing->create_new_list_query( |
74 | 74 | 'date_start desc, date_modified desc', |
75 | - "campaign_id = '{$campaign_id}' and status = 'active' and date_start < " . $db->convert('', 'today'), |
|
75 | + "campaign_id = '{$campaign_id}' and status = 'active' and date_start < ".$db->convert('', 'today'), |
|
76 | 76 | array('id') |
77 | 77 | ); |
78 | 78 | $marketing_result = $db->limitQuery($marketing_query, 0, 1, true); |
@@ -83,22 +83,22 @@ discard block |
||
83 | 83 | $current_user->retrieve($_REQUEST['assigned_user_id']); |
84 | 84 | } |
85 | 85 | |
86 | - if(isset($camp_data) && $camp_data != null ){ |
|
86 | + if (isset($camp_data) && $camp_data != null) { |
|
87 | 87 | $leadForm = new LeadFormBase(); |
88 | 88 | $lead = new Lead(); |
89 | 89 | $prefix = ''; |
90 | - if(!empty($_POST['prefix'])){ |
|
90 | + if (!empty($_POST['prefix'])) { |
|
91 | 91 | $prefix = $_POST['prefix']; |
92 | 92 | } |
93 | 93 | |
94 | - if(empty($lead->id)) { |
|
94 | + if (empty($lead->id)) { |
|
95 | 95 | $lead->id = create_guid(); |
96 | 96 | $lead->new_with_id = true; |
97 | 97 | } |
98 | 98 | $GLOBALS['check_notify'] = true; |
99 | 99 | |
100 | 100 | //bug: 47574 - make sure, that webtolead_email1 field has same required attribute as email1 field |
101 | - if(isset($lead->required_fields['email1'])){ |
|
101 | + if (isset($lead->required_fields['email1'])) { |
|
102 | 102 | $lead->required_fields['webtolead_email1'] = $lead->required_fields['email1']; |
103 | 103 | } |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // checkRequired needs a major overhaul before it works for web to lead forms. |
115 | 115 | $lead = $leadForm->handleSave($prefix, false, false, false, $lead); |
116 | 116 | |
117 | - if(!empty($lead)){ |
|
117 | + if (!empty($lead)) { |
|
118 | 118 | |
119 | 119 | //create campaign log |
120 | 120 | $camplog = new CampaignLog(); |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | $camplog->related_type = $lead->module_dir; |
124 | 124 | $camplog->activity_type = "lead"; |
125 | 125 | $camplog->target_type = $lead->module_dir; |
126 | - $campaign_log->activity_date=$timedate->now(); |
|
127 | - $camplog->target_id = $lead->id; |
|
128 | - if(isset($marketing_data['id'])) |
|
126 | + $campaign_log->activity_date = $timedate->now(); |
|
127 | + $camplog->target_id = $lead->id; |
|
128 | + if (isset($marketing_data['id'])) |
|
129 | 129 | { |
130 | 130 | $camplog->marketing_id = $marketing_data['id']; |
131 | 131 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $lead->load_relationship('campaigns'); |
157 | 157 | $lead->campaigns->add($camplog->id); |
158 | - if(!empty($GLOBALS['check_notify'])) { |
|
158 | + if (!empty($GLOBALS['check_notify'])) { |
|
159 | 159 | $lead->save($GLOBALS['check_notify']); |
160 | 160 | } |
161 | 161 | else { |
@@ -164,47 +164,47 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | //in case there are forms out there still using email_opt_out |
167 | - if(isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])){ |
|
167 | + if (isset($_POST['webtolead_email_opt_out']) || isset($_POST['email_opt_out'])) { |
|
168 | 168 | |
169 | - if(isset ($lead->email1) && !empty($lead->email1)){ |
|
169 | + if (isset ($lead->email1) && !empty($lead->email1)) { |
|
170 | 170 | $sea = new SugarEmailAddress(); |
171 | - $sea->AddUpdateEmailAddress($lead->email1,0,1); |
|
171 | + $sea->AddUpdateEmailAddress($lead->email1, 0, 1); |
|
172 | 172 | } |
173 | - if(isset ($lead->email2) && !empty($lead->email2)){ |
|
173 | + if (isset ($lead->email2) && !empty($lead->email2)) { |
|
174 | 174 | $sea = new SugarEmailAddress(); |
175 | - $sea->AddUpdateEmailAddress($lead->email2,0,1); |
|
175 | + $sea->AddUpdateEmailAddress($lead->email2, 0, 1); |
|
176 | 176 | |
177 | 177 | } |
178 | 178 | } |
179 | - if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){ |
|
179 | + if (isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])) { |
|
180 | 180 | // Get the redirect url, and make sure the query string is not too long |
181 | 181 | $redirect_url = $_POST['redirect_url']; |
182 | 182 | $query_string = ''; |
183 | 183 | $first_char = '&'; |
184 | - if(strpos($redirect_url, '?') === FALSE){ |
|
184 | + if (strpos($redirect_url, '?') === FALSE) { |
|
185 | 185 | $first_char = '?'; |
186 | 186 | } |
187 | 187 | $first_iteration = true; |
188 | 188 | $get_and_post = array_merge($_GET, $_POST); |
189 | - foreach($get_and_post as $param => $value) { |
|
189 | + foreach ($get_and_post as $param => $value) { |
|
190 | 190 | |
191 | - if($param == 'redirect_url' && $param == 'submit') |
|
191 | + if ($param == 'redirect_url' && $param == 'submit') |
|
192 | 192 | continue; |
193 | 193 | |
194 | - if($first_iteration){ |
|
194 | + if ($first_iteration) { |
|
195 | 195 | $first_iteration = false; |
196 | 196 | $query_string .= $first_char; |
197 | 197 | } |
198 | - else{ |
|
198 | + else { |
|
199 | 199 | $query_string .= "&"; |
200 | 200 | } |
201 | 201 | $query_string .= "{$param}=".urlencode($value); |
202 | 202 | } |
203 | - if(empty($lead)) { |
|
204 | - if($first_iteration){ |
|
203 | + if (empty($lead)) { |
|
204 | + if ($first_iteration) { |
|
205 | 205 | $query_string .= $first_char; |
206 | 206 | } |
207 | - else{ |
|
207 | + else { |
|
208 | 208 | $query_string .= "&"; |
209 | 209 | } |
210 | 210 | $query_string .= "error=1"; |
@@ -215,46 +215,46 @@ discard block |
||
215 | 215 | |
216 | 216 | // Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length) |
217 | 217 | // and use a javascript form submission if that is the case. |
218 | - if(headers_sent() || strlen($redirect_url) > 2083){ |
|
219 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
220 | - echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">'; |
|
218 | + if (headers_sent() || strlen($redirect_url) > 2083) { |
|
219 | + echo '<html '.get_language_header().'><head><title>SugarCRM</title></head><body>'; |
|
220 | + echo '<form name="redirect" action="'.$_POST['redirect_url'].'" method="GET">'; |
|
221 | 221 | |
222 | - foreach($_POST as $param => $value) { |
|
223 | - if($param != 'redirect_url' ||$param != 'submit') { |
|
222 | + foreach ($_POST as $param => $value) { |
|
223 | + if ($param != 'redirect_url' || $param != 'submit') { |
|
224 | 224 | echo '<input type="hidden" name="'.$param.'" value="'.$value.'">'; |
225 | 225 | } |
226 | 226 | } |
227 | - if(empty($lead)) { |
|
227 | + if (empty($lead)) { |
|
228 | 228 | echo '<input type="hidden" name="error" value="1">'; |
229 | 229 | } |
230 | 230 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
231 | 231 | echo '</body></html>'; |
232 | 232 | } |
233 | - else{ |
|
233 | + else { |
|
234 | 234 | header("Location: {$redirect_url}"); |
235 | 235 | die(); |
236 | 236 | } |
237 | 237 | } |
238 | - else{ |
|
238 | + else { |
|
239 | 239 | echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD']; |
240 | 240 | } |
241 | 241 | sugar_cleanup(); |
242 | 242 | // die to keep code from running into redirect case below |
243 | 243 | die(); |
244 | 244 | } |
245 | - else{ |
|
245 | + else { |
|
246 | 246 | echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE']; |
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | 250 | if (!empty($_POST['redirect'])) { |
251 | - if(headers_sent()){ |
|
252 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
253 | - echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">'; |
|
251 | + if (headers_sent()) { |
|
252 | + echo '<html '.get_language_header().'><head><title>SugarCRM</title></head><body>'; |
|
253 | + echo '<form name="redirect" action="'.$_POST['redirect'].'" method="GET">'; |
|
254 | 254 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
255 | 255 | echo '</body></html>'; |
256 | 256 | } |
257 | - else{ |
|
257 | + else { |
|
258 | 258 | header("Location: {$_POST['redirect']}"); |
259 | 259 | die(); |
260 | 260 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -157,8 +159,7 @@ discard block |
||
157 | 159 | $lead->campaigns->add($camplog->id); |
158 | 160 | if(!empty($GLOBALS['check_notify'])) { |
159 | 161 | $lead->save($GLOBALS['check_notify']); |
160 | - } |
|
161 | - else { |
|
162 | + } else { |
|
162 | 163 | $lead->save(FALSE); |
163 | 164 | } |
164 | 165 | } |
@@ -188,14 +189,14 @@ discard block |
||
188 | 189 | $get_and_post = array_merge($_GET, $_POST); |
189 | 190 | foreach($get_and_post as $param => $value) { |
190 | 191 | |
191 | - if($param == 'redirect_url' && $param == 'submit') |
|
192 | - continue; |
|
192 | + if($param == 'redirect_url' && $param == 'submit') { |
|
193 | + continue; |
|
194 | + } |
|
193 | 195 | |
194 | 196 | if($first_iteration){ |
195 | 197 | $first_iteration = false; |
196 | 198 | $query_string .= $first_char; |
197 | - } |
|
198 | - else{ |
|
199 | + } else{ |
|
199 | 200 | $query_string .= "&"; |
200 | 201 | } |
201 | 202 | $query_string .= "{$param}=".urlencode($value); |
@@ -203,8 +204,7 @@ discard block |
||
203 | 204 | if(empty($lead)) { |
204 | 205 | if($first_iteration){ |
205 | 206 | $query_string .= $first_char; |
206 | - } |
|
207 | - else{ |
|
207 | + } else{ |
|
208 | 208 | $query_string .= "&"; |
209 | 209 | } |
210 | 210 | $query_string .= "error=1"; |
@@ -229,20 +229,17 @@ discard block |
||
229 | 229 | } |
230 | 230 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
231 | 231 | echo '</body></html>'; |
232 | - } |
|
233 | - else{ |
|
232 | + } else{ |
|
234 | 233 | header("Location: {$redirect_url}"); |
235 | 234 | die(); |
236 | 235 | } |
237 | - } |
|
238 | - else{ |
|
236 | + } else{ |
|
239 | 237 | echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD']; |
240 | 238 | } |
241 | 239 | sugar_cleanup(); |
242 | 240 | // die to keep code from running into redirect case below |
243 | 241 | die(); |
244 | - } |
|
245 | - else{ |
|
242 | + } else{ |
|
246 | 243 | echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE']; |
247 | 244 | } |
248 | 245 | } |
@@ -253,8 +250,7 @@ discard block |
||
253 | 250 | echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">'; |
254 | 251 | echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
255 | 252 | echo '</body></html>'; |
256 | - } |
|
257 | - else{ |
|
253 | + } else{ |
|
258 | 254 | header("Location: {$_POST['redirect']}"); |
259 | 255 | die(); |
260 | 256 | } |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | * To make your changes upgrade safe create a file called leadCapture_override.php and place the changes there |
56 | 56 | */ |
57 | 57 | $users = array( |
58 | - 'PUT A RANDOM KEY FROM THE WEBSITE HERE' => array('name'=>'PUT THE USER_NAME HERE', 'pass'=>'PUT THE USER_HASH FOR THE RESPECTIVE USER HERE'), |
|
58 | + 'PUT A RANDOM KEY FROM THE WEBSITE HERE' => array('name'=>'PUT THE USER_NAME HERE', 'pass'=>'PUT THE USER_HASH FOR THE RESPECTIVE USER HERE'), |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | if (isset($_POST['campaign_id']) && !empty($_POST['campaign_id'])) { |
62 | - //adding the client ip address |
|
63 | - $_POST['client_id_address'] = query_client_ip(); |
|
64 | - $campaign_id=$_POST['campaign_id']; |
|
65 | - $campaign = new Campaign(); |
|
66 | - $camp_query = "select name,id from campaigns where id='$campaign_id'"; |
|
67 | - $camp_query .= " and deleted=0"; |
|
62 | + //adding the client ip address |
|
63 | + $_POST['client_id_address'] = query_client_ip(); |
|
64 | + $campaign_id=$_POST['campaign_id']; |
|
65 | + $campaign = new Campaign(); |
|
66 | + $camp_query = "select name,id from campaigns where id='$campaign_id'"; |
|
67 | + $camp_query .= " and deleted=0"; |
|
68 | 68 | $camp_result=$campaign->db->query($camp_query); |
69 | 69 | $camp_data = $campaign->db->fetchByAssoc($camp_result); |
70 | 70 | // Bug 41292 - have to select marketing_id for new lead |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | $marketing_result = $db->limitQuery($marketing_query, 0, 1, true); |
79 | 79 | $marketing_data = $db->fetchByAssoc($marketing_result); |
80 | 80 | // .Bug 41292 |
81 | - if (isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id'])) { |
|
82 | - $current_user = new User(); |
|
83 | - $current_user->retrieve($_REQUEST['assigned_user_id']); |
|
84 | - } |
|
81 | + if (isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id'])) { |
|
82 | + $current_user = new User(); |
|
83 | + $current_user->retrieve($_REQUEST['assigned_user_id']); |
|
84 | + } |
|
85 | 85 | |
86 | - if(isset($camp_data) && $camp_data != null ){ |
|
87 | - $leadForm = new LeadFormBase(); |
|
86 | + if(isset($camp_data) && $camp_data != null ){ |
|
87 | + $leadForm = new LeadFormBase(); |
|
88 | 88 | $lead = new Lead(); |
89 | - $prefix = ''; |
|
90 | - if(!empty($_POST['prefix'])){ |
|
91 | - $prefix = $_POST['prefix']; |
|
92 | - } |
|
89 | + $prefix = ''; |
|
90 | + if(!empty($_POST['prefix'])){ |
|
91 | + $prefix = $_POST['prefix']; |
|
92 | + } |
|
93 | 93 | |
94 | - if(empty($lead->id)) { |
|
94 | + if(empty($lead->id)) { |
|
95 | 95 | $lead->id = create_guid(); |
96 | 96 | $lead->new_with_id = true; |
97 | 97 | } |
@@ -114,47 +114,47 @@ discard block |
||
114 | 114 | // checkRequired needs a major overhaul before it works for web to lead forms. |
115 | 115 | $lead = $leadForm->handleSave($prefix, false, false, false, $lead); |
116 | 116 | |
117 | - if(!empty($lead)){ |
|
117 | + if(!empty($lead)){ |
|
118 | 118 | |
119 | - //create campaign log |
|
120 | - $camplog = new CampaignLog(); |
|
121 | - $camplog->campaign_id = $_POST['campaign_id']; |
|
122 | - $camplog->related_id = $lead->id; |
|
123 | - $camplog->related_type = $lead->module_dir; |
|
124 | - $camplog->activity_type = "lead"; |
|
125 | - $camplog->target_type = $lead->module_dir; |
|
126 | - $campaign_log->activity_date=$timedate->now(); |
|
127 | - $camplog->target_id = $lead->id; |
|
119 | + //create campaign log |
|
120 | + $camplog = new CampaignLog(); |
|
121 | + $camplog->campaign_id = $_POST['campaign_id']; |
|
122 | + $camplog->related_id = $lead->id; |
|
123 | + $camplog->related_type = $lead->module_dir; |
|
124 | + $camplog->activity_type = "lead"; |
|
125 | + $camplog->target_type = $lead->module_dir; |
|
126 | + $campaign_log->activity_date=$timedate->now(); |
|
127 | + $camplog->target_id = $lead->id; |
|
128 | 128 | if(isset($marketing_data['id'])) |
129 | 129 | { |
130 | 130 | $camplog->marketing_id = $marketing_data['id']; |
131 | 131 | } |
132 | - $camplog->save(); |
|
132 | + $camplog->save(); |
|
133 | 133 | |
134 | - //link campaignlog and lead |
|
134 | + //link campaignlog and lead |
|
135 | 135 | |
136 | - if (isset($_POST['email1']) && $_POST['email1'] != null) |
|
136 | + if (isset($_POST['email1']) && $_POST['email1'] != null) |
|
137 | 137 | { |
138 | 138 | $lead->email1 = $_POST['email1']; |
139 | - } |
|
139 | + } |
|
140 | 140 | //in case there are old forms used webtolead_email1 |
141 | 141 | elseif (isset($_POST['webtolead_email1']) && $_POST['webtolead_email1'] != null) |
142 | 142 | { |
143 | 143 | $lead->email1 = $_POST['webtolead_email1']; |
144 | 144 | } |
145 | 145 | |
146 | - if (isset($_POST['email2']) && $_POST['email2'] != null) |
|
146 | + if (isset($_POST['email2']) && $_POST['email2'] != null) |
|
147 | 147 | { |
148 | 148 | $lead->email2 = $_POST['email2']; |
149 | - } |
|
149 | + } |
|
150 | 150 | //in case there are old forms used webtolead_email2 |
151 | 151 | elseif (isset($_POST['webtolead_email2']) && $_POST['webtolead_email2'] != null) |
152 | 152 | { |
153 | 153 | $lead->email2 = $_POST['webtolead_email2']; |
154 | 154 | } |
155 | 155 | |
156 | - $lead->load_relationship('campaigns'); |
|
157 | - $lead->campaigns->add($camplog->id); |
|
156 | + $lead->load_relationship('campaigns'); |
|
157 | + $lead->campaigns->add($camplog->id); |
|
158 | 158 | if(!empty($GLOBALS['check_notify'])) { |
159 | 159 | $lead->save($GLOBALS['check_notify']); |
160 | 160 | } |
@@ -176,87 +176,87 @@ discard block |
||
176 | 176 | |
177 | 177 | } |
178 | 178 | } |
179 | - if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){ |
|
180 | - // Get the redirect url, and make sure the query string is not too long |
|
181 | - $redirect_url = $_POST['redirect_url']; |
|
182 | - $query_string = ''; |
|
183 | - $first_char = '&'; |
|
184 | - if(strpos($redirect_url, '?') === FALSE){ |
|
185 | - $first_char = '?'; |
|
186 | - } |
|
187 | - $first_iteration = true; |
|
188 | - $get_and_post = array_merge($_GET, $_POST); |
|
189 | - foreach($get_and_post as $param => $value) { |
|
179 | + if(isset($_POST['redirect_url']) && !empty($_POST['redirect_url'])){ |
|
180 | + // Get the redirect url, and make sure the query string is not too long |
|
181 | + $redirect_url = $_POST['redirect_url']; |
|
182 | + $query_string = ''; |
|
183 | + $first_char = '&'; |
|
184 | + if(strpos($redirect_url, '?') === FALSE){ |
|
185 | + $first_char = '?'; |
|
186 | + } |
|
187 | + $first_iteration = true; |
|
188 | + $get_and_post = array_merge($_GET, $_POST); |
|
189 | + foreach($get_and_post as $param => $value) { |
|
190 | 190 | |
191 | - if($param == 'redirect_url' && $param == 'submit') |
|
192 | - continue; |
|
191 | + if($param == 'redirect_url' && $param == 'submit') |
|
192 | + continue; |
|
193 | 193 | |
194 | - if($first_iteration){ |
|
195 | - $first_iteration = false; |
|
196 | - $query_string .= $first_char; |
|
197 | - } |
|
198 | - else{ |
|
199 | - $query_string .= "&"; |
|
200 | - } |
|
201 | - $query_string .= "{$param}=".urlencode($value); |
|
202 | - } |
|
203 | - if(empty($lead)) { |
|
204 | - if($first_iteration){ |
|
205 | - $query_string .= $first_char; |
|
206 | - } |
|
207 | - else{ |
|
208 | - $query_string .= "&"; |
|
209 | - } |
|
210 | - $query_string .= "error=1"; |
|
211 | - } |
|
194 | + if($first_iteration){ |
|
195 | + $first_iteration = false; |
|
196 | + $query_string .= $first_char; |
|
197 | + } |
|
198 | + else{ |
|
199 | + $query_string .= "&"; |
|
200 | + } |
|
201 | + $query_string .= "{$param}=".urlencode($value); |
|
202 | + } |
|
203 | + if(empty($lead)) { |
|
204 | + if($first_iteration){ |
|
205 | + $query_string .= $first_char; |
|
206 | + } |
|
207 | + else{ |
|
208 | + $query_string .= "&"; |
|
209 | + } |
|
210 | + $query_string .= "error=1"; |
|
211 | + } |
|
212 | 212 | |
213 | - $redirect_url = $redirect_url.$query_string; |
|
213 | + $redirect_url = $redirect_url.$query_string; |
|
214 | 214 | |
215 | 215 | |
216 | - // Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length) |
|
217 | - // and use a javascript form submission if that is the case. |
|
218 | - if(headers_sent() || strlen($redirect_url) > 2083){ |
|
219 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
220 | - echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">'; |
|
216 | + // Check if the headers have been sent, or if the redirect url is greater than 2083 characters (IE max URL length) |
|
217 | + // and use a javascript form submission if that is the case. |
|
218 | + if(headers_sent() || strlen($redirect_url) > 2083){ |
|
219 | + echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
220 | + echo '<form name="redirect" action="' .$_POST['redirect_url']. '" method="GET">'; |
|
221 | 221 | |
222 | - foreach($_POST as $param => $value) { |
|
223 | - if($param != 'redirect_url' ||$param != 'submit') { |
|
224 | - echo '<input type="hidden" name="'.$param.'" value="'.$value.'">'; |
|
225 | - } |
|
226 | - } |
|
227 | - if(empty($lead)) { |
|
228 | - echo '<input type="hidden" name="error" value="1">'; |
|
229 | - } |
|
230 | - echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
|
231 | - echo '</body></html>'; |
|
232 | - } |
|
233 | - else{ |
|
234 | - header("Location: {$redirect_url}"); |
|
235 | - die(); |
|
236 | - } |
|
237 | - } |
|
238 | - else{ |
|
239 | - echo $mod_strings['LBL_THANKS_FOR_SUBMITTING']; |
|
240 | - } |
|
241 | - sugar_cleanup(); |
|
242 | - // die to keep code from running into redirect case below |
|
243 | - die(); |
|
244 | - } |
|
245 | - else{ |
|
246 | - echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE']; |
|
247 | - } |
|
222 | + foreach($_POST as $param => $value) { |
|
223 | + if($param != 'redirect_url' ||$param != 'submit') { |
|
224 | + echo '<input type="hidden" name="'.$param.'" value="'.$value.'">'; |
|
225 | + } |
|
226 | + } |
|
227 | + if(empty($lead)) { |
|
228 | + echo '<input type="hidden" name="error" value="1">'; |
|
229 | + } |
|
230 | + echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
|
231 | + echo '</body></html>'; |
|
232 | + } |
|
233 | + else{ |
|
234 | + header("Location: {$redirect_url}"); |
|
235 | + die(); |
|
236 | + } |
|
237 | + } |
|
238 | + else{ |
|
239 | + echo $mod_strings['LBL_THANKS_FOR_SUBMITTING']; |
|
240 | + } |
|
241 | + sugar_cleanup(); |
|
242 | + // die to keep code from running into redirect case below |
|
243 | + die(); |
|
244 | + } |
|
245 | + else{ |
|
246 | + echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE']; |
|
247 | + } |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | if (!empty($_POST['redirect'])) { |
251 | 251 | if(headers_sent()){ |
252 | - echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
253 | - echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">'; |
|
254 | - echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
|
255 | - echo '</body></html>'; |
|
252 | + echo '<html ' . get_language_header() . '><head><title>SugarCRM</title></head><body>'; |
|
253 | + echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">'; |
|
254 | + echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; |
|
255 | + echo '</body></html>'; |
|
256 | 256 | } |
257 | 257 | else{ |
258 | - header("Location: {$_POST['redirect']}"); |
|
259 | - die(); |
|
258 | + header("Location: {$_POST['redirect']}"); |
|
259 | + die(); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 |
@@ -66,8 +66,8 @@ |
||
66 | 66 | $test_ids = array(); |
67 | 67 | $test_list_ids = array(); |
68 | 68 | while($row = $focus->db->fetchByAssoc($res)) { |
69 | - $test_ids[] = $row['emailid']; |
|
70 | - $test_list_ids[$row['listid']] = true; |
|
69 | + $test_ids[] = $row['emailid']; |
|
70 | + $test_list_ids[$row['listid']] = true; |
|
71 | 71 | } |
72 | 72 | $test_list_ids = array_keys($test_list_ids); |
73 | 73 | unset($res); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function deleteTestRecords($focus) |
57 | 57 | { |
58 | - if(empty($focus) || empty($focus->id)) |
|
58 | + if (empty($focus) || empty($focus->id)) |
|
59 | 59 | { |
60 | 60 | return; |
61 | 61 | } |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | WHERE campaign_log.campaign_id = '{$focus->id}' AND prospect_lists.list_type='test'"); |
66 | 66 | $test_ids = array(); |
67 | 67 | $test_list_ids = array(); |
68 | - while($row = $focus->db->fetchByAssoc($res)) { |
|
68 | + while ($row = $focus->db->fetchByAssoc($res)) { |
|
69 | 69 | $test_ids[] = $row['emailid']; |
70 | 70 | $test_list_ids[$row['listid']] = true; |
71 | 71 | } |
72 | 72 | $test_list_ids = array_keys($test_list_ids); |
73 | 73 | unset($res); |
74 | - if(!empty($test_ids)) { |
|
74 | + if (!empty($test_ids)) { |
|
75 | 75 | $focus->db->query("UPDATE emails SET deleted=1 WHERE id IN ('".join("','", $test_ids)."')"); |
76 | 76 | } |
77 | 77 | |
78 | - if(!empty($test_list_ids)) { |
|
78 | + if (!empty($test_list_ids)) { |
|
79 | 79 | $query = "DELETE FROM emailman WHERE campaign_id = '{$focus->id}' AND list_id IN ('".join("','", $test_list_ids)."')"; |
80 | 80 | $focus->db->query($query); |
81 | 81 |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | if(isset($mbox) && count($mbox)>0){ |
138 | 138 | $mboxTable .= "<tr><td colspan='5'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
139 | 139 | $mboxTable .= "<tr class='listViewHRS1'><td width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></td>" |
140 | - . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
|
141 | - . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
|
142 | - . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
|
143 | - . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
|
140 | + . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
|
141 | + . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
|
142 | + . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
|
143 | + . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
|
144 | 144 | $colorclass=' '; |
145 | 145 | foreach($mbox as $details){ |
146 | 146 | |
147 | - if( $colorclass == "class='evenListRowS1'"){ |
|
147 | + if( $colorclass == "class='evenListRowS1'"){ |
|
148 | 148 | $colorclass= "class='oddListRowS1'"; |
149 | 149 | }else{ |
150 | 150 | $colorclass= "class='evenListRowS1'"; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | /**************************** WIZARD UI DIV Stuff *******************/ |
176 | 176 | |
177 | 177 | // this is the wizard control script that resides in page |
178 | - $divScript = <<<EOQ |
|
178 | + $divScript = <<<EOQ |
|
179 | 179 | <script type="text/javascript" language="javascript"> |
180 | 180 | |
181 | 181 | //this function toggles visibility of fields based on selected options |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | -global $mod_strings,$app_list_strings,$app_strings,$current_user; |
|
55 | +global $mod_strings, $app_list_strings, $app_strings, $current_user; |
|
56 | 56 | |
57 | 57 | |
58 | -if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
58 | +if (!is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'], 'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
59 | 59 | |
60 | 60 | $params = array(); |
61 | 61 | $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
@@ -101,25 +101,25 @@ discard block |
||
101 | 101 | $ss->assign('PROTOCOL', get_select_options_with_id($protocol, '')); |
102 | 102 | if (isset($focus->settings['massemailer_campaign_emails_per_run']) && !empty($focus->settings['massemailer_campaign_emails_per_run'])) { |
103 | 103 | $ss->assign("EMAILS_PER_RUN", $focus->settings['massemailer_campaign_emails_per_run']); |
104 | -} else { |
|
104 | +} else { |
|
105 | 105 | $ss->assign("EMAILS_PER_RUN", 500); |
106 | 106 | } |
107 | 107 | |
108 | -if (!isset($focus->settings['massemailer_tracking_entities_location_type']) or empty($focus->settings['massemailer_tracking_entities_location_type']) or $focus->settings['massemailer_tracking_entities_location_type']=='1') { |
|
108 | +if (!isset($focus->settings['massemailer_tracking_entities_location_type']) or empty($focus->settings['massemailer_tracking_entities_location_type']) or $focus->settings['massemailer_tracking_entities_location_type'] == '1') { |
|
109 | 109 | $ss->assign("DEFAULT_CHECKED", "checked"); |
110 | 110 | $ss->assign("TRACKING_ENTRIES_LOCATION_STATE", "disabled"); |
111 | - $ss->assign("TRACKING_ENTRIES_LOCATION",$mod_strings['TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE']); |
|
112 | -} else { |
|
111 | + $ss->assign("TRACKING_ENTRIES_LOCATION", $mod_strings['TRACKING_ENTRIES_LOCATION_DEFAULT_VALUE']); |
|
112 | +} else { |
|
113 | 113 | $ss->assign("USERDEFINED_CHECKED", "checked"); |
114 | - $ss->assign("TRACKING_ENTRIES_LOCATION",$focus->settings["massemailer_tracking_entities_location"]); |
|
114 | + $ss->assign("TRACKING_ENTRIES_LOCATION", $focus->settings["massemailer_tracking_entities_location"]); |
|
115 | 115 | } |
116 | 116 | |
117 | -$ss->assign("SITEURL",$sugar_config['site_url']); |
|
117 | +$ss->assign("SITEURL", $sugar_config['site_url']); |
|
118 | 118 | |
119 | 119 | // Change the default campaign to not store a copy of each message. |
120 | -if (!empty($focus->settings['massemailer_email_copy']) and $focus->settings['massemailer_email_copy']=='1') { |
|
120 | +if (!empty($focus->settings['massemailer_email_copy']) and $focus->settings['massemailer_email_copy'] == '1') { |
|
121 | 121 | $ss->assign("YES_CHECKED", "checked='checked'"); |
122 | -} else { |
|
122 | +} else { |
|
123 | 123 | $ss->assign("NO_CHECKED", "checked='checked'"); |
124 | 124 | } |
125 | 125 | |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | /*********** New Mail Box UI DIV Stuff ****************/ |
130 | 130 | $mbox_qry = "select * from inbound_email where deleted ='0' and mailbox_type = 'bounce'"; |
131 | 131 | $mbox_res = $focus->db->query($mbox_qry); |
132 | -while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)){$mbox[] = $mbox_row;} |
|
132 | +while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)) {$mbox[] = $mbox_row; } |
|
133 | 133 | $mbox_msg = ' '; |
134 | 134 | $need_mbox = ''; |
135 | 135 | |
136 | 136 | $mboxTable = "<table class='list view' width='100%' border='0' cellspacing='1' cellpadding='1'>"; |
137 | -if(isset($mbox) && count($mbox)>0){ |
|
138 | - $mboxTable .= "<tr><td colspan='5'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
|
137 | +if (isset($mbox) && count($mbox) > 0) { |
|
138 | + $mboxTable .= "<tr><td colspan='5'><b>".count($mbox)." ".$mod_strings['LBL_MAILBOX_CHECK_WIZ_GOOD']." </b>.</td></tr>"; |
|
139 | 139 | $mboxTable .= "<tr class='listViewHRS1'><td width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></td>" |
140 | 140 | . " <td width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></td>" |
141 | 141 | . " <td width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></td>" |
142 | 142 | . " <td width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></td>" |
143 | 143 | . " <td width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></td></tr>"; |
144 | - $colorclass=' '; |
|
145 | - foreach($mbox as $details){ |
|
144 | + $colorclass = ' '; |
|
145 | + foreach ($mbox as $details) { |
|
146 | 146 | |
147 | - if( $colorclass == "class='evenListRowS1'"){ |
|
148 | - $colorclass= "class='oddListRowS1'"; |
|
149 | - }else{ |
|
150 | - $colorclass= "class='evenListRowS1'"; |
|
147 | + if ($colorclass == "class='evenListRowS1'") { |
|
148 | + $colorclass = "class='oddListRowS1'"; |
|
149 | + } else { |
|
150 | + $colorclass = "class='evenListRowS1'"; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $mboxTable .= "<tr $colorclass>"; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | |
162 | -}else{ |
|
162 | +} else { |
|
163 | 163 | $need_mbox = 'checked'; |
164 | 164 | $mboxTable .= "<tr><td colspan='5'><b>".$mod_strings['LBL_MAILBOX_CHECK_WIZ_BAD']." </b>.</td></tr>"; |
165 | 165 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $ss->assign("MAILBOXES_DETECTED_MESSAGE", $mboxTable); |
168 | 168 | $ss->assign("MBOX_NEEDED", $need_mbox); |
169 | 169 | $ss->assign('ROLLOVER', $email->rolloverStyle); |
170 | -if(!function_exists('imap_open')) { |
|
170 | +if (!function_exists('imap_open')) { |
|
171 | 171 | $ss->assign('IE_DISABLED', 'DISABLED'); |
172 | 172 | } |
173 | 173 | /**************************** SUMMARY UI DIV Stuff *******************/ |
@@ -406,13 +406,13 @@ discard block |
||
406 | 406 | </script> |
407 | 407 | EOQ; |
408 | 408 | |
409 | -if(isset($_REQUEST['error'])){ |
|
409 | +if (isset($_REQUEST['error'])) { |
|
410 | 410 | //if there is an error flagged, then we are coming here after a save where there was an error detected |
411 | 411 | //on an inbound email save. Display error to user so they are aware. |
412 | 412 | $errorString = "<div class='error'>".$mod_strings['ERR_NO_OPTS_SAVED']." <a href='index.php?module=InboundEmail&action=index'>".$mod_strings['ERR_REVIEW_EMAIL_SETTINGS']."</a></div>"; |
413 | 413 | $ss->assign('ERROR', $errorString); |
414 | 414 | //navigate to inbound email page by default |
415 | - $divScript .=" <script>navigate('next');</script>"; |
|
415 | + $divScript .= " <script>navigate('next');</script>"; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $ss->assign("DIV_JAVASCRIPT", $divScript); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,7 +57,9 @@ discard block |
||
55 | 57 | global $mod_strings,$app_list_strings,$app_strings,$current_user; |
56 | 58 | |
57 | 59 | |
58 | -if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) sugar_die("Unauthorized access to administration."); |
|
60 | +if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) { |
|
61 | + sugar_die("Unauthorized access to administration."); |
|
62 | +} |
|
59 | 63 | |
60 | 64 | $params = array(); |
61 | 65 | $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
@@ -78,9 +82,15 @@ discard block |
||
78 | 82 | $ss = new Sugar_Smarty(); |
79 | 83 | $ss->assign("MOD", $mod_strings); |
80 | 84 | $ss->assign("APP", $app_strings); |
81 | -if (isset($_REQUEST['return_module'])) $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
82 | -if (isset($_REQUEST['return_action'])) $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
83 | -if (isset($_REQUEST['return_id'])) $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
85 | +if (isset($_REQUEST['return_module'])) { |
|
86 | + $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
87 | +} |
|
88 | +if (isset($_REQUEST['return_action'])) { |
|
89 | + $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
90 | +} |
|
91 | +if (isset($_REQUEST['return_id'])) { |
|
92 | + $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
93 | +} |
|
84 | 94 | |
85 | 95 | |
86 | 96 | |
@@ -146,7 +156,7 @@ discard block |
||
146 | 156 | |
147 | 157 | if( $colorclass == "class='evenListRowS1'"){ |
148 | 158 | $colorclass= "class='oddListRowS1'"; |
149 | - }else{ |
|
159 | + } else{ |
|
150 | 160 | $colorclass= "class='evenListRowS1'"; |
151 | 161 | } |
152 | 162 | |
@@ -159,7 +169,7 @@ discard block |
||
159 | 169 | } |
160 | 170 | |
161 | 171 | |
162 | -}else{ |
|
172 | +} else{ |
|
163 | 173 | $need_mbox = 'checked'; |
164 | 174 | $mboxTable .= "<tr><td colspan='5'><b>".$mod_strings['LBL_MAILBOX_CHECK_WIZ_BAD']." </b>.</td></tr>"; |
165 | 175 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $query = "SELECT description FROM notes WHERE file_mime_type = 'messsage/rfc822' AND parent_type='Emails' AND parent_id = '".$email->id."' AND deleted=0"; |
57 | 57 | $rs = $GLOBALS['db']->query($query); |
58 | 58 | while ($row = $GLOBALS['db']->fetchByAssoc($rs)) |
59 | - $contents .= $row['description']; |
|
59 | + $contents .= $row['description']; |
|
60 | 60 | |
61 | 61 | return $contents; |
62 | 62 | } |
@@ -162,80 +162,80 @@ discard block |
||
162 | 162 | |
163 | 163 | function campaign_process_bounced_emails(&$email, &$email_header) |
164 | 164 | { |
165 | - global $sugar_config; |
|
166 | - $emailFromAddress = $email_header->fromaddress; |
|
167 | - $email_description = $email->raw_source; |
|
165 | + global $sugar_config; |
|
166 | + $emailFromAddress = $email_header->fromaddress; |
|
167 | + $email_description = $email->raw_source; |
|
168 | 168 | |
169 | - //if raw_source is empty, try using the description instead |
|
170 | - if (empty($email_description)){ |
|
171 | - $email_description = $email->description; |
|
172 | - } |
|
169 | + //if raw_source is empty, try using the description instead |
|
170 | + if (empty($email_description)){ |
|
171 | + $email_description = $email->description; |
|
172 | + } |
|
173 | 173 | |
174 | 174 | $email_description .= retrieveErrorReportAttachment($email); |
175 | 175 | |
176 | - if (preg_match('/MAILER-DAEMON|POSTMASTER/i',$emailFromAddress)) |
|
177 | - { |
|
178 | - $email_description=quoted_printable_decode($email_description); |
|
179 | - $matches=array(); |
|
176 | + if (preg_match('/MAILER-DAEMON|POSTMASTER/i',$emailFromAddress)) |
|
177 | + { |
|
178 | + $email_description=quoted_printable_decode($email_description); |
|
179 | + $matches=array(); |
|
180 | 180 | |
181 | - //do we have the identifier tag in the email? |
|
182 | - $identifierScanResults = checkBouncedEmailForIdentifier($email_description); |
|
181 | + //do we have the identifier tag in the email? |
|
182 | + $identifierScanResults = checkBouncedEmailForIdentifier($email_description); |
|
183 | 183 | |
184 | - if ( $identifierScanResults['found'] ) |
|
185 | - { |
|
186 | - $matches = $identifierScanResults['matches']; |
|
187 | - $identifiers = $identifierScanResults['identifiers']; |
|
188 | - |
|
189 | - if (!empty($identifiers)) |
|
190 | - { |
|
191 | - //array should have only one element in it. |
|
192 | - $identifier = trim($identifiers[0]); |
|
193 | - $row = getExistingCampaignLogEntry($identifier); |
|
184 | + if ( $identifierScanResults['found'] ) |
|
185 | + { |
|
186 | + $matches = $identifierScanResults['matches']; |
|
187 | + $identifiers = $identifierScanResults['identifiers']; |
|
188 | + |
|
189 | + if (!empty($identifiers)) |
|
190 | + { |
|
191 | + //array should have only one element in it. |
|
192 | + $identifier = trim($identifiers[0]); |
|
193 | + $row = getExistingCampaignLogEntry($identifier); |
|
194 | 194 | |
195 | - //Found entry |
|
196 | - if (!empty($row)) |
|
197 | - { |
|
198 | - //do not create another campaign_log record is we already have an |
|
199 | - //invalid email or send error entry for this tracker key. |
|
200 | - $query_log = "select * from campaign_log where target_tracker_key='{$row['target_tracker_key']}'"; |
|
201 | - $query_log .=" and (activity_type='invalid email' or activity_type='send error')"; |
|
195 | + //Found entry |
|
196 | + if (!empty($row)) |
|
197 | + { |
|
198 | + //do not create another campaign_log record is we already have an |
|
199 | + //invalid email or send error entry for this tracker key. |
|
200 | + $query_log = "select * from campaign_log where target_tracker_key='{$row['target_tracker_key']}'"; |
|
201 | + $query_log .=" and (activity_type='invalid email' or activity_type='send error')"; |
|
202 | 202 | $targeted = new CampaignLog(); |
203 | - $result_log=$targeted->db->query($query_log); |
|
204 | - $row_log=$targeted->db->fetchByAssoc($result_log); |
|
205 | - |
|
206 | - if (empty($row_log)) |
|
207 | - { |
|
208 | - $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
|
209 | - return TRUE; |
|
210 | - } |
|
211 | - else |
|
212 | - { |
|
213 | - $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
|
214 | - return FALSE; |
|
215 | - } |
|
216 | - } |
|
217 | - else |
|
218 | - { |
|
219 | - $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
|
220 | - return FALSE; |
|
221 | - } |
|
222 | - } |
|
223 | - else |
|
224 | - { |
|
225 | - $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
|
226 | - return FALSE; |
|
227 | - } |
|
228 | - } |
|
229 | - else |
|
230 | - { |
|
231 | - $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
|
232 | - return FALSE; |
|
233 | - } |
|
234 | - } |
|
235 | - else |
|
236 | - { |
|
237 | - $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
|
238 | - return FALSE; |
|
239 | - } |
|
203 | + $result_log=$targeted->db->query($query_log); |
|
204 | + $row_log=$targeted->db->fetchByAssoc($result_log); |
|
205 | + |
|
206 | + if (empty($row_log)) |
|
207 | + { |
|
208 | + $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
|
209 | + return TRUE; |
|
210 | + } |
|
211 | + else |
|
212 | + { |
|
213 | + $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
|
214 | + return FALSE; |
|
215 | + } |
|
216 | + } |
|
217 | + else |
|
218 | + { |
|
219 | + $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
|
220 | + return FALSE; |
|
221 | + } |
|
222 | + } |
|
223 | + else |
|
224 | + { |
|
225 | + $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
|
226 | + return FALSE; |
|
227 | + } |
|
228 | + } |
|
229 | + else |
|
230 | + { |
|
231 | + $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
|
232 | + return FALSE; |
|
233 | + } |
|
234 | + } |
|
235 | + else |
|
236 | + { |
|
237 | + $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
|
238 | + return FALSE; |
|
239 | + } |
|
240 | 240 | } |
241 | 241 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -69,31 +69,31 @@ discard block |
||
69 | 69 | * @param string $email_description |
70 | 70 | * @return string |
71 | 71 | */ |
72 | -function createBouncedCampaignLogEntry($row,$email, $email_description) |
|
72 | +function createBouncedCampaignLogEntry($row, $email, $email_description) |
|
73 | 73 | { |
74 | 74 | $GLOBALS['log']->debug("Creating bounced email campaign log"); |
75 | 75 | $bounce = new CampaignLog(); |
76 | - $bounce->campaign_id=$row['campaign_id']; |
|
77 | - $bounce->target_tracker_key=$row['target_tracker_key']; |
|
78 | - $bounce->target_id= $row['target_id']; |
|
79 | - $bounce->target_type=$row['target_type']; |
|
80 | - $bounce->list_id=$row['list_id']; |
|
81 | - $bounce->marketing_id=$row['marketing_id']; |
|
76 | + $bounce->campaign_id = $row['campaign_id']; |
|
77 | + $bounce->target_tracker_key = $row['target_tracker_key']; |
|
78 | + $bounce->target_id = $row['target_id']; |
|
79 | + $bounce->target_type = $row['target_type']; |
|
80 | + $bounce->list_id = $row['list_id']; |
|
81 | + $bounce->marketing_id = $row['marketing_id']; |
|
82 | 82 | |
83 | - $bounce->activity_date=$email->date_created; |
|
84 | - $bounce->related_type='Emails'; |
|
85 | - $bounce->related_id= $email->id; |
|
83 | + $bounce->activity_date = $email->date_created; |
|
84 | + $bounce->related_type = 'Emails'; |
|
85 | + $bounce->related_id = $email->id; |
|
86 | 86 | |
87 | 87 | //do we have the phrase permanent error in the email body. |
88 | - if (preg_match('/permanent[ ]*error/',$email_description)) |
|
88 | + if (preg_match('/permanent[ ]*error/', $email_description)) |
|
89 | 89 | { |
90 | - $bounce->activity_type='invalid email'; |
|
90 | + $bounce->activity_type = 'invalid email'; |
|
91 | 91 | markEmailAddressInvalid($email); |
92 | 92 | } |
93 | 93 | else |
94 | - $bounce->activity_type='send error'; |
|
94 | + $bounce->activity_type = 'send error'; |
|
95 | 95 | |
96 | - $return_id=$bounce->save(); |
|
96 | + $return_id = $bounce->save(); |
|
97 | 97 | return $return_id; |
98 | 98 | } |
99 | 99 | |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | */ |
105 | 105 | function markEmailAddressInvalid($email_address) |
106 | 106 | { |
107 | - if(empty($email_address)) |
|
107 | + if (empty($email_address)) |
|
108 | 108 | return; |
109 | 109 | $sea = new SugarEmailAddress(); |
110 | - $rs = $sea->retrieve_by_string_fields( array('email_address_caps' => trim(strtoupper($email_address))) ); |
|
111 | - if($rs != null) |
|
110 | + $rs = $sea->retrieve_by_string_fields(array('email_address_caps' => trim(strtoupper($email_address)))); |
|
111 | + if ($rs != null) |
|
112 | 112 | { |
113 | 113 | $sea->AddUpdateEmailAddress($email_address, 1, 0, $rs->id); |
114 | 114 | } |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | { |
125 | 125 | $row = FALSE; |
126 | 126 | $targeted = new CampaignLog(); |
127 | - $where="campaign_log.activity_type='targeted' and campaign_log.target_tracker_key='{$identifier}'"; |
|
128 | - $query=$targeted->create_new_list_query('',$where); |
|
129 | - $result=$targeted->db->query($query); |
|
130 | - $row=$targeted->db->fetchByAssoc($result); |
|
127 | + $where = "campaign_log.activity_type='targeted' and campaign_log.target_tracker_key='{$identifier}'"; |
|
128 | + $query = $targeted->create_new_list_query('', $where); |
|
129 | + $result = $targeted->db->query($query); |
|
130 | + $row = $targeted->db->fetchByAssoc($result); |
|
131 | 131 | |
132 | 132 | return $row; |
133 | 133 | } |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | $identifiers = array(); |
145 | 145 | $found = FALSE; |
146 | 146 | //Check if the identifier is present in the header. |
147 | - if(preg_match('/X-CampTrackID: [a-z0-9\-]*/',$email_description,$matches)) |
|
147 | + if (preg_match('/X-CampTrackID: [a-z0-9\-]*/', $email_description, $matches)) |
|
148 | 148 | { |
149 | - $identifiers = preg_split('/X-CampTrackID: /',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
|
149 | + $identifiers = preg_split('/X-CampTrackID: /', $matches[0], -1, PREG_SPLIT_NO_EMPTY); |
|
150 | 150 | $found = TRUE; |
151 | 151 | $GLOBALS['log']->debug("Found campaign identifier in header of email"); |
152 | 152 | } |
153 | - else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) ) |
|
153 | + else if (preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/', $email_description, $matches)) |
|
154 | 154 | { |
155 | - $identifiers = preg_split('/index.php\?entryPoint=removeme&identifier=/',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
|
155 | + $identifiers = preg_split('/index.php\?entryPoint=removeme&identifier=/', $matches[0], -1, PREG_SPLIT_NO_EMPTY); |
|
156 | 156 | $found = TRUE; |
157 | 157 | $GLOBALS['log']->debug("Found campaign identifier in body of email"); |
158 | 158 | } |
@@ -167,21 +167,21 @@ discard block |
||
167 | 167 | $email_description = $email->raw_source; |
168 | 168 | |
169 | 169 | //if raw_source is empty, try using the description instead |
170 | - if (empty($email_description)){ |
|
170 | + if (empty($email_description)) { |
|
171 | 171 | $email_description = $email->description; |
172 | 172 | } |
173 | 173 | |
174 | 174 | $email_description .= retrieveErrorReportAttachment($email); |
175 | 175 | |
176 | - if (preg_match('/MAILER-DAEMON|POSTMASTER/i',$emailFromAddress)) |
|
176 | + if (preg_match('/MAILER-DAEMON|POSTMASTER/i', $emailFromAddress)) |
|
177 | 177 | { |
178 | - $email_description=quoted_printable_decode($email_description); |
|
179 | - $matches=array(); |
|
178 | + $email_description = quoted_printable_decode($email_description); |
|
179 | + $matches = array(); |
|
180 | 180 | |
181 | 181 | //do we have the identifier tag in the email? |
182 | 182 | $identifierScanResults = checkBouncedEmailForIdentifier($email_description); |
183 | 183 | |
184 | - if ( $identifierScanResults['found'] ) |
|
184 | + if ($identifierScanResults['found']) |
|
185 | 185 | { |
186 | 186 | $matches = $identifierScanResults['matches']; |
187 | 187 | $identifiers = $identifierScanResults['identifiers']; |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | //do not create another campaign_log record is we already have an |
199 | 199 | //invalid email or send error entry for this tracker key. |
200 | 200 | $query_log = "select * from campaign_log where target_tracker_key='{$row['target_tracker_key']}'"; |
201 | - $query_log .=" and (activity_type='invalid email' or activity_type='send error')"; |
|
201 | + $query_log .= " and (activity_type='invalid email' or activity_type='send error')"; |
|
202 | 202 | $targeted = new CampaignLog(); |
203 | - $result_log=$targeted->db->query($query_log); |
|
204 | - $row_log=$targeted->db->fetchByAssoc($result_log); |
|
203 | + $result_log = $targeted->db->query($query_log); |
|
204 | + $row_log = $targeted->db->fetchByAssoc($result_log); |
|
205 | 205 | |
206 | 206 | if (empty($row_log)) |
207 | 207 | { |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,8 +57,9 @@ discard block |
||
55 | 57 | $contents = ""; |
56 | 58 | $query = "SELECT description FROM notes WHERE file_mime_type = 'messsage/rfc822' AND parent_type='Emails' AND parent_id = '".$email->id."' AND deleted=0"; |
57 | 59 | $rs = $GLOBALS['db']->query($query); |
58 | - while ($row = $GLOBALS['db']->fetchByAssoc($rs)) |
|
59 | - $contents .= $row['description']; |
|
60 | + while ($row = $GLOBALS['db']->fetchByAssoc($rs)) { |
|
61 | + $contents .= $row['description']; |
|
62 | + } |
|
60 | 63 | |
61 | 64 | return $contents; |
62 | 65 | } |
@@ -89,9 +92,9 @@ discard block |
||
89 | 92 | { |
90 | 93 | $bounce->activity_type='invalid email'; |
91 | 94 | markEmailAddressInvalid($email); |
95 | + } else { |
|
96 | + $bounce->activity_type='send error'; |
|
92 | 97 | } |
93 | - else |
|
94 | - $bounce->activity_type='send error'; |
|
95 | 98 | |
96 | 99 | $return_id=$bounce->save(); |
97 | 100 | return $return_id; |
@@ -104,8 +107,9 @@ discard block |
||
104 | 107 | */ |
105 | 108 | function markEmailAddressInvalid($email_address) |
106 | 109 | { |
107 | - if(empty($email_address)) |
|
108 | - return; |
|
110 | + if(empty($email_address)) { |
|
111 | + return; |
|
112 | + } |
|
109 | 113 | $sea = new SugarEmailAddress(); |
110 | 114 | $rs = $sea->retrieve_by_string_fields( array('email_address_caps' => trim(strtoupper($email_address))) ); |
111 | 115 | if($rs != null) |
@@ -149,8 +153,7 @@ discard block |
||
149 | 153 | $identifiers = preg_split('/X-CampTrackID: /',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
150 | 154 | $found = TRUE; |
151 | 155 | $GLOBALS['log']->debug("Found campaign identifier in header of email"); |
152 | - } |
|
153 | - else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) ) |
|
156 | + } else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) ) |
|
154 | 157 | { |
155 | 158 | $identifiers = preg_split('/index.php\?entryPoint=removeme&identifier=/',$matches[0],-1,PREG_SPLIT_NO_EMPTY); |
156 | 159 | $found = TRUE; |
@@ -207,32 +210,27 @@ discard block |
||
207 | 210 | { |
208 | 211 | $return_id = createBouncedCampaignLogEntry($row, $email, $email_description); |
209 | 212 | return TRUE; |
210 | - } |
|
211 | - else |
|
213 | + } else |
|
212 | 214 | { |
213 | 215 | $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier"); |
214 | 216 | return FALSE; |
215 | 217 | } |
216 | - } |
|
217 | - else |
|
218 | + } else |
|
218 | 219 | { |
219 | 220 | $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier); |
220 | 221 | return FALSE; |
221 | 222 | } |
222 | - } |
|
223 | - else |
|
223 | + } else |
|
224 | 224 | { |
225 | 225 | $GLOBALS['log']->info("Warning: Empty identifier for campaign log."); |
226 | 226 | return FALSE; |
227 | 227 | } |
228 | - } |
|
229 | - else |
|
228 | + } else |
|
230 | 229 | { |
231 | 230 | $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link."); |
232 | 231 | return FALSE; |
233 | 232 | } |
234 | - } |
|
235 | - else |
|
233 | + } else |
|
236 | 234 | { |
237 | 235 | $GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON."); |
238 | 236 | return FALSE; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,52 +56,52 @@ discard block |
||
56 | 56 | |
57 | 57 | //-----------begin replacing text input tags that have been marked with text area tags |
58 | 58 | //get array of text areas strings to process |
59 | -$bodyHTML = html_entity_decode($_REQUEST['body_html'],ENT_QUOTES); |
|
59 | +$bodyHTML = html_entity_decode($_REQUEST['body_html'], ENT_QUOTES); |
|
60 | 60 | //Bug53791 |
61 | 61 | $bodyHTML = str_replace(chr(160), " ", $bodyHTML); |
62 | 62 | |
63 | -while (strpos($bodyHTML, "ta_replace") !== false){ |
|
63 | +while (strpos($bodyHTML, "ta_replace") !== false) { |
|
64 | 64 | |
65 | 65 | //define the marker edges of the sub string to process (opening and closing tag brackets) |
66 | 66 | $marker = strpos($bodyHTML, "ta_replace"); |
67 | - $start_border = strpos($bodyHTML, "input", $marker) - 1;// to account for opening '<' char; |
|
67 | + $start_border = strpos($bodyHTML, "input", $marker) - 1; // to account for opening '<' char; |
|
68 | 68 | $end_border = strpos($bodyHTML, '>', $start_border); //get the closing tag after marker ">"; |
69 | 69 | |
70 | 70 | //extract the input tag string |
71 | - $working_str = substr($bodyHTML, $marker-3, $end_border-($marker-3) ); |
|
71 | + $working_str = substr($bodyHTML, $marker - 3, $end_border - ($marker - 3)); |
|
72 | 72 | |
73 | 73 | //replace input markup with text areas markups |
74 | - $new_str = str_replace('input','textarea',$working_str); |
|
74 | + $new_str = str_replace('input', 'textarea', $working_str); |
|
75 | 75 | $new_str = str_replace("type='text'", ' ', $new_str); |
76 | - $new_str = $new_str . '> </textarea'; |
|
76 | + $new_str = $new_str.'> </textarea'; |
|
77 | 77 | |
78 | 78 | //replace the marker with generic term |
79 | 79 | $new_str = str_replace('ta_replace', 'sugarslot', $new_str); |
80 | 80 | |
81 | 81 | //merge the processed string back into bodyhtml string |
82 | - $bodyHTML = str_replace($working_str , $new_str, $bodyHTML); |
|
82 | + $bodyHTML = str_replace($working_str, $new_str, $bodyHTML); |
|
83 | 83 | } |
84 | 84 | //<<<----------end replacing marked text inputs with text area tags |
85 | 85 | |
86 | 86 | $guid = create_guid(); |
87 | 87 | $form_file = "upload://$guid"; |
88 | 88 | |
89 | -$SugarTiny = new SugarTinyMCE(); |
|
89 | +$SugarTiny = new SugarTinyMCE(); |
|
90 | 90 | $html = $SugarTiny->cleanEncodedMCEHtml($bodyHTML); |
91 | 91 | |
92 | 92 | //Check to ensure we have <html> tags in the form. Without them, IE8 will attempt to display the page as XML. |
93 | 93 | if (stripos($html, "<html") === false) { |
94 | 94 | $langHeader = get_language_header(); |
95 | - $html = "<html {$langHeader}><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>" . $html . "</body></html>"; |
|
95 | + $html = "<html {$langHeader}><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>".$html."</body></html>"; |
|
96 | 96 | } |
97 | 97 | file_put_contents($form_file, $html); |
98 | 98 | |
99 | -$xtpl=new XTemplate ('modules/Campaigns/WebToLeadDownloadForm.html'); |
|
99 | +$xtpl = new XTemplate('modules/Campaigns/WebToLeadDownloadForm.html'); |
|
100 | 100 | $xtpl->assign("MOD", $mod_strings); |
101 | 101 | $xtpl->assign("APP", $app_strings); |
102 | 102 | $webformlink = "<b>$mod_strings[LBL_DOWNLOAD_TEXT_WEB_TO_LEAD_FORM]</b><br/>"; |
103 | 103 | $webformlink .= "<a href=\"index.php?entryPoint=download&id={$guid}&isTempFile=1&tempName=WebToLeadForm.html&type=temp\">$mod_strings[LBL_DOWNLOAD_WEB_TO_LEAD_FORM]</a>"; |
104 | -$xtpl->assign("LINK_TO_WEB_FORM",$webformlink); |
|
104 | +$xtpl->assign("LINK_TO_WEB_FORM", $webformlink); |
|
105 | 105 | $xtpl->assign("RAW_SOURCE", htmlspecialchars($html)); |
106 | 106 | $xtpl->parse("main.copy_source"); |
107 | 107 | $xtpl->parse("main"); |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -62,27 +62,27 @@ |
||
62 | 62 | |
63 | 63 | while (strpos($bodyHTML, "ta_replace") !== false){ |
64 | 64 | |
65 | - //define the marker edges of the sub string to process (opening and closing tag brackets) |
|
66 | - $marker = strpos($bodyHTML, "ta_replace"); |
|
67 | - $start_border = strpos($bodyHTML, "input", $marker) - 1;// to account for opening '<' char; |
|
68 | - $end_border = strpos($bodyHTML, '>', $start_border); //get the closing tag after marker ">"; |
|
65 | + //define the marker edges of the sub string to process (opening and closing tag brackets) |
|
66 | + $marker = strpos($bodyHTML, "ta_replace"); |
|
67 | + $start_border = strpos($bodyHTML, "input", $marker) - 1;// to account for opening '<' char; |
|
68 | + $end_border = strpos($bodyHTML, '>', $start_border); //get the closing tag after marker ">"; |
|
69 | 69 | |
70 | - //extract the input tag string |
|
71 | - $working_str = substr($bodyHTML, $marker-3, $end_border-($marker-3) ); |
|
70 | + //extract the input tag string |
|
71 | + $working_str = substr($bodyHTML, $marker-3, $end_border-($marker-3) ); |
|
72 | 72 | |
73 | - //replace input markup with text areas markups |
|
74 | - $new_str = str_replace('input','textarea',$working_str); |
|
75 | - $new_str = str_replace("type=\"text\"", ' ', $new_str); |
|
76 | - $new_str = $new_str . '> </textarea'; |
|
73 | + //replace input markup with text areas markups |
|
74 | + $new_str = str_replace('input','textarea',$working_str); |
|
75 | + $new_str = str_replace("type=\"text\"", ' ', $new_str); |
|
76 | + $new_str = $new_str . '> </textarea'; |
|
77 | 77 | |
78 | - //replace the marker with generic term |
|
79 | - $new_str = str_replace('ta_replace', 'sugarslot', $new_str); |
|
78 | + //replace the marker with generic term |
|
79 | + $new_str = str_replace('ta_replace', 'sugarslot', $new_str); |
|
80 | 80 | |
81 | - // NET-enabling start-tag requires SHORTTAG YES |
|
82 | - $new_str = str_replace('/> </textarea>', '> </textarea>', $new_str); |
|
81 | + // NET-enabling start-tag requires SHORTTAG YES |
|
82 | + $new_str = str_replace('/> </textarea>', '> </textarea>', $new_str); |
|
83 | 83 | |
84 | - //merge the processed string back into bodyhtml string |
|
85 | - $bodyHTML = str_replace($working_str , $new_str, $bodyHTML); |
|
84 | + //merge the processed string back into bodyhtml string |
|
85 | + $bodyHTML = str_replace($working_str , $new_str, $bodyHTML); |
|
86 | 86 | } |
87 | 87 | //<<<----------end replacing marked text inputs with text area tags |
88 | 88 |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | //if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
60 | 60 | //account for use within wizards |
61 | 61 | if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
62 | - $params = array(); |
|
63 | - $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
|
64 | - $params[] = $mod_strings['LBL_CAMPAIGN_DIAGNOSTICS']; |
|
62 | + $params = array(); |
|
63 | + $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
|
64 | + $params[] = $mod_strings['LBL_CAMPAIGN_DIAGNOSTICS']; |
|
65 | 65 | |
66 | - echo getClassicModuleTitle('Campaigns', $params, true); |
|
66 | + echo getClassicModuleTitle('Campaigns', $params, true); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | global $theme; |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | if(isset($mbox) && count($mbox)>0){ |
111 | 111 | $mboxTable .= "<tr><td colspan='5' style='text-align: left;'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK1_GOOD']." </b>.</td></tr>"; |
112 | 112 | $mboxTable .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></th>" |
113 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></th>" |
|
114 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></th>" |
|
115 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></th>" |
|
116 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></th></tr>"; |
|
113 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></th>" |
|
114 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></th>" |
|
115 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></th>" |
|
116 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></th></tr>"; |
|
117 | 117 | |
118 | 118 | foreach($mbox as $details){ |
119 | 119 | $mboxTable .= "<tr><td>".$details['name']."</td>"; |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | }else{ |
145 | 145 | $conf_msg .= "<tr><td colspan = '5'><b> ".$mod_strings['LBL_MAILBOX_CHECK2_GOOD']."</b></td></tr>"; |
146 | 146 | $conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>" |
147 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
|
148 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>"; |
|
147 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
|
148 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>"; |
|
149 | 149 | if($focus->settings['mail_sendtype']=='SMTP'){ |
150 | - $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
|
151 | - . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
|
150 | + $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
|
151 | + . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
|
152 | 152 | |
153 | 153 | }else{$conf_msg .= "</tr>";} |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $conf_msg .= "<tr><td>".$focus->settings['notify_fromname']."</td>"; |
158 | 158 | $conf_msg .= "<td>".$focus->settings['notify_fromaddress']."</td>"; |
159 | 159 | $conf_msg .= "<td>".$focus->settings['mail_sendtype']."</td>"; |
160 | - if($focus->settings['mail_sendtype']=='SMTP'){ |
|
160 | + if($focus->settings['mail_sendtype']=='SMTP'){ |
|
161 | 161 | $conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>"; |
162 | 162 | $conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>"; |
163 | 163 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | //build the table rows for scheduler display |
199 | 199 | while ($sched_row = $focus->db->fetchByAssoc($sched_res)){$scheds[] = $sched_row;} |
200 | 200 | foreach ($scheds as $funct){ |
201 | - if( ($funct['job']==$check_sched1) || ($funct['job']==$check_sched2)){ |
|
201 | + if( ($funct['job']==$check_sched1) || ($funct['job']==$check_sched2)){ |
|
202 | 202 | $sched_mes = 'use'; |
203 | 203 | $sched_mes_body .= "<tr><td style='text-align: left;'>".$funct['name']."</td>"; |
204 | 204 | $sched_mes_body .= "<td style='text-align: left;'>".$funct['status']."</td></tr>"; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $check_sched2 ="found"; |
209 | 209 | } |
210 | 210 | |
211 | - } |
|
211 | + } |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | //determine which table header to use, based on whether or not schedulers were found |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if($sched_mes == 'use'){ |
217 | 217 | $sched_mes = "<h5>".$mod_strings['LBL_SCHEDULER_CHECK_GOOD']."</h5><br><table class='other view' cellspacing='1'>"; |
218 | 218 | $sched_mes .= "<tr><th scope='col' width='40%'><b>".$mod_strings['LBL_SCHEDULER_NAME']."</b></tH>" |
219 | - . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
|
219 | + . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
|
220 | 220 | |
221 | 221 | }else{ |
222 | 222 | $sched_mes = "<table class='other view' cellspacing='1'>"; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | if (is_admin($current_user)){ |
239 | 239 | $admin_sched_link="<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
240 | 240 | }else{ |
241 | - $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
241 | + $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | /********** FINAL END OF PAGE UI Stuff ********/ |
252 | 252 | if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
253 | 253 | |
254 | - $ss->display('modules/Campaigns/CampaignDiagnostic.html'); |
|
254 | + $ss->display('modules/Campaigns/CampaignDiagnostic.html'); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | }elseif($num == 0){ |
273 | 273 | //if health number is zero, then all checks passed, set green image |
274 | 274 | //green |
275 | - return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
|
275 | + return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
|
276 | 276 | |
277 | 277 | |
278 | 278 | }else{ |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | //if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
60 | 60 | //account for use within wizards |
61 | -if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
|
61 | +if (!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline') { |
|
62 | 62 | $params = array(); |
63 | 63 | $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>"; |
64 | 64 | $params[] = $mod_strings['LBL_CAMPAIGN_DIAGNOSTICS']; |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | |
73 | 73 | |
74 | 74 | |
75 | -if(isset($_REQUEST['inline']) && $_REQUEST['inline'] == 'inline'){ |
|
75 | +if (isset($_REQUEST['inline']) && $_REQUEST['inline'] == 'inline') { |
|
76 | 76 | { |
77 | 77 | |
78 | 78 | } |
79 | -}else{ |
|
79 | +} else { |
|
80 | 80 | //use html if not inline |
81 | 81 | $ss = new Sugar_Smarty(); |
82 | 82 | $ss->assign("MOD", $mod_strings); |
@@ -104,18 +104,18 @@ discard block |
||
104 | 104 | $mboxTable = "<table border ='0' width='100%' class='detail view' cellpadding='0' cellspacing='0'>"; |
105 | 105 | //put all rows returned into an array |
106 | 106 | $mbox = array(); |
107 | -while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)){$mbox[] = $mbox_row;} |
|
107 | +while ($mbox_row = $focus->db->fetchByAssoc($mbox_res)) {$mbox[] = $mbox_row; } |
|
108 | 108 | $mbox_msg = ' '; |
109 | 109 | //if the array is not empty, then set "good" message |
110 | -if(isset($mbox) && count($mbox)>0){ |
|
111 | - $mboxTable .= "<tr><td colspan='5' style='text-align: left;'><b>" .count($mbox) ." ". $mod_strings['LBL_MAILBOX_CHECK1_GOOD']." </b>.</td></tr>"; |
|
110 | +if (isset($mbox) && count($mbox) > 0) { |
|
111 | + $mboxTable .= "<tr><td colspan='5' style='text-align: left;'><b>".count($mbox)." ".$mod_strings['LBL_MAILBOX_CHECK1_GOOD']." </b>.</td></tr>"; |
|
112 | 112 | $mboxTable .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX_NAME']."</b></th>" |
113 | 113 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LOGIN']."</b></th>" |
114 | 114 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAILBOX']."</b></th>" |
115 | 115 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_SERVER_URL']."</b></th>" |
116 | 116 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_LIST_STATUS']."</b></th></tr>"; |
117 | 117 | |
118 | - foreach($mbox as $details){ |
|
118 | + foreach ($mbox as $details) { |
|
119 | 119 | $mboxTable .= "<tr><td>".$details['name']."</td>"; |
120 | 120 | $mboxTable .= "<td>".$details['email_user']."</td>"; |
121 | 121 | $mboxTable .= "<td>".$details['mailbox']."</td>"; |
@@ -123,64 +123,64 @@ discard block |
||
123 | 123 | $mboxTable .= "<td>".$details['status']."</td></tr>"; |
124 | 124 | } |
125 | 125 | |
126 | -}else{ |
|
126 | +} else { |
|
127 | 127 | //if array is empty, then set "bad" message and increment health counter |
128 | - $mboxTable .= "<tr><td colspan='5'><b class='error'>". $mod_strings['LBL_MAILBOX_CHECK1_BAD']."</b></td></tr>"; |
|
129 | - $email_health =$email_health +1; |
|
128 | + $mboxTable .= "<tr><td colspan='5'><b class='error'>".$mod_strings['LBL_MAILBOX_CHECK1_BAD']."</b></td></tr>"; |
|
129 | + $email_health = $email_health + 1; |
|
130 | 130 | } |
131 | 131 | |
132 | -$mboxTable.= '</table>' ; |
|
132 | +$mboxTable .= '</table>'; |
|
133 | 133 | |
134 | 134 | |
135 | 135 | |
136 | 136 | $ss->assign("MAILBOXES_DETECTED_MESSAGE", $mboxTable); |
137 | 137 | |
138 | 138 | //email settings configured |
139 | -$conf_msg="<table border='0' width='100%' class='detail view' cellpadding='0' cellspacing='0'>"; |
|
140 | -if (strstr($focus->settings['notify_fromaddress'], 'example.com')){ |
|
139 | +$conf_msg = "<table border='0' width='100%' class='detail view' cellpadding='0' cellspacing='0'>"; |
|
140 | +if (strstr($focus->settings['notify_fromaddress'], 'example.com')) { |
|
141 | 141 | //if from address is the default, then set "bad" message and increment health counter |
142 | 142 | $conf_msg .= "<tr><td colspan = '5'><b class='error'> ".$mod_strings['LBL_MAILBOX_CHECK2_BAD']." </b></td></td>"; |
143 | - $email_health =$email_health +1; |
|
144 | -}else{ |
|
143 | + $email_health = $email_health + 1; |
|
144 | +} else { |
|
145 | 145 | $conf_msg .= "<tr><td colspan = '5'><b> ".$mod_strings['LBL_MAILBOX_CHECK2_GOOD']."</b></td></tr>"; |
146 | 146 | $conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>" |
147 | 147 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
148 | 148 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SENDTYPE']."</b></th>"; |
149 | - if($focus->settings['mail_sendtype']=='SMTP'){ |
|
149 | + if ($focus->settings['mail_sendtype'] == 'SMTP') { |
|
150 | 150 | $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
151 | 151 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
152 | 152 | |
153 | - }else{$conf_msg .= "</tr>";} |
|
153 | + } else {$conf_msg .= "</tr>"; } |
|
154 | 154 | |
155 | 155 | |
156 | 156 | |
157 | 157 | $conf_msg .= "<tr><td>".$focus->settings['notify_fromname']."</td>"; |
158 | 158 | $conf_msg .= "<td>".$focus->settings['notify_fromaddress']."</td>"; |
159 | 159 | $conf_msg .= "<td>".$focus->settings['mail_sendtype']."</td>"; |
160 | - if($focus->settings['mail_sendtype']=='SMTP'){ |
|
160 | + if ($focus->settings['mail_sendtype'] == 'SMTP') { |
|
161 | 161 | $conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>"; |
162 | 162 | $conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>"; |
163 | 163 | |
164 | - }else{$conf_msg .= "</tr>";} |
|
164 | + } else {$conf_msg .= "</tr>"; } |
|
165 | 165 | |
166 | 166 | } |
167 | 167 | |
168 | 168 | $conf_msg .= '</table>'; |
169 | 169 | $ss->assign("EMAIL_SETTINGS_CONFIGURED_MESSAGE", $conf_msg); |
170 | -$email_setup_wiz_link=''; |
|
171 | -if ($email_health>0){ |
|
172 | - if (is_admin($current_user)){ |
|
173 | - $email_setup_wiz_link="<a href='index.php?module=Campaigns&action=WizardEmailSetup'>".$mod_strings['LBL_EMAIL_SETUP_WIZ']."</a>"; |
|
174 | - }else{ |
|
175 | - $email_setup_wiz_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
170 | +$email_setup_wiz_link = ''; |
|
171 | +if ($email_health > 0) { |
|
172 | + if (is_admin($current_user)) { |
|
173 | + $email_setup_wiz_link = "<a href='index.php?module=Campaigns&action=WizardEmailSetup'>".$mod_strings['LBL_EMAIL_SETUP_WIZ']."</a>"; |
|
174 | + } else { |
|
175 | + $email_setup_wiz_link = $mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
179 | 179 | $ss->assign("EMAIL_SETUP_WIZ_LINK", $email_setup_wiz_link); |
180 | -$ss->assign( 'EMAIL_IMAGE', define_image($email_health, 2)); |
|
181 | -$ss->assign( 'EMAIL_COMPONENTS', $mod_strings['LBL_EMAIL_COMPONENTS']); |
|
182 | -$ss->assign( 'SCHEDULER_COMPONENTS', $mod_strings['LBL_SCHEDULER_COMPONENTS']); |
|
183 | -$ss->assign( 'RECHECK_BTN', $mod_strings['LBL_RECHECK_BTN']); |
|
180 | +$ss->assign('EMAIL_IMAGE', define_image($email_health, 2)); |
|
181 | +$ss->assign('EMAIL_COMPONENTS', $mod_strings['LBL_EMAIL_COMPONENTS']); |
|
182 | +$ss->assign('SCHEDULER_COMPONENTS', $mod_strings['LBL_SCHEDULER_COMPONENTS']); |
|
183 | +$ss->assign('RECHECK_BTN', $mod_strings['LBL_RECHECK_BTN']); |
|
184 | 184 | |
185 | 185 | /************* SCHEDULER COMPONENTS ************/ |
186 | 186 | |
@@ -196,16 +196,16 @@ discard block |
||
196 | 196 | |
197 | 197 | $scheds = array(); |
198 | 198 | //build the table rows for scheduler display |
199 | -while ($sched_row = $focus->db->fetchByAssoc($sched_res)){$scheds[] = $sched_row;} |
|
200 | -foreach ($scheds as $funct){ |
|
201 | - if( ($funct['job']==$check_sched1) || ($funct['job']==$check_sched2)){ |
|
199 | +while ($sched_row = $focus->db->fetchByAssoc($sched_res)) {$scheds[] = $sched_row; } |
|
200 | +foreach ($scheds as $funct) { |
|
201 | + if (($funct['job'] == $check_sched1) || ($funct['job'] == $check_sched2)) { |
|
202 | 202 | $sched_mes = 'use'; |
203 | 203 | $sched_mes_body .= "<tr><td style='text-align: left;'>".$funct['name']."</td>"; |
204 | 204 | $sched_mes_body .= "<td style='text-align: left;'>".$funct['status']."</td></tr>"; |
205 | - if($funct['job']==$check_sched1){ |
|
206 | - $check_sched1 ="found"; |
|
207 | - }else{ |
|
208 | - $check_sched2 ="found"; |
|
205 | + if ($funct['job'] == $check_sched1) { |
|
206 | + $check_sched1 = "found"; |
|
207 | + } else { |
|
208 | + $check_sched2 = "found"; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | } |
@@ -213,43 +213,43 @@ discard block |
||
213 | 213 | |
214 | 214 | //determine which table header to use, based on whether or not schedulers were found |
215 | 215 | $show_admin_link = false; |
216 | -if($sched_mes == 'use'){ |
|
216 | +if ($sched_mes == 'use') { |
|
217 | 217 | $sched_mes = "<h5>".$mod_strings['LBL_SCHEDULER_CHECK_GOOD']."</h5><br><table class='other view' cellspacing='1'>"; |
218 | 218 | $sched_mes .= "<tr><th scope='col' width='40%'><b>".$mod_strings['LBL_SCHEDULER_NAME']."</b></tH>" |
219 | 219 | . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
220 | 220 | |
221 | -}else{ |
|
221 | +} else { |
|
222 | 222 | $sched_mes = "<table class='other view' cellspacing='1'>"; |
223 | - $sched_mes .= "<tr><td colspan ='3'><font color='red'><b> ".$mod_strings['LBL_SCHEDULER_CHECK_BAD']."</b></font></td></tr>"; |
|
223 | + $sched_mes .= "<tr><td colspan ='3'><font color='red'><b> ".$mod_strings['LBL_SCHEDULER_CHECK_BAD']."</b></font></td></tr>"; |
|
224 | 224 | $show_admin_link = true; |
225 | 225 | } |
226 | 226 | |
227 | 227 | //determine if error messages need to be displayed for schedulers |
228 | -if($check_sched2 != 'found'){ |
|
229 | - $sched_health =$sched_health +1; |
|
230 | - $sched_mes_body .= "<tr><td colspan ='3'><font color='red'> ".$mod_strings['LBL_SCHEDULER_CHECK1_BAD']."</font></td></tr>"; |
|
228 | +if ($check_sched2 != 'found') { |
|
229 | + $sched_health = $sched_health + 1; |
|
230 | + $sched_mes_body .= "<tr><td colspan ='3'><font color='red'> ".$mod_strings['LBL_SCHEDULER_CHECK1_BAD']."</font></td></tr>"; |
|
231 | 231 | } |
232 | -if($check_sched1 != 'found'){ |
|
233 | - $sched_health =$sched_health +1; |
|
234 | - $sched_mes_body .= "<tr><td colspan ='3' scope='row'><font color='red'>".$mod_strings['LBL_SCHEDULER_CHECK2_BAD']."</font></td></tr>"; |
|
232 | +if ($check_sched1 != 'found') { |
|
233 | + $sched_health = $sched_health + 1; |
|
234 | + $sched_mes_body .= "<tr><td colspan ='3' scope='row'><font color='red'>".$mod_strings['LBL_SCHEDULER_CHECK2_BAD']."</font></td></tr>"; |
|
235 | 235 | } |
236 | -$admin_sched_link=''; |
|
237 | -if ($sched_health>0){ |
|
238 | - if (is_admin($current_user)){ |
|
239 | - $admin_sched_link="<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
|
240 | - }else{ |
|
241 | - $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
236 | +$admin_sched_link = ''; |
|
237 | +if ($sched_health > 0) { |
|
238 | + if (is_admin($current_user)) { |
|
239 | + $admin_sched_link = "<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
|
240 | + } else { |
|
241 | + $admin_sched_link = $mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
245 | 245 | //put table html together and display |
246 | - $final_sched_msg = $sched_mes . $sched_mes_body . '</table>' . $admin_sched_link; |
|
246 | + $final_sched_msg = $sched_mes.$sched_mes_body.'</table>'.$admin_sched_link; |
|
247 | 247 | $ss->assign("SCHEDULER_EMAILS_MESSAGE", $final_sched_msg); |
248 | - $ss->assign( 'SCHEDULE_IMAGE', define_image($sched_health, 2)); |
|
248 | + $ss->assign('SCHEDULE_IMAGE', define_image($sched_health, 2)); |
|
249 | 249 | |
250 | 250 | |
251 | 251 | /********** FINAL END OF PAGE UI Stuff ********/ |
252 | -if(!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline'){ |
|
252 | +if (!isset($_REQUEST['inline']) || $_REQUEST['inline'] != 'inline') { |
|
253 | 253 | |
254 | 254 | $ss->display('modules/Campaigns/CampaignDiagnostic.html'); |
255 | 255 | } |
@@ -264,18 +264,18 @@ discard block |
||
264 | 264 | function define_image($num, $total) |
265 | 265 | { global $mod_strings; |
266 | 266 | //if health number is equal to total number then all checks failed, set red image |
267 | - if($num == $total){ |
|
267 | + if ($num == $total) { |
|
268 | 268 | //red |
269 | 269 | return SugarThemeRegistry::current()->getImage('red_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_INVALID']); |
270 | 270 | |
271 | 271 | |
272 | - }elseif($num == 0){ |
|
272 | + }elseif ($num == 0) { |
|
273 | 273 | //if health number is zero, then all checks passed, set green image |
274 | 274 | //green |
275 | 275 | return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
276 | 276 | |
277 | 277 | |
278 | - }else{ |
|
278 | + } else { |
|
279 | 279 | //if health number is between total and num params, then some checks failed but not all, set yellow image |
280 | 280 | //yellow |
281 | 281 | return SugarThemeRegistry::current()->getImage('yellow_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_ALERT']); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -76,14 +78,20 @@ discard block |
||
76 | 78 | { |
77 | 79 | |
78 | 80 | } |
79 | -}else{ |
|
81 | +} else{ |
|
80 | 82 | //use html if not inline |
81 | 83 | $ss = new Sugar_Smarty(); |
82 | 84 | $ss->assign("MOD", $mod_strings); |
83 | 85 | $ss->assign("APP", $app_strings); |
84 | - if (isset($_REQUEST['return_module'])) $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
85 | - if (isset($_REQUEST['return_action'])) $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
86 | - if (isset($_REQUEST['return_id'])) $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
86 | + if (isset($_REQUEST['return_module'])) { |
|
87 | + $ss->assign("RETURN_MODULE", $_REQUEST['return_module']); |
|
88 | + } |
|
89 | + if (isset($_REQUEST['return_action'])) { |
|
90 | + $ss->assign("RETURN_ACTION", $_REQUEST['return_action']); |
|
91 | + } |
|
92 | + if (isset($_REQUEST['return_id'])) { |
|
93 | + $ss->assign("RETURN_ID", $_REQUEST['return_id']); |
|
94 | + } |
|
87 | 95 | // handle Create $module then Cancel |
88 | 96 | if (empty($_REQUEST['return_id'])) { |
89 | 97 | $ss->assign("RETURN_ACTION", 'index'); |
@@ -123,7 +131,7 @@ discard block |
||
123 | 131 | $mboxTable .= "<td>".$details['status']."</td></tr>"; |
124 | 132 | } |
125 | 133 | |
126 | -}else{ |
|
134 | +} else{ |
|
127 | 135 | //if array is empty, then set "bad" message and increment health counter |
128 | 136 | $mboxTable .= "<tr><td colspan='5'><b class='error'>". $mod_strings['LBL_MAILBOX_CHECK1_BAD']."</b></td></tr>"; |
129 | 137 | $email_health =$email_health +1; |
@@ -141,7 +149,7 @@ discard block |
||
141 | 149 | //if from address is the default, then set "bad" message and increment health counter |
142 | 150 | $conf_msg .= "<tr><td colspan = '5'><b class='error'> ".$mod_strings['LBL_MAILBOX_CHECK2_BAD']." </b></td></td>"; |
143 | 151 | $email_health =$email_health +1; |
144 | -}else{ |
|
152 | +} else{ |
|
145 | 153 | $conf_msg .= "<tr><td colspan = '5'><b> ".$mod_strings['LBL_MAILBOX_CHECK2_GOOD']."</b></td></tr>"; |
146 | 154 | $conf_msg .= "<tr><th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_NAME']."</b></th>" |
147 | 155 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_WIZ_FROM_ADDRESS']."</b></th>" |
@@ -150,7 +158,7 @@ discard block |
||
150 | 158 | $conf_msg .= " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPSERVER']."</b></th>" |
151 | 159 | . " <th scope='col' width='20%'><b>".$mod_strings['LBL_MAIL_SMTPUSER']."</b></th></tr>"; |
152 | 160 | |
153 | - }else{$conf_msg .= "</tr>";} |
|
161 | + } else{$conf_msg .= "</tr>";} |
|
154 | 162 | |
155 | 163 | |
156 | 164 | |
@@ -161,7 +169,7 @@ discard block |
||
161 | 169 | $conf_msg .= "<td>".$focus->settings['mail_smtpserver']."</td>"; |
162 | 170 | $conf_msg .= "<td>".$focus->settings['mail_smtpuser']."</td></tr>"; |
163 | 171 | |
164 | - }else{$conf_msg .= "</tr>";} |
|
172 | + } else{$conf_msg .= "</tr>";} |
|
165 | 173 | |
166 | 174 | } |
167 | 175 | |
@@ -171,7 +179,7 @@ discard block |
||
171 | 179 | if ($email_health>0){ |
172 | 180 | if (is_admin($current_user)){ |
173 | 181 | $email_setup_wiz_link="<a href='index.php?module=Campaigns&action=WizardEmailSetup'>".$mod_strings['LBL_EMAIL_SETUP_WIZ']."</a>"; |
174 | - }else{ |
|
182 | + } else{ |
|
175 | 183 | $email_setup_wiz_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
176 | 184 | } |
177 | 185 | } |
@@ -204,7 +212,7 @@ discard block |
||
204 | 212 | $sched_mes_body .= "<td style='text-align: left;'>".$funct['status']."</td></tr>"; |
205 | 213 | if($funct['job']==$check_sched1){ |
206 | 214 | $check_sched1 ="found"; |
207 | - }else{ |
|
215 | + } else{ |
|
208 | 216 | $check_sched2 ="found"; |
209 | 217 | } |
210 | 218 | |
@@ -218,7 +226,7 @@ discard block |
||
218 | 226 | $sched_mes .= "<tr><th scope='col' width='40%'><b>".$mod_strings['LBL_SCHEDULER_NAME']."</b></tH>" |
219 | 227 | . " <th scope='col' width='60%'><b>".$mod_strings['LBL_SCHEDULER_STATUS']."</b></tH></tr>"; |
220 | 228 | |
221 | -}else{ |
|
229 | +} else{ |
|
222 | 230 | $sched_mes = "<table class='other view' cellspacing='1'>"; |
223 | 231 | $sched_mes .= "<tr><td colspan ='3'><font color='red'><b> ".$mod_strings['LBL_SCHEDULER_CHECK_BAD']."</b></font></td></tr>"; |
224 | 232 | $show_admin_link = true; |
@@ -237,7 +245,7 @@ discard block |
||
237 | 245 | if ($sched_health>0){ |
238 | 246 | if (is_admin($current_user)){ |
239 | 247 | $admin_sched_link="<a href='index.php?module=Schedulers&action=index'>".$mod_strings['LBL_SCHEDULER_LINK']."</a>"; |
240 | - }else{ |
|
248 | + } else{ |
|
241 | 249 | $admin_sched_link=$mod_strings['LBL_NON_ADMIN_ERROR_MSG']; |
242 | 250 | } |
243 | 251 | } |
@@ -269,13 +277,13 @@ discard block |
||
269 | 277 | return SugarThemeRegistry::current()->getImage('red_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_INVALID']); |
270 | 278 | |
271 | 279 | |
272 | - }elseif($num == 0){ |
|
280 | + } elseif($num == 0){ |
|
273 | 281 | //if health number is zero, then all checks passed, set green image |
274 | 282 | //green |
275 | 283 | return SugarThemeRegistry::current()->getImage('green_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_VALID']); |
276 | 284 | |
277 | 285 | |
278 | - }else{ |
|
286 | + } else{ |
|
279 | 287 | //if health number is between total and num params, then some checks failed but not all, set yellow image |
280 | 288 | //yellow |
281 | 289 | return SugarThemeRegistry::current()->getImage('yellow_camp', "align='absmiddle'", null, null, ".gif", $mod_strings['LBL_ALERT']); |