@@ -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. |
@@ -63,8 +65,7 @@ discard block |
||
63 | 65 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
64 | 66 | if(isset($GLOBALS['log'])) { |
65 | 67 | $GLOBALS['log']->deprecated($deprecatedMessage); |
66 | - } |
|
67 | - else { |
|
68 | + } else { |
|
68 | 69 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
69 | 70 | } |
70 | 71 | self::__construct(); |
@@ -117,10 +118,11 @@ discard block |
||
117 | 118 | while($row = $GLOBALS['db']->fetchByAssoc($result) ){ |
118 | 119 | $role = new ACLRole(); |
119 | 120 | $role->populateFromRow($row); |
120 | - if($getAsNameArray) |
|
121 | - $user_roles[] = $role->name; |
|
122 | - else |
|
123 | - $user_roles[] = $role; |
|
121 | + if($getAsNameArray) { |
|
122 | + $user_roles[] = $role->name; |
|
123 | + } else { |
|
124 | + $user_roles[] = $role; |
|
125 | + } |
|
124 | 126 | } |
125 | 127 | |
126 | 128 | return $user_roles; |
@@ -179,7 +181,7 @@ discard block |
||
179 | 181 | $role->populateFromRow($row); |
180 | 182 | if($returnAsArray){ |
181 | 183 | $roles[] = $role->toArray(); |
182 | - }else{ |
|
184 | + } else{ |
|
183 | 185 | $roles[] = $role; |
184 | 186 | } |
185 | 187 | |
@@ -221,7 +223,7 @@ discard block |
||
221 | 223 | $action->populateFromRow($row); |
222 | 224 | if(!empty($row['access_override'])){ |
223 | 225 | $action->aclaccess = $row['access_override']; |
224 | - }else{ |
|
226 | + } else{ |
|
225 | 227 | $action->aclaccess = ACL_ALLOW_DEFAULT; |
226 | 228 | |
227 | 229 | } |
@@ -252,8 +254,9 @@ discard block |
||
252 | 254 | // Fallback to array key if translation is empty |
253 | 255 | $a = empty($app_list_strings['moduleList'][$a]) ? $a : $app_list_strings['moduleList'][$a]; |
254 | 256 | $b = empty($app_list_strings['moduleList'][$b]) ? $b : $app_list_strings['moduleList'][$b]; |
255 | - if ($a == $b) |
|
256 | - return 0; |
|
257 | + if ($a == $b) { |
|
258 | + return 0; |
|
259 | + } |
|
257 | 260 | return ($a < $b) ? -1 : 1; |
258 | 261 | } |
259 | 262 | /** |
@@ -283,7 +286,7 @@ discard block |
||
283 | 286 | foreach($array_fields as $field){ |
284 | 287 | if(isset($this->$field)){ |
285 | 288 | $arr[$field] = $this->$field; |
286 | - }else{ |
|
289 | + } else{ |
|
287 | 290 | $arr[$field] = ''; |
288 | 291 | } |
289 | 292 | } |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | * Date: 06/03/15 |
44 | 44 | * Comments |
45 | 45 | */ |
46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
47 | + die('Not A Valid Entry Point'); |
|
48 | +} |
|
47 | 49 | |
48 | 50 | class CasesController extends SugarController { |
49 | 51 | |
@@ -90,8 +92,7 @@ discard block |
||
90 | 92 | $count++; |
91 | 93 | } |
92 | 94 | echo '</table>'; |
93 | - } |
|
94 | - else { |
|
95 | + } else { |
|
95 | 96 | echo $mod_strings['LBL_NO_SUGGESTIONS']; |
96 | 97 | } |
97 | 98 | die(); |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | * Date: 06/03/15 |
44 | 44 | * Comments |
45 | 45 | */ |
46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
47 | + die('Not A Valid Entry Point'); |
|
48 | +} |
|
47 | 49 | |
48 | 50 | class CasesController extends SugarController { |
49 | 51 | |
@@ -90,8 +92,7 @@ discard block |
||
90 | 92 | $count++; |
91 | 93 | } |
92 | 94 | echo '</table>'; |
93 | - } |
|
94 | - else { |
|
95 | + } else { |
|
95 | 96 | echo $mod_strings['LBL_NO_SUGGESTIONS']; |
96 | 97 | } |
97 | 98 | die(); |
@@ -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. |
@@ -123,8 +125,7 @@ discard block |
||
123 | 125 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
124 | 126 | if(isset($GLOBALS['log'])) { |
125 | 127 | $GLOBALS['log']->deprecated($deprecatedMessage); |
126 | - } |
|
127 | - else { |
|
128 | + } else { |
|
128 | 129 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
129 | 130 | } |
130 | 131 | self::__construct(); |
@@ -192,8 +193,9 @@ discard block |
||
192 | 193 | break; |
193 | 194 | } |
194 | 195 | } |
195 | - if ($dup) |
|
196 | - $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
196 | + if ($dup) { |
|
197 | + $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
198 | + } |
|
197 | 199 | } |
198 | 200 | } |
199 | 201 | } |
@@ -266,8 +268,9 @@ discard block |
||
266 | 268 | break; |
267 | 269 | } |
268 | 270 | } |
269 | - if ($dup) |
|
270 | - $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
271 | + if ($dup) { |
|
272 | + $collection[$collectionKey][] = array("name" => $optionKey, "value" => $optionLabel); |
|
273 | + } |
|
271 | 274 | } |
272 | 275 | } |
273 | 276 | } |
@@ -328,8 +331,9 @@ discard block |
||
328 | 331 | function parse_tracker_urls($template_text_array, $url_template, $tracked_urls, $removeme_url_template) |
329 | 332 | { |
330 | 333 | global $beanFiles, $beanList, $app_list_strings, $sugar_config; |
331 | - if (!isset($this->parsed_urls)) |
|
332 | - $this->parsed_urls = array(); |
|
334 | + if (!isset($this->parsed_urls)) { |
|
335 | + $this->parsed_urls = array(); |
|
336 | + } |
|
333 | 337 | |
334 | 338 | $return_array = $template_text_array; |
335 | 339 | if (count($tracked_urls) > 0) { |
@@ -410,8 +414,9 @@ discard block |
||
410 | 414 | $user->retrieve($focus->assigned_user_id); |
411 | 415 | } |
412 | 416 | |
413 | - if (!isset($this->parsed_entities)) |
|
414 | - $this->parsed_entities = array(); |
|
417 | + if (!isset($this->parsed_entities)) { |
|
418 | + $this->parsed_entities = array(); |
|
419 | + } |
|
415 | 420 | |
416 | 421 | //parse the template and find all the dynamic strings that need replacement. |
417 | 422 | // Bug #48111 It's strange why prefix for User module is contact_user (see self::generateFieldDefsJS method) |
@@ -788,8 +793,9 @@ discard block |
||
788 | 793 | $template = new EmailTemplate(); |
789 | 794 | $optionKey = $template->field_defs['type']['options']; |
790 | 795 | $options = $GLOBALS['app_list_strings'][$optionKey]; |
791 | - if (!is_admin($GLOBALS['current_user']) && isset($options['workflow'])) |
|
792 | - unset($options['workflow']); |
|
796 | + if (!is_admin($GLOBALS['current_user']) && isset($options['workflow'])) { |
|
797 | + unset($options['workflow']); |
|
798 | + } |
|
793 | 799 | |
794 | 800 | return $options; |
795 | 801 | } |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
56 | 56 | if(isset($GLOBALS['log'])) { |
57 | 57 | $GLOBALS['log']->deprecated($deprecatedMessage); |
58 | - } |
|
59 | - else { |
|
58 | + } else { |
|
60 | 59 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
61 | 60 | } |
62 | 61 | self::__construct(); |
@@ -141,8 +140,9 @@ discard block |
||
141 | 140 | $smarty->assign('APP', $GLOBALS['app_strings']); |
142 | 141 | $smarty->assign("view_module", $this->editModule); |
143 | 142 | $smarty->assign("subpanel", $this->subpanel); |
144 | - if (isset($this->editPackage)) |
|
145 | - $smarty->assign("view_package", $this->editPackage); |
|
143 | + if (isset($this->editPackage)) { |
|
144 | + $smarty->assign("view_package", $this->editPackage); |
|
145 | + } |
|
146 | 146 | |
147 | 147 | $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl')); |
148 | 148 | echo $ajax->getJavascript(); |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
53 | 53 | if(isset($GLOBALS['log'])) { |
54 | 54 | $GLOBALS['log']->deprecated($deprecatedMessage); |
55 | - } |
|
56 | - else { |
|
55 | + } else { |
|
57 | 56 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
58 | 57 | } |
59 | 58 | self::__construct(); |
@@ -116,7 +115,9 @@ discard block |
||
116 | 115 | $smarty->assign('TREElabel', $mbt->getName()); |
117 | 116 | } |
118 | 117 | $userPref = $current_user->getPreference('mb_assist', 'Assistant'); |
119 | - if(!$userPref) $userPref="na"; |
|
118 | + if(!$userPref) { |
|
119 | + $userPref="na"; |
|
120 | + } |
|
120 | 121 | $smarty->assign('userPref',$userPref); |
121 | 122 | |
122 | 123 | /////////////////////////////////// |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
2 | +if (! defined ( 'sugarEntry' ) || ! sugarEntry) { |
|
3 | 3 | die ( 'Not A Valid Entry Point' ) ; |
4 | +} |
|
4 | 5 | |
5 | 6 | /********************************************************************************* |
6 | 7 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -75,8 +76,7 @@ discard block |
||
75 | 76 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
76 | 77 | if(isset($GLOBALS['log'])) { |
77 | 78 | $GLOBALS['log']->deprecated($deprecatedMessage); |
78 | - } |
|
79 | - else { |
|
79 | + } else { |
|
80 | 80 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
81 | 81 | } |
82 | 82 | self::__construct(); |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | $ajax = new AjaxCompose ( ) ; |
270 | 270 | |
271 | 271 | $translatedViewType = '' ; |
272 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
273 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
274 | - else if (isset($this->sm)) |
|
272 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) { |
|
273 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
274 | + } else if (isset($this->sm)) |
|
275 | 275 | { |
276 | 276 | foreach($this->sm->sources as $file => $def) |
277 | 277 | { |
@@ -284,8 +284,9 @@ discard block |
||
284 | 284 | { |
285 | 285 | $label = "LBL_" . strtoupper($this->editLayout); |
286 | 286 | $translated = translate($label, $this->editModule); |
287 | - if ($translated != $label) |
|
288 | - $translatedViewType = $translated; |
|
287 | + if ($translated != $label) { |
|
288 | + $translatedViewType = $translated; |
|
289 | + } |
|
289 | 290 | } |
290 | 291 | } |
291 | 292 |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
2 | +if (! defined ( 'sugarEntry' ) || ! sugarEntry) { |
|
3 | 3 | die ( 'Not A Valid Entry Point' ) ; |
4 | +} |
|
4 | 5 | /********************************************************************************* |
5 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -68,8 +69,7 @@ discard block |
||
68 | 69 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
69 | 70 | if(isset($GLOBALS['log'])) { |
70 | 71 | $GLOBALS['log']->deprecated($deprecatedMessage); |
71 | - } |
|
72 | - else { |
|
72 | + } else { |
|
73 | 73 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
74 | 74 | } |
75 | 75 | self::__construct($moduleName, $packageName); |
@@ -100,9 +100,11 @@ discard block |
||
100 | 100 | function getSearchFields() |
101 | 101 | { |
102 | 102 | $searchFields = array(); |
103 | - if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) //we are in Module builder |
|
103 | + if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
104 | + //we are in Module builder |
|
104 | 105 | { |
105 | 106 | include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"); |
107 | + } |
|
106 | 108 | } else if(file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
107 | 109 | include("custom/modules/{$this->moduleName}/metadata/SearchFields.php"); |
108 | 110 | } else if(file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) { |
@@ -114,9 +116,11 @@ discard block |
||
114 | 116 | |
115 | 117 | function saveSearchFields ($searchFields) |
116 | 118 | { |
117 | - if (!empty($this->packageName)) //we are in Module builder |
|
119 | + if (!empty($this->packageName)) { |
|
120 | + //we are in Module builder |
|
118 | 121 | { |
119 | 122 | $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
123 | + } |
|
120 | 124 | if(!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) |
121 | 125 | { |
122 | 126 | mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata"); |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
2 | +if (! defined ( 'sugarEntry' ) || ! sugarEntry) { |
|
3 | 3 | die ( 'Not A Valid Entry Point' ) ; |
4 | +} |
|
4 | 5 | /********************************************************************************* |
5 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -48,8 +49,9 @@ discard block |
||
48 | 49 | public function __construct ($moduleName, $packageName = '' ) |
49 | 50 | { |
50 | 51 | $this->moduleName = $moduleName; |
51 | - if (!empty($packageName)) |
|
52 | - $this->packageName = $packageName ; |
|
52 | + if (!empty($packageName)) { |
|
53 | + $this->packageName = $packageName ; |
|
54 | + } |
|
53 | 55 | } |
54 | 56 | |
55 | 57 | /** |
@@ -59,8 +61,7 @@ discard block |
||
59 | 61 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
60 | 62 | if(isset($GLOBALS['log'])) { |
61 | 63 | $GLOBALS['log']->deprecated($deprecatedMessage); |
62 | - } |
|
63 | - else { |
|
64 | + } else { |
|
64 | 65 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
65 | 66 | } |
66 | 67 | self::__construct($moduleName, $packageName); |
@@ -82,9 +83,11 @@ discard block |
||
82 | 83 | $labels [ strtoupper(substr ( $key, 6 )) ] = SugarCleaner::cleanHtml(from_html($value),false); |
83 | 84 | } |
84 | 85 | } |
85 | - if (!empty($this->packageName)) //we are in Module builder |
|
86 | + if (!empty($this->packageName)) { |
|
87 | + //we are in Module builder |
|
86 | 88 | { |
87 | 89 | return self::addLabels ( $language, $labels, $this->moduleName, "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/language" ) ; |
90 | + } |
|
88 | 91 | } else |
89 | 92 | { |
90 | 93 | return self::addLabels ( $language, $labels, $this->moduleName ) ; |
@@ -206,7 +209,7 @@ discard block |
||
206 | 209 | { |
207 | 210 | // obtain $mod_strings |
208 | 211 | include ($filename) ; |
209 | - }else if($forRelationshipLabel){ |
|
212 | + } else if($forRelationshipLabel){ |
|
210 | 213 | $fh = fopen ($filename, 'a'); |
211 | 214 | fclose($fh); |
212 | 215 | } |
@@ -285,8 +288,9 @@ discard block |
||
285 | 288 | } |
286 | 289 | } |
287 | 290 | |
288 | - foreach ($mod_strings as $key => $val) |
|
289 | - $out .= override_value_to_string_recursive2('mod_strings', $key, $val); |
|
291 | + foreach ($mod_strings as $key => $val) { |
|
292 | + $out .= override_value_to_string_recursive2('mod_strings', $key, $val); |
|
293 | + } |
|
290 | 294 | |
291 | 295 | $failed_to_write = false; |
292 | 296 | try { |
@@ -328,8 +332,9 @@ discard block |
||
328 | 332 | } |
329 | 333 | } |
330 | 334 | |
331 | - foreach ($mod_strings as $key => $val) |
|
332 | - $out .= override_value_to_string_recursive2('mod_strings', $key, $val); |
|
335 | + foreach ($mod_strings as $key => $val) { |
|
336 | + $out .= override_value_to_string_recursive2('mod_strings', $key, $val); |
|
337 | + } |
|
333 | 338 | |
334 | 339 | $failed_to_write = false; |
335 | 340 | try { |