Completed
Push — develop ( 7c1bda...edae1e )
by Adam
18:38 queued 03:14
created
custom/modules/unified_search_modules_display.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -1,140 +1,140 @@
 block discarded – undo
1 1
 <?php
2 2
 // created: 2014-01-29 09:59:23
3 3
 $unified_search_modules_display = array (
4
-  'AOP_Case_Events' => 
5
-  array (
4
+    'AOP_Case_Events' => 
5
+    array (
6 6
     'visible' => false,
7
-  ),
8
-  'AOP_Case_Updates' => 
9
-  array (
7
+    ),
8
+    'AOP_Case_Updates' => 
9
+    array (
10 10
     'visible' => false,
11
-  ),
12
-  'AOR_Reports' => 
13
-  array (
11
+    ),
12
+    'AOR_Reports' => 
13
+    array (
14 14
     'visible' => false,
15
-  ),
16
-  'AOS_Contracts' => 
17
-  array (
15
+    ),
16
+    'AOS_Contracts' => 
17
+    array (
18 18
     'visible' => false,
19
-  ),
20
-  'AOS_Invoices' => 
21
-  array (
19
+    ),
20
+    'AOS_Invoices' => 
21
+    array (
22 22
     'visible' => false,
23
-  ),
24
-  'AOS_PDF_Templates' => 
25
-  array (
23
+    ),
24
+    'AOS_PDF_Templates' => 
25
+    array (
26 26
     'visible' => false,
27
-  ),
28
-  'AOS_Product_Categories' => 
29
-  array (
27
+    ),
28
+    'AOS_Product_Categories' => 
29
+    array (
30 30
     'visible' => false,
31
-  ),
32
-  'AOS_Products' => 
33
-  array (
31
+    ),
32
+    'AOS_Products' => 
33
+    array (
34 34
     'visible' => false,
35
-  ),
36
-  'AOS_Quotes' => 
37
-  array (
35
+    ),
36
+    'AOS_Quotes' => 
37
+    array (
38 38
     'visible' => false,
39
-  ),
40
-  'AOW_Processed' => 
41
-  array (
39
+    ),
40
+    'AOW_Processed' => 
41
+    array (
42 42
     'visible' => false,
43
-  ),
44
-  'AOW_WorkFlow' => 
45
-  array (
43
+    ),
44
+    'AOW_WorkFlow' => 
45
+    array (
46 46
     'visible' => false,
47
-  ),
48
-  'Accounts' => 
49
-  array (
47
+    ),
48
+    'Accounts' => 
49
+    array (
50 50
     'visible' => true,
51
-  ),
52
-  'Bugs' => 
53
-  array (
51
+    ),
52
+    'Bugs' => 
53
+    array (
54 54
     'visible' => false,
55
-  ),
56
-  'Calls' => 
57
-  array (
55
+    ),
56
+    'Calls' => 
57
+    array (
58 58
     'visible' => true,
59
-  ),
60
-  'Calls_Reschedule' => 
61
-  array (
59
+    ),
60
+    'Calls_Reschedule' => 
61
+    array (
62 62
     'visible' => false,
63
-  ),
64
-  'Campaigns' => 
65
-  array (
63
+    ),
64
+    'Campaigns' => 
65
+    array (
66 66
     'visible' => false,
67
-  ),
68
-  'Cases' => 
69
-  array (
67
+    ),
68
+    'Cases' => 
69
+    array (
70 70
     'visible' => true,
71
-  ),
72
-  'Contacts' => 
73
-  array (
71
+    ),
72
+    'Contacts' => 
73
+    array (
74 74
     'visible' => true,
75
-  ),
76
-  'Documents' => 
77
-  array (
75
+    ),
76
+    'Documents' => 
77
+    array (
78 78
     'visible' => true,
79
-  ),
80
-  'FP_Event_Locations' => 
81
-  array (
79
+    ),
80
+    'FP_Event_Locations' => 
81
+    array (
82 82
     'visible' => false,
83
-  ),
84
-  'FP_events' => 
85
-  array (
83
+    ),
84
+    'FP_events' => 
85
+    array (
86 86
     'visible' => false,
87
-  ),
88
-  'Leads' => 
89
-  array (
87
+    ),
88
+    'Leads' => 
89
+    array (
90 90
     'visible' => true,
91
-  ),
92
-  'Meetings' => 
93
-  array (
91
+    ),
92
+    'Meetings' => 
93
+    array (
94 94
     'visible' => true,
95
-  ),
96
-  'Notes' => 
97
-  array (
95
+    ),
96
+    'Notes' => 
97
+    array (
98 98
     'visible' => true,
99
-  ),
100
-  'Opportunities' => 
101
-  array (
99
+    ),
100
+    'Opportunities' => 
101
+    array (
102 102
     'visible' => true,
103
-  ),
104
-  'Project' => 
105
-  array (
103
+    ),
104
+    'Project' => 
105
+    array (
106 106
     'visible' => false,
107
-  ),
108
-  'ProjectTask' => 
109
-  array (
107
+    ),
108
+    'ProjectTask' => 
109
+    array (
110 110
     'visible' => false,
111
-  ),
112
-  'ProspectLists' => 
113
-  array (
111
+    ),
112
+    'ProspectLists' => 
113
+    array (
114 114
     'visible' => false,
115
-  ),
116
-  'Prospects' => 
117
-  array (
115
+    ),
116
+    'Prospects' => 
117
+    array (
118 118
     'visible' => false,
119
-  ),
120
-  'Tasks' => 
121
-  array (
119
+    ),
120
+    'Tasks' => 
121
+    array (
122 122
     'visible' => false,
123
-  ),
124
-  'jjwg_Address_Cache' => 
125
-  array (
123
+    ),
124
+    'jjwg_Address_Cache' => 
125
+    array (
126 126
     'visible' => false,
127
-  ),
128
-  'jjwg_Areas' => 
129
-  array (
127
+    ),
128
+    'jjwg_Areas' => 
129
+    array (
130 130
     'visible' => false,
131
-  ),
132
-  'jjwg_Maps' => 
133
-  array (
131
+    ),
132
+    'jjwg_Maps' => 
133
+    array (
134 134
     'visible' => false,
135
-  ),
136
-  'jjwg_Markers' => 
137
-  array (
135
+    ),
136
+    'jjwg_Markers' => 
137
+    array (
138 138
     'visible' => false,
139
-  ),
139
+    ),
140 140
 );
141 141
\ No newline at end of file
Please login to merge, or discard this patch.
include/SugarFields/Fields/Datetimecombo/SugarFieldDatetimecombo.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -44,19 +44,19 @@  discard block
 block discarded – undo
44 44
     function getEditViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
45 45
         // Create Smarty variables for the Calendar picker widget
46 46
         if(!isset($displayParams['showMinutesDropdown'])) {
47
-           $displayParams['showMinutesDropdown'] = false;
47
+            $displayParams['showMinutesDropdown'] = false;
48 48
         }
49 49
 
50 50
         if(!isset($displayParams['showHoursDropdown'])) {
51
-           $displayParams['showHoursDropdown'] = false;
51
+            $displayParams['showHoursDropdown'] = false;
52 52
         }
53 53
 
54 54
         if(!isset($displayParams['showNoneCheckbox'])) {
55
-           $displayParams['showNoneCheckbox'] = false;
55
+            $displayParams['showNoneCheckbox'] = false;
56 56
         }
57 57
 
58 58
         if(!isset($displayParams['showFormats'])) {
59
-           $displayParams['showFormats'] = false;
59
+            $displayParams['showFormats'] = false;
60 60
         }
61 61
 
62 62
         global $timedate;
@@ -75,44 +75,44 @@  discard block
 block discarded – undo
75 75
 	
76 76
     function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
77 77
 
78
-    	 if($this->isRangeSearchView($vardef)) {
79
-           $displayParams['showMinutesDropdown'] = false;
80
-           $displayParams['showHoursDropdown'] = false;
81
-           $displayParams['showNoneCheckbox'] = false;
82
-           $displayParams['showFormats'] = false;
83
-	       global $timedate, $current_language;
84
-	       $displayParams['dateFormat'] = $timedate->get_cal_date_format();
85
-	       $displayParams['timeFormat'] = $timedate->get_user_time_format();
86
-
87
-           $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
88
-           $id = isset($displayParams['idName']) ? $displayParams['idName'] : $vardef['name'];
89
-           $this->ss->assign('original_id', "{$id}");
90
-           $this->ss->assign('id_range', "range_{$id}");
91
-           $this->ss->assign('id_range_start', "start_range_{$id}");
92
-           $this->ss->assign('id_range_end', "end_range_{$id}");
93
-           $this->ss->assign('id_range_choice', "{$id}_range_choice");
94
-           if(file_exists('custom/include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl'))
95
-           {
96
-              return $this->fetch('custom/include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl');
97
-           }
98
-           return $this->fetch('include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl');
78
+            if($this->isRangeSearchView($vardef)) {
79
+            $displayParams['showMinutesDropdown'] = false;
80
+            $displayParams['showHoursDropdown'] = false;
81
+            $displayParams['showNoneCheckbox'] = false;
82
+            $displayParams['showFormats'] = false;
83
+            global $timedate, $current_language;
84
+            $displayParams['dateFormat'] = $timedate->get_cal_date_format();
85
+            $displayParams['timeFormat'] = $timedate->get_user_time_format();
86
+
87
+            $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
88
+            $id = isset($displayParams['idName']) ? $displayParams['idName'] : $vardef['name'];
89
+            $this->ss->assign('original_id', "{$id}");
90
+            $this->ss->assign('id_range', "range_{$id}");
91
+            $this->ss->assign('id_range_start', "start_range_{$id}");
92
+            $this->ss->assign('id_range_end', "end_range_{$id}");
93
+            $this->ss->assign('id_range_choice', "{$id}_range_choice");
94
+            if(file_exists('custom/include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl'))
95
+            {
96
+                return $this->fetch('custom/include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl');
97
+            }
98
+            return $this->fetch('include/SugarFields/Fields/Datetimecombo/RangeSearchForm.tpl');
99 99
         }
100 100
 
101
-    	// Create Smarty variables for the Calendar picker widget
101
+        // Create Smarty variables for the Calendar picker widget
102 102
         if(!isset($displayParams['showMinutesDropdown'])) {
103
-           $displayParams['showMinutesDropdown'] = false;
103
+            $displayParams['showMinutesDropdown'] = false;
104 104
         }
105 105
 
106 106
         if(!isset($displayParams['showHoursDropdown'])) {
107
-           $displayParams['showHoursDropdown'] = false;
107
+            $displayParams['showHoursDropdown'] = false;
108 108
         }
109 109
 
110 110
         if(!isset($displayParams['showNoneCheckbox'])) {
111
-           $displayParams['showNoneCheckbox'] = false;
111
+            $displayParams['showNoneCheckbox'] = false;
112 112
         }
113 113
 
114 114
         if(!isset($displayParams['showFormats'])) {
115
-           $displayParams['showFormats'] = false;
115
+            $displayParams['showFormats'] = false;
116 116
         }
117 117
 
118 118
         global $timedate;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
 
127
-	public function getEmailTemplateValue($inputField, $vardef, $context = null, $tabindex = 0){
127
+    public function getEmailTemplateValue($inputField, $vardef, $context = null, $tabindex = 0){
128 128
         // This does not return a smarty section, instead it returns a direct value
129 129
         if(isset($context['notify_user'])) {
130 130
             $user = $context['notify_user'];
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
 
144 144
         if(strpos($params[$prefix.$field], ' ') > 0) {
145 145
             if ($timedate->check_matching_format($params[$prefix.$field], TimeDate::DB_DATETIME_FORMAT)) {
146
-	            $bean->$field = $params[$prefix.$field];
146
+                $bean->$field = $params[$prefix.$field];
147 147
             } else {
148 148
                 $bean->$field = $timedate->to_db($params[$prefix.$field]);
149 149
             }
150 150
         } else {
151
-        	$GLOBALS['log']->error('Field ' . $prefix.$field . ' expecting datetime format, but got value: ' . $params[$prefix.$field]);
152
-	        //Default to assume date format value
153
-        	if ($timedate->check_matching_format($params[$prefix.$field], TimeDate::DB_DATE_FORMAT)) {
151
+            $GLOBALS['log']->error('Field ' . $prefix.$field . ' expecting datetime format, but got value: ' . $params[$prefix.$field]);
152
+            //Default to assume date format value
153
+            if ($timedate->check_matching_format($params[$prefix.$field], TimeDate::DB_DATE_FORMAT)) {
154 154
                 $bean->$field = $params[$prefix.$field];
155 155
             } else {
156 156
                 $bean->$field = $timedate->to_db_date($params[$prefix.$field]);
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         if ( !$timedate->check_matching_format($value, $format) ) {
176 176
             $parts = $timedate->split_date_time($value);
177 177
             if(empty($parts[0])) {
178
-               $datepart = $timedate->getNow()->format($settings->dateformat);
178
+                $datepart = $timedate->getNow()->format($settings->dateformat);
179 179
             }
180 180
             else {
181
-               $datepart = $parts[0];
181
+                $datepart = $parts[0];
182 182
             }
183 183
             if(empty($parts[1])) {
184 184
                 $timepart = $timedate->fromTimestamp(0)->format($settings->timeformat);
Please login to merge, or discard this 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 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,14 +41,14 @@
 block discarded – undo
41 41
 
42 42
 class SugarFieldAssigned_user_name extends SugarFieldBase {
43 43
 
44
-	function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
45
-    	$vardef['options'] = get_user_array(false);
46
-		if(!empty($vardef['function']['returns']) && $vardef['function']['returns']== 'html'){
47
-    	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
48
-           return $this->fetch($this->findTemplate('EditViewFunction'));
49
-    	}else{
50
-    	   $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
51
-           return $this->fetch($this->findTemplate('SearchView'));
52
-    	}
44
+    function getSearchViewSmarty($parentFieldArray, $vardef, $displayParams, $tabindex) {
45
+        $vardef['options'] = get_user_array(false);
46
+        if(!empty($vardef['function']['returns']) && $vardef['function']['returns']== 'html'){
47
+            $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
48
+            return $this->fetch($this->findTemplate('EditViewFunction'));
49
+        }else{
50
+            $this->setup($parentFieldArray, $vardef, $displayParams, $tabindex);
51
+            return $this->fetch($this->findTemplate('SearchView'));
52
+        }
53 53
     }
54 54
 }
Please login to merge, or discard this 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/SugarOauth.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -145,34 +145,34 @@  discard block
 block discarded – undo
145 145
          * @return array
146 146
          */
147 147
         public function getAccessToken($url,
148
-                                       Zend_Oauth_Token_Request $token = null,
149
-                                       $httpMethod = null,
150
-                                       Zend_Oauth_Http_AccessToken $request = null)
148
+                                        Zend_Oauth_Token_Request $token = null,
149
+                                        $httpMethod = null,
150
+                                        Zend_Oauth_Http_AccessToken $request = null)
151 151
         {
152 152
             $this->setAccessTokenUrl($url);
153 153
             $this->_last = $token = parent::getAccessToken($_REQUEST, $this->makeRequestToken());
154 154
             return array('oauth_token' => $token->getToken(), 'oauth_token_secret' => $token->getTokenSecret());
155 155
         }
156 156
 
157
-       /**
158
-        * Fetch URL with OAuth
159
-        * @param string $url
160
-        * @param string $params Query params
161
-        * @param string $method HTTP method
162
-        * @param array $headers HTTP headers
163
-        * @return string
164
-        */
157
+        /**
158
+         * Fetch URL with OAuth
159
+         * @param string $url
160
+         * @param string $params Query params
161
+         * @param string $method HTTP method
162
+         * @param array $headers HTTP headers
163
+         * @return string
164
+         */
165 165
         
166 166
         public function fetch($url, $params = null, $method = 'GET', $headers = null)
167 167
         {
168 168
             $acc = $this->makeAccessToken();
169 169
             if ( strpos($url,'?') ) {
170
-               list($clean_url, $query) = explode('?', $url);
171
-               if($query) {
172
-                   $url = $clean_url;
173
-                   parse_str($query, $query_params);
174
-                   $params = array_merge($params?$params:array(), $query_params);
175
-               }
170
+                list($clean_url, $query) = explode('?', $url);
171
+                if($query) {
172
+                    $url = $clean_url;
173
+                    parse_str($query, $query_params);
174
+                    $params = array_merge($params?$params:array(), $query_params);
175
+                }
176 176
             }
177 177
             $client = $acc->getHttpClient($this->_oauth_config, $url);
178 178
             
@@ -212,33 +212,33 @@  discard block
 block discarded – undo
212 212
             $this->_last = $resp = $client->request();
213 213
             $this->_lastReq = $client->getLastRequest();
214 214
             return $resp->getBody();
215
-       }
215
+        }
216 216
 
217
-       /**
218
-        * Get HTTP client
219
-        * @return Zend_Oauth_Client
220
-        */
221
-       public function getClient()
222
-       {
217
+        /**
218
+         * Get HTTP client
219
+         * @return Zend_Oauth_Client
220
+         */
221
+        public function getClient()
222
+        {
223 223
             $acc = $this->makeAccessToken();
224 224
             return $acc->getHttpClient($this->_oauth_config);
225
-       }
225
+        }
226 226
 
227
-       /**
228
-        * Get last response
229
-        * @return string
230
-        */
231
-       public function getLastResponse()
232
-       {
227
+        /**
228
+         * Get last response
229
+         * @return string
230
+         */
231
+        public function getLastResponse()
232
+        {
233 233
             return $this->_last;
234
-       }
234
+        }
235 235
 
236
-       /**
237
-        * Get last request
238
-        * @return string
239
-        */
240
-       public function getLastRequest()
241
-       {
236
+        /**
237
+         * Get last request
238
+         * @return string
239
+         */
240
+        public function getLastRequest()
241
+        {
242 242
             return $this->_lastReq;
243
-       }
243
+        }
244 244
     }
Please login to merge, or discard this 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.
include/phpmailer/language/phpmailer.lang-ar.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
20 20
 $PHPMAILER_LANG['provide_address']      = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.';
21 21
 $PHPMAILER_LANG['recipients_failed']    = 'خطأ SMTP: الأخطاء التالية ' .
22
-                                          'فشل في الارسال لكل من : ';
22
+                                            'فشل في الارسال لكل من : ';
23 23
 $PHPMAILER_LANG['signing']              = 'خطأ في التوقيع: ';
24 24
 $PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() غير ممكن.';
25 25
 $PHPMAILER_LANG['smtp_error']           = 'خطأ على مستوى الخادم SMTP: ';
Please login to merge, or discard this patch.
include/formbase.php 2 patches
Braces   +10 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.
@@ -77,8 +79,9 @@  discard block
 block discarded – undo
77 79
 {
78 80
 	global $current_user;
79 81
 
80
-	if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve)
81
-		$focus->retrieve($_REQUEST[$prefix.'record']);
82
+	if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve) {
83
+			$focus->retrieve($_REQUEST[$prefix.'record']);
84
+	}
82 85
 
83 86
 	if(!empty($_POST['assigned_user_id']) && 
84 87
 	    ($focus->assigned_user_id != $_POST['assigned_user_id']) && 
@@ -240,8 +243,7 @@  discard block
 block discarded – undo
240 243
     if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "")
241 244
 	{
242 245
 		$return_module = $_REQUEST['return_module'];
243
-	}
244
-	else
246
+	} else
245 247
 	{
246 248
 		$return_module = $return_module;
247 249
 	}
@@ -275,14 +277,12 @@  discard block
 block discarded – undo
275 277
 			$return_module = $_REQUEST['module'];
276 278
 			$return_action = $_REQUEST['return_action']; 
277 279
 			// wp: return action needs to be set for one-click close in task list
278
-		} 
279
-		else 
280
+		} else 
280 281
 		{
281 282
 			// if we "Cancel", we go back to the list view.
282 283
 			$return_action = $_REQUEST['return_action'];
283 284
 		}
284
-	}
285
-	else
285
+	} else
286 286
 	{
287 287
 		$return_action = "DetailView";
288 288
 	}
@@ -378,8 +378,7 @@  discard block
 block discarded – undo
378 378
     $focus=BeanFactory::getBean('Prospects');
379 379
     if(is_array($child_id)){
380 380
         $uids = $child_id;
381
-    }
382
-    else{
381
+    } else{
383 382
         $uids = array($child_id);
384 383
     }
385 384
 
Please login to merge, or discard this patch.
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
  */
55 55
 function checkRequired($prefix, $required)
56 56
 {
57
-	foreach($required as $key)
58
-	{
59
-		if(!isset($_POST[$prefix.$key]) || number_empty($_POST[$prefix.$key]))
60
-		{
61
-			return false;
62
-		}
63
-	}
64
-	return true;
57
+    foreach($required as $key)
58
+    {
59
+        if(!isset($_POST[$prefix.$key]) || number_empty($_POST[$prefix.$key]))
60
+        {
61
+            return false;
62
+        }
63
+    }
64
+    return true;
65 65
 }
66 66
 
67 67
 /**
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function populateFromPost($prefix, &$focus, $skipRetrieve = false, $checkACL = false)
77 77
 {
78
-	global $current_user;
78
+    global $current_user;
79 79
 
80
-	if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve)
81
-		$focus->retrieve($_REQUEST[$prefix.'record']);
80
+    if(!empty($_REQUEST[$prefix.'record']) && !$skipRetrieve)
81
+        $focus->retrieve($_REQUEST[$prefix.'record']);
82 82
 
83
-	if(!empty($_POST['assigned_user_id']) && 
84
-	    ($focus->assigned_user_id != $_POST['assigned_user_id']) && 
85
-	    ($_POST['assigned_user_id'] != $current_user->id)) {
86
-		$GLOBALS['check_notify'] = true;
87
-	}
83
+    if(!empty($_POST['assigned_user_id']) && 
84
+        ($focus->assigned_user_id != $_POST['assigned_user_id']) && 
85
+        ($_POST['assigned_user_id'] != $current_user->id)) {
86
+        $GLOBALS['check_notify'] = true;
87
+    }
88 88
     if(isset($_POST['dup_checked']) && $_POST['dup_checked'] && isset($_POST['id']) && $_POST['id'] != '' ){
89 89
         $focus->new_with_id = true;
90 90
     }
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
         $relatedFields[$def['id_name']] = $field;
107 107
     }
108 108
 
109
-	foreach($focus->field_defs as $field=>$def) {
109
+    foreach($focus->field_defs as $field=>$def) {
110 110
         if ( $field == 'id' && !empty($focus->id) ) {
111 111
             // Don't try and overwrite the ID
112 112
             continue;
113 113
         }
114 114
 
115 115
 
116
-	    $type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type'];
117
-		$sf = $sfh::getSugarField($type);
116
+        $type = !empty($def['custom_type']) ? $def['custom_type'] : $def['type'];
117
+        $sf = $sfh::getSugarField($type);
118 118
         if($sf != null){
119 119
             $sf->save($focus, $_POST, $field, $def, $prefix);
120 120
         } else {
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 			$focus->$field = '';
153 153
 		}
154 154
 */
155
-	}
155
+    }
156 156
 
157
-	foreach($focus->additional_column_fields as $field) {
158
-		if(isset($_POST[$prefix.$field])) {
159
-			$value = $_POST[$prefix.$field];
160
-			$focus->$field = $value;
161
-		}
162
-	}
163
-	return $focus;
157
+    foreach($focus->additional_column_fields as $field) {
158
+        if(isset($_POST[$prefix.$field])) {
159
+            $value = $_POST[$prefix.$field];
160
+            $focus->$field = $value;
161
+        }
162
+    }
163
+    return $focus;
164 164
 }
165 165
 
166 166
 function add_hidden_elements($key, $value) {
@@ -182,73 +182,73 @@  discard block
 block discarded – undo
182 182
 
183 183
 function getPostToForm($ignore='', $isRegularExpression=false)
184 184
 {
185
-	$fields = '';
186
-	if(!empty($ignore) && $isRegularExpression) {
187
-		foreach ($_POST as $key=>$value){
188
-			if(!preg_match($ignore, $key)) {
185
+    $fields = '';
186
+    if(!empty($ignore) && $isRegularExpression) {
187
+        foreach ($_POST as $key=>$value){
188
+            if(!preg_match($ignore, $key)) {
189 189
                                 $fields .= add_hidden_elements($key, $value);
190
-			}
191
-		}	
192
-	} else {
193
-		foreach ($_POST as $key=>$value){
194
-			if($key != $ignore) {
190
+            }
191
+        }	
192
+    } else {
193
+        foreach ($_POST as $key=>$value){
194
+            if($key != $ignore) {
195 195
                                 $fields .= add_hidden_elements($key, $value);
196
-			}
197
-		}
198
-	}
199
-	return $fields;
196
+            }
197
+        }
198
+    }
199
+    return $fields;
200 200
 }
201 201
 
202 202
 function getGetToForm($ignore='', $usePostAsAuthority = false)
203 203
 {
204
-	$fields = '';
205
-	foreach ($_GET as $key=>$value)
206
-	{
207
-		if($key != $ignore){
208
-			if(!$usePostAsAuthority || !isset($_POST[$key])){
209
-				$fields.= "<input type='hidden' name='$key' value='$value'>";
210
-			}
211
-		}
212
-	}
213
-	return $fields;
204
+    $fields = '';
205
+    foreach ($_GET as $key=>$value)
206
+    {
207
+        if($key != $ignore){
208
+            if(!$usePostAsAuthority || !isset($_POST[$key])){
209
+                $fields.= "<input type='hidden' name='$key' value='$value'>";
210
+            }
211
+        }
212
+    }
213
+    return $fields;
214 214
 
215 215
 }
216 216
 function getAnyToForm($ignore='', $usePostAsAuthority = false)
217 217
 {
218
-	$fields = getPostToForm($ignore);
219
-	$fields .= getGetToForm($ignore, $usePostAsAuthority);
220
-	return $fields;
218
+    $fields = getPostToForm($ignore);
219
+    $fields .= getGetToForm($ignore, $usePostAsAuthority);
220
+    return $fields;
221 221
 
222 222
 }
223 223
 
224 224
 function handleRedirect($return_id='', $return_module='', $additionalFlags = false)
225 225
 {
226
-	if(isset($_REQUEST['return_url']) && $_REQUEST['return_url'] != "")
227
-	{
228
-		header("Location: ". $_REQUEST['return_url']);
229
-		exit;
230
-	}
231
-
232
-	$url = buildRedirectURL($return_id, $return_module);
233
-	header($url);
234
-	exit;	
226
+    if(isset($_REQUEST['return_url']) && $_REQUEST['return_url'] != "")
227
+    {
228
+        header("Location: ". $_REQUEST['return_url']);
229
+        exit;
230
+    }
231
+
232
+    $url = buildRedirectURL($return_id, $return_module);
233
+    header($url);
234
+    exit;	
235 235
 }
236 236
 
237 237
 //eggsurplus: abstract to simplify unit testing
238 238
 function buildRedirectURL($return_id='', $return_module='') 
239 239
 {
240 240
     if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "")
241
-	{
242
-		$return_module = $_REQUEST['return_module'];
243
-	}
244
-	else
245
-	{
246
-		$return_module = $return_module;
247
-	}
248
-	if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "")
249
-	{
241
+    {
242
+        $return_module = $_REQUEST['return_module'];
243
+    }
244
+    else
245
+    {
246
+        $return_module = $return_module;
247
+    }
248
+    if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "")
249
+    {
250 250
 	    
251
-	   //if we are doing a "Close and Create New"
251
+        //if we are doing a "Close and Create New"
252 252
         if(isCloseAndCreateNewPressed())
253 253
         {
254 254
             $return_action = "EditView";    
@@ -257,40 +257,40 @@  discard block
 block discarded – undo
257 257
             
258 258
             // Meeting Integration
259 259
             if(isset($_REQUEST['meetingIntegrationFlag']) && $_REQUEST['meetingIntegrationFlag'] == 1) {
260
-            	$additionalFlags = array('meetingIntegrationShowForm' => '1');
260
+                $additionalFlags = array('meetingIntegrationShowForm' => '1');
261 261
             }
262 262
             // END Meeting Integration
263 263
         } 
264
-		// if we create a new record "Save", we want to redirect to the DetailView
265
-		else if(isset($_REQUEST['action']) && $_REQUEST['action'] == "Save" 
266
-			&& $_REQUEST['return_module'] != 'Activities'
267
-			&& $_REQUEST['return_module'] != 'Home' 
268
-			&& $_REQUEST['return_module'] != 'Forecasts' 
269
-			&& $_REQUEST['return_module'] != 'Calendar'
270
-			&& $_REQUEST['return_module'] != 'MailMerge'
271
-			) 
272
-			{
273
-			    $return_action = 'DetailView';
274
-			} elseif($_REQUEST['return_module'] == 'Activities' || $_REQUEST['return_module'] == 'Calendar') {
275
-			$return_module = $_REQUEST['module'];
276
-			$return_action = $_REQUEST['return_action']; 
277
-			// wp: return action needs to be set for one-click close in task list
278
-		} 
279
-		else 
280
-		{
281
-			// if we "Cancel", we go back to the list view.
282
-			$return_action = $_REQUEST['return_action'];
283
-		}
284
-	}
285
-	else
286
-	{
287
-		$return_action = "DetailView";
288
-	}
264
+        // if we create a new record "Save", we want to redirect to the DetailView
265
+        else if(isset($_REQUEST['action']) && $_REQUEST['action'] == "Save" 
266
+            && $_REQUEST['return_module'] != 'Activities'
267
+            && $_REQUEST['return_module'] != 'Home' 
268
+            && $_REQUEST['return_module'] != 'Forecasts' 
269
+            && $_REQUEST['return_module'] != 'Calendar'
270
+            && $_REQUEST['return_module'] != 'MailMerge'
271
+            ) 
272
+            {
273
+                $return_action = 'DetailView';
274
+            } elseif($_REQUEST['return_module'] == 'Activities' || $_REQUEST['return_module'] == 'Calendar') {
275
+            $return_module = $_REQUEST['module'];
276
+            $return_action = $_REQUEST['return_action']; 
277
+            // wp: return action needs to be set for one-click close in task list
278
+        } 
279
+        else 
280
+        {
281
+            // if we "Cancel", we go back to the list view.
282
+            $return_action = $_REQUEST['return_action'];
283
+        }
284
+    }
285
+    else
286
+    {
287
+        $return_action = "DetailView";
288
+    }
289 289
 	
290
-	if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "")
291
-	{
292
-		$return_id = $_REQUEST['return_id'];
293
-	}
290
+    if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "")
291
+    {
292
+        $return_id = $_REQUEST['return_id'];
293
+    }
294 294
 
295 295
     $add = "";
296 296
     if(isset($additionalFlags) && !empty($additionalFlags)) {
@@ -320,16 +320,16 @@  discard block
 block discarded – undo
320 320
             return "Location: $url";
321 321
         }
322 322
     } else {
323
-    	$standard = "action=$return_action&module=$return_module&record=$return_id&isDuplicate=true&return_module=$return_module&return_action=$return_action&status=$status";
323
+        $standard = "action=$return_action&module=$return_module&record=$return_id&isDuplicate=true&return_module=$return_module&return_action=$return_action&status=$status";
324 324
         $url="index.php?{$standard}{$add}";
325 325
         if(!empty($_REQUEST['ajax_load']))
326 326
         {
327 327
             $ajax_ret = array(
328
-                 'content' => "<script>SUGAR.ajaxUI.loadContent('$url');</script>\n",
329
-                 'menu' => array(
330
-                     'module' => $return_module,
331
-                     'label' => translate($return_module),
332
-                 ),
328
+                    'content' => "<script>SUGAR.ajaxUI.loadContent('$url');</script>\n",
329
+                    'menu' => array(
330
+                        'module' => $return_module,
331
+                        'label' => translate($return_module),
332
+                    ),
333 333
             );
334 334
             $json = getJSONobj();
335 335
             echo $json->encode($ajax_ret);
@@ -341,21 +341,21 @@  discard block
 block discarded – undo
341 341
 
342 342
 function getLikeForEachWord($fieldname, $value, $minsize=4)
343 343
 {
344
-	$value = trim($value);
345
-	$values = explode(' ',$value);
346
-	$ret = '';
347
-	foreach($values as $val)
348
-	{
349
-		if(strlen($val) >= $minsize)
350
-		{
351
-			if(!empty($ret))
352
-			{
353
-				$ret .= ' or';
354
-			}
355
-			$ret .= ' '. $fieldname . ' LIKE %'.$val.'%';
356
-		}
344
+    $value = trim($value);
345
+    $values = explode(' ',$value);
346
+    $ret = '';
347
+    foreach($values as $val)
348
+    {
349
+        if(strlen($val) >= $minsize)
350
+        {
351
+            if(!empty($ret))
352
+            {
353
+                $ret .= ' or';
354
+            }
355
+            $ret .= ' '. $fieldname . ' LIKE %'.$val.'%';
356
+        }
357 357
 
358
-	}
358
+    }
359 359
 
360 360
 
361 361
 }
Please login to merge, or discard this patch.
include/SubPanel/registered_layout_defs.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@
 block discarded – undo
49 49
 function get_layout_defs()
50 50
 {
51 51
     //TODO add global memory cache support here.  If there is an in memory cache, leverage it.
52
-	global $layout_defs;
53
-	return $layout_defs;
52
+    global $layout_defs;
53
+    return $layout_defs;
54 54
 }
55 55
 
56 56
 ?>
57 57
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
include/SubPanel/SubPanelTilesTabs.php 2 patches
Braces   +22 added lines, -17 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.
@@ -111,8 +113,9 @@  discard block
 block discarded – undo
111 113
     function _getTabs($tabs, $showTabs = true, $selectedGroup='All')
112 114
     {
113 115
         //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized.
114
-        if($selectedGroup=='All')
115
-        	$selectedGroup=translate('LBL_TABGROUP_ALL');
116
+        if($selectedGroup=='All') {
117
+                	$selectedGroup=translate('LBL_TABGROUP_ALL');
118
+        }
116 119
 
117 120
     	// Set up a mapping from subpanelID, found in the $tabs list, to the source module name
118 121
     	// As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two
@@ -127,8 +130,9 @@  discard block
 block discarded – undo
127 130
             // Bug #44344 : Custom relationships under same module only show once in subpanel tabs
128 131
             // use object property instead new object to have ability run unit test (can override subpanel_definitions)
129 132
             $subpanel =  $this->subpanel_definitions->load_subpanel( $subpanelID );
130
-    		if ($subpanel !== false)
131
-    		  $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ;
133
+    		if ($subpanel !== false) {
134
+    		    		  $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ;
135
+    		}
132 136
     	}
133 137
 
134 138
     	$groups =  array () ;
@@ -138,11 +142,12 @@  discard block
 block discarded – undo
138 142
         {
139 143
             foreach( $subModules['modules'] as $key => $subModule )
140 144
             {
141
-    			foreach ( $tabs as $subpanelID )
142
-                    if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0)
145
+    			foreach ( $tabs as $subpanelID ) {
146
+    			                    if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0)
143 147
                     {
144 148
                         // Bug #44344 : Custom relationships under same module only show once in subpanel tabs
145 149
                         $groups [ translate ( $mainTab ) ] [ 'modules' ] [] = $subpanelID ;
150
+    			}
146 151
                     	$found [ $subpanelID ] = true ;
147 152
                 	}
148 153
             }
@@ -152,8 +157,9 @@  discard block
 block discarded – undo
152 157
 
153 158
         foreach( $tabs as $subpanelID )
154 159
         {
155
-        	if ( ! isset ( $found [ $subpanelID ] ) )
156
-	        	$groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ;
160
+        	if ( ! isset ( $found [ $subpanelID ] ) ) {
161
+        		        	$groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ;
162
+        	}
157 163
         }
158 164
 
159 165
         /* Move history to same tab as activities */
@@ -168,8 +174,7 @@  discard block
 block discarded – undo
168 174
                     	/* Move hist from there to here */
169 175
                         $groups[$mainTab]['modules'] []= 'history';
170 176
                     }
171
-                }
172
-                else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules']))))
177
+                } else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules']))))
173 178
                 {
174 179
                     unset($groups[$mainTab]['modules'][$i]);
175 180
                     if(empty($groups[$mainTab]['modules']))
@@ -184,10 +189,11 @@  discard block
 block discarded – undo
184 189
          * Note that if a tab group already exists with the name 'All',
185 190
          * it will be overwritten in this union operation.
186 191
          */
187
-        if(count($groups) <= 1)
188
-        	$groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs));
189
-        else
190
-            $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups;
192
+        if(count($groups) <= 1) {
193
+                	$groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs));
194
+        } else {
195
+                    $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups;
196
+        }
191 197
         /* Note - all $display checking and array_intersects with $tabs
192 198
          * are now redundant (thanks to GroupedTabStructure), and could
193 199
          * be removed for performance, but for now can stay to help ensure
@@ -261,8 +267,7 @@  discard block
 block discarded – undo
261 267
             	$sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup);
262 268
             	$sugarTab->display();
263 269
             }
264
-        }
265
-        else
270
+        } else
266 271
         {
267 272
             $tabs = SubPanelTilesTabs::applyUserCustomLayoutToTabs($tabs, $selectedGroup);
268 273
 
Please login to merge, or discard this patch.
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
 class SubPanelTilesTabs extends SubPanelTiles
49 49
 {
50 50
 
51
-	function __construct(&$focus, $layout_def_key='', $layout_def_override = '')
52
-	{
51
+    function __construct(&$focus, $layout_def_key='', $layout_def_override = '')
52
+    {
53 53
 
54
-		$this->focus = $focus;
55
-		$this->id = $focus->id;
56
-		$this->module = $focus->module_dir;
57
-		$this->layout_def_key = $layout_def_key;
58
-		$this->subpanel_definitions = new SubPanelDefinitions($focus, $layout_def_key, $layout_def_override);
59
-	}
54
+        $this->focus = $focus;
55
+        $this->id = $focus->id;
56
+        $this->module = $focus->module_dir;
57
+        $this->layout_def_key = $layout_def_key;
58
+        $this->subpanel_definitions = new SubPanelDefinitions($focus, $layout_def_key, $layout_def_override);
59
+    }
60 60
 
61 61
     function getSubpanelGroupLayout($selectedGroup)
62 62
     {
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
     {
78 78
         //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized.
79 79
         if($key=='All')
80
-    	{
81
-    		$key=translate('LBL_TABGROUP_ALL');
82
-    	}
80
+        {
81
+            $key=translate('LBL_TABGROUP_ALL');
82
+        }
83 83
         $usersCustomLayout = SubPanelTilesTabs::getSubpanelGroupLayout($key);
84 84
         if(!empty($usersCustomLayout))
85 85
         {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $tabs = array_intersect($usersCustomLayout, $tabs);
92 92
             foreach($diff as $subpanel)
93 93
             {
94
-            	$tabs []= $subpanel;
94
+                $tabs []= $subpanel;
95 95
             }
96 96
         }
97 97
 
@@ -112,39 +112,39 @@  discard block
 block discarded – undo
112 112
     {
113 113
         //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized.
114 114
         if($selectedGroup=='All')
115
-        	$selectedGroup=translate('LBL_TABGROUP_ALL');
116
-
117
-    	// Set up a mapping from subpanelID, found in the $tabs list, to the source module name
118
-    	// As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two
119
-    	// when constructing the subpanel tabs
120
-    	// Note that we can't use the very similar GroupedTabStructure class as it lacks this mapping, and logically, it is designed
121
-    	// for use when constructing the module by module tabs, not the subpanel tabs, as we move away from using module names to represent
122
-    	// subpanels, and use unique subpanel IDs instead.
123
-
124
-    	$moduleNames = array () ;
125
-    	foreach ( $tabs as $subpanelID )
126
-    	{
115
+            $selectedGroup=translate('LBL_TABGROUP_ALL');
116
+
117
+        // Set up a mapping from subpanelID, found in the $tabs list, to the source module name
118
+        // As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two
119
+        // when constructing the subpanel tabs
120
+        // Note that we can't use the very similar GroupedTabStructure class as it lacks this mapping, and logically, it is designed
121
+        // for use when constructing the module by module tabs, not the subpanel tabs, as we move away from using module names to represent
122
+        // subpanels, and use unique subpanel IDs instead.
123
+
124
+        $moduleNames = array () ;
125
+        foreach ( $tabs as $subpanelID )
126
+        {
127 127
             // Bug #44344 : Custom relationships under same module only show once in subpanel tabs
128 128
             // use object property instead new object to have ability run unit test (can override subpanel_definitions)
129 129
             $subpanel =  $this->subpanel_definitions->load_subpanel( $subpanelID );
130
-    		if ($subpanel !== false)
131
-    		  $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ;
132
-    	}
130
+            if ($subpanel !== false)
131
+                $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ;
132
+        }
133 133
 
134
-    	$groups =  array () ;
135
-    	$found = array () ;
134
+        $groups =  array () ;
135
+        $found = array () ;
136 136
 
137 137
         foreach( $GLOBALS['tabStructure'] as $mainTab => $subModules)
138 138
         {
139 139
             foreach( $subModules['modules'] as $key => $subModule )
140 140
             {
141
-    			foreach ( $tabs as $subpanelID )
141
+                foreach ( $tabs as $subpanelID )
142 142
                     if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0)
143 143
                     {
144 144
                         // Bug #44344 : Custom relationships under same module only show once in subpanel tabs
145 145
                         $groups [ translate ( $mainTab ) ] [ 'modules' ] [] = $subpanelID ;
146
-                    	$found [ $subpanelID ] = true ;
147
-                	}
146
+                        $found [ $subpanelID ] = true ;
147
+                    }
148 148
             }
149 149
         }
150 150
 
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 
153 153
         foreach( $tabs as $subpanelID )
154 154
         {
155
-        	if ( ! isset ( $found [ $subpanelID ] ) )
156
-	        	$groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ;
155
+            if ( ! isset ( $found [ $subpanelID ] ) )
156
+                $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ;
157 157
         }
158 158
 
159 159
         /* Move history to same tab as activities */
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
         {
162 162
             foreach($groups as $mainTab => $group)
163 163
             {
164
-            	if(in_array('activities', array_map('strtolower', $group['modules'])))
164
+                if(in_array('activities', array_map('strtolower', $group['modules'])))
165 165
                 {
166
-                	if(!in_array('history', array_map('strtolower', $group['modules'])))
166
+                    if(!in_array('history', array_map('strtolower', $group['modules'])))
167 167
                     {
168
-                    	/* Move hist from there to here */
168
+                        /* Move hist from there to here */
169 169
                         $groups[$mainTab]['modules'] []= 'history';
170 170
                     }
171 171
                 }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                     unset($groups[$mainTab]['modules'][$i]);
175 175
                     if(empty($groups[$mainTab]['modules']))
176 176
                     {
177
-                    	unset($groups[$mainTab]);
177
+                        unset($groups[$mainTab]);
178 178
                     }
179 179
                 }
180 180
             }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
          * it will be overwritten in this union operation.
186 186
          */
187 187
         if(count($groups) <= 1)
188
-        	$groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs));
188
+            $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs));
189 189
         else
190 190
             $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups;
191 191
         /* Note - all $display checking and array_intersects with $tabs
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
         $retTabs = array();
198 198
         if($showTabs)
199 199
         {
200
-        	require_once('include/SubPanel/SugarTab.php');
201
-        	$sugarTab = new SugarTab();
200
+            require_once('include/SubPanel/SugarTab.php');
201
+            $sugarTab = new SugarTab();
202 202
 
203 203
             $displayTabs = array();
204 204
             $otherTabs = array();
205 205
 
206
-    	    foreach ($groups as $key => $tab)
207
-    		{
206
+            foreach ($groups as $key => $tab)
207
+            {
208 208
                 $display = false;
209 209
                 foreach($tab['modules'] as $subkey=>$subtab)
210 210
                 {
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
                     $relevantTabs = SubPanelTilesTabs::applyUserCustomLayoutToTabs($tabs, $key);
228 228
 
229 229
                     $sugarTabs[$key] = array(
230
-                             'label'=>( !empty($tab['label']) ? $tab['label']: $key ),
231
-                             'type'=>$selected
230
+                                'label'=>( !empty($tab['label']) ? $tab['label']: $key ),
231
+                                'type'=>$selected
232 232
                     );
233 233
 
234 234
                     $otherTabs[$key] = array('key'=>$key, 'tabs'=>array());
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                         $retTabs = $orderedTabs;
247 247
                     }
248 248
                 }
249
-    		}
249
+            }
250 250
 
251 251
             if(empty($displayTabs) && !empty($otherTabs))
252 252
             {
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
             }
259 259
 
260 260
             if (!empty($sugarTabs) || !empty($otherTabs) ) {
261
-            	$sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup);
262
-            	$sugarTab->display();
261
+                $sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup);
262
+                $sugarTab->display();
263 263
             }
264 264
         }
265 265
         else
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         }
271 271
 
272 272
         // Use javascript to filter tabs.
273
-		return $tabs;
274
-	}
273
+        return $tabs;
274
+    }
275 275
 }
276 276
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelGetLatestButton.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -45,40 +45,40 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelGetLatestButton extends SugarWidgetField
47 47
 {
48
-	function displayHeaderCell($layout_def)
49
-	{
50
-		return '&nbsp;';
51
-	}
48
+    function displayHeaderCell($layout_def)
49
+    {
50
+        return '&nbsp;';
51
+    }
52 52
 
53
-	function displayList($layout_def)
54
-	{
55
-		//if the contract has been executed or selected_revision is same as latest revision
56
-		//then hide the latest button. 		
57
-		//if the contract state is executed or document is not a template hide this action.
58
-		if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or
59
-			$layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) {
60
-			return "";
61
-		}
53
+    function displayList($layout_def)
54
+    {
55
+        //if the contract has been executed or selected_revision is same as latest revision
56
+        //then hide the latest button. 		
57
+        //if the contract state is executed or document is not a template hide this action.
58
+        if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or
59
+            $layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) {
60
+            return "";
61
+        }
62 62
 		
63
-		global $app_strings;
63
+        global $app_strings;
64 64
 		
65 65
 
66
-		$href = 'index.php?module=' . $layout_def['module']
67
-			. '&action=' . 'GetLatestRevision'
68
-			. '&record=' . $layout_def['fields']['ID']
69
-			. '&return_module=' . $_REQUEST['module']
70
-			. '&return_action=' . 'DetailView'
71
-			. '&return_id=' . $_REQUEST['record']
72
-			. '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID'];
66
+        $href = 'index.php?module=' . $layout_def['module']
67
+            . '&action=' . 'GetLatestRevision'
68
+            . '&record=' . $layout_def['fields']['ID']
69
+            . '&return_module=' . $_REQUEST['module']
70
+            . '&return_action=' . 'DetailView'
71
+            . '&return_id=' . $_REQUEST['record']
72
+            . '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID'];
73 73
 
74
-		$edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']);
75
-		if($layout_def['EditView']){
76
-			return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP']  ."'"
77
-			. 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_GET_LATEST'] .'</a>&nbsp;';
78
-		}else{
79
-			return '';
80
-		}
81
-	}
74
+        $edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']);
75
+        if($layout_def['EditView']){
76
+            return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP']  ."'"
77
+            . 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_GET_LATEST'] .'</a>&nbsp;';
78
+        }else{
79
+            return '';
80
+        }
81
+    }
82 82
 		
83 83
 }
84 84
 
Please login to merge, or discard this patch.
Braces   +4 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.
@@ -75,7 +77,7 @@  discard block
 block discarded – undo
75 77
 		if($layout_def['EditView']){
76 78
 			return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP']  ."'"
77 79
 			. 'class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_GET_LATEST'] .'</a>&nbsp;';
78
-		}else{
80
+		} else{
79 81
 			return '';
80 82
 		}
81 83
 	}
Please login to merge, or discard this patch.