@@ -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,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. |
@@ -58,8 +60,7 @@ discard block |
||
58 | 60 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
59 | 61 | if(isset($GLOBALS['log'])) { |
60 | 62 | $GLOBALS['log']->deprecated($deprecatedMessage); |
61 | - } |
|
62 | - else { |
|
63 | + } else { |
|
63 | 64 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
64 | 65 | } |
65 | 66 | self::__construct(); |
@@ -131,8 +132,9 @@ discard block |
||
131 | 132 | */ |
132 | 133 | function _writeToFile ($file,$view,$moduleName,$defs,$variables) |
133 | 134 | { |
134 | - if(file_exists($file)) |
|
135 | - unlink($file); |
|
135 | + if(file_exists($file)) { |
|
136 | + unlink($file); |
|
137 | + } |
|
136 | 138 | |
137 | 139 | mkdir_recursive ( dirname ( $file ) ) ; |
138 | 140 | $GLOBALS['log']->debug("ModuleBuilderParser->_writeFile(): file=".$file); |
@@ -174,8 +176,7 @@ discard block |
||
174 | 176 | // $GLOBALS['log']->debug("parser.modifylayout.php->_writeFile(): out=".print_r($out,true)); |
175 | 177 | fputs( $fh, $out); |
176 | 178 | fclose( $fh ); |
177 | - } |
|
178 | - else |
|
179 | + } else |
|
179 | 180 | { |
180 | 181 | $GLOBALS['log']->fatal("ModuleBuilderParser->_writeFile() Could not write new viewdef file ".$file); |
181 | 182 | } |
@@ -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. |
@@ -83,8 +85,7 @@ discard block |
||
83 | 85 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
84 | 86 | if(isset($GLOBALS['log'])) { |
85 | 87 | $GLOBALS['log']->deprecated($deprecatedMessage); |
86 | - } |
|
87 | - else { |
|
88 | + } else { |
|
88 | 89 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
89 | 90 | } |
90 | 91 | self::__construct(); |
@@ -212,8 +213,7 @@ discard block |
||
212 | 213 | { |
213 | 214 | $this->$field = $value; |
214 | 215 | } |
215 | - } |
|
216 | - else { |
|
216 | + } else { |
|
217 | 217 | $GLOBALS['log']->fatal('Error fetching relationship from cache '.$relationship_name); |
218 | 218 | return false; |
219 | 219 | } |
@@ -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 LeadsJjwg_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. |
@@ -110,8 +112,7 @@ discard block |
||
110 | 112 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
111 | 113 | if(isset($GLOBALS['log'])) { |
112 | 114 | $GLOBALS['log']->deprecated($deprecatedMessage); |
113 | - } |
|
114 | - else { |
|
115 | + } else { |
|
115 | 116 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
116 | 117 | } |
117 | 118 | self::__construct(); |
@@ -587,12 +588,10 @@ discard block |
||
587 | 588 | } else { |
588 | 589 | return $this->resolution != self::JOB_FAILURE; |
589 | 590 | } |
590 | - } |
|
591 | - else { |
|
591 | + } else { |
|
592 | 592 | $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target))); |
593 | 593 | } |
594 | - } |
|
595 | - else { |
|
594 | + } else { |
|
596 | 595 | $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target))); |
597 | 596 | } |
598 | 597 | return false; |
@@ -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. |
@@ -62,8 +64,7 @@ discard block |
||
62 | 64 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
63 | 65 | if(isset($GLOBALS['log'])) { |
64 | 66 | $GLOBALS['log']->deprecated($deprecatedMessage); |
65 | - } |
|
66 | - else { |
|
67 | + } else { |
|
67 | 68 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
68 | 69 | } |
69 | 70 | self::__construct(); |
@@ -100,7 +101,7 @@ discard block |
||
100 | 101 | } |
101 | 102 | } |
102 | 103 | |
103 | - }else{ |
|
104 | + } else{ |
|
104 | 105 | sugar_die("FAILED TO ADD: $category - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php"); |
105 | 106 | } |
106 | 107 | |
@@ -128,7 +129,7 @@ discard block |
||
128 | 129 | $action->mark_deleted($row['id']); |
129 | 130 | } |
130 | 131 | } |
131 | - }else{ |
|
132 | + } else{ |
|
132 | 133 | sugar_die("FAILED TO REMOVE: $category : $name - TYPE $type NOT DEFINED IN modules/ACLActions/actiondefs.php"); |
133 | 134 | } |
134 | 135 | } |
@@ -196,7 +197,9 @@ discard block |
||
196 | 197 | global $ACLActions; |
197 | 198 | $options = array(); |
198 | 199 | |
199 | - if(empty($ACLActions[$type]['actions'][$action]['aclaccess']))return $options; |
|
200 | + if(empty($ACLActions[$type]['actions'][$action]['aclaccess'])) { |
|
201 | + return $options; |
|
202 | + } |
|
200 | 203 | foreach($ACLActions[$type]['actions'][$action]['aclaccess'] as $action){ |
201 | 204 | $options[$action] = ACLAction::AccessName($action); |
202 | 205 | } |
@@ -247,14 +250,14 @@ discard block |
||
247 | 250 | if(!$refresh && !empty($_SESSION['ACL'][$user_id])){ |
248 | 251 | if(empty($category) && empty($action)){ |
249 | 252 | return $_SESSION['ACL'][$user_id]; |
250 | - }else{ |
|
253 | + } else{ |
|
251 | 254 | if(!empty($category) && isset($_SESSION['ACL'][$user_id][$category])){ |
252 | 255 | if(empty($action)){ |
253 | 256 | if(empty($type)){ |
254 | 257 | return $_SESSION['ACL'][$user_id][$category]; |
255 | 258 | } |
256 | 259 | return $_SESSION['ACL'][$user_id][$category][$type]; |
257 | - }else if(!empty($type) && isset($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
260 | + } else if(!empty($type) && isset($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
|
258 | 261 | return $_SESSION['ACL'][$user_id][$category][$type][$action]; |
259 | 262 | } |
260 | 263 | } |
@@ -374,12 +377,12 @@ discard block |
||
374 | 377 | $_SESSION['ACL'] = array(); |
375 | 378 | } |
376 | 379 | $_SESSION['ACL'][$user_id] = $selected_actions; |
377 | - }else{ |
|
380 | + } else{ |
|
378 | 381 | if(empty($action) && !empty($category)){ |
379 | 382 | if(!empty($type)){ |
380 | 383 | $_SESSION['ACL'][$user_id][$category][$type] = $selected_actions[$category][$type];} |
381 | 384 | $_SESSION['ACL'][$user_id][$category] = $selected_actions[$category]; |
382 | - }else{ |
|
385 | + } else{ |
|
383 | 386 | if(!empty($action) && !empty($category) && !empty($type)){ |
384 | 387 | $_SESSION['ACL'][$user_id][$category][$type][$action] = $selected_actions[$category][$action]; |
385 | 388 | |
@@ -398,8 +401,9 @@ discard block |
||
398 | 401 | // Fallback to array key if translation is empty |
399 | 402 | $a = empty($app_list_strings['moduleList'][$a]) ? $a : $app_list_strings['moduleList'][$a]; |
400 | 403 | $b = empty($app_list_strings['moduleList'][$b]) ? $b : $app_list_strings['moduleList'][$b]; |
401 | - if ($a == $b) |
|
402 | - return 0; |
|
404 | + if ($a == $b) { |
|
405 | + return 0; |
|
406 | + } |
|
403 | 407 | return ($a < $b) ? -1 : 1; |
404 | 408 | } |
405 | 409 | |
@@ -494,7 +498,9 @@ discard block |
||
494 | 498 | return true; |
495 | 499 | } |
496 | 500 | //check if we don't have it set in the cache if not lets reload the cache |
497 | - if(ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) return false; |
|
501 | + if(ACLAction::getUserAccessLevel($user_id, $category, 'access', $type) < ACL_ALLOW_ENABLED) { |
|
502 | + return false; |
|
503 | + } |
|
498 | 504 | if(empty($_SESSION['ACL'][$user_id][$category][$type][$action])){ |
499 | 505 | ACLAction::getUserActions($user_id, false); |
500 | 506 | |
@@ -590,8 +596,7 @@ discard block |
||
590 | 596 | if($cat_name=='Users'&& $act_name=='admin'){ |
591 | 597 | $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEFAULT]=ACLAction::AccessName(ACL_ALLOW_DEFAULT);; |
592 | 598 | $categories[$cat_name][$type_name][$act_name]['accessOptions'][ACL_ALLOW_DEV]=ACLAction::AccessName(ACL_ALLOW_DEV);; |
593 | - } |
|
594 | - else{ |
|
599 | + } else{ |
|
595 | 600 | $categories[$cat_name][$type_name][$act_name]['accessOptions'] = ACLAction::getAccessOptions($act_name, $type_name); |
596 | 601 | } |
597 | 602 | } |