@@ -83,8 +83,7 @@ discard block |
||
83 | 83 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
84 | 84 | if(isset($GLOBALS['log'])) { |
85 | 85 | $GLOBALS['log']->deprecated($deprecatedMessage); |
86 | - } |
|
87 | - else { |
|
86 | + } else { |
|
88 | 87 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
89 | 88 | } |
90 | 89 | self::__construct($dir, $masterCopyDirecotry, $debugMode); |
@@ -145,12 +144,10 @@ discard block |
||
145 | 144 | $file_queries_file = $upgrade_progress_dir.'/files_queries.php'; |
146 | 145 | if(file_exists($file_queries_file)){ |
147 | 146 | include($file_queries_file); |
148 | - } |
|
149 | - else{ |
|
147 | + } else{ |
|
150 | 148 | if(function_exists('sugar_fopen')){ |
151 | 149 | sugar_fopen($file_queries_file, 'w+'); |
152 | - } |
|
153 | - else{ |
|
150 | + } else{ |
|
154 | 151 | fopen($file_queries_file, 'w+'); |
155 | 152 | } |
156 | 153 | } |
@@ -176,7 +173,9 @@ discard block |
||
176 | 173 | $modulesAll = getAllModules(); //keep all modules as well |
177 | 174 | $allOtherModules = array_diff($modulesAll,$modules); |
178 | 175 | foreach($modules as $mod) { |
179 | - if(!is_dir('modules/'.$mod)) continue; |
|
176 | + if(!is_dir('modules/'.$mod)) { |
|
177 | + continue; |
|
178 | + } |
|
180 | 179 | $editView = "modules/$mod/EditView.html"; |
181 | 180 | $detailView ="modules/$mod/DetailView.html"; |
182 | 181 | $exclude_files[]=$editView; |
@@ -190,8 +189,7 @@ discard block |
||
190 | 189 | $fileContents = file_get_contents($file); |
191 | 190 | if(md5($fileContents) != $md5_string['./'.$file]) { |
192 | 191 | $return_array[$mod][] = $file; |
193 | - } |
|
194 | - else{ |
|
192 | + } else{ |
|
195 | 193 | //keep in the array to be deleted later |
196 | 194 | $_SESSION['removeMd5MatchingFiles'][] = $file; |
197 | 195 | } |
@@ -202,7 +200,9 @@ discard block |
||
202 | 200 | //also check out other non-studio modules by taking the difference between |
203 | 201 | //allMOdules and |
204 | 202 | foreach($allOtherModules as $mod) { |
205 | - if(!is_dir('modules/'.$mod)) continue; |
|
203 | + if(!is_dir('modules/'.$mod)) { |
|
204 | + continue; |
|
205 | + } |
|
206 | 206 | $allModFiles = array(); |
207 | 207 | $allModFiles = findAllFiles('modules/'.$mod,$allModFiles); |
208 | 208 | foreach($allModFiles as $file){ |
@@ -251,8 +251,7 @@ discard block |
||
251 | 251 | $return_array[$mod]; |
252 | 252 | break; |
253 | 253 | } |
254 | - } |
|
255 | - else{ |
|
254 | + } else{ |
|
256 | 255 | // This is a new file in user's version and indicates that module has been |
257 | 256 | //customized. Put the module in the customized array. |
258 | 257 | echo 'New File'.$file; |
@@ -275,7 +274,9 @@ discard block |
||
275 | 274 | $modules = array(); |
276 | 275 | $d = dir('modules'); |
277 | 276 | while($e = $d->read()){ |
278 | - if(substr($e, 0, 1) == '.' || !is_dir('modules/' . $e))continue; |
|
277 | + if(substr($e, 0, 1) == '.' || !is_dir('modules/' . $e)) { |
|
278 | + continue; |
|
279 | + } |
|
279 | 280 | if(file_exists('modules/' . $e . '/metadata/studio.php')){ |
280 | 281 | $modules[] = $e; |
281 | 282 | } |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('sugarEntry') || !sugarEntry) |
|
3 | +if (!defined('sugarEntry') || !sugarEntry) { |
|
4 | 4 | die('Not A Valid Entry Point'); |
5 | +} |
|
5 | 6 | |
6 | 7 | class OpportunitiesJjwg_MapsLogicHook { |
7 | 8 | |
@@ -17,8 +18,7 @@ discard block |
||
17 | 18 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
18 | 19 | if(isset($GLOBALS['log'])) { |
19 | 20 | $GLOBALS['log']->deprecated($deprecatedMessage); |
20 | - } |
|
21 | - else { |
|
21 | + } else { |
|
22 | 22 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
23 | 23 | } |
24 | 24 | self::__construct(); |
@@ -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. |
@@ -75,8 +77,7 @@ discard block |
||
75 | 77 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
76 | 78 | if(isset($GLOBALS['log'])) { |
77 | 79 | $GLOBALS['log']->deprecated($deprecatedMessage); |
78 | - } |
|
79 | - else { |
|
80 | + } else { |
|
80 | 81 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
81 | 82 | } |
82 | 83 | self::__construct(); |
@@ -99,8 +100,7 @@ discard block |
||
99 | 100 | } |
100 | 101 | $_SESSION[$this->var_order_by] = array('orderBy'=>$orderBy, 'direction'=> $direction); |
101 | 102 | $_SESSION['lvd']['last_ob'] = $orderBy; |
102 | - } |
|
103 | - else { |
|
103 | + } else { |
|
104 | 104 | $userPreferenceOrder = $GLOBALS['current_user']->getPreference('listviewOrder', $this->var_name); |
105 | 105 | if(!empty($_SESSION[$this->var_order_by])) { |
106 | 106 | $orderBy = $_SESSION[$this->var_order_by]['orderBy']; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | function getTotalCount($main_query){ |
199 | 199 | if(!empty($this->count_query)){ |
200 | 200 | $count_query = $this->count_query; |
201 | - }else{ |
|
201 | + } else{ |
|
202 | 202 | $count_query = $this->seed->create_list_count_query($main_query); |
203 | 203 | } |
204 | 204 | $result = $this->db->query($count_query); |
@@ -261,8 +261,7 @@ discard block |
||
261 | 261 | // if $params tell us to override all ordering |
262 | 262 | if(!empty($params['overrideOrder']) && !empty($params['orderBy'])) { |
263 | 263 | $order = $this->getOrderBy(strtolower($params['orderBy']), (empty($params['sortOrder']) ? '' : $params['sortOrder'])); // retreive from $_REQUEST |
264 | - } |
|
265 | - else { |
|
264 | + } else { |
|
266 | 265 | $order = $this->getOrderBy(); // retreive from $_REQUEST |
267 | 266 | } |
268 | 267 | |
@@ -289,8 +288,9 @@ discard block |
||
289 | 288 | } else { |
290 | 289 | $orderBy = $order['orderBy'] . ' ' . $order['sortOrder']; |
291 | 290 | //wdong, Bug 25476, fix the sorting problem of Oracle. |
292 | - if (isset($params['custom_order_by_override']['ori_code']) && $order['orderBy'] == $params['custom_order_by_override']['ori_code']) |
|
293 | - $orderBy = $params['custom_order_by_override']['custom_code'] . ' ' . $order['sortOrder']; |
|
291 | + if (isset($params['custom_order_by_override']['ori_code']) && $order['orderBy'] == $params['custom_order_by_override']['ori_code']) { |
|
292 | + $orderBy = $params['custom_order_by_override']['custom_code'] . ' ' . $order['sortOrder']; |
|
293 | + } |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | if (empty($params['skipOrderSave'])) { // don't save preferences if told so |
@@ -308,11 +308,21 @@ discard block |
||
308 | 308 | $ret_array['inner_join'] = ' ' . implode(' ', $this->seed->listview_inner_join) . ' '; |
309 | 309 | } |
310 | 310 | |
311 | - if(!is_array($params)) $params = array(); |
|
312 | - if(!isset($params['custom_select'])) $params['custom_select'] = ''; |
|
313 | - if(!isset($params['custom_from'])) $params['custom_from'] = ''; |
|
314 | - if(!isset($params['custom_where'])) $params['custom_where'] = ''; |
|
315 | - if(!isset($params['custom_order_by'])) $params['custom_order_by'] = ''; |
|
311 | + if(!is_array($params)) { |
|
312 | + $params = array(); |
|
313 | + } |
|
314 | + if(!isset($params['custom_select'])) { |
|
315 | + $params['custom_select'] = ''; |
|
316 | + } |
|
317 | + if(!isset($params['custom_from'])) { |
|
318 | + $params['custom_from'] = ''; |
|
319 | + } |
|
320 | + if(!isset($params['custom_where'])) { |
|
321 | + $params['custom_where'] = ''; |
|
322 | + } |
|
323 | + if(!isset($params['custom_order_by'])) { |
|
324 | + $params['custom_order_by'] = ''; |
|
325 | + } |
|
316 | 326 | $main_query = $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['inner_join']. $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by']; |
317 | 327 | //C.L. - Fix for 23461 |
318 | 328 | if(empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') { |
@@ -320,13 +330,14 @@ discard block |
||
320 | 330 | } |
321 | 331 | if($limit < -1) { |
322 | 332 | $result = $this->db->query($main_query); |
323 | - } |
|
324 | - else { |
|
333 | + } else { |
|
325 | 334 | if($limit == -1) { |
326 | 335 | $limit = $this->getLimit(); |
327 | 336 | } |
328 | 337 | $dyn_offset = $this->getOffset(); |
329 | - if($dyn_offset > 0 || !is_int($dyn_offset))$offset = $dyn_offset; |
|
338 | + if($dyn_offset > 0 || !is_int($dyn_offset)) { |
|
339 | + $offset = $dyn_offset; |
|
340 | + } |
|
330 | 341 | |
331 | 342 | if(strcmp($offset, 'end') == 0){ |
332 | 343 | $totalCount = $this->getTotalCount($main_query); |
@@ -334,8 +345,7 @@ discard block |
||
334 | 345 | } |
335 | 346 | if($this->seed->ACLAccess('ListView')) { |
336 | 347 | $result = $this->db->limitQuery($main_query, $offset, $limit + 1); |
337 | - } |
|
338 | - else { |
|
348 | + } else { |
|
339 | 349 | $result = array(); |
340 | 350 | } |
341 | 351 | |
@@ -403,7 +413,9 @@ discard block |
||
403 | 413 | if(!isset($post_retrieve[$rows[$rowIndex[0]]['parent_type']])) { |
404 | 414 | $post_retrieve[$rows[$rowIndex[0]]['parent_type']] = array(); |
405 | 415 | } |
406 | - if(!empty($rows[$rowIndex[0]]['parent_id'])) $post_retrieve[$rows[$rowIndex[0]]['parent_type']][] = array('child_id' => $id , 'parent_id'=> $rows[$rowIndex[0]]['parent_id'], 'parent_type' => $rows[$rowIndex[0]]['parent_type'], 'type' => 'parent'); |
|
416 | + if(!empty($rows[$rowIndex[0]]['parent_id'])) { |
|
417 | + $post_retrieve[$rows[$rowIndex[0]]['parent_type']][] = array('child_id' => $id , 'parent_id'=> $rows[$rowIndex[0]]['parent_id'], 'parent_type' => $rows[$rowIndex[0]]['parent_type'], 'type' => 'parent'); |
|
418 | + } |
|
407 | 419 | } |
408 | 420 | if(isset($post_retrieve)) { |
409 | 421 | $parent_fields = $seed->retrieve_parent_fields($post_retrieve); |
@@ -431,7 +443,7 @@ discard block |
||
431 | 443 | } |
432 | 444 | if($idIndex[$row[$id_field]][0] == $dataIndex){ |
433 | 445 | $pageData['tag'][$dataIndex] = $temp->listviewACLHelper(); |
434 | - }else{ |
|
446 | + } else{ |
|
435 | 447 | $pageData['tag'][$dataIndex] = $pageData['tag'][$idIndex[$row[$id_field]][0]]; |
436 | 448 | } |
437 | 449 | $data[$dataIndex] = $temp->get_list_view_data($filter_fields); |
@@ -445,8 +457,7 @@ discard block |
||
445 | 457 | if($additionalDetailsAllow) { |
446 | 458 | if($this->additionalDetailsAjax) { |
447 | 459 | $ar = $this->getAdditionalDetailsAjax($data[$dataIndex]['ID']); |
448 | - } |
|
449 | - else { |
|
460 | + } else { |
|
450 | 461 | $additionalDetailsFile = 'modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php'; |
451 | 462 | if(file_exists('custom/modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php')){ |
452 | 463 | $additionalDetailsFile = 'custom/modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php'; |
@@ -471,7 +482,9 @@ discard block |
||
471 | 482 | |
472 | 483 | if($offset > 0) { |
473 | 484 | $prevOffset = $offset - $limit; |
474 | - if($prevOffset < 0)$prevOffset = 0; |
|
485 | + if($prevOffset < 0) { |
|
486 | + $prevOffset = 0; |
|
487 | + } |
|
475 | 488 | } |
476 | 489 | $totalCount = $count + $offset; |
477 | 490 | |
@@ -505,16 +518,19 @@ discard block |
||
505 | 518 | isset($_REQUEST["module"]) && $_REQUEST["module"] == "MergeRecords") |
506 | 519 | { |
507 | 520 | $queryString = "-advanced_search"; |
508 | - } |
|
509 | - else if (isset($_REQUEST["searchFormTab"]) && $_REQUEST["searchFormTab"] == "basic_search") |
|
521 | + } else if (isset($_REQUEST["searchFormTab"]) && $_REQUEST["searchFormTab"] == "basic_search") |
|
510 | 522 | { |
511 | - if($seed->module_dir == "Reports") $searchMetaData = SearchFormReports::retrieveReportsSearchDefs(); |
|
512 | - else $searchMetaData = SearchForm::retrieveSearchDefs($seed->module_dir); |
|
523 | + if($seed->module_dir == "Reports") { |
|
524 | + $searchMetaData = SearchFormReports::retrieveReportsSearchDefs(); |
|
525 | + } else { |
|
526 | + $searchMetaData = SearchForm::retrieveSearchDefs($seed->module_dir); |
|
527 | + } |
|
513 | 528 | |
514 | 529 | $basicSearchFields = array(); |
515 | 530 | |
516 | - if( isset($searchMetaData['searchdefs']) && isset($searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search']) ) |
|
517 | - $basicSearchFields = $searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search']; |
|
531 | + if( isset($searchMetaData['searchdefs']) && isset($searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search']) ) { |
|
532 | + $basicSearchFields = $searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search']; |
|
533 | + } |
|
518 | 534 | |
519 | 535 | foreach( $basicSearchFields as $basicSearchField) |
520 | 536 | { |
@@ -588,8 +604,7 @@ discard block |
||
588 | 604 | { |
589 | 605 | $queries['endPage'] = $queries['baseURL']; |
590 | 606 | $queries['endPage'][$this->var_offset] = $endOffset; |
591 | - } |
|
592 | - else |
|
607 | + } else |
|
593 | 608 | { |
594 | 609 | $queries['endPage'] = $queries['baseURL']; |
595 | 610 | $queries['endPage'][$this->var_offset] = 'end'; |
@@ -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. |
@@ -64,8 +66,7 @@ discard block |
||
64 | 66 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
65 | 67 | if(isset($GLOBALS['log'])) { |
66 | 68 | $GLOBALS['log']->deprecated($deprecatedMessage); |
67 | - } |
|
68 | - else { |
|
69 | + } else { |
|
69 | 70 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
70 | 71 | } |
71 | 72 | self::__construct(); |
@@ -471,8 +472,9 @@ discard block |
||
471 | 472 | while ($file = readdir($handler)) { |
472 | 473 | // if $file isn't this directory or its parent, |
473 | 474 | // add it to the results array |
474 | - if ($file != '.' && $file != '..') |
|
475 | - $results[] = $file; |
|
475 | + if ($file != '.' && $file != '..') { |
|
476 | + $results[] = $file; |
|
477 | + } |
|
476 | 478 | } |
477 | 479 | |
478 | 480 | // tidy up: close the handler |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
55 | 55 | if(isset($GLOBALS['log'])) { |
56 | 56 | $GLOBALS['log']->deprecated($deprecatedMessage); |
57 | - } |
|
58 | - else { |
|
57 | + } else { |
|
59 | 58 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
60 | 59 | } |
61 | 60 | self::__construct(); |
@@ -106,10 +105,10 @@ discard block |
||
106 | 105 | $file = 'custom/include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php'; |
107 | 106 | $type = $field; |
108 | 107 | //else check the fields directory |
109 | - }else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){ |
|
108 | + } else if(file_exists('include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php')){ |
|
110 | 109 | $file = 'include/SugarFields/Fields/' . $field . '/SugarField' . $field. '.php'; |
111 | 110 | $type = $field; |
112 | - }else{ |
|
111 | + } else{ |
|
113 | 112 | // No direct class, check the directories to see if they are defined |
114 | 113 | if( $returnNullIfBase && |
115 | 114 | !is_dir('custom/include/SugarFields/Fields/'.$field) && |
@@ -126,7 +125,7 @@ discard block |
||
126 | 125 | $customClass = 'Custom' . $class; |
127 | 126 | if(class_exists($customClass)){ |
128 | 127 | $sugarFieldObjects[$field] = new $customClass($field); |
129 | - }else{ |
|
128 | + } else{ |
|
130 | 129 | $sugarFieldObjects[$field] = new $class($field); |
131 | 130 | } |
132 | 131 | } |
@@ -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. |
@@ -91,8 +93,7 @@ discard block |
||
91 | 93 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
92 | 94 | if(isset($GLOBALS['log'])) { |
93 | 95 | $GLOBALS['log']->deprecated($deprecatedMessage); |
94 | - } |
|
95 | - else { |
|
96 | + } else { |
|
96 | 97 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
97 | 98 | } |
98 | 99 | self::__construct($seed, $module); |
@@ -143,8 +144,9 @@ discard block |
||
143 | 144 | foreach($this->displayColumns as $name => $params) { |
144 | 145 | $this->displayColumns[$name]['width'] = round($this->displayColumns[$name]['width'] / $adjustment, 2); |
145 | 146 | // figure out which contextMenu objectsTypes are required |
146 | - if(!empty($params['contextMenu']['objectType'])) |
|
147 | - $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true; |
|
147 | + if(!empty($params['contextMenu']['objectType'])) { |
|
148 | + $contextMenuObjectsTypes[$params['contextMenu']['objectType']] = true; |
|
149 | + } |
|
148 | 150 | } |
149 | 151 | $this->th->ss->assign('displayColumns', $this->displayColumns); |
150 | 152 | |
@@ -162,10 +164,17 @@ discard block |
||
162 | 164 | $this->th->ss->assign('searchForm', $this->searchForm->display(false)); |
163 | 165 | //rrs |
164 | 166 | |
165 | - if($this->export) $this->th->ss->assign('exportLink', $this->buildExportLink()); |
|
167 | + if($this->export) { |
|
168 | + $this->th->ss->assign('exportLink', $this->buildExportLink()); |
|
169 | + } |
|
166 | 170 | $this->th->ss->assign('quickViewLinks', $this->quickViewLinks); |
167 | - if($this->mailMerge) $this->th->ss->assign('mergeLink', $this->buildMergeLink()); // still check for mailmerge access |
|
168 | - if($this->mergeduplicates) $this->th->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink()); |
|
171 | + if($this->mailMerge) { |
|
172 | + $this->th->ss->assign('mergeLink', $this->buildMergeLink()); |
|
173 | + } |
|
174 | + // still check for mailmerge access |
|
175 | + if($this->mergeduplicates) { |
|
176 | + $this->th->ss->assign('mergedupLink', $this->buildMergeDuplicatesLink()); |
|
177 | + } |
|
169 | 178 | |
170 | 179 | |
171 | 180 | if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') { |
@@ -316,7 +325,7 @@ discard block |
||
316 | 325 | |
317 | 326 | if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){ |
318 | 327 | require('custom/modules/'.$this->module.'/metadata/metafiles.php'); |
319 | - }elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){ |
|
328 | + } elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){ |
|
320 | 329 | require('modules/'.$this->module.'/metadata/metafiles.php'); |
321 | 330 | } |
322 | 331 | |
@@ -336,21 +345,24 @@ discard block |
||
336 | 345 | $displayColumns = array(); |
337 | 346 | if(!empty($_REQUEST['displayColumns'])) { |
338 | 347 | foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) { |
339 | - if(!empty($listViewDefs[$this->module][$col])) |
|
340 | - $displayColumns[$col] = $this->listviewdefs[$this->module][$col]; |
|
348 | + if(!empty($listViewDefs[$this->module][$col])) { |
|
349 | + $displayColumns[$col] = $this->listviewdefs[$this->module][$col]; |
|
350 | + } |
|
341 | 351 | } |
342 | - } |
|
343 | - else { |
|
352 | + } else { |
|
344 | 353 | foreach($this->listviewdefs[$this->module] as $col => $para) { |
345 | - if(!empty($para['default']) && $para['default']) |
|
346 | - $displayColumns[$col] = $para; |
|
354 | + if(!empty($para['default']) && $para['default']) { |
|
355 | + $displayColumns[$col] = $para; |
|
356 | + } |
|
347 | 357 | } |
348 | 358 | } |
349 | 359 | $params['massupdate'] = true; |
350 | 360 | if(!empty($_REQUEST['orderBy'])) { |
351 | 361 | $params['orderBy'] = $_REQUEST['orderBy']; |
352 | 362 | $params['overrideOrder'] = true; |
353 | - if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder']; |
|
363 | + if(!empty($_REQUEST['sortOrder'])) { |
|
364 | + $params['sortOrder'] = $_REQUEST['sortOrder']; |
|
365 | + } |
|
354 | 366 | } |
355 | 367 | |
356 | 368 | $lv->displayColumns = $displayColumns; |
@@ -468,7 +480,9 @@ discard block |
||
468 | 480 | |
469 | 481 | // Need to include the default whereStatement |
470 | 482 | if(!empty($this->_popupMeta['whereStatement'])){ |
471 | - if(!empty($where))$where .= ' AND '; |
|
483 | + if(!empty($where)) { |
|
484 | + $where .= ' AND '; |
|
485 | + } |
|
472 | 486 | $where .= $this->_popupMeta['whereStatement']; |
473 | 487 | } |
474 | 488 | |
@@ -487,11 +501,13 @@ discard block |
||
487 | 501 | $this->formData[] = array('field' => $data); |
488 | 502 | $value = ''; |
489 | 503 | $this->customFieldDefs[$data['name']]= $data; |
490 | - if(!empty($_REQUEST[$data['name']])) |
|
491 | - $value = $_REQUEST[$data['name']]; |
|
504 | + if(!empty($_REQUEST[$data['name']])) { |
|
505 | + $value = $_REQUEST[$data['name']]; |
|
506 | + } |
|
492 | 507 | $this->customFieldDefs[$data['name']]['value'] = $value; |
493 | - }else |
|
494 | - $this->formData[] = array('field' => array('name'=>$data)); |
|
508 | + } else { |
|
509 | + $this->formData[] = array('field' => array('name'=>$data)); |
|
510 | + } |
|
495 | 511 | } |
496 | 512 | $this->fieldDefs = array(); |
497 | 513 | if($this->seed){ |
@@ -502,13 +518,15 @@ discard block |
||
502 | 518 | //if we have a relate type then reset to name so that we end up with a textbox |
503 | 519 | //rather than a select button |
504 | 520 | $this->fieldDefs[$name]['name'] = $this->fieldDefs[$name]['name']; |
505 | - if($this->fieldDefs[$name]['type'] == 'relate') |
|
506 | - $this->fieldDefs[$name]['type'] = 'name'; |
|
521 | + if($this->fieldDefs[$name]['type'] == 'relate') { |
|
522 | + $this->fieldDefs[$name]['type'] = 'name'; |
|
523 | + } |
|
507 | 524 | if(isset($this->fieldDefs[$name]['options']) && isset($GLOBALS['app_list_strings'][$this->fieldDefs[$name]['options']])) { |
508 | 525 | $this->fieldDefs[$name]['options'] = $GLOBALS['app_list_strings'][$this->fieldDefs[$name]['options']]; // fill in enums |
509 | 526 | } |
510 | - if(!empty($_REQUEST[$name])) |
|
511 | - $value = $_REQUEST[$name]; |
|
527 | + if(!empty($_REQUEST[$name])) { |
|
528 | + $value = $_REQUEST[$name]; |
|
529 | + } |
|
512 | 530 | $this->fieldDefs[$name]['value'] = $value; |
513 | 531 | } |
514 | 532 | } |
@@ -555,8 +573,9 @@ discard block |
||
555 | 573 | EOQ; |
556 | 574 | // if metadata contains custom inputs for the quickcreate |
557 | 575 | if(!empty($this->_popupMeta['customInput']) && is_array($this->_popupMeta['customInput'])) { |
558 | - foreach($this->_popupMeta['customInput'] as $key => $value) |
|
559 | - $formSave .= '<input type="hidden" name="' . $key . '" value="'. $value .'">\n'; |
|
576 | + foreach($this->_popupMeta['customInput'] as $key => $value) { |
|
577 | + $formSave .= '<input type="hidden" name="' . $key . '" value="'. $value .'">\n'; |
|
578 | + } |
|
560 | 579 | } |
561 | 580 | |
562 | 581 |
@@ -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. |
@@ -85,8 +87,7 @@ discard block |
||
85 | 87 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
86 | 88 | if(isset($GLOBALS['log'])) { |
87 | 89 | $GLOBALS['log']->deprecated($deprecatedMessage); |
88 | - } |
|
89 | - else { |
|
90 | + } else { |
|
90 | 91 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
91 | 92 | } |
92 | 93 | self::__construct(); |
@@ -147,8 +148,9 @@ discard block |
||
147 | 148 | $alternate_found = false; |
148 | 149 | $alternate2_found = false; |
149 | 150 | foreach($this->addresses as $k=>$address) { |
150 | - if ($primary_found && $alternate_found) |
|
151 | - break; |
|
151 | + if ($primary_found && $alternate_found) { |
|
152 | + break; |
|
153 | + } |
|
152 | 154 | if ($address['primary_address'] == 1 && !$primary_found) { |
153 | 155 | $primary_index = $k; |
154 | 156 | $primary_found = true; |
@@ -286,8 +288,9 @@ discard block |
||
286 | 288 | ) |
287 | 289 | { |
288 | 290 | $emailCaps = strtoupper(trim($email)); |
289 | - if(empty($emailCaps)) |
|
290 | - return 0; |
|
291 | + if(empty($emailCaps)) { |
|
292 | + return 0; |
|
293 | + } |
|
291 | 294 | |
292 | 295 | $q = "SELECT * |
293 | 296 | FROM email_addr_bean_rel eabl JOIN email_addresses ea |
@@ -303,7 +306,9 @@ discard block |
||
303 | 306 | |
304 | 307 | // do it this way to make the count accurate in oracle |
305 | 308 | $i = 0; |
306 | - while ($this->db->fetchByAssoc($r)) ++$i; |
|
309 | + while ($this->db->fetchByAssoc($r)) { |
|
310 | + ++$i; |
|
311 | + } |
|
307 | 312 | |
308 | 313 | return $i; |
309 | 314 | } |
@@ -486,8 +491,9 @@ discard block |
||
486 | 491 | foreach($_REQUEST as $k => $v) { |
487 | 492 | if(preg_match('/'.$eId.'emailAddressVerifiedValue[0-9]+$/i', $k) && !empty($v)) { |
488 | 493 | $validateFlag = str_replace("Value", "Flag", $k); |
489 | - if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true") |
|
490 | - $new_addrs[$k] = $v; |
|
494 | + if (isset($_REQUEST[$validateFlag]) && $_REQUEST[$validateFlag] == "true") { |
|
495 | + $new_addrs[$k] = $v; |
|
496 | + } |
|
491 | 497 | } |
492 | 498 | } |
493 | 499 | } |
@@ -690,8 +696,7 @@ discard block |
||
690 | 696 | if ($id) { |
691 | 697 | $r = $this->db->query("SELECT * FROM email_addresses WHERE id='".$this->db->quote($id)."'"); |
692 | 698 | $current_email = $this->db->fetchByAssoc($r); |
693 | - } |
|
694 | - else { |
|
699 | + } else { |
|
695 | 700 | $current_email = null; |
696 | 701 | } |
697 | 702 | |
@@ -731,8 +736,7 @@ discard block |
||
731 | 736 | $upd_r = $this->db->query($upd_q); |
732 | 737 | } |
733 | 738 | return $duplicate_email['id']; |
734 | - } |
|
735 | - else { |
|
739 | + } else { |
|
736 | 740 | // no case-insensitive address match - it's new, or undeleted. |
737 | 741 | $guid = ''; |
738 | 742 | if(!empty($address)){ |
@@ -798,8 +802,7 @@ discard block |
||
798 | 802 | // otherwise |
799 | 803 | $q .= " |
800 | 804 | ORDER BY ear.reply_to_address DESC"; |
801 | - } |
|
802 | - else |
|
805 | + } else |
|
803 | 806 | { |
804 | 807 | // retrieve reply-to address only |
805 | 808 | $q .= " |
@@ -850,8 +853,9 @@ discard block |
||
850 | 853 | */ |
851 | 854 | function getEmailAddressWidgetEditView($id, $module, $asMetadata=false, $tpl='',$tabindex='0') |
852 | 855 | { |
853 | - if ( !($this->smarty instanceOf Sugar_Smarty ) ) |
|
854 | - $this->smarty = new Sugar_Smarty(); |
|
856 | + if ( !($this->smarty instanceOf Sugar_Smarty ) ) { |
|
857 | + $this->smarty = new Sugar_Smarty(); |
|
858 | + } |
|
855 | 859 | |
856 | 860 | global $app_strings, $dictionary, $beanList; |
857 | 861 | |
@@ -869,8 +873,9 @@ discard block |
||
869 | 873 | if(!empty($id)) { |
870 | 874 | $prefillDataArr = $this->getAddressesByGUID($id, $module); |
871 | 875 | //When coming from convert leads, sometimes module is Contacts while the id is for a lead. |
872 | - if (empty($prefillDataArr) && $module == "Contacts") |
|
873 | - $prefillDataArr = $this->getAddressesByGUID($id, "Leads"); |
|
876 | + if (empty($prefillDataArr) && $module == "Contacts") { |
|
877 | + $prefillDataArr = $this->getAddressesByGUID($id, "Leads"); |
|
878 | + } |
|
874 | 879 | } else if(isset($_REQUEST['full_form']) && !empty($_REQUEST['emailAddressWidget'])){ |
875 | 880 | $widget_id = isset($_REQUEST[$module . '_email_widget_id']) ? $_REQUEST[$module . '_email_widget_id'] : '0'; |
876 | 881 | $count = 0; |
@@ -895,8 +900,9 @@ discard block |
||
895 | 900 | |
896 | 901 | $required = false; |
897 | 902 | $vardefs = $dictionary[$beanList[$passedModule]]['fields']; |
898 | - if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required']) |
|
899 | - $required = true; |
|
903 | + if (!empty($vardefs['email1']) && isset($vardefs['email1']['required']) && $vardefs['email1']['required']) { |
|
904 | + $required = true; |
|
905 | + } |
|
900 | 906 | $this->smarty->assign('required', $required); |
901 | 907 | |
902 | 908 | $this->smarty->assign('module', $saveModule); |
@@ -950,13 +956,16 @@ discard block |
||
950 | 956 | */ |
951 | 957 | function getEmailAddressWidgetDetailView($focus, $tpl='') |
952 | 958 | { |
953 | - if ( !($this->smarty instanceOf Sugar_Smarty ) ) |
|
954 | - $this->smarty = new Sugar_Smarty(); |
|
959 | + if ( !($this->smarty instanceOf Sugar_Smarty ) ) { |
|
960 | + $this->smarty = new Sugar_Smarty(); |
|
961 | + } |
|
955 | 962 | |
956 | 963 | global $app_strings; |
957 | 964 | global $current_user; |
958 | 965 | $assign = array(); |
959 | - if(empty($focus->id))return ''; |
|
966 | + if(empty($focus->id)) { |
|
967 | + return ''; |
|
968 | + } |
|
960 | 969 | $prefillData = $this->getAddressesByGUID($focus->id, $focus->module_dir); |
961 | 970 | |
962 | 971 | foreach($prefillData as $addressItem) { |
@@ -985,8 +994,9 @@ discard block |
||
985 | 994 | */ |
986 | 995 | function getEmailAddressWidgetDuplicatesView($focus) |
987 | 996 | { |
988 | - if ( !($this->smarty instanceOf Sugar_Smarty ) ) |
|
989 | - $this->smarty = new Sugar_Smarty(); |
|
997 | + if ( !($this->smarty instanceOf Sugar_Smarty ) ) { |
|
998 | + $this->smarty = new Sugar_Smarty(); |
|
999 | + } |
|
990 | 1000 | |
991 | 1001 | $count = 0; |
992 | 1002 | $emails = array(); |
@@ -1146,7 +1156,9 @@ discard block |
||
1146 | 1156 | |
1147 | 1157 | if($view == 'EditView' || $view == 'QuickCreate' || $view == 'ConvertLead') { |
1148 | 1158 | $module = $focus->module_dir; |
1149 | - if ($view == 'ConvertLead' && $module == "Contacts") $module = "Leads"; |
|
1159 | + if ($view == 'ConvertLead' && $module == "Contacts") { |
|
1160 | + $module = "Leads"; |
|
1161 | + } |
|
1150 | 1162 | |
1151 | 1163 | return $sea->getEmailAddressWidgetEditView($focus->id, $module, false,'',$tabindex); |
1152 | 1164 | } |
@@ -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. |
@@ -85,7 +87,9 @@ discard block |
||
85 | 87 | |
86 | 88 | $this->_instance_properties = $instance_properties ; |
87 | 89 | |
88 | - if(isset($instance_properties['collection_list' ])) $this->base_collection_list = $instance_properties['collection_list' ]; |
|
90 | + if(isset($instance_properties['collection_list' ])) { |
|
91 | + $this->base_collection_list = $instance_properties['collection_list' ]; |
|
92 | + } |
|
89 | 93 | |
90 | 94 | if(!empty($collections) && isset($instance_properties['collection_list' ])){ |
91 | 95 | foreach($instance_properties['collection_list' ] as $cname => $value){ |
@@ -168,8 +172,7 @@ discard block |
||
168 | 172 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
169 | 173 | if(isset($GLOBALS['log'])) { |
170 | 174 | $GLOBALS['log']->deprecated($deprecatedMessage); |
171 | - } |
|
172 | - else { |
|
175 | + } else { |
|
173 | 176 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
174 | 177 | } |
175 | 178 | self::__construct($name, $instance_properties, $parent_bean, $reload, $original_only, $search_query, $collections); |
@@ -291,7 +294,9 @@ discard block |
||
291 | 294 | } |
292 | 295 | } |
293 | 296 | // if it's empty just dump out as there is nothing to process. |
294 | - if(empty($this->sub_subpanels)) return false; |
|
297 | + if(empty($this->sub_subpanels)) { |
|
298 | + return false; |
|
299 | + } |
|
295 | 300 | //Sync displayed list fields across the subpanels |
296 | 301 | $display_fields = $this->getDisplayFieldsFromCollection($this->sub_subpanels); |
297 | 302 | $query_fields = array(); |
@@ -305,10 +310,11 @@ discard block |
||
305 | 310 | if (isset($def['vname']) && isset($def['width'])) |
306 | 311 | { |
307 | 312 | $index++; |
308 | - if(!empty($def['alias'])) |
|
309 | - $listFieldMap[$key][$def['alias']] = $field; |
|
310 | - else |
|
311 | - $listFieldMap[$key][$field] = $field; |
|
313 | + if(!empty($def['alias'])) { |
|
314 | + $listFieldMap[$key][$def['alias']] = $field; |
|
315 | + } else { |
|
316 | + $listFieldMap[$key][$field] = $field; |
|
317 | + } |
|
312 | 318 | if (!isset($display_fields[$def['vname']])) |
313 | 319 | { |
314 | 320 | if(sizeof($display_fields) > $index) |
@@ -346,13 +352,11 @@ discard block |
||
346 | 352 | if (isset($subpanel->panel_definition['list_fields'][$field])) |
347 | 353 | { |
348 | 354 | $list_fields[$field] = $subpanel->panel_definition['list_fields'][$field]; |
349 | - } |
|
350 | - else if ($list_key != $field && isset($subpanel->panel_definition['list_fields'][$list_key])) |
|
355 | + } else if ($list_key != $field && isset($subpanel->panel_definition['list_fields'][$list_key])) |
|
351 | 356 | { |
352 | 357 | $list_fields[$list_key] = $subpanel->panel_definition['list_fields'][$list_key]; |
353 | 358 | |
354 | - } |
|
355 | - else { |
|
359 | + } else { |
|
356 | 360 | $list_fields[$field] = $display_fields[$vname]; |
357 | 361 | } |
358 | 362 | } |
@@ -361,8 +365,7 @@ discard block |
||
361 | 365 | if (isset($subpanel->panel_definition['list_fields'][$field])) |
362 | 366 | { |
363 | 367 | $list_fields[$field] = $subpanel->panel_definition['list_fields'][$field]; |
364 | - } |
|
365 | - else { |
|
368 | + } else { |
|
366 | 369 | $list_fields[$field] = $def; |
367 | 370 | } |
368 | 371 | } |
@@ -638,18 +641,22 @@ discard block |
||
638 | 641 | global $modListHeader ; |
639 | 642 | global $modules_exempt_from_availability_check ; |
640 | 643 | |
641 | - if (isset ( $this->_visible_tabs_array )) |
|
642 | - return $this->_visible_tabs_array ; |
|
644 | + if (isset ( $this->_visible_tabs_array )) { |
|
645 | + return $this->_visible_tabs_array ; |
|
646 | + } |
|
643 | 647 | |
644 | - if (empty($modListHeader)) |
|
645 | - $modListHeader = query_module_access_list($GLOBALS['current_user']); |
|
648 | + if (empty($modListHeader)) { |
|
649 | + $modListHeader = query_module_access_list($GLOBALS['current_user']); |
|
650 | + } |
|
646 | 651 | |
647 | 652 | $this->_visible_tabs_array = array ( ) ; // bug 16820 - make sure this is an array for the later ksort |
648 | 653 | |
649 | - if (isset ( $this->layout_defs [ 'subpanel_setup' ] )) // bug 17434 - belts-and-braces - check that we have some subpanels first |
|
654 | + if (isset ( $this->layout_defs [ 'subpanel_setup' ] )) { |
|
655 | + // bug 17434 - belts-and-braces - check that we have some subpanels first |
|
650 | 656 | { |
651 | 657 | //retrieve list of hidden subpanels |
652 | 658 | $hidden_panels = $this->get_hidden_subpanels(); |
659 | + } |
|
653 | 660 | |
654 | 661 | //activities is a special use case in that if it is hidden, |
655 | 662 | //then the history tab should be hidden too. |
@@ -662,8 +669,9 @@ discard block |
||
662 | 669 | { |
663 | 670 | //exclude if this subpanel is hidden from admin screens |
664 | 671 | $module = $key; |
665 | - if ( isset($values_array['module']) ) |
|
666 | - $module = strtolower($values_array['module']); |
|
672 | + if ( isset($values_array['module']) ) { |
|
673 | + $module = strtolower($values_array['module']); |
|
674 | + } |
|
667 | 675 | if ($hidden_panels && is_array($hidden_panels) && (in_array($module, $hidden_panels) || array_key_exists($module, $hidden_panels)) ){ |
668 | 676 | //this panel is hidden, skip it |
669 | 677 | continue; |
@@ -710,8 +718,9 @@ discard block |
||
710 | 718 | */ |
711 | 719 | function load_subpanel ( $name , $reload = false , $original_only = false, $search_query = '', $collections = array() ) |
712 | 720 | { |
713 | - if (!is_dir('modules/' . $this->layout_defs [ 'subpanel_setup' ][ strtolower ( $name ) ] [ 'module' ])) |
|
714 | - return false; |
|
721 | + if (!is_dir('modules/' . $this->layout_defs [ 'subpanel_setup' ][ strtolower ( $name ) ] [ 'module' ])) { |
|
722 | + return false; |
|
723 | + } |
|
715 | 724 | |
716 | 725 | $subpanel = new aSubPanel ( $name, $this->layout_defs [ 'subpanel_setup' ] [ strtolower ( $name ) ], $this->_focus, $reload, $original_only, $search_query, $collections ) ; |
717 | 726 | |
@@ -734,16 +743,19 @@ discard block |
||
734 | 743 | |
735 | 744 | if (empty ( $this->layout_defs ) || $reload || (! empty ( $layout_def_key ) && ! isset ( $layout_defs [ $layout_def_key ] ))) |
736 | 745 | { |
737 | - if (file_exists ( 'modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php' )) |
|
738 | - require ('modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php') ; |
|
746 | + if (file_exists ( 'modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php' )) { |
|
747 | + require ('modules/' . $this->_focus->module_dir . '/metadata/subpaneldefs.php') ; |
|
748 | + } |
|
739 | 749 | |
740 | - if (! $original_only && file_exists ( 'custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php' )) |
|
741 | - require ('custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php') ; |
|
750 | + if (! $original_only && file_exists ( 'custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php' )) { |
|
751 | + require ('custom/modules/' . $this->_focus->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php') ; |
|
752 | + } |
|
742 | 753 | |
743 | - if (! empty ( $layout_def_key )) |
|
744 | - $this->layout_defs = $layout_defs [ $layout_def_key ] ; |
|
745 | - else |
|
746 | - $this->layout_defs = $layout_defs [ $this->_focus->module_dir ] ; |
|
754 | + if (! empty ( $layout_def_key )) { |
|
755 | + $this->layout_defs = $layout_defs [ $layout_def_key ] ; |
|
756 | + } else { |
|
757 | + $this->layout_defs = $layout_defs [ $this->_focus->module_dir ] ; |
|
758 | + } |
|
747 | 759 | |
748 | 760 | } |
749 | 761 | |
@@ -799,11 +811,15 @@ discard block |
||
799 | 811 | foreach($modules_to_check as $mod_name){ |
800 | 812 | |
801 | 813 | //skip if module name is not in bean list, otherwise get the bean class name |
802 | - if(!isset($beanList[$mod_name])) continue; |
|
814 | + if(!isset($beanList[$mod_name])) { |
|
815 | + continue; |
|
816 | + } |
|
803 | 817 | $class = $beanList[$mod_name]; |
804 | 818 | |
805 | 819 | //skip if class name is not in file list, otherwise require the bean file and create new class |
806 | - if(!isset($beanFiles[$class]) || !file_exists($beanFiles[$class])) continue; |
|
820 | + if(!isset($beanFiles[$class]) || !file_exists($beanFiles[$class])) { |
|
821 | + continue; |
|
822 | + } |
|
807 | 823 | |
808 | 824 | //retrieve subpanels for this bean |
809 | 825 | require_once($beanFiles[$class]); |
@@ -817,15 +833,20 @@ discard block |
||
817 | 833 | foreach( $sub_tabs as $panel_key){ |
818 | 834 | $panel_key = strtolower($panel_key); |
819 | 835 | $panel_module = $panel_key; |
820 | - if ( isset($spd->layout_defs['subpanel_setup'][$panel_key]['module']) ) |
|
821 | - $panel_module = strtolower($spd->layout_defs['subpanel_setup'][$panel_key]['module']); |
|
836 | + if ( isset($spd->layout_defs['subpanel_setup'][$panel_key]['module']) ) { |
|
837 | + $panel_module = strtolower($spd->layout_defs['subpanel_setup'][$panel_key]['module']); |
|
838 | + } |
|
822 | 839 | //if module_only flag is set, only if it is also in module array |
823 | - if($return_tab_modules_only && !array_key_exists($panel_module, $modules_to_check)) continue; |
|
840 | + if($return_tab_modules_only && !array_key_exists($panel_module, $modules_to_check)) { |
|
841 | + continue; |
|
842 | + } |
|
824 | 843 | $panel_key_name = $panel_module; |
825 | 844 | |
826 | 845 | //group_by_key_name is set to true, then array will hold an entry for each |
827 | 846 | //subpanel, with the module name prepended in the key |
828 | - if($group_by_module) $panel_key_name = $class.'_'.$panel_key_name; |
|
847 | + if($group_by_module) { |
|
848 | + $panel_key_name = $class.'_'.$panel_key_name; |
|
849 | + } |
|
829 | 850 | //add panel name to subpanel array |
830 | 851 | $spd_arr[$panel_key_name] = $panel_module; |
831 | 852 | } |
@@ -878,12 +899,11 @@ discard block |
||
878 | 899 | } |
879 | 900 | |
880 | 901 | |
881 | - }else{ |
|
902 | + } else{ |
|
882 | 903 | //no settings found, return empty |
883 | 904 | return $hidden_subpanels; |
884 | 905 | } |
885 | - } |
|
886 | - else |
|
906 | + } else |
|
887 | 907 | { //no settings found, return empty |
888 | 908 | return $hidden_subpanels; |
889 | 909 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
24 | 24 | if(isset($GLOBALS['log'])) { |
25 | 25 | $GLOBALS['log']->deprecated($deprecatedMessage); |
26 | - } |
|
27 | - else { |
|
26 | + } else { |
|
28 | 27 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
29 | 28 | } |
30 | 29 | self::__construct($seed, $module, $subPanel, $options); |