Completed
Branch master (a75ecc)
by Adam
24:46
created
include/SugarFields/Parsers/MetaParser.php 1 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.
@@ -456,8 +458,9 @@  discard block
 block discarded – undo
456 458
     while ($file = readdir($handler)) {
457 459
         // if $file isn't this directory or its parent,
458 460
         // add it to the results array
459
-        if ($file != '.' && $file != '..')
460
-            $results[] = $file;
461
+        if ($file != '.' && $file != '..') {
462
+                    $results[] = $file;
463
+        }
461 464
     }
462 465
 
463 466
     // tidy up: close the handler
Please login to merge, or discard this patch.
include/SugarFields/Parsers/QuickCreateMetaParser.php 1 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.
include/SugarFields/Parsers/EditViewMetaParser.php 1 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.
include/SugarFields/Parsers/DetailViewMetaParser.php 1 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.
include/SugarFields/SugarFieldHandler.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
         		$file = 'custom/include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php';
92 92
                 $type = $field;
93 93
 			//else check the fields directory
94
-			}else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){
94
+			} else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){
95 95
            		$file = 'include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php';
96 96
                 $type = $field;
97
-        	}else{
97
+        	} else{
98 98
                 // No direct class, check the directories to see if they are defined
99 99
         		if( $returnNullIfBase &&
100 100
                     !is_dir('custom/include/SugarFields/Fields/'.$field) &&
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			$customClass = 'Custom' . $class;
112 112
         	if(class_exists($customClass)){
113 113
         		$sugarFieldObjects[$field] = new $customClass($field);
114
-        	}else{
114
+        	} else{
115 115
         		$sugarFieldObjects[$field] = new $class($field);
116 116
         	}
117 117
         }
Please login to merge, or discard this patch.
include/SugarFields/Fields/Datetimecombo/SugarFieldDatetimecombo.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,8 +176,7 @@
 block discarded – undo
176 176
             $parts = $timedate->split_date_time($value);
177 177
             if(empty($parts[0])) {
178 178
                $datepart = $timedate->getNow()->format($settings->dateformat);
179
-            }
180
-            else {
179
+            } else {
181 180
                $datepart = $parts[0];
182 181
             }
183 182
             if(empty($parts[1])) {
Please login to merge, or discard this patch.
SugarFields/Fields/Assigned_user_name/SugarFieldAssigned_user_name.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 		if(!empty($vardef['function']['returns']) && $vardef['function']['returns']== 'html'){
47 47
     	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
48 48
            return $this->fetch($this->findTemplate('EditViewFunction'));
49
-    	}else{
49
+    	} else{
50 50
     	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
51 51
            return $this->fetch($this->findTemplate('SearchView'));
52 52
     	}
Please login to merge, or discard this patch.
include/SugarEmailAddress/SugarEmailAddress.php 1 patch
Braces   +39 added lines, -26 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.
@@ -132,8 +134,9 @@  discard block
 block discarded – undo
132 134
         $alternate_found = false;
133 135
         $alternate2_found = false;
134 136
         foreach($this->addresses as $k=>$address) {
135
-            if ($primary_found && $alternate_found)
136
-                break;
137
+            if ($primary_found && $alternate_found) {
138
+                            break;
139
+            }
137 140
             if ($address['primary_address'] == 1 && !$primary_found) {
138 141
                 $primary_index = $k;
139 142
                 $primary_found = true;
@@ -271,8 +274,9 @@  discard block
 block discarded – undo
271 274
         )
272 275
     {
273 276
         $emailCaps = strtoupper(trim($email));
274
-        if(empty($emailCaps))
275
-            return 0;
277
+        if(empty($emailCaps)) {
278
+                    return 0;
279
+        }
276 280
 
277 281
         $q = "SELECT *
278 282
                 FROM email_addr_bean_rel eabl JOIN email_addresses ea
@@ -288,7 +292,9 @@  discard block
 block discarded – undo
288 292
 
289 293
         // do it this way to make the count accurate in oracle
290 294
         $i = 0;
291
-        while ($this->db->fetchByAssoc($r)) ++$i;
295
+        while ($this->db->fetchByAssoc($r)) {
296
+            ++$i;
297
+        }
292 298
 
293 299
         return $i;
294 300
     }
@@ -471,8 +477,9 @@  discard block
 block discarded – undo
471 477
                     foreach($_REQUEST as $k => $v) {
472 478
                         if(preg_match('/'.$eId.'emailAddressVerifiedValue[0-9]+$/i', $k) && !empty($v)) {
473 479
                             $validateFlag = str_replace("Value", "Flag", $k);
474
-                            if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true")
475
-                              $new_addrs[$k] = $v;
480
+                            if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true") {
481
+                                                          $new_addrs[$k] = $v;
482
+                            }
476 483
                         }
477 484
                     }
478 485
                 }
@@ -675,8 +682,7 @@  discard block
 block discarded – undo
675 682
         if ($id) {
676 683
             $r = $this->db->query("SELECT * FROM email_addresses WHERE id='".$this->db->quote($id)."'");
677 684
             $current_email = $this->db->fetchByAssoc($r);
678
-        }
679
-        else {
685
+        } else {
680 686
             $current_email = null;
681 687
         }
682 688
 
@@ -716,8 +722,7 @@  discard block
 block discarded – undo
716 722
                 $upd_r = $this->db->query($upd_q);
717 723
             }
718 724
             return $duplicate_email['id'];
719
-        }
720
-        else {
725
+        } else {
721 726
             // no case-insensitive address match - it's new, or undeleted.
722 727
             $guid = '';
723 728
             if(!empty($address)){
@@ -783,8 +788,7 @@  discard block
 block discarded – undo
783 788
             // otherwise
784 789
             $q .= "
785 790
                 ORDER BY ear.reply_to_address DESC";
786
-        }
787
-        else
791
+        } else
788 792
         {
789 793
             // retrieve reply-to address only
790 794
             $q .= "
@@ -835,8 +839,9 @@  discard block
 block discarded – undo
835 839
      */
836 840
     function getEmailAddressWidgetEditView($id, $module, $asMetadata=false, $tpl='',$tabindex='0')
837 841
     {
838
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
839
-            $this->smarty = new Sugar_Smarty();
842
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
843
+                    $this->smarty = new Sugar_Smarty();
844
+        }
840 845
 
841 846
         global $app_strings, $dictionary, $beanList;
842 847
 
@@ -854,8 +859,9 @@  discard block
 block discarded – undo
854 859
         if(!empty($id)) {
855 860
             $prefillDataArr = $this->getAddressesByGUID($id, $module);
856 861
             //When coming from convert leads, sometimes module is Contacts while the id is for a lead.
857
-            if (empty($prefillDataArr) && $module == "Contacts")
858
-                $prefillDataArr = $this->getAddressesByGUID($id, "Leads");
862
+            if (empty($prefillDataArr) && $module == "Contacts") {
863
+                            $prefillDataArr = $this->getAddressesByGUID($id, "Leads");
864
+            }
859 865
         } else if(isset($_REQUEST['full_form']) && !empty($_REQUEST['emailAddressWidget'])){
860 866
             $widget_id = isset($_REQUEST[$module . '_email_widget_id']) ? $_REQUEST[$module . '_email_widget_id'] : '0';
861 867
             $count = 0;
@@ -880,8 +886,9 @@  discard block
 block discarded – undo
880 886
 
881 887
         $required = false;
882 888
         $vardefs = $dictionary[$beanList[$passedModule]]['fields'];
883
-        if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required'])
884
-            $required = true;
889
+        if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required']) {
890
+                    $required = true;
891
+        }
885 892
         $this->smarty->assign('required', $required);
886 893
 
887 894
         $this->smarty->assign('module', $saveModule);
@@ -935,13 +942,16 @@  discard block
 block discarded – undo
935 942
      */
936 943
     function getEmailAddressWidgetDetailView($focus, $tpl='')
937 944
     {
938
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
939
-            $this->smarty = new Sugar_Smarty();
945
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
946
+                    $this->smarty = new Sugar_Smarty();
947
+        }
940 948
 
941 949
         global $app_strings;
942 950
         global $current_user;
943 951
         $assign = array();
944
-        if(empty($focus->id))return '';
952
+        if(empty($focus->id)) {
953
+            return '';
954
+        }
945 955
         $prefillData = $this->getAddressesByGUID($focus->id, $focus->module_dir);
946 956
 
947 957
         foreach($prefillData as $addressItem) {
@@ -970,8 +980,9 @@  discard block
 block discarded – undo
970 980
      */
971 981
     function getEmailAddressWidgetDuplicatesView($focus)
972 982
     {
973
-        if ( !($this->smarty instanceOf Sugar_Smarty ) )
974
-            $this->smarty = new Sugar_Smarty();
983
+        if ( !($this->smarty instanceOf Sugar_Smarty ) ) {
984
+                    $this->smarty = new Sugar_Smarty();
985
+        }
975 986
 
976 987
         $count = 0;
977 988
         $emails = array();
@@ -1131,7 +1142,9 @@  discard block
 block discarded – undo
1131 1142
 
1132 1143
         if($view == 'EditView' || $view == 'QuickCreate' || $view == 'ConvertLead') {
1133 1144
             $module = $focus->module_dir;
1134
-            if ($view == 'ConvertLead' && $module == "Contacts")  $module = "Leads";
1145
+            if ($view == 'ConvertLead' && $module == "Contacts") {
1146
+                $module = "Leads";
1147
+            }
1135 1148
 
1136 1149
             return $sea->getEmailAddressWidgetEditView($focus->id, $module, false,'',$tabindex);
1137 1150
         }
Please login to merge, or discard this patch.
include/SugarOauth.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
             try{
134 134
                 $this->_last = $token = parent::getRequestToken($params);
135 135
                 return array('oauth_token' => $token->getToken(), 'oauth_token_secret' => $token->getTokenSecret());
136
-            }catch(Zend_Oauth_Exception $e){
136
+            } catch(Zend_Oauth_Exception $e){
137 137
                 return array('oauth_token' => '', 'oauth_token_secret' => '');
138 138
             }
139 139
         }
Please login to merge, or discard this patch.