@@ -171,11 +171,13 @@ discard block |
||
| 171 | 171 | * |
| 172 | 172 | */ |
| 173 | 173 | public function setup($module = ''){ |
| 174 | - if(empty($module) && !empty($_REQUEST['module'])) |
|
| 175 | - $module = $_REQUEST['module']; |
|
| 174 | + if(empty($module) && !empty($_REQUEST['module'])) { |
|
| 175 | + $module = $_REQUEST['module']; |
|
| 176 | + } |
|
| 176 | 177 | //set the module |
| 177 | - if(!empty($module)) |
|
| 178 | - $this->setModule($module); |
|
| 178 | + if(!empty($module)) { |
|
| 179 | + $this->setModule($module); |
|
| 180 | + } |
|
| 179 | 181 | |
| 180 | 182 | if(!empty($_REQUEST['target_module']) && $_REQUEST['target_module'] != 'undefined') { |
| 181 | 183 | $this->target_module = $_REQUEST['target_module']; |
@@ -199,18 +201,24 @@ discard block |
||
| 199 | 201 | * |
| 200 | 202 | */ |
| 201 | 203 | private function loadPropertiesFromRequest(){ |
| 202 | - if(!empty($_REQUEST['action'])) |
|
| 203 | - $this->action = $_REQUEST['action']; |
|
| 204 | - if(!empty($_REQUEST['record'])) |
|
| 205 | - $this->record = $_REQUEST['record']; |
|
| 206 | - if(!empty($_REQUEST['view'])) |
|
| 207 | - $this->view = $_REQUEST['view']; |
|
| 208 | - if(!empty($_REQUEST['return_module'])) |
|
| 209 | - $this->return_module = $_REQUEST['return_module']; |
|
| 210 | - if(!empty($_REQUEST['return_action'])) |
|
| 211 | - $this->return_action = $_REQUEST['return_action']; |
|
| 212 | - if(!empty($_REQUEST['return_id'])) |
|
| 213 | - $this->return_id = $_REQUEST['return_id']; |
|
| 204 | + if(!empty($_REQUEST['action'])) { |
|
| 205 | + $this->action = $_REQUEST['action']; |
|
| 206 | + } |
|
| 207 | + if(!empty($_REQUEST['record'])) { |
|
| 208 | + $this->record = $_REQUEST['record']; |
|
| 209 | + } |
|
| 210 | + if(!empty($_REQUEST['view'])) { |
|
| 211 | + $this->view = $_REQUEST['view']; |
|
| 212 | + } |
|
| 213 | + if(!empty($_REQUEST['return_module'])) { |
|
| 214 | + $this->return_module = $_REQUEST['return_module']; |
|
| 215 | + } |
|
| 216 | + if(!empty($_REQUEST['return_action'])) { |
|
| 217 | + $this->return_action = $_REQUEST['return_action']; |
|
| 218 | + } |
|
| 219 | + if(!empty($_REQUEST['return_id'])) { |
|
| 220 | + $this->return_id = $_REQUEST['return_id']; |
|
| 221 | + } |
|
| 214 | 222 | } |
| 215 | 223 | |
| 216 | 224 | /** |
@@ -235,8 +243,9 @@ discard block |
||
| 235 | 243 | $this->bean = new $class(); |
| 236 | 244 | if(!empty($this->record)){ |
| 237 | 245 | $this->bean->retrieve($this->record); |
| 238 | - if($this->bean) |
|
| 239 | - $GLOBALS['FOCUS'] = $this->bean; |
|
| 246 | + if($this->bean) { |
|
| 247 | + $GLOBALS['FOCUS'] = $this->bean; |
|
| 248 | + } |
|
| 240 | 249 | } |
| 241 | 250 | } |
| 242 | 251 | } |
@@ -250,7 +259,7 @@ discard block |
||
| 250 | 259 | if(!$$var){ |
| 251 | 260 | if($merge && !empty($this->$var)){ |
| 252 | 261 | $$var = $this->$var; |
| 253 | - }else{ |
|
| 262 | + } else{ |
|
| 254 | 263 | $$var = array(); |
| 255 | 264 | } |
| 256 | 265 | if(file_exists('include/MVC/Controller/'. $var . '.php')){ |
@@ -293,13 +302,11 @@ discard block |
||
| 293 | 302 | if(!empty($this->view)) |
| 294 | 303 | { |
| 295 | 304 | $this->processView(); |
| 296 | - } |
|
| 297 | - elseif(!empty($this->redirect_url)) |
|
| 305 | + } elseif(!empty($this->redirect_url)) |
|
| 298 | 306 | { |
| 299 | 307 | $this->redirect(); |
| 300 | 308 | } |
| 301 | - } |
|
| 302 | - catch (Exception $e) |
|
| 309 | + } catch (Exception $e) |
|
| 303 | 310 | { |
| 304 | 311 | $this->handleException($e); |
| 305 | 312 | } |
@@ -321,8 +328,7 @@ discard block |
||
| 321 | 328 | { |
| 322 | 329 | $logicHook->setBean($this->bean); |
| 323 | 330 | $logicHook->call_custom_logic($this->bean->module_dir, "handle_exception", $e); |
| 324 | - } |
|
| 325 | - else |
|
| 331 | + } else |
|
| 326 | 332 | { |
| 327 | 333 | $logicHook->call_custom_logic('', "handle_exception", $e); |
| 328 | 334 | } |
@@ -384,7 +390,7 @@ discard block |
||
| 384 | 390 | } |
| 385 | 391 | |
| 386 | 392 | $this->redirect(); |
| 387 | - }else{ |
|
| 393 | + } else{ |
|
| 388 | 394 | $this->no_access(); |
| 389 | 395 | } |
| 390 | 396 | } |
@@ -491,8 +497,9 @@ discard block |
||
| 491 | 497 | */ |
| 492 | 498 | protected function redirect(){ |
| 493 | 499 | |
| 494 | - if(!empty($this->redirect_url)) |
|
| 495 | - SugarApplication::redirect($this->redirect_url); |
|
| 500 | + if(!empty($this->redirect_url)) { |
|
| 501 | + SugarApplication::redirect($this->redirect_url); |
|
| 502 | + } |
|
| 496 | 503 | } |
| 497 | 504 | |
| 498 | 505 | //////////////////////////////////////////////////////// |
@@ -586,7 +593,7 @@ discard block |
||
| 586 | 593 | sugar_cleanup(true); |
| 587 | 594 | } |
| 588 | 595 | $this->bean->mark_deleted($_REQUEST['record']); |
| 589 | - }else{ |
|
| 596 | + } else{ |
|
| 590 | 597 | sugar_die("A record number must be specified to delete"); |
| 591 | 598 | } |
| 592 | 599 | } |
@@ -652,7 +659,7 @@ discard block |
||
| 652 | 659 | unset($_REQUEST[$seed->module_dir.'2_'.strtoupper($seed->object_name).'_offset']);//after massupdate, the page should redirect to no offset page |
| 653 | 660 | $storeQuery->saveFromRequest($_REQUEST['module']); |
| 654 | 661 | $_REQUEST = array('return_module' => $temp_req['return_module'], 'return_action' => $temp_req['return_action']);//for post_massupdate, to go back to original page. |
| 655 | - }else{ |
|
| 662 | + } else{ |
|
| 656 | 663 | sugar_die("You must massupdate at least one record"); |
| 657 | 664 | } |
| 658 | 665 | } |
@@ -711,8 +718,7 @@ discard block |
||
| 711 | 718 | |
| 712 | 719 | if(method_exists($dashlet, $requestedMethod) || method_exists($dashlet, '__call')) { |
| 713 | 720 | echo $dashlet->$requestedMethod(); |
| 714 | - } |
|
| 715 | - else { |
|
| 721 | + } else { |
|
| 716 | 722 | echo 'no method'; |
| 717 | 723 | } |
| 718 | 724 | } |
@@ -734,15 +740,13 @@ discard block |
||
| 734 | 740 | if(!empty($_REQUEST['configure']) && $_REQUEST['configure']) { // save settings |
| 735 | 741 | $dashletDefs[$id]['options'] = $dashlet->saveOptions($_REQUEST); |
| 736 | 742 | $current_user->setPreference('dashlets', $dashletDefs, 0, $_REQUEST['module']); |
| 737 | - } |
|
| 738 | - else { // display options |
|
| 743 | + } else { // display options |
|
| 739 | 744 | $json = getJSONobj(); |
| 740 | 745 | return 'result = ' . $json->encode((array('header' => $dashlet->title . ' : ' . $mod_strings['LBL_OPTIONS'], |
| 741 | 746 | 'body' => $dashlet->displayOptions()))); |
| 742 | 747 | |
| 743 | 748 | } |
| 744 | - } |
|
| 745 | - else { |
|
| 749 | + } else { |
|
| 746 | 750 | return '0'; |
| 747 | 751 | } |
| 748 | 752 | } |
@@ -824,13 +828,14 @@ discard block |
||
| 824 | 828 | $this->_processed = true; |
| 825 | 829 | $this->no_access(); |
| 826 | 830 | } |
| 827 | - }else{ |
|
| 831 | + } else{ |
|
| 828 | 832 | $this->_processed = true; |
| 829 | 833 | $this->no_access(); |
| 830 | 834 | } |
| 831 | 835 | } |
| 832 | - }else |
|
| 833 | - $this->_processed = false; |
|
| 836 | + } else { |
|
| 837 | + $this->_processed = false; |
|
| 838 | + } |
|
| 834 | 839 | } |
| 835 | 840 | |
| 836 | 841 | /** |
@@ -865,8 +870,9 @@ discard block |
||
| 865 | 870 | $this->loadMapping('entry_point_registry'); |
| 866 | 871 | |
| 867 | 872 | if ( isset($this->entry_point_registry[$entryPoint]['auth']) |
| 868 | - && !$this->entry_point_registry[$entryPoint]['auth'] ) |
|
| 869 | - return false; |
|
| 873 | + && !$this->entry_point_registry[$entryPoint]['auth'] ) { |
|
| 874 | + return false; |
|
| 875 | + } |
|
| 870 | 876 | return true; |
| 871 | 877 | } |
| 872 | 878 | |
@@ -879,8 +885,7 @@ discard block |
||
| 879 | 885 | $file = self::getActionFilename($this->do_action); |
| 880 | 886 | if ( isset($this->action_view_map[strtolower($this->do_action)]) ) { |
| 881 | 887 | $action = $this->action_view_map[strtolower($this->do_action)]; |
| 882 | - } |
|
| 883 | - else { |
|
| 888 | + } else { |
|
| 884 | 889 | $action = $this->do_action; |
| 885 | 890 | } |
| 886 | 891 | // index actions actually maps to the view.list.php view |
@@ -913,12 +918,13 @@ discard block |
||
| 913 | 918 | $GLOBALS['log']->debug('Using Action File Map:' . $this->action_file_map[strtolower($this->do_action)]); |
| 914 | 919 | require_once($this->action_file_map[strtolower($this->do_action)]); |
| 915 | 920 | $this->_processed = true; |
| 916 | - }elseif(!empty($this->action_view_map[strtolower($this->do_action)])){ |
|
| 921 | + } elseif(!empty($this->action_view_map[strtolower($this->do_action)])){ |
|
| 917 | 922 | $GLOBALS['log']->debug('Using Action View Map:' . $this->action_view_map[strtolower($this->do_action)]); |
| 918 | 923 | $this->view = $this->action_view_map[strtolower($this->do_action)]; |
| 919 | 924 | $this->_processed = true; |
| 920 | - }else |
|
| 921 | - $this->no_action(); |
|
| 925 | + } else { |
|
| 926 | + $this->no_action(); |
|
| 927 | + } |
|
| 922 | 928 | } |
| 923 | 929 | |
| 924 | 930 | /** |
@@ -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. |
@@ -38,7 +40,9 @@ discard block |
||
| 38 | 40 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
| 39 | 41 | ********************************************************************************/ |
| 40 | 42 | |
| 41 | -if (empty($_REQUEST)) die(); |
|
| 43 | +if (empty($_REQUEST)) { |
|
| 44 | + die(); |
|
| 45 | +} |
|
| 42 | 46 | |
| 43 | 47 | $yui_path = array( |
| 44 | 48 | "2.9.0" => "include/javascript/yui", |
@@ -58,20 +62,24 @@ discard block |
||
| 58 | 62 | foreach ($_REQUEST as $param => $val) |
| 59 | 63 | { |
| 60 | 64 | //No backtracking in the path |
| 61 | - if (strpos($param, "..") !== false) |
|
| 62 | - continue; |
|
| 65 | + if (strpos($param, "..") !== false) { |
|
| 66 | + continue; |
|
| 67 | + } |
|
| 63 | 68 | |
| 64 | 69 | $version = explode("/", $param); |
| 65 | 70 | $version = $version[0]; |
| 66 | - if (empty($yui_path[$version])) continue; |
|
| 71 | + if (empty($yui_path[$version])) { |
|
| 72 | + continue; |
|
| 73 | + } |
|
| 67 | 74 | |
| 68 | 75 | $path = $yui_path[$version] . substr($param, strlen($version)); |
| 69 | 76 | |
| 70 | 77 | $extension = substr($path, strrpos($path, "_") + 1); |
| 71 | 78 | |
| 72 | 79 | //Only allowed file extensions |
| 73 | - if (empty($types[$extension])) |
|
| 74 | - continue; |
|
| 80 | + if (empty($types[$extension])) { |
|
| 81 | + continue; |
|
| 82 | + } |
|
| 75 | 83 | |
| 76 | 84 | if (empty($contentType)) |
| 77 | 85 | { |
@@ -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. |
@@ -121,10 +123,12 @@ discard block |
||
| 121 | 123 | // load language files |
| 122 | 124 | $this->loadLanguage($classname, 'modules/Charts/Dashlets/'); |
| 123 | 125 | |
| 124 | - if ( empty($options['title']) ) |
|
| 125 | - $this->title = $this->dashletStrings['LBL_TITLE']; |
|
| 126 | - if ( isset($options['autoRefresh']) ) |
|
| 127 | - $this->autoRefresh = $options['autoRefresh']; |
|
| 126 | + if ( empty($options['title']) ) { |
|
| 127 | + $this->title = $this->dashletStrings['LBL_TITLE']; |
|
| 128 | + } |
|
| 129 | + if ( isset($options['autoRefresh']) ) { |
|
| 130 | + $this->autoRefresh = $options['autoRefresh']; |
|
| 131 | + } |
|
| 128 | 132 | |
| 129 | 133 | $this->layoutManager = new LayoutManager(); |
| 130 | 134 | $this->layoutManager->setAttribute('context', 'Report'); |
@@ -140,8 +144,8 @@ discard block |
||
| 140 | 144 | public function setRefreshIcon() |
| 141 | 145 | { |
| 142 | 146 | $additionalTitle = ''; |
| 143 | - if($this->isRefreshable) |
|
| 144 | - |
|
| 147 | + if($this->isRefreshable) { |
|
| 148 | + |
|
| 145 | 149 | $additionalTitle .= '<a href="#" onclick="SUGAR.mySugar.retrieveDashlet(\'' |
| 146 | 150 | . $this->id |
| 147 | 151 | . '\',\'predefined_chart\'); return false;"><!--not_in_theme!-->' |
@@ -154,6 +158,7 @@ discard block |
||
| 154 | 158 | translate('LBL_DASHLET_REFRESH', 'Home') |
| 155 | 159 | ) |
| 156 | 160 | . '</a>'; |
| 161 | + } |
|
| 157 | 162 | return $additionalTitle; |
| 158 | 163 | } |
| 159 | 164 | |
@@ -200,25 +205,32 @@ discard block |
||
| 200 | 205 | |
| 201 | 206 | $options = array(); |
| 202 | 207 | |
| 203 | - foreach($req as $name => $value) |
|
| 204 | - if(!is_array($value)) $req[$name] = trim($value); |
|
| 208 | + foreach($req as $name => $value) { |
|
| 209 | + if(!is_array($value)) $req[$name] = trim($value); |
|
| 210 | + } |
|
| 205 | 211 | |
| 206 | 212 | foreach($this->_searchFields as $name => $params) { |
| 207 | 213 | $widgetDef = $params; |
| 208 | - if ( isset($this->getSeedBean()->field_defs[$name]) ) |
|
| 209 | - $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 210 | - if ( $widgetDef['type'] == 'date') // special case date types |
|
| 214 | + if ( isset($this->getSeedBean()->field_defs[$name]) ) { |
|
| 215 | + $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 216 | + } |
|
| 217 | + if ( $widgetDef['type'] == 'date') { |
|
| 218 | + // special case date types |
|
| 211 | 219 | $options[$widgetDef['name']] = $timedate->swap_formats($req['type_'.$widgetDef['name']], $timedate->get_date_format(), $timedate->dbDayFormat); |
| 212 | - elseif ( $widgetDef['type'] == 'time') // special case time types |
|
| 220 | + } elseif ( $widgetDef['type'] == 'time') { |
|
| 221 | + // special case time types |
|
| 213 | 222 | $options[$widgetDef['name']] = $timedate->swap_formats($req['type_'.$widgetDef['name']], $timedate->get_time_format(), $timedate->dbTimeFormat); |
| 214 | - elseif ( $widgetDef['type'] == 'datepicker') // special case datepicker types |
|
| 223 | + } elseif ( $widgetDef['type'] == 'datepicker') { |
|
| 224 | + // special case datepicker types |
|
| 215 | 225 | $options[$widgetDef['name']] = $timedate->swap_formats($req[$widgetDef['name']], $timedate->get_date_format(), $timedate->dbDayFormat); |
| 216 | - elseif (!empty($req[$widgetDef['name']])) |
|
| 217 | - $options[$widgetDef['name']] = $req[$widgetDef['name']]; |
|
| 226 | + } elseif (!empty($req[$widgetDef['name']])) { |
|
| 227 | + $options[$widgetDef['name']] = $req[$widgetDef['name']]; |
|
| 228 | + } |
|
| 218 | 229 | } |
| 219 | 230 | |
| 220 | - if (!empty($req['dashletTitle'])) |
|
| 221 | - $options['title'] = $req['dashletTitle']; |
|
| 231 | + if (!empty($req['dashletTitle'])) { |
|
| 232 | + $options['title'] = $req['dashletTitle']; |
|
| 233 | + } |
|
| 222 | 234 | |
| 223 | 235 | $options['autoRefresh'] = empty($req['autoRefresh']) ? '0' : $req['autoRefresh']; |
| 224 | 236 | |
@@ -241,19 +253,24 @@ discard block |
||
| 241 | 253 | $currentSearchFields[$name] = array(); |
| 242 | 254 | |
| 243 | 255 | $widgetDef = $params; |
| 244 | - if ( isset($this->getSeedBean()->field_defs[$name]) ) |
|
| 245 | - $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 256 | + if ( isset($this->getSeedBean()->field_defs[$name]) ) { |
|
| 257 | + $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 258 | + } |
|
| 246 | 259 | |
| 247 | - if($widgetDef['type'] == 'enum' || $widgetDef['type'] == 'singleenum') $widgetDef['remove_blank'] = true; // remove the blank option for the dropdown |
|
| 260 | + if($widgetDef['type'] == 'enum' || $widgetDef['type'] == 'singleenum') { |
|
| 261 | + $widgetDef['remove_blank'] = true; |
|
| 262 | + } |
|
| 263 | + // remove the blank option for the dropdown |
|
| 248 | 264 | |
| 249 | - if ( empty($widgetDef['input_name0']) ) |
|
| 250 | - $widgetDef['input_name0'] = empty($this->$name) ? '' : $this->$name; |
|
| 265 | + if ( empty($widgetDef['input_name0']) ) { |
|
| 266 | + $widgetDef['input_name0'] = empty($this->$name) ? '' : $this->$name; |
|
| 267 | + } |
|
| 251 | 268 | $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], $this->getSeedBean()->module_dir); |
| 252 | - if ( $currentSearchFields[$name]['label'] == $widgetDef['vname'] ) |
|
| 253 | - $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], 'Charts'); |
|
| 269 | + if ( $currentSearchFields[$name]['label'] == $widgetDef['vname'] ) { |
|
| 270 | + $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], 'Charts'); |
|
| 271 | + } |
|
| 254 | 272 | $currentSearchFields[$name]['input'] = $this->layoutManager->widgetDisplayInput($widgetDef, true, (empty($this->$name) ? '' : $this->$name)); |
| 255 | - } |
|
| 256 | - else { // ability to create spacers in input fields |
|
| 273 | + } else { // ability to create spacers in input fields |
|
| 257 | 274 | $currentSearchFields['blank' + $count]['label'] = ''; |
| 258 | 275 | $currentSearchFields['blank' + $count]['input'] = ''; |
| 259 | 276 | $count++; |
@@ -289,8 +306,9 @@ discard block |
||
| 289 | 306 | */ |
| 290 | 307 | protected function getSeedBean() |
| 291 | 308 | { |
| 292 | - if ( !($this->_seedBean instanceof SugarBean) ) |
|
| 293 | - $this->_seedBean = SugarModule::get($this->_seedName)->loadBean(); |
|
| 309 | + if ( !($this->_seedBean instanceof SugarBean) ) { |
|
| 310 | + $this->_seedBean = SugarModule::get($this->_seedName)->loadBean(); |
|
| 311 | + } |
|
| 294 | 312 | |
| 295 | 313 | return $this->_seedBean; |
| 296 | 314 | } |
@@ -412,9 +430,14 @@ discard block |
||
| 412 | 430 | } |
| 413 | 431 | |
| 414 | 432 | //if(isset($sortby1[0]) && $sortby1[0]=='') unset($sortby1[0]);//the beginning of lead_source_dom is blank. |
| 415 | - if(isset($sortby1[0]) && $sortby1[0]==array()) unset($sortby1[0]);//the beginning of month after search is blank. |
|
| 433 | + if(isset($sortby1[0]) && $sortby1[0]==array()) { |
|
| 434 | + unset($sortby1[0]); |
|
| 435 | + } |
|
| 436 | + //the beginning of month after search is blank. |
|
| 416 | 437 | |
| 417 | - if($ifsort2==false) $sortby2=array(0); |
|
| 438 | + if($ifsort2==false) { |
|
| 439 | + $sortby2=array(0); |
|
| 440 | + } |
|
| 418 | 441 | |
| 419 | 442 | if($keycolname2!=null) { |
| 420 | 443 | $sortby2 = array(); |
@@ -438,7 +461,9 @@ discard block |
||
| 438 | 461 | |
| 439 | 462 | foreach($sortby1 as $sort1) { |
| 440 | 463 | foreach($sortby2 as $sort2) { |
| 441 | - if($ifsort2) $a=0; |
|
| 464 | + if($ifsort2) { |
|
| 465 | + $a=0; |
|
| 466 | + } |
|
| 442 | 467 | foreach($data_set as $key => $value){ |
| 443 | 468 | if($value[$keycolname1] == $sort1 && (!$ifsort2 || $value[$keycolname2]== $sort2)) { |
| 444 | 469 | if($translate1) { |
@@ -461,15 +486,13 @@ discard block |
||
| 461 | 486 | if($translate1) { |
| 462 | 487 | $val[$keycolname1] = $app_list_strings[$keycolname1.'_dom'][$sort1]; |
| 463 | 488 | $val[$keycolname1.'_dom_option'] = $sort1; |
| 464 | - } |
|
| 465 | - else { |
|
| 489 | + } else { |
|
| 466 | 490 | $val[$keycolname1] = $sort1; |
| 467 | 491 | } |
| 468 | 492 | if($translate2) { |
| 469 | 493 | $val[$keycolname2] = $app_list_strings[$keycolname2.'_dom'][$sort2]; |
| 470 | 494 | $val[$keycolname2.'_dom_option'] = $sort2; |
| 471 | - } |
|
| 472 | - elseif($keycolname2!=null) { |
|
| 495 | + } elseif($keycolname2!=null) { |
|
| 473 | 496 | $val[$keycolname2] = $sort2; |
| 474 | 497 | } |
| 475 | 498 | array_push($data, $val); |
@@ -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. |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | if(is_file(preg_replace('/(.*\/.*)(\.php)/Uis', '$1.meta$2', $file))) { // is there an associated meta data file? |
| 74 | 76 | $dashletFiles[$class]['meta'] = preg_replace('/(.*\/.*)(\.php)/Uis', '$1.meta$2', $file); |
| 75 | 77 | require($dashletFiles[$class]['meta']); |
| 76 | - if ( isset($dashletMeta[$class]['module']) ) |
|
| 77 | - $dashletFiles[$class]['module'] = $dashletMeta[$class]['module']; |
|
| 78 | + if ( isset($dashletMeta[$class]['module']) ) { |
|
| 79 | + $dashletFiles[$class]['module'] = $dashletMeta[$class]['module']; |
|
| 80 | + } |
|
| 78 | 81 | } |
| 79 | 82 | |
| 80 | 83 | $filesInDirectory = array(); |
@@ -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. |
@@ -121,9 +123,9 @@ discard block |
||
| 121 | 123 | $this->Username = $oe->mail_smtpuser; |
| 122 | 124 | $this->Password = $oe->mail_smtppass; |
| 123 | 125 | } |
| 126 | + } else { |
|
| 127 | + $this->Mailer = "sendmail"; |
|
| 124 | 128 | } |
| 125 | - else |
|
| 126 | - $this->Mailer = "sendmail"; |
|
| 127 | 129 | } |
| 128 | 130 | |
| 129 | 131 | /** |
@@ -154,9 +156,9 @@ discard block |
||
| 154 | 156 | $this->Username = $oe->mail_smtpuser; |
| 155 | 157 | $this->Password = $oe->mail_smtppass; |
| 156 | 158 | } |
| 159 | + } else { |
|
| 160 | + $this->Mailer = "sendmail"; |
|
| 157 | 161 | } |
| 158 | - else |
|
| 159 | - $this->Mailer = "sendmail"; |
|
| 160 | 162 | } |
| 161 | 163 | |
| 162 | 164 | /** |
@@ -300,7 +302,9 @@ discard block |
||
| 300 | 302 | $filename = urldecode($match); |
| 301 | 303 | $cid = $filename; |
| 302 | 304 | $file_location = $local_prefix.$filename; |
| 303 | - if(!file_exists($file_location)) continue; |
|
| 305 | + if(!file_exists($file_location)) { |
|
| 306 | + continue; |
|
| 307 | + } |
|
| 304 | 308 | if($object) { |
| 305 | 309 | if(preg_match('#&(?:amp;)?type=([\w]+)#i', $matches[0][$i], $typematch)) { |
| 306 | 310 | switch(strtolower($typematch[1])) { |
@@ -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. |
@@ -94,8 +96,7 @@ discard block |
||
| 94 | 96 | $old_dashlets = array(); |
| 95 | 97 | $current_user->setPreference('columns', $old_columns, 0, 'home'); |
| 96 | 98 | $current_user->setPreference('dashlets', $old_dashlets, 0, 'home'); |
| 97 | - } |
|
| 98 | - else{ |
|
| 99 | + } else{ |
|
| 99 | 100 | // This is here to get Sugar dashlets added above the rest |
| 100 | 101 | $dashlets[create_guid()] = array('className' => 'iFrameDashlet', |
| 101 | 102 | 'module' => 'Home', |
@@ -150,8 +151,11 @@ discard block |
||
| 150 | 151 | $columns[1]['dashlets'] = array(); |
| 151 | 152 | |
| 152 | 153 | foreach($dashlets as $guid=>$dashlet) { |
| 153 | - if( $dashlet['forceColumn'] == 0 ) array_push($columns[0]['dashlets'], $guid); |
|
| 154 | - else array_push($columns[1]['dashlets'], $guid); |
|
| 154 | + if( $dashlet['forceColumn'] == 0 ) { |
|
| 155 | + array_push($columns[0]['dashlets'], $guid); |
|
| 156 | + } else { |
|
| 157 | + array_push($columns[1]['dashlets'], $guid); |
|
| 158 | + } |
|
| 155 | 159 | $count++; |
| 156 | 160 | } |
| 157 | 161 | } |
@@ -179,8 +183,9 @@ discard block |
||
| 179 | 183 | $dashlets = array_merge($dashlets,$dashletsDashboard); |
| 180 | 184 | $current_user->setPreference('dashlets', $dashlets, 0, 'Home'); |
| 181 | 185 | } |
| 182 | -if ( !empty($pagesDashboard) || !empty($dashletsDashboard) ) |
|
| 186 | +if ( !empty($pagesDashboard) || !empty($dashletsDashboard) ) { |
|
| 183 | 187 | $current_user->resetPreferences('Dashboard'); |
| 188 | +} |
|
| 184 | 189 | |
| 185 | 190 | if (empty($pages)){ |
| 186 | 191 | $pages = array(); |
@@ -217,12 +222,14 @@ discard block |
||
| 217 | 222 | // only display dashlets that are from visibile modules and that the user has permission to list |
| 218 | 223 | if(!empty($id) && isset($dashlets[$id]) && is_file($dashlets[$id]['fileLocation'])) { |
| 219 | 224 | $module = 'Home'; |
| 220 | - if ( !empty($dashletsFiles[$dashlets[$id]['className']]['module']) ) |
|
| 221 | - $module = $dashletsFiles[$dashlets[$id]['className']]['module']; |
|
| 225 | + if ( !empty($dashletsFiles[$dashlets[$id]['className']]['module']) ) { |
|
| 226 | + $module = $dashletsFiles[$dashlets[$id]['className']]['module']; |
|
| 227 | + } |
|
| 222 | 228 | // Bug 24772 - Look into the user preference for the module the dashlet is a part of in case |
| 223 | 229 | // of the Report Chart dashlets. |
| 224 | - elseif ( !empty($dashlets[$id]['module']) ) |
|
| 225 | - $module = $dashlets[$id]['module']; |
|
| 230 | + elseif ( !empty($dashlets[$id]['module']) ) { |
|
| 231 | + $module = $dashlets[$id]['module']; |
|
| 232 | + } |
|
| 226 | 233 | |
| 227 | 234 | $myDashlet = new MySugar($module); |
| 228 | 235 | |
@@ -267,7 +274,9 @@ discard block |
||
| 267 | 274 | $_SESSION['current_tab'] = $activePage; |
| 268 | 275 | |
| 269 | 276 | |
| 270 | -if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) $sugar_smarty->assign('lock_homepage', true); |
|
| 277 | +if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) { |
|
| 278 | + $sugar_smarty->assign('lock_homepage', true); |
|
| 279 | +} |
|
| 271 | 280 | |
| 272 | 281 | |
| 273 | 282 | $sugar_smarty->assign('sugarVersion', $sugar_version); |
@@ -68,15 +68,18 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (!isset($options) && !isset($values)) |
|
| 72 | - return ''; /* raise error here? */ |
|
| 71 | + if (!isset($options) && !isset($values)) { |
|
| 72 | + return ''; |
|
| 73 | + } |
|
| 74 | + /* raise error here? */ |
|
| 73 | 75 | |
| 74 | 76 | $_html_result = ''; |
| 75 | 77 | |
| 76 | 78 | if (isset($options)) { |
| 77 | 79 | |
| 78 | - foreach ($options as $_key=>$_val) |
|
| 79 | - $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
| 80 | + foreach ($options as $_key=>$_val) { |
|
| 81 | + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
| 82 | + } |
|
| 80 | 83 | |
| 81 | 84 | } else { |
| 82 | 85 | |
@@ -99,8 +102,9 @@ discard block |
||
| 99 | 102 | if(!is_array($value)) { |
| 100 | 103 | $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . |
| 101 | 104 | smarty_function_escape_special_chars($key) . '"'; |
| 102 | - if (in_array((string)$key, $selected)) |
|
| 103 | - $_html_result .= ' selected="selected"'; |
|
| 105 | + if (in_array((string)$key, $selected)) { |
|
| 106 | + $_html_result .= ' selected="selected"'; |
|
| 107 | + } |
|
| 104 | 108 | $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; |
| 105 | 109 | } else { |
| 106 | 110 | $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); |
@@ -100,15 +100,18 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if (!isset($options) && !isset($values)) |
|
| 104 | - return ''; /* raise error here? */ |
|
| 103 | + if (!isset($options) && !isset($values)) { |
|
| 104 | + return ''; |
|
| 105 | + } |
|
| 106 | + /* raise error here? */ |
|
| 105 | 107 | |
| 106 | 108 | $_html_result = array(); |
| 107 | 109 | |
| 108 | 110 | if (isset($options)) { |
| 109 | 111 | |
| 110 | - foreach ($options as $_key=>$_val) |
|
| 111 | - $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); |
|
| 112 | + foreach ($options as $_key=>$_val) { |
|
| 113 | + $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); |
|
| 114 | + } |
|
| 112 | 115 | |
| 113 | 116 | } else { |
| 114 | 117 | |
@@ -141,13 +144,17 @@ discard block |
||
| 141 | 144 | . smarty_function_escape_special_chars($name) . '" value="' |
| 142 | 145 | . smarty_function_escape_special_chars($value) . '"'; |
| 143 | 146 | |
| 144 | - if ($labels && $label_ids) $_output .= ' id="' . $_id . '"'; |
|
| 147 | + if ($labels && $label_ids) { |
|
| 148 | + $_output .= ' id="' . $_id . '"'; |
|
| 149 | + } |
|
| 145 | 150 | |
| 146 | 151 | if ((string)$value==$selected) { |
| 147 | 152 | $_output .= ' checked="checked"'; |
| 148 | 153 | } |
| 149 | 154 | $_output .= $extra . ' />' . $output; |
| 150 | - if ($labels) $_output .= '</label>'; |
|
| 155 | + if ($labels) { |
|
| 156 | + $_output .= '</label>'; |
|
| 157 | + } |
|
| 151 | 158 | $_output .= $separator; |
| 152 | 159 | |
| 153 | 160 | return $_output; |
@@ -54,26 +54,33 @@ |
||
| 54 | 54 | function smarty_function_sugar_getimage($params, &$smarty) { |
| 55 | 55 | |
| 56 | 56 | // error checking for required parameters |
| 57 | - if(!isset($params['name'])) |
|
| 58 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'name'); |
|
| 57 | + if(!isset($params['name'])) { |
|
| 58 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'name'); |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | // temp hack to deprecate the use of other_attributes |
| 61 | - if(isset($params['other_attributes'])) |
|
| 62 | - $params['attr'] = $params['other_attributes']; |
|
| 62 | + if(isset($params['other_attributes'])) { |
|
| 63 | + $params['attr'] = $params['other_attributes']; |
|
| 64 | + } |
|
| 63 | 65 | |
| 64 | 66 | // set defaults |
| 65 | - if(!isset($params['attr'])) |
|
| 66 | - $params['attr'] = ''; |
|
| 67 | - if(!isset($params['width'])) |
|
| 68 | - $params['width'] = null; |
|
| 69 | - if(!isset($params['height'])) |
|
| 70 | - $params['height'] = null; |
|
| 71 | - if(!isset($params['alt'])) |
|
| 72 | - $params['alt'] = ''; |
|
| 67 | + if(!isset($params['attr'])) { |
|
| 68 | + $params['attr'] = ''; |
|
| 69 | + } |
|
| 70 | + if(!isset($params['width'])) { |
|
| 71 | + $params['width'] = null; |
|
| 72 | + } |
|
| 73 | + if(!isset($params['height'])) { |
|
| 74 | + $params['height'] = null; |
|
| 75 | + } |
|
| 76 | + if(!isset($params['alt'])) { |
|
| 77 | + $params['alt'] = ''; |
|
| 78 | + } |
|
| 73 | 79 | |
| 74 | 80 | // deprecated ? |
| 75 | - if(!isset($params['ext'])) |
|
| 76 | - $params['ext'] = null; |
|
| 81 | + if(!isset($params['ext'])) { |
|
| 82 | + $params['ext'] = null; |
|
| 83 | + } |
|
| 77 | 84 | |
| 78 | 85 | return SugarThemeRegistry::current()->getImage($params['name'], $params['attr'], $params['width'], $params['height'], $params['ext'], $params['alt']); |
| 79 | 86 | } |