Completed
Push — master ( 24ce66...da2f36 )
by Adam
25:35
created
modules/Campaigns/CampaignDiagnostic.php 3 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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{
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.
Braces   +23 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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']);
Please login to merge, or discard this patch.
modules/Campaigns/WizardMarketingSave.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     }
66 66
         
67 67
 }else{
68
-     //default to just saving and exiting wizard
69
-     $master = 'save';   
68
+        //default to just saving and exiting wizard
69
+        $master = 'save';   
70 70
 }
71 71
 
72 72
 
@@ -90,17 +90,17 @@  discard block
 block discarded – undo
90 90
 }
91 91
 
92 92
     foreach ($_REQUEST as $key => $val) {
93
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
94
-              $newkey  =substr($key, strlen($prefix)) ;
95
-              $_REQUEST[$newkey] = $val;
96
-         }               
93
+                if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
94
+                $newkey  =substr($key, strlen($prefix)) ;
95
+                $_REQUEST[$newkey] = $val;
96
+            }               
97 97
     }
98 98
 
99 99
     foreach ($_REQUEST as $key => $val) {
100
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
101
-              $newkey  =substr($key, strlen($prefix)) ;
102
-              $_REQUEST[$newkey] = $val;
103
-         }               
100
+                if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
101
+                $newkey  =substr($key, strlen($prefix)) ;
102
+                $_REQUEST[$newkey] = $val;
103
+            }               
104 104
     }
105 105
 
106 106
 if(!empty($_REQUEST['meridiem'])){
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 }
109 109
 
110 110
 if(empty($_REQUEST['time_start'])) {
111
-  $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' 00:00';	
111
+    $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' 00:00';	
112 112
 } else {
113
-  $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' ' . $_REQUEST['time_start'];
113
+    $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' ' . $_REQUEST['time_start'];
114 114
 }
115 115
 
116 116
 foreach($marketing->column_fields as $field)
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
     $_REQUEST['record'] =$marketing->campaign_id;
181 181
     $_POST['record']=$marketing->campaign_id;
182 182
     $_REQUEST['mode'] = $master;
183
-     $_POST['mode'] = $master; 
184
-     $_REQUEST['from_wiz']= 'true';
183
+        $_POST['mode'] = $master; 
184
+        $_REQUEST['from_wiz']= 'true';
185 185
     require_once('modules/Campaigns/QueueCampaign.php');
186 186
 }
187 187
 
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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.
@@ -53,18 +53,18 @@  discard block
 block discarded – undo
53 53
 $master = 'save';
54 54
 if (isset($_REQUEST['wiz_home_next_step']) && !empty($_REQUEST['wiz_home_next_step'])) {
55 55
     
56
-    if($_REQUEST['wiz_home_next_step']==3){
56
+    if ($_REQUEST['wiz_home_next_step'] == 3) {
57 57
         //user has chosen to save and schedule this campaign for email
58 58
         $master = 'send';
59
-    }elseif($_REQUEST['wiz_home_next_step']==2){
59
+    }elseif ($_REQUEST['wiz_home_next_step'] == 2) {
60 60
         //user has chosen to save and send this campaign in test mode
61 61
         $master = 'test';
62
-    }else{
62
+    } else {
63 63
         //user has chosen to simply save
64
-        $master  = 'save';        
64
+        $master = 'save';        
65 65
     }
66 66
         
67
-}else{
67
+} else {
68 68
      //default to just saving and exiting wizard
69 69
      $master = 'save';   
70 70
 }
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
     $marketing->retrieve($_REQUEST['record']);
79 79
 }
80 80
 else {
81
-    if(!empty($_SESSION['campaignWizard'][$_REQUEST['campaign_id']]['defaultSelectedMarketingId'])) {
81
+    if (!empty($_SESSION['campaignWizard'][$_REQUEST['campaign_id']]['defaultSelectedMarketingId'])) {
82 82
         $marketing->retrieve($_SESSION['campaignWizard'][$_REQUEST['campaign_id']]['defaultSelectedMarketingId']);
83 83
     }
84 84
 }
85
-if(!$marketing->ACLAccess('Save')){
85
+if (!$marketing->ACLAccess('Save')) {
86 86
         ACLController::displayNoAccess(true);
87 87
         sugar_cleanup(true);
88 88
 }
@@ -95,40 +95,40 @@  discard block
 block discarded – undo
95 95
 }
96 96
 
97 97
     foreach ($_REQUEST as $key => $val) {
98
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
99
-              $newkey  =substr($key, strlen($prefix)) ;
98
+              if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) {
99
+              $newkey = substr($key, strlen($prefix));
100 100
               $_REQUEST[$newkey] = $val;
101 101
          }               
102 102
     }
103 103
 
104 104
     foreach ($_REQUEST as $key => $val) {
105
-              if((strstr($key, $prefix )) && (strpos($key, $prefix )== 0)){
106
-              $newkey  =substr($key, strlen($prefix)) ;
105
+              if ((strstr($key, $prefix)) && (strpos($key, $prefix) == 0)) {
106
+              $newkey = substr($key, strlen($prefix));
107 107
               $_REQUEST[$newkey] = $val;
108 108
          }               
109 109
     }
110 110
 
111
-if(!empty($_REQUEST['meridiem'])){
112
-    $_REQUEST['time_start'] = $timedate->merge_time_meridiem($_REQUEST['time_start'],$timedate->get_time_format(), $_REQUEST['meridiem']);
111
+if (!empty($_REQUEST['meridiem'])) {
112
+    $_REQUEST['time_start'] = $timedate->merge_time_meridiem($_REQUEST['time_start'], $timedate->get_time_format(), $_REQUEST['meridiem']);
113 113
 }
114 114
 
115
-if(empty($_REQUEST['time_start'])) {
116
-  $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' 00:00';	
115
+if (empty($_REQUEST['time_start'])) {
116
+  $_REQUEST['date_start'] = $_REQUEST['date_start'].' 00:00';	
117 117
 } else {
118
-  $_REQUEST['date_start'] = $_REQUEST['date_start'] . ' ' . $_REQUEST['time_start'];
118
+  $_REQUEST['date_start'] = $_REQUEST['date_start'].' '.$_REQUEST['time_start'];
119 119
 }
120 120
 
121
-foreach($marketing->column_fields as $field)
121
+foreach ($marketing->column_fields as $field)
122 122
 {
123 123
     if ($field == 'all_prospect_lists') {
124
-        if(isset($_REQUEST[$field]) && $_REQUEST[$field]='on' )
124
+        if (isset($_REQUEST[$field]) && $_REQUEST[$field] = 'on')
125 125
         {
126 126
             $marketing->$field = 1;
127 127
         } else {
128 128
             $marketing->$field = 0;         
129 129
         }
130
-    }else {
131
-        if(isset($_REQUEST[$field]))
130
+    } else {
131
+        if (isset($_REQUEST[$field]))
132 132
         {
133 133
             $value = $_REQUEST[$field];
134 134
             $marketing->$field = trim($value);
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
     }
137 137
 }
138 138
 
139
-foreach($marketing->additional_column_fields as $field)
139
+foreach ($marketing->additional_column_fields as $field)
140 140
 {
141
-    if(isset($_REQUEST[$field]))
141
+    if (isset($_REQUEST[$field]))
142 142
     {
143 143
         $value = $_REQUEST[$field];
144 144
         $marketing->$field = $value;
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 
151 151
 //add prospect lists to campaign.
152 152
 $marketing->load_relationship('prospectlists');
153
-$prospectlists=$marketing->prospectlists->get();
154
-if ($marketing->all_prospect_lists==1) {
153
+$prospectlists = $marketing->prospectlists->get();
154
+if ($marketing->all_prospect_lists == 1) {
155 155
     //remove all related prospect lists.
156 156
     if (!empty($prospectlists)) {
157 157
         $marketing->prospectlists->delete($marketing->id);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
     if (isset($_REQUEST['message_for']) && is_array($_REQUEST['message_for'])) {
161 161
         foreach ($_REQUEST['message_for'] as $prospect_list_id) {
162 162
             
163
-            $key=array_search($prospect_list_id,$prospectlists);
163
+            $key = array_search($prospect_list_id, $prospectlists);
164 164
             if ($key === null or $key === false) {
165 165
                 $marketing->prospectlists->add($prospect_list_id);          
166 166
             } else {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         }
170 170
         if (count($prospectlists) != 0) {
171 171
             foreach ($prospectlists as $key=>$list_id) {
172
-                $marketing->prospectlists->delete($marketing->id,$list_id);             
172
+                $marketing->prospectlists->delete($marketing->id, $list_id);             
173 173
             }   
174 174
         }
175 175
     }
@@ -179,21 +179,21 @@  discard block
 block discarded – undo
179 179
 $mass[] = $marketing->id; 
180 180
 //if sending an email was chosen, set all the needed variables for queuing campaign
181 181
 
182
-if($master !='save'){
183
-    $_REQUEST['mass']= $mass;
184
-    $_POST['mass']=$mass;
185
-    $_REQUEST['record'] =$marketing->campaign_id;
186
-    $_POST['record']=$marketing->campaign_id;
182
+if ($master != 'save') {
183
+    $_REQUEST['mass'] = $mass;
184
+    $_POST['mass'] = $mass;
185
+    $_REQUEST['record'] = $marketing->campaign_id;
186
+    $_POST['record'] = $marketing->campaign_id;
187 187
     $_REQUEST['mode'] = $master;
188 188
      $_POST['mode'] = $master; 
189
-     $_REQUEST['from_wiz']= 'true';
189
+     $_REQUEST['from_wiz'] = 'true';
190 190
     require_once('modules/Campaigns/QueueCampaign.php');
191 191
 }
192 192
 
193
-if(isset($_REQUEST['show_wizard_summary']) && $_REQUEST['show_wizard_summary']) {
193
+if (isset($_REQUEST['show_wizard_summary']) && $_REQUEST['show_wizard_summary']) {
194 194
 
195
-    if( (isset($_REQUEST['sendMarketingEmailTest']) && $_REQUEST['sendMarketingEmailTest']) ||
196
-        (isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule']) ) {
195
+    if ((isset($_REQUEST['sendMarketingEmailTest']) && $_REQUEST['sendMarketingEmailTest']) ||
196
+        (isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule'])) {
197 197
         // set correct post variables..
198 198
         $_POST['module'] = 'Campaigns';
199 199
         $_POST['action'] = 'QueueCampaign';
@@ -205,10 +205,10 @@  discard block
 block discarded – undo
205 205
         $_POST['direct_step'] = '1';
206 206
         //$_POST['campaign_id'] = '';
207 207
         $_POST['wiz_mass'] = $marketing->id;
208
-        if(isset($_REQUEST['sendMarketingEmailTest']) && $_REQUEST['sendMarketingEmailTest']) {
208
+        if (isset($_REQUEST['sendMarketingEmailTest']) && $_REQUEST['sendMarketingEmailTest']) {
209 209
             $_POST['mode'] = 'test';
210 210
         }
211
-        else if(isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule']) {
211
+        else if (isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule']) {
212 212
             $_POST['mode'] = 'send';
213 213
             $_SESSION['msg'] = 'LBL_EMAILS_SCHEDULED';
214 214
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         exit;
223 223
     }
224 224
 
225
-    $header_URL = "Location: index.php?action=WizardMarketing&module=Campaigns&return_module=Campaigns&return_action=WizardHome&return_id=" . $marketing->campaign_id . "&campaign_id=" . $marketing->campaign_id . "&jump=3&marketing_id=" . $marketing->id;
225
+    $header_URL = "Location: index.php?action=WizardMarketing&module=Campaigns&return_module=Campaigns&return_action=WizardHome&return_id=".$marketing->campaign_id."&campaign_id=".$marketing->campaign_id."&jump=3&marketing_id=".$marketing->id;
226 226
 }
227 227
 else {
228 228
     $header_URL = "Location: index.php?action=WizardHome&module=Campaigns&record=".$marketing->campaign_id;
Please login to merge, or discard this patch.
Braces   +12 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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.
@@ -56,15 +58,15 @@  discard block
 block discarded – undo
56 58
     if($_REQUEST['wiz_home_next_step']==3){
57 59
         //user has chosen to save and schedule this campaign for email
58 60
         $master = 'send';
59
-    }elseif($_REQUEST['wiz_home_next_step']==2){
61
+    } elseif($_REQUEST['wiz_home_next_step']==2){
60 62
         //user has chosen to save and send this campaign in test mode
61 63
         $master = 'test';
62
-    }else{
64
+    } else{
63 65
         //user has chosen to simply save
64 66
         $master  = 'save';        
65 67
     }
66 68
         
67
-}else{
69
+} else{
68 70
      //default to just saving and exiting wizard
69 71
      $master = 'save';   
70 72
 }
@@ -76,8 +78,7 @@  discard block
 block discarded – undo
76 78
 $marketing = new EmailMarketing();
77 79
 if (isset($_REQUEST['record']) && !empty($_REQUEST['record'])) {
78 80
     $marketing->retrieve($_REQUEST['record']);
79
-}
80
-else {
81
+} else {
81 82
     if(!empty($_SESSION['campaignWizard'][$_REQUEST['campaign_id']]['defaultSelectedMarketingId'])) {
82 83
         $marketing->retrieve($_SESSION['campaignWizard'][$_REQUEST['campaign_id']]['defaultSelectedMarketingId']);
83 84
     }
@@ -89,8 +90,7 @@  discard block
 block discarded – undo
89 90
 
90 91
 if (!empty($_REQUEST['assigned_user_id']) && ($marketing->assigned_user_id != $_REQUEST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
91 92
     $check_notify = TRUE;
92
-}
93
-else {
93
+} else {
94 94
     $check_notify = FALSE;
95 95
 }
96 96
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         } else {
128 128
             $marketing->$field = 0;         
129 129
         }
130
-    }else {
130
+    } else {
131 131
         if(isset($_REQUEST[$field]))
132 132
         {
133 133
             $value = $_REQUEST[$field];
@@ -207,12 +207,10 @@  discard block
 block discarded – undo
207 207
         $_POST['wiz_mass'] = $marketing->id;
208 208
         if(isset($_REQUEST['sendMarketingEmailTest']) && $_REQUEST['sendMarketingEmailTest']) {
209 209
             $_POST['mode'] = 'test';
210
-        }
211
-        else if(isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule']) {
210
+        } else if(isset($_REQUEST['sendMarketingEmailSchedule']) && $_REQUEST['sendMarketingEmailSchedule']) {
212 211
             $_POST['mode'] = 'send';
213 212
             $_SESSION['msg'] = 'LBL_EMAILS_SCHEDULED';
214
-        }
215
-        else {
213
+        } else {
216 214
             throw new Exception('request error');
217 215
         }
218 216
 
@@ -223,8 +221,7 @@  discard block
 block discarded – undo
223 221
     }
224 222
 
225 223
     $header_URL = "Location: index.php?action=WizardMarketing&module=Campaigns&return_module=Campaigns&return_action=WizardHome&return_id=" . $marketing->campaign_id . "&campaign_id=" . $marketing->campaign_id . "&jump=3&marketing_id=" . $marketing->id;
226
-}
227
-else {
224
+} else {
228 225
     $header_URL = "Location: index.php?action=WizardHome&module=Campaigns&record=".$marketing->campaign_id;
229 226
 }
230 227
 
Please login to merge, or discard this patch.
modules/AOR_Conditions/conditionLines.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@
 block discarded – undo
70 70
             $html .= "</script>";
71 71
         }
72 72
 
73
-    }
74
-    else if($view == 'DetailView'){
73
+    } else if($view == 'DetailView'){
75 74
         $html .= '<script src="modules/AOR_Conditions/conditionLines.js"></script>';
76 75
         $html .= "<table border='0' cellspacing='0' width='100%' id='conditionLines'></table>";
77 76
 
Please login to merge, or discard this patch.
modules/EmailTemplates/field_arrays.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -46,19 +46,19 @@
 block discarded – undo
46 46
  * Contributor(s): ______________________________________..
47 47
  ********************************************************************************/
48 48
 $fields_array['EmailTemplate'] = array ('column_fields' => Array("id"
49
-		, "date_entered"
50
-		, "date_modified"
51
-		, "modified_user_id"
52
-		, "created_by"
53
-		, "description"
54
-		, "subject"
55
-		, "body"
56
-		, "body_html"
57
-		, "name"
58
-		, "published"
59
-		),
49
+        , "date_entered"
50
+        , "date_modified"
51
+        , "modified_user_id"
52
+        , "created_by"
53
+        , "description"
54
+        , "subject"
55
+        , "body"
56
+        , "body_html"
57
+        , "name"
58
+        , "published"
59
+        ),
60 60
         'list_fields' =>  Array('id', 'name', 'description','date_modified'
61
-	),
61
+    ),
62 62
     'required_fields' => array("name"=>1),
63 63
 );
64 64
 ?>
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 );
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
modules/EmailTemplates/PopupDocumentsCampaignTemplate.php 3 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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.
@@ -94,8 +96,11 @@  discard block
 block discarded – undo
94 96
 $form->assign('MODULE_NAME', $currentModule);
95 97
 $form->assign('NAME', $name);
96 98
 $form->assign('DOCUMENT_NAME', $document_name);
97
-if(isset($_REQUEST['target'])) $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
98
-else $form->assign('DOCUMENT_TARGET', '');
99
+if(isset($_REQUEST['target'])) {
100
+    $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
101
+} else {
102
+    $form->assign('DOCUMENT_TARGET', '');
103
+}
99 104
 
100 105
 $form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
101 106
 
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -49,25 +49,25 @@  discard block
 block discarded – undo
49 49
 
50 50
 class DocumentPopupPicker extends Popup_Picker {
51 51
 
52
-	public function __construct()
53
-	{
54
-	}
55
-
56
-	public function _get_where_clause() {
57
-		$where = '';
58
-		if(isset($_REQUEST['query']))
59
-		{
60
-			$where_clauses = array();
61
-			append_where_clause($where_clauses, "document_name", "documents.document_name");
62
-			append_where_clause($where_clauses, "category_id", "documents.category_id");
63
-			append_where_clause($where_clauses, "subcategory_id", "documents.subcategory_id");
64
-			append_where_clause($where_clauses, "template_type", "documents.template_type");
65
-			append_where_clause($where_clauses, "is_template", "documents.is_template");
66
-
67
-			$where = generate_where_statement($where_clauses);
68
-		}
69
-		return $where;
70
-	}
52
+    public function __construct()
53
+    {
54
+    }
55
+
56
+    public function _get_where_clause() {
57
+        $where = '';
58
+        if(isset($_REQUEST['query']))
59
+        {
60
+            $where_clauses = array();
61
+            append_where_clause($where_clauses, "document_name", "documents.document_name");
62
+            append_where_clause($where_clauses, "category_id", "documents.category_id");
63
+            append_where_clause($where_clauses, "subcategory_id", "documents.subcategory_id");
64
+            append_where_clause($where_clauses, "template_type", "documents.template_type");
65
+            append_where_clause($where_clauses, "is_template", "documents.is_template");
66
+
67
+            $where = generate_where_statement($where_clauses);
68
+        }
69
+        return $where;
70
+    }
71 71
 
72 72
 }
73 73
 
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 $button  = "<form action='index.php' method='post' name='form' id='form'>\n";
102 102
 if(!$hide_clear_button)
103 103
 {
104
-	$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
105
-		.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
106
-		.$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
104
+    $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
105
+        .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
106
+        .$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
107 107
 }
108 108
 $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
109
-	.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
110
-	.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
111
-	.$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
109
+    .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
110
+    .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
111
+    .$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
112 112
 $button .= "</form>\n";
113 113
 
114 114
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
55 55
 
56 56
 	public function _get_where_clause() {
57 57
 		$where = '';
58
-		if(isset($_REQUEST['query']))
58
+		if (isset($_REQUEST['query']))
59 59
 		{
60 60
 			$where_clauses = array();
61 61
 			append_where_clause($where_clauses, "document_name", "documents.document_name");
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
101
-$button  = "<form action='index.php' method='post' name='form' id='form'>\n";
102
-if(!$hide_clear_button)
101
+$button = "<form action='index.php' method='post' name='form' id='form'>\n";
102
+if (!$hide_clear_button)
103 103
 {
104 104
 	$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
105 105
 		.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 $form->assign('MODULE_NAME', $currentModule);
120 120
 $form->assign('NAME', $name);
121 121
 $form->assign('DOCUMENT_NAME', $document_name);
122
-if(isset($_REQUEST['target'])) $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
122
+if (isset($_REQUEST['target'])) $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
123 123
 else $form->assign('DOCUMENT_TARGET', '');
124 124
 
125 125
 $form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
Please login to merge, or discard this patch.
modules/EmailTemplates/AttachFiles.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
39 39
  ********************************************************************************/
40 40
 
41
- //Request object must have these property values:
42
- //		Module: module name, this module should have a file called TreeData.php
43
- //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
- //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
41
+    //Request object must have these property values:
42
+    //		Module: module name, this module should have a file called TreeData.php
43
+    //		Function: name of the function to be called in TreeData.php, the function will be called statically.
44
+    //		PARAM prefixed properties: array of these property/values will be passed to the function as parameter.
45 45
 
46 46
 
47 47
 require_once('include/JSON.php');
@@ -56,27 +56,27 @@  discard block
 block discarded – undo
56 56
 $ret = array();
57 57
 
58 58
 foreach($_FILES as $k => $file) {
59
-	if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) {
60
-	    $upload_file = new UploadFile($k);
61
-		// check the file
62
-		if($upload_file->confirm_upload()) {
63
-		    $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name
64
-		    $guid = create_guid();
65
-		    if($upload_file->final_move($guid)) { // move to uploads
66
-		        $path = $upload_file->get_upload_path($guid);
67
-		        // if file is OK, copy to cache
68
-		        if(verify_uploaded_image($path) && copy($path, $dest)) {
69
-		            $ret[] = $dest;
70
-		        }
71
-		        // remove temp file
72
-		        unlink($path);
73
-		    }
74
-		}
75
-	}
59
+    if(in_array(strtolower($_FILES[$k]['type']), $imgType) && $_FILES[$k]['size'] > 0) {
60
+        $upload_file = new UploadFile($k);
61
+        // check the file
62
+        if($upload_file->confirm_upload()) {
63
+            $dest = $cachedir.basename($upload_file->get_stored_file_name()); // target name
64
+            $guid = create_guid();
65
+            if($upload_file->final_move($guid)) { // move to uploads
66
+                $path = $upload_file->get_upload_path($guid);
67
+                // if file is OK, copy to cache
68
+                if(verify_uploaded_image($path) && copy($path, $dest)) {
69
+                    $ret[] = $dest;
70
+                }
71
+                // remove temp file
72
+                unlink($path);
73
+            }
74
+        }
75
+    }
76 76
 }
77 77
 
78 78
 if (!empty($ret)) {
79
-	$json = getJSONobj();
80
-	echo $json->encode($ret);
81
-	//return the parameters
79
+    $json = getJSONobj();
80
+    echo $json->encode($ret);
81
+    //return the parameters
82 82
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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.
@@ -47,8 +49,9 @@  discard block
 block discarded – undo
47 49
 require_once('include/JSON.php');
48 50
 require_once('include/upload_file.php');
49 51
 
50
-if (!is_dir($cachedir = sugar_cached('images/')))
52
+if (!is_dir($cachedir = sugar_cached('images/'))) {
51 53
     mkdir_recursive($cachedir);
54
+}
52 55
 
53 56
 // cn: bug 11012 - fixed some MIME types not getting picked up.  Also changed array iterator.
54 57
 $imgType = array('image/gif', 'image/png', 'image/x-png', 'image/bmp', 'image/jpeg', 'image/jpg', 'image/pjpeg');
Please login to merge, or discard this patch.
modules/EmailTemplates/EditView.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'] . '&nbsp;&nbsp;';
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'].'&nbsp;&nbsp;';
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);
Please login to merge, or discard this patch.
Braces   +42 added lines, -12 removed lines patch added patch discarded remove patch
@@ -68,7 +68,9 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 //setting default flag value so due date and time not required
71
-if (!isset($focus->id)) $focus->date_due_flag = 1;
71
+if (!isset($focus->id)) {
72
+    $focus->date_due_flag = 1;
73
+}
72 74
 
73 75
 //needed when creating a new case with default values passed in
74 76
 if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
@@ -130,12 +132,16 @@  discard block
 block discarded – undo
130 132
 $xtpl->parse("main.variable_option");
131 133
 
132 134
 $returnAction = 'index';
133
-if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
135
+if (isset($_REQUEST['return_module'])) {
136
+    $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
137
+}
134 138
 if (isset($_REQUEST['return_action'])) {
135 139
     $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
136 140
     $returnAction = $_REQUEST['return_action'];
137 141
 }
138
-if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
142
+if (isset($_REQUEST['return_id'])) {
143
+    $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
144
+}
139 145
 // handle Create $module then Cancel
140 146
 if (empty($_REQUEST['return_id'])) {
141 147
     $xtpl->assign("RETURN_ACTION", 'index');
@@ -164,8 +170,9 @@  discard block
 block discarded – undo
164 170
 );
165 171
 $json = getJSONobj();
166 172
 $xtpl->assign('encoded_assigned_users_popup_request_data', $json->encode($popup_request_data));
167
-if (!empty($focus->assigned_user_name))
173
+if (!empty($focus->assigned_user_name)) {
168 174
     $xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
175
+}
169 176
 
170 177
 $xtpl->assign("assign_user_select", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT']));
171 178
 $xtpl->assign("assign_user_clear", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR']));
@@ -187,23 +194,38 @@  discard block
 block discarded – undo
187 194
 $xtpl->assign("JSLANG", $jsLang);
188 195
 
189 196
 $xtpl->assign("ID", $focus->id);
190
-if (isset($focus->name)) $xtpl->assign("NAME", $focus->name); else $xtpl->assign("NAME", "");
197
+if (isset($focus->name)) {
198
+    $xtpl->assign("NAME", $focus->name);
199
+} else {
200
+    $xtpl->assign("NAME", "");
201
+}
191 202
 
192 203
 //Bug45632
193 204
 /* BEGIN - SECURITY GROUPS */
194 205
 /**
195 206
  * if(isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); else $xtpl->assign("ASSIGNED_USER_ID", "");
196 207
  */
197
-if (isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
198
-else if (empty($focus->id) && empty($focus->assigned_user_id)) {
208
+if (isset($focus->assigned_user_id)) {
209
+    $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
210
+} else if (empty($focus->id) && empty($focus->assigned_user_id)) {
199 211
     $xtpl->assign("ASSIGNED_USER_ID", $current_user->id);
200 212
     $xtpl->assign("ASSIGNED_USER_NAME", get_assigned_user_name($current_user->id));
201
-} else $xtpl->assign("ASSIGNED_USER_ID", "");
213
+} else {
214
+    $xtpl->assign("ASSIGNED_USER_ID", "");
215
+}
202 216
 /* END - SECURITY GROUPS */
203 217
 //Bug45632
204 218
 
205
-if (isset($focus->description)) $xtpl->assign("DESCRIPTION", $focus->description); else $xtpl->assign("DESCRIPTION", "");
206
-if (isset($focus->subject)) $xtpl->assign("SUBJECT", $focus->subject); else $xtpl->assign("SUBJECT", "");
219
+if (isset($focus->description)) {
220
+    $xtpl->assign("DESCRIPTION", $focus->description);
221
+} else {
222
+    $xtpl->assign("DESCRIPTION", "");
223
+}
224
+if (isset($focus->subject)) {
225
+    $xtpl->assign("SUBJECT", $focus->subject);
226
+} else {
227
+    $xtpl->assign("SUBJECT", "");
228
+}
207 229
 if ($focus->published == 'on') {
208 230
     $xtpl->assign("PUBLISHED", "CHECKED");
209 231
 }
@@ -244,8 +266,16 @@  discard block
 block discarded – undo
244 266
 $xtpl->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['record_type_display'], $focus->parent_type));
245 267
 //$xtpl->assign("DEFAULT_MODULE","Accounts");
246 268
 
247
-if (isset($focus->body)) $xtpl->assign("BODY", $focus->body); else $xtpl->assign("BODY", "");
248
-if (isset($focus->body_html)) $xtpl->assign("BODY_HTML", $focus->body_html); else $xtpl->assign("BODY_HTML", "");
269
+if (isset($focus->body)) {
270
+    $xtpl->assign("BODY", $focus->body);
271
+} else {
272
+    $xtpl->assign("BODY", "");
273
+}
274
+if (isset($focus->body_html)) {
275
+    $xtpl->assign("BODY_HTML", $focus->body_html);
276
+} else {
277
+    $xtpl->assign("BODY_HTML", "");
278
+}
249 279
 
250 280
 
251 281
 // ---------------------------------
Please login to merge, or discard this patch.
modules/EmailTemplates/CheckDeletable.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -50,38 +50,38 @@
 block discarded – undo
50 50
 
51 51
 $focus = new EmailTemplate();
52 52
 if($_REQUEST['from'] == 'DetailView') {
53
-	if(!isset($_REQUEST['record']))
54
-		sugar_die("A record number must be specified to delete the template.");
55
-	$focus->retrieve($_REQUEST['record']);
56
-	if(check_email_template_in_use($focus)) {
57
-		echo 'true';
58
-		return;
59
-	}
60
-	echo 'false';
53
+    if(!isset($_REQUEST['record']))
54
+        sugar_die("A record number must be specified to delete the template.");
55
+    $focus->retrieve($_REQUEST['record']);
56
+    if(check_email_template_in_use($focus)) {
57
+        echo 'true';
58
+        return;
59
+    }
60
+    echo 'false';
61 61
 } else if($_REQUEST['from'] == 'ListView') {
62
-	$returnString = '';
63
-	$idArray = explode(',', $_REQUEST['records']);
64
-	foreach($idArray as $key => $value) {
65
-		if($focus->retrieve($value)) {
66
-			if(check_email_template_in_use($focus)) {
67
-				$returnString .= $focus->name . ',';
68
-			}
69
-		}
70
-	}
71
-	$returnString = substr($returnString, 0, -1);
72
-	echo $returnString;
62
+    $returnString = '';
63
+    $idArray = explode(',', $_REQUEST['records']);
64
+    foreach($idArray as $key => $value) {
65
+        if($focus->retrieve($value)) {
66
+            if(check_email_template_in_use($focus)) {
67
+                $returnString .= $focus->name . ',';
68
+            }
69
+        }
70
+    }
71
+    $returnString = substr($returnString, 0, -1);
72
+    echo $returnString;
73 73
 } else {
74
-	echo '';
74
+    echo '';
75 75
 }
76 76
 
77 77
 function check_email_template_in_use($focus)
78 78
 {
79
-	if($focus->is_used_by_email_marketing()) {
80
-		return true;
81
-	}
82
-	$system = $GLOBALS['sugar_config']['passwordsetting'];
83
-	if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) {
84
-	    return true;
85
-	}
79
+    if($focus->is_used_by_email_marketing()) {
80
+        return true;
81
+    }
82
+    $system = $GLOBALS['sugar_config']['passwordsetting'];
83
+    if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) {
84
+        return true;
85
+    }
86 86
     return false;
87 87
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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.
@@ -49,22 +49,22 @@  discard block
 block discarded – undo
49 49
 require_once('modules/EmailTemplates/EmailTemplate.php');
50 50
 
51 51
 $focus = new EmailTemplate();
52
-if($_REQUEST['from'] == 'DetailView') {
53
-	if(!isset($_REQUEST['record']))
52
+if ($_REQUEST['from'] == 'DetailView') {
53
+	if (!isset($_REQUEST['record']))
54 54
 		sugar_die("A record number must be specified to delete the template.");
55 55
 	$focus->retrieve($_REQUEST['record']);
56
-	if(check_email_template_in_use($focus)) {
56
+	if (check_email_template_in_use($focus)) {
57 57
 		echo 'true';
58 58
 		return;
59 59
 	}
60 60
 	echo 'false';
61
-} else if($_REQUEST['from'] == 'ListView') {
61
+} else if ($_REQUEST['from'] == 'ListView') {
62 62
 	$returnString = '';
63 63
 	$idArray = explode(',', $_REQUEST['records']);
64
-	foreach($idArray as $key => $value) {
65
-		if($focus->retrieve($value)) {
66
-			if(check_email_template_in_use($focus)) {
67
-				$returnString .= $focus->name . ',';
64
+	foreach ($idArray as $key => $value) {
65
+		if ($focus->retrieve($value)) {
66
+			if (check_email_template_in_use($focus)) {
67
+				$returnString .= $focus->name.',';
68 68
 			}
69 69
 		}
70 70
 	}
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
 
77 77
 function check_email_template_in_use($focus)
78 78
 {
79
-	if($focus->is_used_by_email_marketing()) {
79
+	if ($focus->is_used_by_email_marketing()) {
80 80
 		return true;
81 81
 	}
82 82
 	$system = $GLOBALS['sugar_config']['passwordsetting'];
83
-	if($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) {
83
+	if ($focus->id == $system['generatepasswordtmpl'] || $focus->id == $system['lostpasswordtmpl']) {
84 84
 	    return true;
85 85
 	}
86 86
     return false;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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.
@@ -50,8 +52,9 @@  discard block
 block discarded – undo
50 52
 
51 53
 $focus = new EmailTemplate();
52 54
 if($_REQUEST['from'] == 'DetailView') {
53
-	if(!isset($_REQUEST['record']))
54
-		sugar_die("A record number must be specified to delete the template.");
55
+	if(!isset($_REQUEST['record'])) {
56
+			sugar_die("A record number must be specified to delete the template.");
57
+	}
55 58
 	$focus->retrieve($_REQUEST['record']);
56 59
 	if(check_email_template_in_use($focus)) {
57 60
 		echo 'true';
Please login to merge, or discard this patch.
modules/EmailTemplates/templateFields.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
             require_once($beanFiles[$beanList[$key]]);
47 47
             $focus = new $beanList[$key];
48 48
             $loopControl[$key][$key] = $focus;
49
-            $prefixes[$key] = strtolower($focus->object_name) . '_';
50
-            if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_';
49
+            $prefixes[$key] = strtolower($focus->object_name).'_';
50
+            if ($focus->object_name == 'Case') $prefixes[$key] = 'a'.strtolower($focus->object_name).'_';
51 51
         }
52 52
     }
53 53
 
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
         if (isset($beanList[$key]) && isset($beanFiles[$beanList[$key]]) && !str_begin($key, 'AOW_') && !str_begin($key, 'zr2_')) {
126 126
 
127 127
             if ($key == 'Contacts') {
128
-                $dropdown .= "<option value='" . $key . "'>
129
-						" . $lblContactAndOthers . "
128
+                $dropdown .= "<option value='".$key."'>
129
+						" . $lblContactAndOthers."
130 130
 		  	       </option>";
131 131
             } else if (isset($app_list_strings['moduleListSingular'][$key])) {
132
-                $dropdown .= "<option value='" . $key . "'>
133
-						" . $app_list_strings['moduleListSingular'][$key] . "
132
+                $dropdown .= "<option value='".$key."'>
133
+						" . $app_list_strings['moduleListSingular'][$key]."
134 134
 		  	       </option>";
135 135
             } else {
136
-                $dropdown .= "<option value='" . $key . "'>
137
-						" . $app_list_strings['moduleList'][$key] . "
136
+                $dropdown .= "<option value='".$key."'>
137
+						" . $app_list_strings['moduleList'][$key]."
138 138
 		  	       </option>";
139 139
             }
140 140
         }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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
 
5 7
 function generateFieldDefsJS2()
@@ -47,7 +49,9 @@  discard block
 block discarded – undo
47 49
             $focus = new $beanList[$key];
48 50
             $loopControl[$key][$key] = $focus;
49 51
             $prefixes[$key] = strtolower($focus->object_name) . '_';
50
-            if ($focus->object_name == 'Case') $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_';
52
+            if ($focus->object_name == 'Case') {
53
+                $prefixes[$key] = 'a' . strtolower($focus->object_name) . '_';
54
+            }
51 55
         }
52 56
     }
53 57
 
@@ -94,8 +98,9 @@  discard block
 block discarded – undo
94 98
                         break;
95 99
                     }
96 100
                 }
97
-                if ($dup)
98
-                    $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
101
+                if ($dup) {
102
+                                    $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
103
+                }
99 104
             }
100 105
         }
101 106
     }
Please login to merge, or discard this patch.