@@ -1,5 +1,7 @@ discard block |
||
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 | * Advanced OpenWorkflow, Automating SugarCRM. |
5 | 7 | * @package Advanced OpenWorkflow for SugarCRM |
@@ -26,5 +28,9 @@ discard block |
||
26 | 28 | |
27 | 29 | global $mod_strings, $app_strings, $sugar_config; |
28 | 30 | |
29 | -if(ACLController::checkAccess('FP_Event_Locations', 'edit', true))$module_menu[]=Array("index.php?module=FP_Event_Locations&action=EditView&return_module=FP_Event_Locations&return_action=DetailView", $mod_strings['LNK_NEW_RECORD'],"Create", 'FP_Event_Locations'); |
|
30 | -if(ACLController::checkAccess('FP_Event_Locations', 'list', true))$module_menu[]=Array("index.php?module=FP_Event_Locations&action=index", $mod_strings['LNK_LIST'],"List", 'FP_Event_Locations'); |
|
31 | 31 | \ No newline at end of file |
32 | +if(ACLController::checkAccess('FP_Event_Locations', 'edit', true)) { |
|
33 | + $module_menu[]=Array("index.php?module=FP_Event_Locations&action=EditView&return_module=FP_Event_Locations&return_action=DetailView", $mod_strings['LNK_NEW_RECORD'],"Create", 'FP_Event_Locations'); |
|
34 | +} |
|
35 | +if(ACLController::checkAccess('FP_Event_Locations', 'list', true)) { |
|
36 | + $module_menu[]=Array("index.php?module=FP_Event_Locations&action=index", $mod_strings['LNK_LIST'],"List", 'FP_Event_Locations'); |
|
37 | +} |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -484,8 +484,7 @@ discard block |
||
484 | 484 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
485 | 485 | if(isset($GLOBALS['log'])) { |
486 | 486 | $GLOBALS['log']->deprecated($deprecatedMessage); |
487 | - } |
|
488 | - else { |
|
487 | + } else { |
|
489 | 488 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
490 | 489 | } |
491 | 490 | self::__construct(); |
@@ -5122,8 +5121,7 @@ discard block |
||
5122 | 5121 | elseif (((!empty($value['type']) && ($value['type'] == 'enum' || $value['type'] == 'radioenum'))) && empty($value['function'])) { |
5123 | 5122 | if (!empty($value['options']) && !empty($app_list_strings[$value['options']][$this->$field])) { |
5124 | 5123 | $return_array[$cache[$field]] = $app_list_strings[$value['options']][$this->$field]; |
5125 | - } |
|
5126 | - elseif (!empty($value['options']) && !empty($mod_strings[$value['options']][$this->$field])) { |
|
5124 | + } elseif (!empty($value['options']) && !empty($mod_strings[$value['options']][$this->$field])) { |
|
5127 | 5125 | $return_array[$cache[$field]] = $mod_strings[$value['options']][$this->$field]; |
5128 | 5126 | } else { |
5129 | 5127 | $return_array[$cache[$field]] = $this->$field; |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | try { |
17 | 17 | $LogicHook = new LogicHook(); |
18 | 18 | $this->assertTrue(true); |
19 | - } |
|
20 | - catch (Exception $e) { |
|
19 | + } catch (Exception $e) { |
|
21 | 20 | $this->fail(); |
22 | 21 | } |
23 | 22 | |
@@ -303,8 +302,7 @@ discard block |
||
303 | 302 | try { |
304 | 303 | $LogicHook->call_custom_logic('', 'after_ui_footer'); |
305 | 304 | $this->assertTrue(true); |
306 | - } |
|
307 | - catch (Exception $e) { |
|
305 | + } catch (Exception $e) { |
|
308 | 306 | $this->fail(); |
309 | 307 | } |
310 | 308 | |
@@ -322,8 +320,7 @@ discard block |
||
322 | 320 | try { |
323 | 321 | $LogicHook->process_hooks($hooks, 'after_ui_footer',array() ); |
324 | 322 | $this->assertTrue(true); |
325 | - } |
|
326 | - catch (Exception $e) { |
|
323 | + } catch (Exception $e) { |
|
327 | 324 | $this->fail(); |
328 | 325 | } |
329 | 326 |
@@ -217,8 +217,7 @@ discard block |
||
217 | 217 | $detectedType = exif_imagetype($_FILES['company_logo']['tmp_name']); |
218 | 218 | if(!in_array($detectedType, $allowedTypes)) { |
219 | 219 | $errors[] = $mod_strings['ERR_UPLOAD_FILETYPE']; |
220 | - } |
|
221 | - else { |
|
220 | + } else { |
|
222 | 221 | // uploaded image stored in the /custom path instead of put into the original theme directory.. |
223 | 222 | |
224 | 223 | mkdir_recursive('custom/' . SugarThemeRegistry::current()->getDefaultImagePath(), true); |
@@ -226,8 +225,7 @@ discard block |
||
226 | 225 | $destFile = 'custom/' . $tmpvar[0]; |
227 | 226 | if (!move_uploaded_file($_FILES['company_logo']['tmp_name'], $destFile)) { |
228 | 227 | $errors[] = $mod_strings['ERR_LANG_UPLOAD_1']; |
229 | - } |
|
230 | - else { |
|
228 | + } else { |
|
231 | 229 | $filepath = $destFile; |
232 | 230 | } |
233 | 231 | } |
@@ -277,7 +275,9 @@ discard block |
||
277 | 275 | |
278 | 276 | if(isset($_REQUEST['storeConfig']) && ($_REQUEST['storeConfig'])){ |
279 | 277 | // store configuration by form to session |
280 | - if(!isset($_SESSION)) session_start(); |
|
278 | + if(!isset($_SESSION)) { |
|
279 | + session_start(); |
|
280 | + } |
|
281 | 281 | $_SESSION = array_merge($_SESSION, $_POST); |
282 | 282 | |
283 | 283 | // TODO--low: don't forget the custom type install settings! validate here.. |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | //define web root, which will be used as default for site_url |
371 | 371 | if($_SERVER['SERVER_PORT']=='80'){ |
372 | 372 | $web_root = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; |
373 | -}else{ |
|
373 | +} else{ |
|
374 | 374 | $web_root = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['PHP_SELF']; |
375 | 375 | } |
376 | 376 | $web_root = str_replace("/install.php", "", $web_root); |
@@ -515,8 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | <p>{$mod_strings['LBL_DISABLED_HELP_1']} <a href="{$mod_strings['LBL_DISABLED_HELP_LNK']}" target="_blank">{$mod_strings['LBL_DISABLED_HELP_2']}</a>.</p> |
517 | 517 | EOQ; |
518 | -} |
|
519 | -else{ |
|
518 | +} else{ |
|
520 | 519 | $validation_errors = array(); |
521 | 520 | // process the data posted |
522 | 521 | if($next_clicked) { |
@@ -607,27 +606,27 @@ discard block |
||
607 | 606 | $_SESSION['setup_site_custom_session_path'] = get_boolean_from_request('setup_site_custom_session_path'); |
608 | 607 | if($_SESSION['setup_site_custom_session_path']){ |
609 | 608 | $_SESSION['setup_site_session_path'] = $_REQUEST['setup_site_session_path']; |
610 | - }else{ |
|
609 | + } else{ |
|
611 | 610 | $_SESSION['setup_site_session_path'] = ''; |
612 | 611 | } |
613 | 612 | |
614 | 613 | $_SESSION['setup_site_custom_log_dir'] = get_boolean_from_request('setup_site_custom_log_dir'); |
615 | 614 | if($_SESSION['setup_site_custom_log_dir']){ |
616 | 615 | $_SESSION['setup_site_log_dir'] = $_REQUEST['setup_site_log_dir']; |
617 | - }else{ |
|
616 | + } else{ |
|
618 | 617 | $_SESSION['setup_site_log_dir'] = '.'; |
619 | 618 | } |
620 | 619 | |
621 | 620 | $_SESSION['setup_site_specify_guid'] = get_boolean_from_request('setup_site_specify_guid'); |
622 | 621 | if($_SESSION['setup_site_specify_guid']){ |
623 | 622 | $_SESSION['setup_site_guid'] = $_REQUEST['setup_site_guid']; |
624 | - }else{ |
|
623 | + } else{ |
|
625 | 624 | $_SESSION['setup_site_guid'] = ''; |
626 | 625 | } |
627 | 626 | $_SESSION['siteConfig_submitted'] = true; |
628 | 627 | if(isset($_REQUEST['setup_site_sugarbeet_anonymous_stats'])){ |
629 | 628 | $_SESSION['setup_site_sugarbeet_anonymous_stats'] = get_boolean_from_request('setup_site_sugarbeet_anonymous_stats'); |
630 | - }else{ |
|
629 | + } else{ |
|
631 | 630 | $_SESSION['setup_site_sugarbeet_anonymous_stats'] = 0; |
632 | 631 | } |
633 | 632 | |
@@ -642,13 +641,12 @@ discard block |
||
642 | 641 | |
643 | 642 | if($next_step == 9999) { |
644 | 643 | $the_file = 'SilentInstall'; |
645 | -}else if($next_step == 9191) { |
|
644 | +} else if($next_step == 9191) { |
|
646 | 645 | $_SESSION['oc_server_url'] = $_REQUEST['oc_server_url']; |
647 | 646 | $_SESSION['oc_username'] = $_REQUEST['oc_username']; |
648 | 647 | $_SESSION['oc_password'] = $_REQUEST['oc_password']; |
649 | 648 | $the_file = 'oc_convert.php'; |
650 | -} |
|
651 | -else{ |
|
649 | +} else{ |
|
652 | 650 | $the_file = $workflow[$next_step]; |
653 | 651 | |
654 | 652 | } |
@@ -1,5 +1,7 @@ |
||
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. |
@@ -96,14 +96,18 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | static function addTemplate($module, $object, $template, $object_name=false){ |
99 | - if($template == 'default')$template = 'basic'; |
|
99 | + if($template == 'default') { |
|
100 | + $template = 'basic'; |
|
101 | + } |
|
100 | 102 | $templates = array(); |
101 | 103 | $fields = array(); |
102 | - if(empty($object_name))$object_name = $object; |
|
104 | + if(empty($object_name)) { |
|
105 | + $object_name = $object; |
|
106 | + } |
|
103 | 107 | $_object_name = strtolower($object_name); |
104 | 108 | if(!empty($GLOBALS['dictionary'][$object]['table'])){ |
105 | 109 | $table_name = $GLOBALS['dictionary'][$object]['table']; |
106 | - }else{ |
|
110 | + } else{ |
|
107 | 111 | $table_name = strtolower($module); |
108 | 112 | } |
109 | 113 | |
@@ -112,7 +116,7 @@ discard block |
||
112 | 116 | if(file_exists($path)){ |
113 | 117 | require($path); |
114 | 118 | $templates[$template] = $vardefs; |
115 | - }else{ |
|
119 | + } else{ |
|
116 | 120 | $path = 'include/SugarObjects/implements/' . $template . '/vardefs.php'; |
117 | 121 | if(file_exists($path)){ |
118 | 122 | require($path); |
@@ -122,12 +126,22 @@ discard block |
||
122 | 126 | } |
123 | 127 | |
124 | 128 | if(!empty($templates[$template])){ |
125 | - if(empty($GLOBALS['dictionary'][$object]['fields']))$GLOBALS['dictionary'][$object]['fields'] = array(); |
|
126 | - if(empty($GLOBALS['dictionary'][$object]['relationships']))$GLOBALS['dictionary'][$object]['relationships'] = array(); |
|
127 | - if(empty($GLOBALS['dictionary'][$object]['indices']))$GLOBALS['dictionary'][$object]['indices'] = array(); |
|
129 | + if(empty($GLOBALS['dictionary'][$object]['fields'])) { |
|
130 | + $GLOBALS['dictionary'][$object]['fields'] = array(); |
|
131 | + } |
|
132 | + if(empty($GLOBALS['dictionary'][$object]['relationships'])) { |
|
133 | + $GLOBALS['dictionary'][$object]['relationships'] = array(); |
|
134 | + } |
|
135 | + if(empty($GLOBALS['dictionary'][$object]['indices'])) { |
|
136 | + $GLOBALS['dictionary'][$object]['indices'] = array(); |
|
137 | + } |
|
128 | 138 | $GLOBALS['dictionary'][$object]['fields'] = array_merge($templates[$template]['fields'], $GLOBALS['dictionary'][$object]['fields']); |
129 | - if(!empty($templates[$template]['relationships']))$GLOBALS['dictionary'][$object]['relationships'] = array_merge($templates[$template]['relationships'], $GLOBALS['dictionary'][$object]['relationships']); |
|
130 | - if(!empty($templates[$template]['indices']))$GLOBALS['dictionary'][$object]['indices'] = array_merge($templates[$template]['indices'], $GLOBALS['dictionary'][$object]['indices']); |
|
139 | + if(!empty($templates[$template]['relationships'])) { |
|
140 | + $GLOBALS['dictionary'][$object]['relationships'] = array_merge($templates[$template]['relationships'], $GLOBALS['dictionary'][$object]['relationships']); |
|
141 | + } |
|
142 | + if(!empty($templates[$template]['indices'])) { |
|
143 | + $GLOBALS['dictionary'][$object]['indices'] = array_merge($templates[$template]['indices'], $GLOBALS['dictionary'][$object]['indices']); |
|
144 | + } |
|
131 | 145 | // maintain a record of this objects inheritance from the SugarObject templates... |
132 | 146 | $GLOBALS['dictionary'][$object]['templates'][ $template ] = $template ; |
133 | 147 | } |
@@ -160,8 +174,9 @@ discard block |
||
160 | 174 | */ |
161 | 175 | static function saveCache($module,$object, $additonal_objects= array()){ |
162 | 176 | |
163 | - if (empty($GLOBALS['dictionary'][$object])) |
|
164 | - $object = BeanFactory::getObjectName($module); |
|
177 | + if (empty($GLOBALS['dictionary'][$object])) { |
|
178 | + $object = BeanFactory::getObjectName($module); |
|
179 | + } |
|
165 | 180 | |
166 | 181 | //Sometimes bad definitions can get in from left over extensions or file system lag(caching). We need to clean those. |
167 | 182 | $data = self::cleanVardefs($GLOBALS['dictionary'][$object]); |
@@ -191,7 +206,7 @@ discard block |
||
191 | 206 | //otherwise go through each module and remove the vardefs.php |
192 | 207 | if(!empty($module_dir) && !empty($object_name)){ |
193 | 208 | VardefManager::_clearCache($module_dir, $object_name); |
194 | - }else{ |
|
209 | + } else{ |
|
195 | 210 | global $beanList; |
196 | 211 | foreach($beanList as $module_dir => $object_name){ |
197 | 212 | VardefManager::_clearCache($module_dir, $object_name); |
@@ -310,11 +325,13 @@ discard block |
||
310 | 325 | } |
311 | 326 | |
312 | 327 | //Cache link fields for this call in a static variable |
313 | - if (!isset(self::$linkFields)) |
|
314 | - self::$linkFields = array(); |
|
328 | + if (!isset(self::$linkFields)) { |
|
329 | + self::$linkFields = array(); |
|
330 | + } |
|
315 | 331 | |
316 | - if (isset(self::$linkFields[$object])) |
|
317 | - return self::$linkFields[$object]; |
|
332 | + if (isset(self::$linkFields[$object])) { |
|
333 | + return self::$linkFields[$object]; |
|
334 | + } |
|
318 | 335 | |
319 | 336 | $vardef = $dictionary[$object]; |
320 | 337 | $links = array(); |
@@ -337,8 +354,9 @@ discard block |
||
337 | 354 | { |
338 | 355 | $cacheKey = "LFR{$module}{$object}{$relName}"; |
339 | 356 | $cacheValue = sugar_cache_retrieve($cacheKey); |
340 | - if(!empty($cacheValue)) |
|
341 | - return $cacheValue; |
|
357 | + if(!empty($cacheValue)) { |
|
358 | + return $cacheValue; |
|
359 | + } |
|
342 | 360 | |
343 | 361 | $relLinkFields = self::getLinkFieldsForModule($module, $object); |
344 | 362 | $matches = array(); |
@@ -352,13 +370,15 @@ discard block |
||
352 | 370 | } |
353 | 371 | } |
354 | 372 | } |
355 | - if (empty($matches)) |
|
356 | - return false; |
|
357 | - if (sizeof($matches) == 1) |
|
358 | - $results = $matches[0]; |
|
359 | - else |
|
360 | - //For relationships where both sides are the same module, more than one link will be returned |
|
373 | + if (empty($matches)) { |
|
374 | + return false; |
|
375 | + } |
|
376 | + if (sizeof($matches) == 1) { |
|
377 | + $results = $matches[0]; |
|
378 | + } else { |
|
379 | + //For relationships where both sides are the same module, more than one link will be returned |
|
361 | 380 | $results = $matches; |
381 | + } |
|
362 | 382 | |
363 | 383 | sugar_cache_put($cacheKey, $results); |
364 | 384 | return $results ; |
@@ -1,5 +1,7 @@ discard block |
||
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. |
@@ -135,8 +137,9 @@ discard block |
||
135 | 137 | $result = $suppress?@mysqli_query($this->database,$sql):mysqli_query($this->database,$sql); |
136 | 138 | $md5 = md5($sql); |
137 | 139 | |
138 | - if (empty($queryMD5[$md5])) |
|
139 | - $queryMD5[$md5] = true; |
|
140 | + if (empty($queryMD5[$md5])) { |
|
141 | + $queryMD5[$md5] = true; |
|
142 | + } |
|
140 | 143 | |
141 | 144 | $this->query_time = microtime(true) - $this->query_time; |
142 | 145 | $GLOBALS['log']->info('Query Execution Time:'.$this->query_time); |
@@ -155,8 +158,9 @@ discard block |
||
155 | 158 | */ |
156 | 159 | |
157 | 160 | |
158 | - if($keepResult) |
|
159 | - $this->lastResult = $result; |
|
161 | + if($keepResult) { |
|
162 | + $this->lastResult = $result; |
|
163 | + } |
|
160 | 164 | $this->checkError($msg.' Query Failed: ' . $sql, $dieOnError); |
161 | 165 | |
162 | 166 | return $result; |
@@ -209,8 +213,9 @@ discard block |
||
209 | 213 | */ |
210 | 214 | protected function freeDbResult($dbResult) |
211 | 215 | { |
212 | - if(!empty($dbResult)) |
|
213 | - mysqli_free_result($dbResult); |
|
216 | + if(!empty($dbResult)) { |
|
217 | + mysqli_free_result($dbResult); |
|
218 | + } |
|
214 | 219 | } |
215 | 220 | |
216 | 221 | /** |
@@ -220,17 +225,20 @@ discard block |
||
220 | 225 | { |
221 | 226 | $field_array = array(); |
222 | 227 | |
223 | - if (!isset($result) || empty($result)) |
|
224 | - return 0; |
|
228 | + if (!isset($result) || empty($result)) { |
|
229 | + return 0; |
|
230 | + } |
|
225 | 231 | |
226 | 232 | $i = 0; |
227 | 233 | while ($i < mysqli_num_fields($result)) { |
228 | 234 | $meta = mysqli_fetch_field_direct($result, $i); |
229 | - if (!$meta) |
|
230 | - return 0; |
|
235 | + if (!$meta) { |
|
236 | + return 0; |
|
237 | + } |
|
231 | 238 | |
232 | - if($make_lower_case == true) |
|
233 | - $meta->name = strtolower($meta->name); |
|
239 | + if($make_lower_case == true) { |
|
240 | + $meta->name = strtolower($meta->name); |
|
241 | + } |
|
234 | 242 | |
235 | 243 | $field_array[] = $meta->name; |
236 | 244 | |
@@ -245,10 +253,15 @@ discard block |
||
245 | 253 | */ |
246 | 254 | public function fetchRow($result) |
247 | 255 | { |
248 | - if (empty($result)) return false; |
|
256 | + if (empty($result)) { |
|
257 | + return false; |
|
258 | + } |
|
249 | 259 | |
250 | 260 | $row = mysqli_fetch_assoc($result); |
251 | - if($row == null) $row = false; //Make sure MySQLi driver results are consistent with other database drivers |
|
261 | + if($row == null) { |
|
262 | + $row = false; |
|
263 | + } |
|
264 | + //Make sure MySQLi driver results are consistent with other database drivers |
|
252 | 265 | return $row; |
253 | 266 | } |
254 | 267 | |
@@ -267,8 +280,9 @@ discard block |
||
267 | 280 | { |
268 | 281 | global $sugar_config; |
269 | 282 | |
270 | - if (is_null($configOptions)) |
|
271 | - $configOptions = $sugar_config['dbconfig']; |
|
283 | + if (is_null($configOptions)) { |
|
284 | + $configOptions = $sugar_config['dbconfig']; |
|
285 | + } |
|
272 | 286 | |
273 | 287 | if(!isset($this->database)) { |
274 | 288 | |
@@ -319,8 +333,9 @@ discard block |
||
319 | 333 | } |
320 | 334 | mysqli_set_charset ($this->database , "utf8" ); |
321 | 335 | |
322 | - if($this->checkError('Could Not Connect', $dieOnError)) |
|
323 | - $GLOBALS['log']->info("connected to db"); |
|
336 | + if($this->checkError('Could Not Connect', $dieOnError)) { |
|
337 | + $GLOBALS['log']->info("connected to db"); |
|
338 | + } |
|
324 | 339 | |
325 | 340 | $this->connectOptions = $configOptions; |
326 | 341 | return true; |
@@ -1,5 +1,7 @@ |
||
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. |