@@ -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,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,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,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,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']); |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | |
26 | -function display_condition_lines($focus, $field, $value, $view){ |
|
26 | +function display_condition_lines($focus, $field, $value, $view) { |
|
27 | 27 | |
28 | 28 | global $locale, $app_list_strings, $mod_strings; |
29 | 29 | |
30 | 30 | $html = ''; |
31 | 31 | |
32 | - if (!is_file('cache/jsLanguage/AOR_Conditions/' . $GLOBALS['current_language'] . '.js')) { |
|
32 | + if (!is_file('cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js')) { |
|
33 | 33 | require_once ('include/language/jsLanguage.php'); |
34 | 34 | jsLanguage::createModuleStringsCache('AOR_Conditions', $GLOBALS['current_language']); |
35 | 35 | } |
36 | - $html .= '<script src="cache/jsLanguage/AOR_Conditions/'. $GLOBALS['current_language'] . '.js"></script>'; |
|
36 | + $html .= '<script src="cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js"></script>'; |
|
37 | 37 | |
38 | - if($view == 'EditView'){ |
|
38 | + if ($view == 'EditView') { |
|
39 | 39 | |
40 | 40 | $html .= '<script src="modules/AOR_Conditions/conditionLines.js"></script>'; |
41 | 41 | $html .= "<table border='0' cellspacing='4' width='100%' id='conditionLines'></table>"; |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | $html .= "</div>"; |
46 | 46 | |
47 | 47 | |
48 | - if(isset($focus->report_module) && $focus->report_module != ''){ |
|
48 | + if (isset($focus->report_module) && $focus->report_module != '') { |
|
49 | 49 | require_once("modules/AOW_WorkFlow/aow_utils.php"); |
50 | 50 | $html .= "<script>"; |
51 | 51 | $html .= "report_module = \"".$focus->report_module."\";"; |
52 | 52 | $html .= "document.getElementById('btn_ConditionLine').disabled = '';"; |
53 | - if($focus->id != ''){ |
|
53 | + if ($focus->id != '') { |
|
54 | 54 | $sql = "SELECT id FROM aor_conditions WHERE aor_report_id = '".$focus->id."' AND deleted = 0 ORDER BY condition_order ASC"; |
55 | 55 | $result = $focus->db->query($sql); |
56 | 56 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | $condition_name = new AOR_Condition(); |
59 | 59 | $condition_name->retrieve($row['id']); |
60 | 60 | $condition_name->module_path = unserialize(base64_decode($condition_name->module_path)); |
61 | - $html .= "report_fields = \"".trim(preg_replace('/\s+/', ' ', getModuleFields(getRelatedModule($focus->report_module,$condition_name->module_path[0]))))."\";"; |
|
62 | - if($condition_name->value_type == 'Date'){ |
|
61 | + $html .= "report_fields = \"".trim(preg_replace('/\s+/', ' ', getModuleFields(getRelatedModule($focus->report_module, $condition_name->module_path[0]))))."\";"; |
|
62 | + if ($condition_name->value_type == 'Date') { |
|
63 | 63 | $condition_name->value = unserialize(base64_decode($condition_name->value)); |
64 | 64 | } |
65 | 65 | $condition_item = json_encode($condition_name->toArray()); |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | } |
74 | - else if($view == 'DetailView'){ |
|
74 | + else if ($view == 'DetailView') { |
|
75 | 75 | $html .= '<script src="modules/AOR_Conditions/conditionLines.js"></script>'; |
76 | 76 | $html .= "<table border='0' cellspacing='0' width='100%' id='conditionLines'></table>"; |
77 | 77 | |
78 | 78 | |
79 | - if(isset($focus->report_module) && $focus->report_module != ''){ |
|
79 | + if (isset($focus->report_module) && $focus->report_module != '') { |
|
80 | 80 | require_once("modules/AOW_WorkFlow/aow_utils.php"); |
81 | 81 | $html .= "<script>"; |
82 | 82 | $html .= "report_fields = \"".trim(preg_replace('/\s+/', ' ', getModuleFields($focus->report_module)))."\";"; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $condition_name = new AOR_Condition(); |
89 | 89 | $condition_name->retrieve($row['id']); |
90 | 90 | $condition_name->module_path = unserialize(base64_decode($condition_name->module_path)); |
91 | - if($condition_name->value_type == 'Date'){ |
|
91 | + if ($condition_name->value_type == 'Date') { |
|
92 | 92 | $condition_name->value = unserialize(base64_decode($condition_name->value)); |
93 | 93 | } |
94 | 94 | $condition_item = json_encode($condition_name->toArray()); |
@@ -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. |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * All Rights Reserved. |
46 | 46 | * Contributor(s): ______________________________________.. |
47 | 47 | ********************************************************************************/ |
48 | -$fields_array['EmailTemplate'] = array ('column_fields' => Array("id" |
|
48 | +$fields_array['EmailTemplate'] = array('column_fields' => Array("id" |
|
49 | 49 | , "date_entered" |
50 | 50 | , "date_modified" |
51 | 51 | , "modified_user_id" |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | , "name" |
58 | 58 | , "published" |
59 | 59 | ), |
60 | - 'list_fields' => Array('id', 'name', 'description','date_modified' |
|
60 | + 'list_fields' => Array('id', 'name', 'description', 'date_modified' |
|
61 | 61 | ), |
62 | 62 | 'required_fields' => array("name"=>1), |
63 | 63 | ); |
@@ -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,17 +55,17 @@ discard block |
||
55 | 55 | |
56 | 56 | $ret = array(); |
57 | 57 | |
58 | -foreach($_FILES as $k => $file) { |
|
59 | - if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
58 | +foreach ($_FILES as $k => $file) { |
|
59 | + if (in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) { |
|
60 | 60 | $upload_file = new UploadFile($k); |
61 | 61 | // check the file |
62 | - if($upload_file->confirm_upload()) { |
|
62 | + if ($upload_file->confirm_upload()) { |
|
63 | 63 | $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name |
64 | 64 | $guid = create_guid(); |
65 | - if($upload_file->final_move($guid)) { // move to uploads |
|
65 | + if ($upload_file->final_move($guid)) { // move to uploads |
|
66 | 66 | $path = $upload_file->get_upload_path($guid); |
67 | 67 | // if file is OK, copy to cache |
68 | - if(verify_uploaded_image($path) && copy($path, $dest)) { |
|
68 | + if (verify_uploaded_image($path) && copy($path, $dest)) { |
|
69 | 69 | $ret[] = $dest; |
70 | 70 | } |
71 | 71 | // remove temp file |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | $GLOBALS['log']->info("EmailTemplate detail view"); |
75 | 75 | |
76 | 76 | if ($has_campaign || $inboundEmail) { |
77 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditView.html'); |
|
77 | + $xtpl = new XTemplate('modules/EmailTemplates/EditView.html'); |
|
78 | 78 | } else { |
79 | - $xtpl = new XTemplate ('modules/EmailTemplates/EditViewMain.html'); |
|
79 | + $xtpl = new XTemplate('modules/EmailTemplates/EditViewMain.html'); |
|
80 | 80 | } // else |
81 | 81 | $xtpl->assign("MOD", $mod_strings); |
82 | 82 | $xtpl->assign("APP", $app_strings); |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | require_once('include/QuickSearchDefaults.php'); |
129 | 129 | $qsd = QuickSearchDefaults::getQuickSearchDefaults(); |
130 | 130 | $sqs_objects = array('EditView_assigned_user_name' => $qsd->getQSUser()); |
131 | -$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>'; |
|
131 | +$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = '.$json->encode($sqs_objects).'; enableQS();</script>'; |
|
132 | 132 | |
133 | 133 | $xtpl->assign("CANCEL_SCRIPT", $cancel_script); |
134 | -$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']); |
|
135 | -$xtpl->assign("JAVASCRIPT", get_set_focus_js() . $quicksearch_js); |
|
134 | +$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']); |
|
135 | +$xtpl->assign("JAVASCRIPT", get_set_focus_js().$quicksearch_js); |
|
136 | 136 | |
137 | -if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) { |
|
137 | +if (!is_file(sugar_cached('jsLanguage/').$GLOBALS['current_language'].'.js')) { |
|
138 | 138 | require_once('include/language/jsLanguage.php'); |
139 | 139 | jsLanguage::createAppStringsCache($GLOBALS['current_language']); |
140 | 140 | } |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | $record = $_REQUEST['record']; |
184 | 184 | } |
185 | 185 | |
186 | - $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=" . $_REQUEST['action'] . "&from_module=" . $_REQUEST['module'] . "&record=" . $record . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>"); |
|
186 | + $xtpl->assign("ADMIN_EDIT", "<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action']."&from_module=".$_REQUEST['module']."&record=".$record."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT'])."</a>"); |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | if (isset($focus->parent_type) && $focus->parent_type != "") { |
190 | - $change_parent_button = "<input title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' |
|
191 | -tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "' name='button' LANGUAGE=javascript onclick='return |
|
190 | + $change_parent_button = "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']."' |
|
191 | +tabindex='3' type='button' class='button' value='" . $app_strings['LBL_SELECT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='return |
|
192 | 192 | window.open(\"index.php?module=\"+ document.EditView.parent_type.value + |
193 | 193 | \"&action=Popup&html=Popup_picker&form=TasksEditView\",\"test\",\"width=600,height=400,resizable=1,scrollbars=1\");'>"; |
194 | 194 | $xtpl->assign("CHANGE_PARENT_BUTTON", $change_parent_button); |
195 | 195 | } |
196 | 196 | if ($focus->parent_type == "Account") { |
197 | - $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=" . urlencode($focus->parent_name)); |
|
197 | + $xtpl->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $xtpl->assign("DESCRIPTION", $focus->description); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | // If it's campaign then hide the Account. |
252 | 252 | if ($has_campaign) { |
253 | 253 | $dropdown = "<option value='Contacts'> |
254 | - " . $lblContactAndOthers . " |
|
254 | + " . $lblContactAndOthers." |
|
255 | 255 | </option>"; |
256 | 256 | $xtpl->assign("DROPDOWN", $dropdown); |
257 | 257 | $xtpl->assign("DEFAULT_MODULE", 'Contacts'); |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | if (empty($the_note->filename)) { |
286 | 286 | continue; |
287 | 287 | } |
288 | - $secureLink = 'index.php?entryPoint=download&id=' . $the_note->id . '&type=Notes'; |
|
289 | - $attachments .= '<input type="checkbox" name="remove_attachment[]" value="' . $the_note->id . '"> ' . $app_strings['LNK_REMOVE'] . ' '; |
|
290 | - $attachments .= '<a href="' . $secureLink . '" target="_blank">' . $the_note->filename . '</a><br>'; |
|
288 | + $secureLink = 'index.php?entryPoint=download&id='.$the_note->id.'&type=Notes'; |
|
289 | + $attachments .= '<input type="checkbox" name="remove_attachment[]" value="'.$the_note->id.'"> '.$app_strings['LNK_REMOVE'].' '; |
|
290 | + $attachments .= '<a href="'.$secureLink.'" target="_blank">'.$the_note->filename.'</a><br>'; |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | $attJs = '<script type="text/javascript">'; |
294 | - $attJs .= 'var lnk_remove = "' . $app_strings['LNK_REMOVE'] . '";'; |
|
294 | + $attJs .= 'var lnk_remove = "'.$app_strings['LNK_REMOVE'].'";'; |
|
295 | 295 | $attJs .= '</script>'; |
296 | 296 | $xtpl->assign('ATTACHMENTS', $attachments); |
297 | 297 | $xtpl->assign('ATTACHMENTS_JAVASCRIPT', $attJs); |