Passed
Push — scrutinizer-code-quality ( 27193c...09f5a1 )
by Adam
51:28
created
modules/EmailTemplates/PopupDocumentsCampaignTemplate.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@
 block discarded – undo
76 76
 $button  = "<form action='index.php' method='post' name='form' id='form'>\n";
77 77
 if(!$hide_clear_button)
78 78
 {
79
-	$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
80
-		.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
81
-		.$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
79
+    $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
80
+        .$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
81
+        .$app_strings['LBL_CLEAR_BUTTON_LABEL']."  ' />\n";
82 82
 }
83 83
 $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
84
-	.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
85
-	.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
86
-	.$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
84
+    .$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
85
+    .$app_strings['LBL_CANCEL_BUTTON_KEY']."' value='  "
86
+    .$app_strings['LBL_CANCEL_BUTTON_LABEL']."  ' />\n";
87 87
 $button .= "</form>\n";
88 88
 
89 89
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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.
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
 
75 75
 $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
76
-$button  = "<form action='index.php' method='post' name='form' id='form'>\n";
77
-if(!$hide_clear_button)
76
+$button = "<form action='index.php' method='post' name='form' id='form'>\n";
77
+if (!$hide_clear_button)
78 78
 {
79 79
 	$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
80 80
 		.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' value='  "
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 $form->assign('MODULE_NAME', $currentModule);
95 95
 $form->assign('NAME', $name);
96 96
 $form->assign('DOCUMENT_NAME', $document_name);
97
-if(isset($_REQUEST['target'])) $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
97
+if (isset($_REQUEST['target'])) $form->assign('DOCUMENT_TARGET', $_REQUEST['target']);
98 98
 else $form->assign('DOCUMENT_TARGET', '');
99 99
 
100 100
 $form->assign('DOCUMENT_REVISION_ID', $document_revision_id);
Please login to merge, or discard this patch.
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.
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   +45 added lines, -13 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
 require_once('modules/Campaigns/utils.php');
5 7
 
@@ -26,7 +28,9 @@  discard block
 block discarded – undo
26 28
 
27 29
 
28 30
 //setting default flag value so due date and time not required
29
-if (!isset($focus->id)) $focus->date_due_flag = 1;
31
+if (!isset($focus->id)) {
32
+    $focus->date_due_flag = 1;
33
+}
30 34
 
31 35
 //needed when creating a new case with default values passed in
32 36
 if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
@@ -85,12 +89,16 @@  discard block
 block discarded – undo
85 89
 $xtpl->parse("main.variable_option");
86 90
 
87 91
 $returnAction = 'index';
88
-if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
92
+if (isset($_REQUEST['return_module'])) {
93
+    $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
94
+}
89 95
 if (isset($_REQUEST['return_action'])) {
90 96
     $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
91 97
     $returnAction = $_REQUEST['return_action'];
92 98
 }
93
-if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
99
+if (isset($_REQUEST['return_id'])) {
100
+    $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
101
+}
94 102
 // handle Create $module then Cancel
95 103
 if (empty($_REQUEST['return_id'])) {
96 104
     $xtpl->assign("RETURN_ACTION", 'index');
@@ -119,8 +127,9 @@  discard block
 block discarded – undo
119 127
 );
120 128
 $json = getJSONobj();
121 129
 $xtpl->assign('encoded_assigned_users_popup_request_data', $json->encode($popup_request_data));
122
-if (!empty($focus->assigned_user_name))
130
+if (!empty($focus->assigned_user_name)) {
123 131
     $xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
132
+}
124 133
 
125 134
 $xtpl->assign("assign_user_select", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT']));
126 135
 $xtpl->assign("assign_user_clear", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR']));
@@ -142,24 +151,39 @@  discard block
 block discarded – undo
142 151
 $xtpl->assign("JSLANG", $jsLang);
143 152
 
144 153
 $xtpl->assign("ID", $focus->id);
145
-if (isset($focus->name)) $xtpl->assign("NAME", $focus->name); else $xtpl->assign("NAME", "");
154
+if (isset($focus->name)) {
155
+    $xtpl->assign("NAME", $focus->name);
156
+} else {
157
+    $xtpl->assign("NAME", "");
158
+}
146 159
 
147 160
 //Bug45632
148 161
 /* BEGIN - SECURITY GROUPS */
149 162
 /**
150 163
  * if(isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); else $xtpl->assign("ASSIGNED_USER_ID", "");
151 164
  */
152
-if (isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
153
-else if (empty($focus->id) && empty($focus->assigned_user_id)) {
165
+if (isset($focus->assigned_user_id)) {
166
+    $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
167
+} else if (empty($focus->id) && empty($focus->assigned_user_id)) {
154 168
     global $current_user;
155 169
     $xtpl->assign("ASSIGNED_USER_ID", $current_user->id);
156 170
     $xtpl->assign("ASSIGNED_USER_NAME", get_assigned_user_name($current_user->id));
157
-} else $xtpl->assign("ASSIGNED_USER_ID", "");
171
+} else {
172
+    $xtpl->assign("ASSIGNED_USER_ID", "");
173
+}
158 174
 /* END - SECURITY GROUPS */
159 175
 //Bug45632
160 176
 
161
-if (isset($focus->description)) $xtpl->assign("DESCRIPTION", $focus->description); else $xtpl->assign("DESCRIPTION", "");
162
-if (isset($focus->subject)) $xtpl->assign("SUBJECT", $focus->subject); else $xtpl->assign("SUBJECT", "");
177
+if (isset($focus->description)) {
178
+    $xtpl->assign("DESCRIPTION", $focus->description);
179
+} else {
180
+    $xtpl->assign("DESCRIPTION", "");
181
+}
182
+if (isset($focus->subject)) {
183
+    $xtpl->assign("SUBJECT", $focus->subject);
184
+} else {
185
+    $xtpl->assign("SUBJECT", "");
186
+}
163 187
 if ($focus->published == 'on') {
164 188
     $xtpl->assign("PUBLISHED", "CHECKED");
165 189
 }
@@ -201,8 +225,16 @@  discard block
 block discarded – undo
201 225
 $xtpl->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['record_type_display'], $focus->parent_type));
202 226
 //$xtpl->assign("DEFAULT_MODULE","Accounts");
203 227
 
204
-if (isset($focus->body)) $xtpl->assign("BODY", $focus->body); else $xtpl->assign("BODY", "");
205
-if (isset($focus->body_html)) $xtpl->assign("BODY_HTML", $focus->body_html); else $xtpl->assign("BODY_HTML", "");
228
+if (isset($focus->body)) {
229
+    $xtpl->assign("BODY", $focus->body);
230
+} else {
231
+    $xtpl->assign("BODY", "");
232
+}
233
+if (isset($focus->body_html)) {
234
+    $xtpl->assign("BODY_HTML", $focus->body_html);
235
+} else {
236
+    $xtpl->assign("BODY_HTML", "");
237
+}
206 238
 
207 239
 
208 240
 if (true) {
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.
modules/EmailTemplates/EmailTemplate.php 4 patches
Braces   +18 added lines, -11 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.
@@ -179,8 +181,9 @@  discard block
 block discarded – undo
179 181
                             break;
180 182
                         }
181 183
                     }
182
-                    if ($dup)
183
-                        $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
184
+                    if ($dup) {
185
+                                            $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
186
+                    }
184 187
                 }
185 188
             }
186 189
         }
@@ -253,8 +256,9 @@  discard block
 block discarded – undo
253 256
                             break;
254 257
                         }
255 258
                     }
256
-                    if ($dup)
257
-                        $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
259
+                    if ($dup) {
260
+                                            $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel);
261
+                    }
258 262
                 }
259 263
             }
260 264
         }
@@ -314,8 +318,9 @@  discard block
 block discarded – undo
314 318
     function parse_tracker_urls($template_text_array, $url_template, $tracked_urls, $removeme_url_template)
315 319
     {
316 320
         global $beanFiles, $beanList, $app_list_strings, $sugar_config;
317
-        if (!isset($this->parsed_urls))
318
-            $this->parsed_urls = array();
321
+        if (!isset($this->parsed_urls)) {
322
+                    $this->parsed_urls = array();
323
+        }
319 324
 
320 325
         $return_array = $template_text_array;
321 326
         if (count($tracked_urls) > 0) {
@@ -398,8 +403,9 @@  discard block
 block discarded – undo
398 403
             $user->retrieve($focus->assigned_user_id);
399 404
         }
400 405
 
401
-        if (!isset($this->parsed_entities))
402
-            $this->parsed_entities = array();
406
+        if (!isset($this->parsed_entities)) {
407
+                    $this->parsed_entities = array();
408
+        }
403 409
 
404 410
         //parse the template and find all the dynamic strings that need replacement.
405 411
         // Bug #48111 It's strange why prefix for User module is contact_user (see self::generateFieldDefsJS method)
@@ -775,8 +781,9 @@  discard block
 block discarded – undo
775 781
         $template = new EmailTemplate();
776 782
         $optionKey = $template->field_defs['type']['options'];
777 783
         $options = $GLOBALS['app_list_strings'][$optionKey];
778
-        if (!is_admin($GLOBALS['current_user']) && isset($options['workflow']))
779
-            unset($options['workflow']);
784
+        if (!is_admin($GLOBALS['current_user']) && isset($options['workflow'])) {
785
+                    unset($options['workflow']);
786
+        }
780 787
 
781 788
         return $options;
782 789
     }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     /**
120 120
      * Generates the extended field_defs for creating macros
121
-     * @return array
121
+     * @return string
122 122
      */
123 123
     function generateFieldDefsJS()
124 124
     {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     /**
366 366
      *
367 367
      * Method for replace "preg_match_all" in method "parse_tracker_urls"
368
-     * @param $text string String in which we need to search all string that match the pattern {.}
368
+     * @param string $text string String in which we need to search all string that match the pattern {.}
369 369
      * @return array result of search
370 370
      */
371 371
     private function _preg_match_tracker_url($text)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -817,7 +817,7 @@
 block discarded – undo
817 817
     public function save($check_notify = FALSE)
818 818
     {
819 819
         $this->repairMozaikClears();
820
-       return parent::save($check_notify);
820
+        return parent::save($check_notify);
821 821
     }
822 822
 
823 823
     public function retrieve($id = -1, $encode = true, $deleted = true)
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                             }
352 352
                             if (!empty($tracker_url) && !empty($template_text) && !empty($matches[0][$i][0]) && !empty($tracked_urls[$matches[0][$i][0]])) {
353 353
                                 $template_text = substr_replace($template_text, $tracker_url, $matches[0][$i][1], strlen($matches[0][$i][0]));
354
-                                $template_text = str_replace($sugar_config['site_url'] . '/' . $sugar_config['site_url'], $sugar_config['site_url'], $template_text);
354
+                                $template_text = str_replace($sugar_config['site_url'].'/'.$sugar_config['site_url'], $sugar_config['site_url'], $template_text);
355 355
                             }
356 356
                         }
357 357
                     }
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
         if ($beanList[$focus_name] == 'User') {
404 404
             $pattern_prefix = '$contact_user_';
405 405
         } else {
406
-            $pattern_prefix = '$' . strtolower($beanList[$focus_name]) . '_';
406
+            $pattern_prefix = '$'.strtolower($beanList[$focus_name]).'_';
407 407
         }
408 408
         $pattern_prefix_length = strlen($pattern_prefix);
409
-        $pattern = '/\\' . $pattern_prefix . '[A-Za-z_0-9]*/';
409
+        $pattern = '/\\'.$pattern_prefix.'[A-Za-z_0-9]*/';
410 410
 
411 411
         $return_array = array();
412 412
         foreach ($template_text_array as $key => $template_text) {
@@ -504,16 +504,16 @@  discard block
 block discarded – undo
504 504
                 $translated = translate($field_def['options'], 'Users', $user->$fieldName);
505 505
 
506 506
                 if (isset($translated) && !is_array($translated)) {
507
-                    $repl_arr["contact_user_" . $fieldName] = $translated;
507
+                    $repl_arr["contact_user_".$fieldName] = $translated;
508 508
                 } else { // unset enum field, make sure we have a match string to replace with ""
509
-                    $repl_arr["contact_user_" . $fieldName] = '';
509
+                    $repl_arr["contact_user_".$fieldName] = '';
510 510
                 }
511 511
             } else {
512 512
                 if (isset($user->$fieldName)) {
513 513
                     // bug 47647 - allow for fields to translate before adding to template
514
-                    $repl_arr["contact_user_" . $fieldName] = self::_convertToType($field_def['type'], $user->$fieldName);
514
+                    $repl_arr["contact_user_".$fieldName] = self::_convertToType($field_def['type'], $user->$fieldName);
515 515
                 } else {
516
-                    $repl_arr["contact_user_" . $fieldName] = "";
516
+                    $repl_arr["contact_user_".$fieldName] = "";
517 517
                 }
518 518
             }
519 519
         }
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
                 continue;
540 540
             }
541 541
             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
542
-                'contact_' . $field_def['name'] => '',
543
-                'contact_account_' . $field_def['name'] => '',
542
+                'contact_'.$field_def['name'] => '',
543
+                'contact_account_'.$field_def['name'] => '',
544 544
             ));
545 545
         }
546 546
         foreach ($prospect->field_defs as $field_def) {
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
                 continue;
549 549
             }
550 550
             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
551
-                'contact_' . $field_def['name'] => '',
552
-                'contact_account_' . $field_def['name'] => '',
551
+                'contact_'.$field_def['name'] => '',
552
+                'contact_account_'.$field_def['name'] => '',
553 553
             ));
554 554
         }
555 555
         foreach ($contact->field_defs as $field_def) {
@@ -557,8 +557,8 @@  discard block
 block discarded – undo
557 557
                 continue;
558 558
             }
559 559
             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
560
-                'contact_' . $field_def['name'] => '',
561
-                'contact_account_' . $field_def['name'] => '',
560
+                'contact_'.$field_def['name'] => '',
561
+                'contact_account_'.$field_def['name'] => '',
562 562
             ));
563 563
         }
564 564
         foreach ($acct->field_defs as $field_def) {
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
                 continue;
567 567
             }
568 568
             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
569
-                'account_' . $field_def['name'] => '',
570
-                'account_contact_' . $field_def['name'] => '',
569
+                'account_'.$field_def['name'] => '',
570
+                'account_contact_'.$field_def['name'] => '',
571 571
             ));
572 572
         }
573 573
         // cn: end bug 9277 fix
@@ -592,21 +592,21 @@  discard block
 block discarded – undo
592 592
 
593 593
                         if (isset($translated) && !is_array($translated)) {
594 594
                             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
595
-                                'account_' . $fieldName => $translated,
596
-                                'contact_account_' . $fieldName => $translated,
595
+                                'account_'.$fieldName => $translated,
596
+                                'contact_account_'.$fieldName => $translated,
597 597
                             ));
598 598
                         } else { // unset enum field, make sure we have a match string to replace with ""
599 599
                             $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
600
-                                'account_' . $fieldName => '',
601
-                                'contact_account_' . $fieldName => '',
600
+                                'account_'.$fieldName => '',
601
+                                'contact_account_'.$fieldName => '',
602 602
                             ));
603 603
                         }
604 604
                     } else {
605 605
                         // bug 47647 - allow for fields to translate before adding to template
606 606
                         $translated = self::_convertToType($field_def['type'], $acct->$fieldName);
607 607
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
608
-                            'account_' . $fieldName => $translated,
609
-                            'contact_account_' . $fieldName => $translated,
608
+                            'account_'.$fieldName => $translated,
609
+                            'contact_account_'.$fieldName => $translated,
610 610
                         ));
611 611
                     }
612 612
                 }
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
 
638 638
                     if (isset($translated) && !is_array($translated)) {
639 639
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
640
-                            'contact_' . $fieldName => $translated,
641
-                            'contact_account_' . $fieldName => $translated,
640
+                            'contact_'.$fieldName => $translated,
641
+                            'contact_account_'.$fieldName => $translated,
642 642
                         ));
643 643
                     } else { // unset enum field, make sure we have a match string to replace with ""
644 644
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
645
-                            'contact_' . $fieldName => '',
646
-                            'contact_account_' . $fieldName => '',
645
+                            'contact_'.$fieldName => '',
646
+                            'contact_account_'.$fieldName => '',
647 647
                         ));
648 648
                     }
649 649
                 } else {
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
                         // bug 47647 - allow for fields to translate before adding to template
652 652
                         $translated = self::_convertToType($field_def['type'], $contact->$fieldName);
653 653
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
654
-                            'contact_' . $fieldName => $translated,
655
-                            'contact_account_' . $fieldName => $translated,
654
+                            'contact_'.$fieldName => $translated,
655
+                            'contact_account_'.$fieldName => $translated,
656 656
                         ));
657 657
                     } // if
658 658
                 }
@@ -673,27 +673,27 @@  discard block
 block discarded – undo
673 673
 
674 674
                     if (isset($translated) && !is_array($translated)) {
675 675
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
676
-                            strtolower($beanList[$bean_name]) . "_" . $fieldName => $translated,
676
+                            strtolower($beanList[$bean_name])."_".$fieldName => $translated,
677 677
                         ));
678 678
                     } else { // unset enum field, make sure we have a match string to replace with ""
679 679
                         $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
680
-                            strtolower($beanList[$bean_name]) . "_" . $fieldName => '',
680
+                            strtolower($beanList[$bean_name])."_".$fieldName => '',
681 681
                         ));
682 682
                     }
683 683
                 } else {
684 684
                     // bug 47647 - translate currencies to appropriate values
685 685
                     $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
686
-                        strtolower($beanList[$bean_name]) . "_" . $fieldName => self::_convertToType($field_def['type'], $focus->$fieldName),
686
+                        strtolower($beanList[$bean_name])."_".$fieldName => self::_convertToType($field_def['type'], $focus->$fieldName),
687 687
                     ));
688 688
                 }
689 689
             } else {
690 690
                 if ($fieldName == 'full_name') {
691 691
                     $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
692
-                        strtolower($beanList[$bean_name]) . '_full_name' => $focus->get_summary_text(),
692
+                        strtolower($beanList[$bean_name]).'_full_name' => $focus->get_summary_text(),
693 693
                     ));
694 694
                 } else {
695 695
                     $repl_arr = EmailTemplate::add_replacement($repl_arr, $field_def, array(
696
-                        strtolower($beanList[$bean_name]) . "_" . $fieldName => '',
696
+                        strtolower($beanList[$bean_name])."_".$fieldName => '',
697 697
                     ));
698 698
                 }
699 699
             }
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     {
745 745
         foreach ($bean_arr as $bean_name => $bean_id) {
746 746
 
747
-            $focus = BeanFactory::getBean($bean_name,$bean_id);
747
+            $focus = BeanFactory::getBean($bean_name, $bean_id);
748 748
 
749 749
             if ($bean_name == 'Leads' || $bean_name == 'Prospects') {
750 750
                 $bean_name = 'Contacts';
Please login to merge, or discard this patch.
modules/Calendar/processScreenSize.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 
10
-if(
10
+if (
11 11
     (isset($_SESSION['screen_height']) ? $_SESSION['screen_height'] : null) != (isset($_POST['height']) ? $_POST['height'] : null) ||
12 12
     (isset($_SESSION['screen_width']) ? $_SESSION['screen_width'] : null) != (isset($_POST['width']) ? $_POST['width'] : null)) {
13 13
     $_SESSION['screen_height'] = $_POST['height'];
Please login to merge, or discard this patch.
modules/FP_events/responseEntryPoint.php 3 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4
-	global $db;
4
+    global $db;
5 5
 	 
6
-	$even_id = $_GET['event'];
7
-	$delegate_id = $_GET['delegate'];
8
-	$type = $_GET['type'];
9
-	$response = $_GET['response'];	
6
+    $even_id = $_GET['event'];
7
+    $delegate_id = $_GET['delegate'];
8
+    $type = $_GET['type'];
9
+    $response = $_GET['response'];	
10 10
 
11
-	//get event
11
+    //get event
12 12
     $event = new FP_events();
13 13
     $event->retrieve($even_id);
14 14
     
15 15
     if($type == 'c'){
16 16
     	
17
-    	$event->load_relationship('fp_events_contacts'); // get related contacts
17
+        $event->load_relationship('fp_events_contacts'); // get related contacts
18 18
 
19
-    	if($response == 'accept'){
19
+        if($response == 'accept'){
20 20
 
21 21
             //check to see if they have already responded to the email
22 22
             $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"';
23
-             $check = $db->getOne($check_q);
24
-    		//update contact to accepted
25
-    		$query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
26
-    		if($db->query($query) && $check != '1'){
23
+                $check = $db->getOne($check_q);
24
+            //update contact to accepted
25
+            $query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
26
+            if($db->query($query) && $check != '1'){
27 27
     			
28 28
                 if(!IsNullOrEmptyString($event->accept_redirect)){
29 29
                     
@@ -33,17 +33,17 @@  discard block
 block discarded – undo
33 33
                 else{
34 34
                     echo 'Thank you for accepting';
35 35
                 }   
36
-    		}
37
-    		else {
38
-    			echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
39
-    		}	
40
-    	}
41
-    	else if($response == 'decline'){
42
-    		//check to see if they have already responded to the email
36
+            }
37
+            else {
38
+                echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
39
+            }	
40
+        }
41
+        else if($response == 'decline'){
42
+            //check to see if they have already responded to the email
43 43
             $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"';
44
-             $check = $db->getOne($check_q);
44
+                $check = $db->getOne($check_q);
45 45
             //update contact to accepted
46
-    		$query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
46
+            $query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
47 47
     		
48 48
             if($db->query($query) && $check != '1'){
49 49
     			
@@ -56,24 +56,24 @@  discard block
 block discarded – undo
56 56
                 else{
57 57
                     echo 'Thank you for declining';
58 58
                 }
59
-    		}
60
-    		else {
61
-    			echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
62
-    		}
63
-    	}
59
+            }
60
+            else {
61
+                echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
62
+            }
63
+        }
64 64
     }
65 65
     if($type == 't'){
66 66
     	
67
-    	$event->load_relationship('fp_events_prospects_1'); //get related targets
67
+        $event->load_relationship('fp_events_prospects_1'); //get related targets
68 68
 
69
-    	if($response == 'accept'){
69
+        if($response == 'accept'){
70 70
             //check to see if they have already responded to the email
71 71
             $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"';
72
-             $check = $db->getOne($check_q);
72
+                $check = $db->getOne($check_q);
73 73
 
74
-    		//update contact to accepted
75
-    		$query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
76
-    		if($db->query($query) && $check != '1'){
74
+            //update contact to accepted
75
+            $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
76
+            if($db->query($query) && $check != '1'){
77 77
                 
78 78
                 if(!IsNullOrEmptyString($event->accept_redirect)){
79 79
                     
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
             else {
88 88
                 echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
89 89
             }   
90
-    	}
91
-    	else if($response == 'decline'){
90
+        }
91
+        else if($response == 'decline'){
92 92
             //check to see if they have already responded to the email
93 93
             $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"';
94
-             $check = $db->getOne($check_q);
95
-    		//update contact to accepted
96
-    		$query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
97
-    		if($db->query($query) && $check != '1'){
94
+                $check = $db->getOne($check_q);
95
+            //update contact to accepted
96
+            $query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
97
+            if($db->query($query) && $check != '1'){
98 98
                 
99 99
                 if(!IsNullOrEmptyString($event->decline_redirect)){
100 100
 
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
             else {
110 110
                 echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
111 111
             }
112
-    	}
112
+        }
113 113
     }
114 114
     if($type == 'l'){
115 115
     	
116
-    	$event->load_relationship('fp_events_leads_1'); //get related leads
116
+        $event->load_relationship('fp_events_leads_1'); //get related leads
117 117
 
118
-    	if($response == 'accept'){
118
+        if($response == 'accept'){
119 119
             //check to see if they have already responded to the email
120 120
             $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"';
121
-             $check = $db->getOne($check_q);
122
-    		//update contact to accepted
123
-    		$query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
124
-    		if($db->query($query) && $check != '1'){
121
+                $check = $db->getOne($check_q);
122
+            //update contact to accepted
123
+            $query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
124
+            if($db->query($query) && $check != '1'){
125 125
                 
126 126
                 if(!IsNullOrEmptyString($event->accept_redirect)){
127 127
                     
@@ -135,15 +135,15 @@  discard block
 block discarded – undo
135 135
             else {
136 136
                 echo 'There was a problem with the link please contact the sender of the invite';
137 137
             }   
138
-    	}
139
-    	else if($response == 'decline'){
140
-    		//check to see if they have already responded to the email
138
+        }
139
+        else if($response == 'decline'){
140
+            //check to see if they have already responded to the email
141 141
             $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"';
142
-             $check = $db->getOne($check_q);
142
+                $check = $db->getOne($check_q);
143 143
             //update contact to accepted
144
-    		$query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
144
+            $query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
145 145
 
146
-    		if($db->query($query) && $check != '1'){
146
+            if($db->query($query) && $check != '1'){
147 147
                 
148 148
                 if(!IsNullOrEmptyString($event->decline_redirect)){
149 149
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             else {
159 159
                 echo 'There was a problem with the link please contact the sender of the invite';
160 160
             }
161
-    	}
161
+        }
162 162
     }
163 163
     // Function for basic field validation (present and neither empty nor only white space nor just 'http://')
164 164
     function IsNullOrEmptyString($question){
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 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
 	global $db;
5 5
 	 
@@ -12,25 +12,25 @@  discard block
 block discarded – undo
12 12
     $event = new FP_events();
13 13
     $event->retrieve($even_id);
14 14
     
15
-    if($type == 'c'){
15
+    if ($type == 'c') {
16 16
     	
17 17
     	$event->load_relationship('fp_events_contacts'); // get related contacts
18 18
 
19
-    	if($response == 'accept'){
19
+    	if ($response == 'accept') {
20 20
 
21 21
             //check to see if they have already responded to the email
22 22
             $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"';
23 23
              $check = $db->getOne($check_q);
24 24
     		//update contact to accepted
25 25
     		$query = 'UPDATE fp_events_contacts_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
26
-    		if($db->query($query) && $check != '1'){
26
+    		if ($db->query($query) && $check != '1') {
27 27
     			
28
-                if(!IsNullOrEmptyString($event->accept_redirect)){
28
+                if (!IsNullOrEmptyString($event->accept_redirect)) {
29 29
                     
30 30
                     $url = $event->accept_redirect;
31
-                    header('Location: ' . $url);    
31
+                    header('Location: '.$url);    
32 32
                 }
33
-                else{
33
+                else {
34 34
                     echo 'Thank you for accepting';
35 35
                 }   
36 36
     		}
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
     			echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
39 39
     		}	
40 40
     	}
41
-    	else if($response == 'decline'){
41
+    	else if ($response == 'decline') {
42 42
     		//check to see if they have already responded to the email
43 43
             $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"';
44 44
              $check = $db->getOne($check_q);
45 45
             //update contact to accepted
46 46
     		$query = 'UPDATE fp_events_contacts_c SET accept_status="Declined", email_responded="1" WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'" AND email_responded="0"';
47 47
     		
48
-            if($db->query($query) && $check != '1'){
48
+            if ($db->query($query) && $check != '1') {
49 49
     			
50
-                if(!IsNullOrEmptyString($event->decline_redirect)){
50
+                if (!IsNullOrEmptyString($event->decline_redirect)) {
51 51
 
52 52
                     $url = $event->decline_redirect;
53
-                    header('Location: ' . $url);    
53
+                    header('Location: '.$url);    
54 54
                     
55 55
                 }
56
-                else{
56
+                else {
57 57
                     echo 'Thank you for declining';
58 58
                 }
59 59
     		}
@@ -62,25 +62,25 @@  discard block
 block discarded – undo
62 62
     		}
63 63
     	}
64 64
     }
65
-    if($type == 't'){
65
+    if ($type == 't') {
66 66
     	
67 67
     	$event->load_relationship('fp_events_prospects_1'); //get related targets
68 68
 
69
-    	if($response == 'accept'){
69
+    	if ($response == 'accept') {
70 70
             //check to see if they have already responded to the email
71 71
             $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"';
72 72
              $check = $db->getOne($check_q);
73 73
 
74 74
     		//update contact to accepted
75 75
     		$query = 'UPDATE fp_events_prospects_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
76
-    		if($db->query($query) && $check != '1'){
76
+    		if ($db->query($query) && $check != '1') {
77 77
                 
78
-                if(!IsNullOrEmptyString($event->accept_redirect)){
78
+                if (!IsNullOrEmptyString($event->accept_redirect)) {
79 79
                     
80 80
                     $url = $event->accept_redirect;
81
-                    header('Location: ' . $url);    
81
+                    header('Location: '.$url);    
82 82
                 }
83
-                else{
83
+                else {
84 84
                     echo 'Thank you for accepting';
85 85
                 }   
86 86
             }
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
88 88
                 echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
89 89
             }   
90 90
     	}
91
-    	else if($response == 'decline'){
91
+    	else if ($response == 'decline') {
92 92
             //check to see if they have already responded to the email
93 93
             $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"';
94 94
              $check = $db->getOne($check_q);
95 95
     		//update contact to accepted
96 96
     		$query = 'UPDATE fp_events_prospects_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'" AND email_responded="0"';
97
-    		if($db->query($query) && $check != '1'){
97
+    		if ($db->query($query) && $check != '1') {
98 98
                 
99
-                if(!IsNullOrEmptyString($event->decline_redirect)){
99
+                if (!IsNullOrEmptyString($event->decline_redirect)) {
100 100
 
101 101
                     $url = $event->decline_redirect;
102
-                    header('Location: ' . $url);    
102
+                    header('Location: '.$url);    
103 103
                     
104 104
                 }
105
-                else{
105
+                else {
106 106
                     echo 'Thank you for declining';
107 107
                 }
108 108
             }
@@ -111,24 +111,24 @@  discard block
 block discarded – undo
111 111
             }
112 112
     	}
113 113
     }
114
-    if($type == 'l'){
114
+    if ($type == 'l') {
115 115
     	
116 116
     	$event->load_relationship('fp_events_leads_1'); //get related leads
117 117
 
118
-    	if($response == 'accept'){
118
+    	if ($response == 'accept') {
119 119
             //check to see if they have already responded to the email
120 120
             $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE ffp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"';
121 121
              $check = $db->getOne($check_q);
122 122
     		//update contact to accepted
123 123
     		$query = 'UPDATE fp_events_leads_1_c SET accept_status="Accepted", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
124
-    		if($db->query($query) && $check != '1'){
124
+    		if ($db->query($query) && $check != '1') {
125 125
                 
126
-                if(!IsNullOrEmptyString($event->accept_redirect)){
126
+                if (!IsNullOrEmptyString($event->accept_redirect)) {
127 127
                     
128 128
                     $url = $event->accept_redirect;
129
-                    header('Location: ' . $url);    
129
+                    header('Location: '.$url);    
130 130
                 }
131
-                else{
131
+                else {
132 132
                     echo 'Thank you for accepting';
133 133
                 }   
134 134
             }
@@ -136,22 +136,22 @@  discard block
 block discarded – undo
136 136
                 echo 'There was a problem with the link please contact the sender of the invite';
137 137
             }   
138 138
     	}
139
-    	else if($response == 'decline'){
139
+    	else if ($response == 'decline') {
140 140
     		//check to see if they have already responded to the email
141 141
             $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"';
142 142
              $check = $db->getOne($check_q);
143 143
             //update contact to accepted
144 144
     		$query = 'UPDATE fp_events_leads_1_c SET accept_status="Declined", email_responded="1" WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'" AND email_responded="0"';
145 145
 
146
-    		if($db->query($query) && $check != '1'){
146
+    		if ($db->query($query) && $check != '1') {
147 147
                 
148
-                if(!IsNullOrEmptyString($event->decline_redirect)){
148
+                if (!IsNullOrEmptyString($event->decline_redirect)) {
149 149
 
150 150
                     $url = $event->decline_redirect;
151
-                    header('Location: ' . $url);    
151
+                    header('Location: '.$url);    
152 152
                     
153 153
                 }
154
-                else{
154
+                else {
155 155
                     echo 'Thank you for declining';
156 156
                 }
157 157
             }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
     	}
162 162
     }
163 163
     // Function for basic field validation (present and neither empty nor only white space nor just 'http://')
164
-    function IsNullOrEmptyString($question){
165
-        return (!isset($question) || trim($question)==='' || $question =='http://');
164
+    function IsNullOrEmptyString($question) {
165
+        return (!isset($question) || trim($question) === '' || $question == 'http://');
166 166
     }
167 167
 
168 168
 ?>
Please login to merge, or discard this patch.
Braces   +18 added lines, -31 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
 	global $db;
5 7
 	 
@@ -29,16 +31,13 @@  discard block
 block discarded – undo
29 31
                     
30 32
                     $url = $event->accept_redirect;
31 33
                     header('Location: ' . $url);    
32
-                }
33
-                else{
34
+                } else{
34 35
                     echo 'Thank you for accepting';
35 36
                 }   
36
-    		}
37
-    		else {
37
+    		} else {
38 38
     			echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
39 39
     		}	
40
-    	}
41
-    	else if($response == 'decline'){
40
+    	} else if($response == 'decline'){
42 41
     		//check to see if they have already responded to the email
43 42
             $check_q = 'SELECT email_responded FROM fp_events_contacts_c WHERE fp_events_contactsfp_events_ida="'.$event->id.'" AND fp_events_contactscontacts_idb="'.$delegate_id.'"';
44 43
              $check = $db->getOne($check_q);
@@ -52,12 +51,10 @@  discard block
 block discarded – undo
52 51
                     $url = $event->decline_redirect;
53 52
                     header('Location: ' . $url);    
54 53
                     
55
-                }
56
-                else{
54
+                } else{
57 55
                     echo 'Thank you for declining';
58 56
                 }
59
-    		}
60
-    		else {
57
+    		} else {
61 58
     			echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
62 59
     		}
63 60
     	}
@@ -79,16 +76,13 @@  discard block
 block discarded – undo
79 76
                     
80 77
                     $url = $event->accept_redirect;
81 78
                     header('Location: ' . $url);    
82
-                }
83
-                else{
79
+                } else{
84 80
                     echo 'Thank you for accepting';
85 81
                 }   
86
-            }
87
-            else {
82
+            } else {
88 83
                 echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
89 84
             }   
90
-    	}
91
-    	else if($response == 'decline'){
85
+    	} else if($response == 'decline'){
92 86
             //check to see if they have already responded to the email
93 87
             $check_q = 'SELECT email_responded FROM fp_events_prospects_1_c WHERE fp_events_prospects_1fp_events_ida="'.$event->id.'" AND fp_events_prospects_1prospects_idb="'.$delegate_id.'"';
94 88
              $check = $db->getOne($check_q);
@@ -101,12 +95,10 @@  discard block
 block discarded – undo
101 95
                     $url = $event->decline_redirect;
102 96
                     header('Location: ' . $url);    
103 97
                     
104
-                }
105
-                else{
98
+                } else{
106 99
                     echo 'Thank you for declining';
107 100
                 }
108
-            }
109
-            else {
101
+            } else {
110 102
                 echo 'You have already responded to the invitation or there was a problem with the link. Please contact the sender of the invite for help.';
111 103
             }
112 104
     	}
@@ -127,16 +119,13 @@  discard block
 block discarded – undo
127 119
                     
128 120
                     $url = $event->accept_redirect;
129 121
                     header('Location: ' . $url);    
130
-                }
131
-                else{
122
+                } else{
132 123
                     echo 'Thank you for accepting';
133 124
                 }   
134
-            }
135
-            else {
125
+            } else {
136 126
                 echo 'There was a problem with the link please contact the sender of the invite';
137 127
             }   
138
-    	}
139
-    	else if($response == 'decline'){
128
+    	} else if($response == 'decline'){
140 129
     		//check to see if they have already responded to the email
141 130
             $check_q = 'SELECT email_responded FROM fp_events_leads_1_c WHERE fp_events_leads_1fp_events_ida="'.$event->id.'" AND fp_events_leads_1leads_idb="'.$delegate_id.'"';
142 131
              $check = $db->getOne($check_q);
@@ -150,12 +139,10 @@  discard block
 block discarded – undo
150 139
                     $url = $event->decline_redirect;
151 140
                     header('Location: ' . $url);    
152 141
                     
153
-                }
154
-                else{
142
+                } else{
155 143
                     echo 'Thank you for declining';
156 144
                 }
157
-            }
158
-            else {
145
+            } else {
159 146
                 echo 'There was a problem with the link please contact the sender of the invite';
160 147
             }
161 148
     	}
Please login to merge, or discard this patch.
modules/Meetings/JoinExternalMeeting.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     }
71 71
 }else{
72 72
     if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){
73
-      SugarApplication::redirect($meetingBean->join_url);
73
+        SugarApplication::redirect($meetingBean->join_url);
74 74
     }else{
75 75
         //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting.
76 76
         $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl';
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 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.
@@ -47,40 +47,40 @@  discard block
 block discarded – undo
47 47
 
48 48
 global $db, $current_user, $mod_strings, $app_strings, $app_list_strings;
49 49
 
50
-$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0",true);
50
+$ret = $db->query("SELECT id FROM meetings_users WHERE meeting_id = '".$db->quote($_REQUEST['meeting_id'])."' AND user_id = '".$current_user->id."' AND deleted = 0", true);
51 51
 $row = $db->fetchByAssoc($ret);
52 52
 
53 53
 $meetingBean = loadBean('Meetings');
54 54
 $meetingBean->retrieve($_REQUEST['meeting_id']);
55 55
 
56
-if ( $_REQUEST['host_meeting'] == '1' ) {
57
-    if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){
56
+if ($_REQUEST['host_meeting'] == '1') {
57
+    if ($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) {
58 58
         SugarApplication::redirect($meetingBean->host_url);
59
-    }else{
59
+    } else {
60 60
         //since they are now the owner of the meeting nor an Admin they cannot start the meeting.
61 61
         $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl';
62
-        if ( file_exists('custom/'.$tplFile) ) {
62
+        if (file_exists('custom/'.$tplFile)) {
63 63
             $tplFile = 'custom/'.$tplFile;
64 64
         }
65 65
 
66 66
         $ss = new Sugar_Smarty();
67
-        $ss->assign('current_user',$current_user);
68
-        $ss->assign('bean',$meetingBean->toArray());
67
+        $ss->assign('current_user', $current_user);
68
+        $ss->assign('bean', $meetingBean->toArray());
69 69
         $ss->display($tplFile);
70 70
     }
71
-}else{
72
-    if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){
71
+} else {
72
+    if (isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'], 'Meetings')) {
73 73
       SugarApplication::redirect($meetingBean->join_url);
74
-    }else{
74
+    } else {
75 75
         //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting.
76 76
         $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl';
77
-        if ( file_exists('custom/'.$tplFile) ) {
77
+        if (file_exists('custom/'.$tplFile)) {
78 78
             $tplFile = 'custom/'.$tplFile;
79 79
         }
80 80
 
81 81
         $ss = new Sugar_Smarty();
82
-        $ss->assign('current_user',$current_user);
83
-        $ss->assign('bean',$meetingBean->toArray());
82
+        $ss->assign('current_user', $current_user);
83
+        $ss->assign('bean', $meetingBean->toArray());
84 84
         $ss->display($tplFile);
85 85
     }
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 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
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -56,7 +58,7 @@  discard block
 block discarded – undo
56 58
 if ( $_REQUEST['host_meeting'] == '1' ) {
57 59
     if($meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){
58 60
         SugarApplication::redirect($meetingBean->host_url);
59
-    }else{
61
+    } else{
60 62
         //since they are now the owner of the meeting nor an Admin they cannot start the meeting.
61 63
         $tplFile = 'modules/Meetings/tpls/extMeetingNoStart.tpl';
62 64
         if ( file_exists('custom/'.$tplFile) ) {
@@ -68,10 +70,10 @@  discard block
 block discarded – undo
68 70
         $ss->assign('bean',$meetingBean->toArray());
69 71
         $ss->display($tplFile);
70 72
     }
71
-}else{
73
+} else{
72 74
     if(isset($row['id']) || $meetingBean->assigned_user_id == $GLOBALS['current_user']->id || is_admin($GLOBALS['current_user']) || is_admin_for_module($GLOBALS['current_user'],'Meetings')){
73 75
       SugarApplication::redirect($meetingBean->join_url);
74
-    }else{
76
+    } else{
75 77
         //if the user is not invited or the owner of the meeting or an admin then they cannot join the meeting.
76 78
         $tplFile = 'modules/Meetings/tpls/extMeetingNotInvited.tpl';
77 79
         if ( file_exists('custom/'.$tplFile) ) {
Please login to merge, or discard this patch.