@@ -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. |
@@ -53,7 +55,9 @@ discard block |
||
53 | 55 | |
54 | 56 | switch ($_REQUEST['view']) { |
55 | 57 | case "support_portal": |
56 | - if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
58 | + if (!is_admin($current_user)) { |
|
59 | + sugar_die("Unauthorized access to administration."); |
|
60 | + } |
|
57 | 61 | $GLOBALS['log']->info("Administration SupportPortal"); |
58 | 62 | |
59 | 63 | $iframe_url = add_http("www.sugarcrm.com/network/redirect.php?tmpl=network"); |
@@ -83,14 +87,18 @@ discard block |
||
83 | 87 | $send_key = isset($_REQUEST['key']) ? $_REQUEST['key'] : ""; |
84 | 88 | $send_anchor = ''; |
85 | 89 | // awu: Fixes the ProjectTasks pluralization issue -- must fix in later versions. |
86 | - if ($send_module == 'ProjectTasks') |
|
87 | - $send_module = 'ProjectTask'; |
|
88 | - if ($send_module == 'ProductCatalog') |
|
89 | - $send_module = 'ProductTemplates'; |
|
90 | - if ($send_module == 'TargetLists') |
|
91 | - $send_module = 'ProspectLists'; |
|
92 | - if ($send_module == 'Targets') |
|
93 | - $send_module = 'Prospects'; |
|
90 | + if ($send_module == 'ProjectTasks') { |
|
91 | + $send_module = 'ProjectTask'; |
|
92 | + } |
|
93 | + if ($send_module == 'ProductCatalog') { |
|
94 | + $send_module = 'ProductTemplates'; |
|
95 | + } |
|
96 | + if ($send_module == 'TargetLists') { |
|
97 | + $send_module = 'ProspectLists'; |
|
98 | + } |
|
99 | + if ($send_module == 'Targets') { |
|
100 | + $send_module = 'Prospects'; |
|
101 | + } |
|
94 | 102 | // FG - Bug 39819 - Check for custom help files |
95 | 103 | $helpPath = 'modules/'.$send_module.'/language/'.$send_lang.'.help.'.$send_action.'.html'; |
96 | 104 | if (sugar_is_file("custom/" . $helpPath)) { |
@@ -205,7 +213,7 @@ discard block |
||
205 | 213 | $send_anchor = $map['anchor']; |
206 | 214 | } |
207 | 215 | } |
208 | - }else{ |
|
216 | + } else{ |
|
209 | 217 | $send_module = $map['name']; |
210 | 218 | if(!empty($map['anchor'])){ |
211 | 219 | $send_anchor = $map['anchor']; |
@@ -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. |
@@ -47,7 +49,9 @@ discard block |
||
47 | 49 | global $current_user; |
48 | 50 | |
49 | 51 | |
50 | -if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
52 | +if (!is_admin($current_user)) { |
|
53 | + sugar_die("Unauthorized access to administration."); |
|
54 | +} |
|
51 | 55 | if (isset($GLOBALS['sugar_config']['hide_admin_diagnostics']) && $GLOBALS['sugar_config']['hide_admin_diagnostics']) |
52 | 56 | { |
53 | 57 | sugar_die("Unauthorized access to diagnostic tool."); |
@@ -131,9 +135,9 @@ discard block |
||
131 | 135 | global $currentitems; |
132 | 136 | |
133 | 137 | $currentitems++; |
134 | - if($currentitems == $totalitems) |
|
135 | - update_progress_bar("diagnostic", 100, 100); |
|
136 | - else |
|
138 | + if($currentitems == $totalitems) { |
|
139 | + update_progress_bar("diagnostic", 100, 100); |
|
140 | + } else |
|
137 | 141 | { |
138 | 142 | $progress_bar_percent += ($itemweight / $GLOBALS['totalweight'] * 100); |
139 | 143 | update_progress_bar("diagnostic", $progress_bar_percent, 100); |
@@ -214,18 +218,21 @@ discard block |
||
214 | 218 | //perform this check when counter is set to two, which means it is on the 'value' column |
215 | 219 | if($counter == 2) { |
216 | 220 | //if the previous "name" column value was set to smtppass, set replace_val to true |
217 | - if(strcmp($row[$counter - 1], "smtppass") == 0 ) |
|
218 | - $replace_val = true; |
|
221 | + if(strcmp($row[$counter - 1], "smtppass") == 0 ) { |
|
222 | + $replace_val = true; |
|
223 | + } |
|
219 | 224 | |
220 | 225 | //if the previous "name" column value was set to smtppass, |
221 | 226 | //and the "category" value set to ldap, set replace_val to true |
222 | - if (strcmp($row[$counter - 2], "ldap") == 0 && strcmp($row[$counter - 1], "admin_password") == 0) |
|
223 | - $replace_val = true; |
|
227 | + if (strcmp($row[$counter - 2], "ldap") == 0 && strcmp($row[$counter - 1], "admin_password") == 0) { |
|
228 | + $replace_val = true; |
|
229 | + } |
|
224 | 230 | |
225 | 231 | //if the previous "name" column value was set to password, |
226 | 232 | //and the "category" value set to proxy, set replace_val to true |
227 | - if(strcmp($row[$counter - 2], "proxy") == 0 && strcmp($row[$counter - 1], "password") == 0 ) |
|
228 | - $replace_val = true; |
|
233 | + if(strcmp($row[$counter - 2], "proxy") == 0 && strcmp($row[$counter - 1], "password") == 0 ) { |
|
234 | + $replace_val = true; |
|
235 | + } |
|
229 | 236 | } |
230 | 237 | |
231 | 238 | if($replace_val) { |
@@ -245,8 +252,9 @@ discard block |
||
245 | 252 | // Deletes the directory recursively |
246 | 253 | function deleteDir($dir) |
247 | 254 | { |
248 | - if (substr($dir, strlen($dir)-1, 1) != '/') |
|
249 | - $dir .= '/'; |
|
255 | + if (substr($dir, strlen($dir)-1, 1) != '/') { |
|
256 | + $dir .= '/'; |
|
257 | + } |
|
250 | 258 | |
251 | 259 | if ($handle = opendir($dir)) |
252 | 260 | { |
@@ -256,21 +264,23 @@ discard block |
||
256 | 264 | { |
257 | 265 | if (is_dir($dir.$obj)) |
258 | 266 | { |
259 | - if (!deleteDir($dir.$obj)) |
|
260 | - return false; |
|
261 | - } |
|
262 | - elseif (is_file($dir.$obj)) |
|
267 | + if (!deleteDir($dir.$obj)) { |
|
268 | + return false; |
|
269 | + } |
|
270 | + } elseif (is_file($dir.$obj)) |
|
263 | 271 | { |
264 | - if (!unlink($dir.$obj)) |
|
265 | - return false; |
|
272 | + if (!unlink($dir.$obj)) { |
|
273 | + return false; |
|
274 | + } |
|
266 | 275 | } |
267 | 276 | } |
268 | 277 | } |
269 | 278 | |
270 | 279 | closedir($handle); |
271 | 280 | |
272 | - if (!@rmdir($dir)) |
|
273 | - return false; |
|
281 | + if (!@rmdir($dir)) { |
|
282 | + return false; |
|
283 | + } |
|
274 | 284 | return true; |
275 | 285 | } |
276 | 286 | return false; |
@@ -301,10 +311,11 @@ discard block |
||
301 | 311 | |
302 | 312 | |
303 | 313 | //determine if files.md5 exists or not |
304 | - if(file_exists('files.md5')) |
|
305 | - $skip_md5_diff = false; |
|
306 | - else |
|
307 | - $skip_md5_diff = true; |
|
314 | + if(file_exists('files.md5')) { |
|
315 | + $skip_md5_diff = false; |
|
316 | + } else { |
|
317 | + $skip_md5_diff = true; |
|
318 | + } |
|
308 | 319 | |
309 | 320 | // array of all tables that we need to pull rows from below |
310 | 321 | $getDumpsFrom = array('config' => 'config', |
@@ -392,8 +403,9 @@ discard block |
||
392 | 403 | |
393 | 404 | |
394 | 405 | //create directory for table definitions |
395 | - if($getschema) |
|
396 | - $tablesSchemaDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/{$db->dbName}/TableSchema/"); |
|
406 | + if($getschema) { |
|
407 | + $tablesSchemaDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/{$db->dbName}/TableSchema/"); |
|
408 | + } |
|
397 | 409 | |
398 | 410 | //make sure they checked the box to get basic info |
399 | 411 | if($getinfo) |
@@ -547,13 +559,13 @@ discard block |
||
547 | 559 | if(!isset($beanFiles[$beanz])) |
548 | 560 | { |
549 | 561 | echo "<font color=orange>NO! --- ".$beanz." is not an index in \$beanFiles</font><br>"; |
550 | - } |
|
551 | - else |
|
562 | + } else |
|
552 | 563 | { |
553 | - if(file_exists($beanFiles[$beanz])) |
|
554 | - echo "<font color=green>YES --- ".$beanz." file \"".$beanFiles[$beanz]."\" exists</font><br>"; |
|
555 | - else |
|
556 | - echo "<font color=red>NO! --- ".$beanz." file \"".$beanFiles[$beanz]."\" does NOT exist</font><br>"; |
|
564 | + if(file_exists($beanFiles[$beanz])) { |
|
565 | + echo "<font color=green>YES --- ".$beanz." file \"".$beanFiles[$beanz]."\" exists</font><br>"; |
|
566 | + } else { |
|
567 | + echo "<font color=red>NO! --- ".$beanz." file \"".$beanFiles[$beanz]."\" does NOT exist</font><br>"; |
|
568 | + } |
|
557 | 569 | } |
558 | 570 | } |
559 | 571 | |
@@ -589,8 +601,9 @@ discard block |
||
589 | 601 | global $curdatetime; |
590 | 602 | global $skip_md5_diff; |
591 | 603 | global $sod_guid; |
592 | - if(file_exists('files.md5')) |
|
593 | - include( 'files.md5'); |
|
604 | + if(file_exists('files.md5')) { |
|
605 | + include( 'files.md5'); |
|
606 | + } |
|
594 | 607 | //create dir for md5s |
595 | 608 | $md5_directory = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/md5/"); |
596 | 609 | |
@@ -598,15 +611,17 @@ discard block |
||
598 | 611 | if(!$skip_md5_diff) |
599 | 612 | { |
600 | 613 | //make sure the files.md5 |
601 | - if($filesmd5) |
|
602 | - if(!copy('files.md5', $md5_directory."files.md5")) |
|
614 | + if($filesmd5) { |
|
615 | + if(!copy('files.md5', $md5_directory."files.md5")) |
|
603 | 616 | echo "Couldn't copy files.md5 to ".$md5_directory."<br>Skipping md5 checks.<br>"; |
617 | + } |
|
604 | 618 | } |
605 | 619 | |
606 | 620 | $md5_string_calculated = generateMD5array('./'); |
607 | 621 | |
608 | - if($md5calculated) |
|
609 | - write_array_to_file('md5_string_calculated', $md5_string_calculated, $md5_directory."md5_array_calculated.php"); |
|
622 | + if($md5calculated) { |
|
623 | + write_array_to_file('md5_string_calculated', $md5_string_calculated, $md5_directory."md5_array_calculated.php"); |
|
624 | + } |
|
610 | 625 | |
611 | 626 | |
612 | 627 | //if the files.md5 didn't exist, we can't do this |
@@ -668,8 +683,9 @@ discard block |
||
668 | 683 | |
669 | 684 | foreach($tables as $t) { |
670 | 685 | $name = $t; |
671 | - if ( $name == "does_not_exist" ) |
|
672 | - continue; |
|
686 | + if ( $name == "does_not_exist" ) { |
|
687 | + continue; |
|
688 | + } |
|
673 | 689 | $comment = $comments[$t]; |
674 | 690 | echo "<h2>Table: $t</h2> |
675 | 691 | <p><i>{$comment}</i></p>"; |
@@ -686,8 +702,9 @@ discard block |
||
686 | 702 | |
687 | 703 | foreach($fields[$t] as $k => $v) { |
688 | 704 | // we only care about physical tables ('source' can be 'non-db' or 'nondb' or 'function' ) |
689 | - if ( isset( $v[ 'source' ] )) |
|
690 | - continue; |
|
705 | + if ( isset( $v[ 'source' ] )) { |
|
706 | + continue; |
|
707 | + } |
|
691 | 708 | $columnname = $v[ 'name' ]; |
692 | 709 | $columntype = $v[ 'type' ]; |
693 | 710 | $columndbtype = $v[ 'dbType' ]; |
@@ -695,13 +712,20 @@ discard block |
||
695 | 712 | $columncomment = $v[ 'comment' ]; |
696 | 713 | $columnrequired = $v[ 'required' ]; |
697 | 714 | |
698 | - if ( empty( $columnlen ) ) $columnlen = '<i>n/a</i>'; |
|
699 | - if ( empty( $columncomment ) ) $columncomment = '<i>(none)</i>'; |
|
700 | - if ( !empty( $columndbtype ) ) $columntype = $columndbtype; |
|
701 | - if ( empty( $columnrequired ) || ( $columnrequired == false )) |
|
702 | - $columndisplayrequired = 'no'; |
|
703 | - else |
|
704 | - $columndisplayrequired = 'yes'; |
|
715 | + if ( empty( $columnlen ) ) { |
|
716 | + $columnlen = '<i>n/a</i>'; |
|
717 | + } |
|
718 | + if ( empty( $columncomment ) ) { |
|
719 | + $columncomment = '<i>(none)</i>'; |
|
720 | + } |
|
721 | + if ( !empty( $columndbtype ) ) { |
|
722 | + $columntype = $columndbtype; |
|
723 | + } |
|
724 | + if ( empty( $columnrequired ) || ( $columnrequired == false )) { |
|
725 | + $columndisplayrequired = 'no'; |
|
726 | + } else { |
|
727 | + $columndisplayrequired = 'yes'; |
|
728 | + } |
|
705 | 729 | |
706 | 730 | echo '<TR BGCOLOR="#FFFFFF" ALIGN=left> |
707 | 731 | <TD ALIGN=left class=\"tabDetailViewDF\">'.$columnname.'</TD> |
@@ -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. |
@@ -47,7 +49,7 @@ discard block |
||
47 | 49 | $status = ''; |
48 | 50 | if($_POST['activate'] == 'false'){ |
49 | 51 | $status = 'Inactive'; |
50 | - }else{ |
|
52 | + } else{ |
|
51 | 53 | $status = 'Active'; |
52 | 54 | } |
53 | 55 | } |
@@ -73,18 +75,17 @@ discard block |
||
73 | 75 | <table cellspacing="{CELLSPACING}" class="otherview"> |
74 | 76 | <tr> |
75 | 77 | <td scope="row" width="30%"><?php echo $mod_strings['LBL_REPAIR_SEED_USERS_TITLE']; ?></td> |
76 | - <td><input type="submit" name="button" value="<?php if($row['status'] == 'Inactive'){echo $mod_strings['LBL_REPAIR_SEED_USERS_ACTIVATE'];}else{echo $mod_strings['LBL_REPAIR_SEED_USERS_DECACTIVATE'];} ?>"></td> |
|
78 | + <td><input type="submit" name="button" value="<?php if($row['status'] == 'Inactive'){echo $mod_strings['LBL_REPAIR_SEED_USERS_ACTIVATE'];} else{echo $mod_strings['LBL_REPAIR_SEED_USERS_DECACTIVATE'];} ?>"></td> |
|
77 | 79 | </tr> |
78 | 80 | </table> |
79 | 81 | </form> |
80 | 82 | </p> |
81 | 83 | <?php |
82 | 84 | |
83 | - }else{ |
|
85 | + } else{ |
|
84 | 86 | echo 'No seed Users'; |
85 | 87 | } |
86 | -} |
|
87 | -else{ |
|
88 | +} else{ |
|
88 | 89 | sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
89 | 90 | } |
90 | 91 | ?> |
91 | 92 | \ No newline at end of file |
@@ -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,10 +96,11 @@ discard block |
||
94 | 96 | |
95 | 97 | if(!$send_usage_info){ |
96 | 98 | $info['latest_tracker_id'] = -1; |
97 | - }else{ |
|
99 | + } else{ |
|
98 | 100 | $id=$db->getOne("select id from tracker order by date_modified desc", false, 'fetching most recent tracker entry'); |
99 | - if ( $id !== false ) |
|
100 | - $info['latest_tracker_id'] = $id; |
|
101 | + if ( $id !== false ) { |
|
102 | + $info['latest_tracker_id'] = $id; |
|
103 | + } |
|
101 | 104 | } |
102 | 105 | |
103 | 106 | $info['db_type']=$sugar_config['dbconfig']['db_type']; |
@@ -105,7 +108,9 @@ discard block |
||
105 | 108 | } |
106 | 109 | if(file_exists('distro.php')){ |
107 | 110 | include('distro.php'); |
108 | - if(!empty($distro_name))$info['distro_name'] = $distro_name; |
|
111 | + if(!empty($distro_name)) { |
|
112 | + $info['distro_name'] = $distro_name; |
|
113 | + } |
|
109 | 114 | } |
110 | 115 | $info['os'] = php_uname('s'); |
111 | 116 | $info['os_version'] = php_uname('r'); |
@@ -143,14 +148,16 @@ discard block |
||
143 | 148 | |
144 | 149 | |
145 | 150 | $return_array=array(); |
146 | - if(!$from_install && empty($license))loadLicense(true); |
|
151 | + if(!$from_install && empty($license)) { |
|
152 | + loadLicense(true); |
|
153 | + } |
|
147 | 154 | |
148 | 155 | if(!$response_data){ |
149 | 156 | |
150 | 157 | if($from_install){ |
151 | 158 | $info = getBaseSystemInfo(false); |
152 | 159 | |
153 | - }else{ |
|
160 | + } else{ |
|
154 | 161 | $info = getSystemInfo($send_usage_info); |
155 | 162 | } |
156 | 163 | |
@@ -183,7 +190,7 @@ discard block |
||
183 | 190 | } |
184 | 191 | $encodedResult = $sclient->call('sugarHome', array('key'=>$key, 'data'=>$encoded)); |
185 | 192 | |
186 | - }else{ |
|
193 | + } else{ |
|
187 | 194 | $encodedResult = $response_data['data']; |
188 | 195 | $key = $response_data['key']; |
189 | 196 | |
@@ -197,7 +204,7 @@ discard block |
||
197 | 204 | $resultData = array(); |
198 | 205 | $resultData['validation'] = 'invalid validation key'; |
199 | 206 | } |
200 | - }else |
|
207 | + } else |
|
201 | 208 | { |
202 | 209 | $resultData = array(); |
203 | 210 | $resultData['versions'] = array(); |
@@ -209,22 +216,21 @@ discard block |
||
209 | 216 | if(!empty($resultData['msg'])){ |
210 | 217 | if(!empty($resultData['msg']['admin'])){ |
211 | 218 | $license->saveSetting('license', 'msg_admin', base64_encode($resultData['msg']['admin'])); |
212 | - }else{ |
|
219 | + } else{ |
|
213 | 220 | $license->saveSetting('license', 'msg_admin',''); |
214 | 221 | } |
215 | 222 | if(!empty($resultData['msg']['all'])){ |
216 | 223 | $license->saveSetting('license', 'msg_all', base64_encode($resultData['msg']['all'])); |
217 | - }else{ |
|
224 | + } else{ |
|
218 | 225 | $license->saveSetting('license', 'msg_all',''); |
219 | 226 | } |
220 | - }else{ |
|
227 | + } else{ |
|
221 | 228 | $license->saveSetting('license', 'msg_admin',''); |
222 | 229 | $license->saveSetting('license', 'msg_all',''); |
223 | 230 | } |
224 | 231 | $license->saveSetting('license', 'last_validation', 'success'); |
225 | 232 | unset($_SESSION['COULD_NOT_CONNECT']); |
226 | - } |
|
227 | - else |
|
233 | + } else |
|
228 | 234 | { |
229 | 235 | $resultData = array(); |
230 | 236 | $resultData['versions'] = array(); |
@@ -243,7 +249,7 @@ discard block |
||
243 | 249 | if(!empty($resultData['versions'])){ |
244 | 250 | |
245 | 251 | $license->saveSetting('license', 'latest_versions',base64_encode(serialize($resultData['versions']))); |
246 | - }else{ |
|
252 | + } else{ |
|
247 | 253 | $resultData['versions'] = array(); |
248 | 254 | $license->saveSetting('license', 'latest_versions','') ; |
249 | 255 | } |
@@ -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. |
@@ -42,7 +44,9 @@ discard block |
||
42 | 44 | global $current_user; |
43 | 45 | |
44 | 46 | |
45 | -if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
47 | +if (!is_admin($current_user)) { |
|
48 | + sugar_die("Unauthorized access to administration."); |
|
49 | +} |
|
46 | 50 | if (isset($GLOBALS['sugar_config']['hide_admin_diagnostics']) && $GLOBALS['sugar_config']['hide_admin_diagnostics']) |
47 | 51 | { |
48 | 52 | sugar_die("Unauthorized access to diagnostic tool."); |
@@ -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. |
@@ -157,7 +159,7 @@ discard block |
||
157 | 159 | echo "<b>{$mod_strings['LBL_EXPAND_DATABASE_FINISHED_ERROR']}</b><br>"; |
158 | 160 | } //if-else |
159 | 161 | } //if |
160 | -}else{ |
|
162 | +} else{ |
|
161 | 163 | sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
162 | 164 | } |
163 | 165 |
@@ -45,13 +45,16 @@ discard block |
||
45 | 45 | function upgrade_custom_relationships($modules = array()) |
46 | 46 | { |
47 | 47 | global $current_user, $moduleList; |
48 | - if (!is_admin($current_user)) sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
|
48 | + if (!is_admin($current_user)) { |
|
49 | + sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
|
50 | + } |
|
49 | 51 | |
50 | 52 | require_once("modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php"); |
51 | 53 | require_once("modules/ModuleBuilder/parsers/relationships/OneToManyRelationship.php"); |
52 | 54 | |
53 | - if (empty($modules)) |
|
54 | - $modules = $moduleList; |
|
55 | + if (empty($modules)) { |
|
56 | + $modules = $moduleList; |
|
57 | + } |
|
55 | 58 | |
56 | 59 | foreach($modules as $module) |
57 | 60 | { |
@@ -65,8 +68,9 @@ discard block |
||
65 | 68 | if ($def['lhs_module'] == $def['rhs_module'] && $def['is_custom'] && $def['relationship_type'] == "one-to-many") |
66 | 69 | { |
67 | 70 | $layout_defs = array(); |
68 | - if (!is_dir("custom/Extension/modules/$module/Ext/Layoutdefs") || !is_dir("custom/Extension/modules/$module/Ext/Vardefs")) |
|
69 | - continue; |
|
71 | + if (!is_dir("custom/Extension/modules/$module/Ext/Layoutdefs") || !is_dir("custom/Extension/modules/$module/Ext/Vardefs")) { |
|
72 | + continue; |
|
73 | + } |
|
70 | 74 | //Find the extension file containing the vardefs for this relationship |
71 | 75 | foreach(scandir("custom/Extension/modules/$module/Ext/Vardefs") as $file) |
72 | 76 | { |
@@ -121,5 +125,6 @@ discard block |
||
121 | 125 | } |
122 | 126 | } |
123 | 127 | |
124 | -if (isset($_REQUEST['execute']) && $_REQUEST['execute']) |
|
125 | - upgrade_custom_relationships(); |
|
126 | 128 | \ No newline at end of file |
129 | +if (isset($_REQUEST['execute']) && $_REQUEST['execute']) { |
|
130 | + upgrade_custom_relationships(); |
|
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. |
@@ -60,8 +62,7 @@ discard block |
||
60 | 62 | if(empty($_REQUEST['file']) || empty($_REQUEST['guid'])) |
61 | 63 | { |
62 | 64 | echo $mod_strings['LBL_DIAGNOSTIC_DELETE_ERROR']; |
63 | -} |
|
64 | -else |
|
65 | +} else |
|
65 | 66 | { |
66 | 67 | // Make sure the guid and file are valid file names for security purposes |
67 | 68 | clean_string($_REQUEST['guid'], "ALPHANUM"); |
@@ -79,10 +80,10 @@ discard block |
||
79 | 80 | unlink($cachedfile); |
80 | 81 | rmdir(dirname($cachedfile)); |
81 | 82 | echo $mod_strings['LBL_DIAGNOSTIC_DELETED']."<br><br>"; |
83 | + } else { |
|
84 | + echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP']; |
|
85 | + } |
|
82 | 86 | } |
83 | - else |
|
84 | - echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP']; |
|
85 | -} |
|
86 | 87 | |
87 | 88 | print "<a href=\"index.php?module=Administration&action=index\">" . $mod_strings['LBL_DIAGNOSTIC_DELETE_RETURN'] . "</a><br>"; |
88 | 89 |
@@ -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. |
@@ -67,11 +68,13 @@ discard block |
||
67 | 68 | if ( $focus instanceOf SugarBean ) { |
68 | 69 | $table_name = $focus->table_name ; |
69 | 70 | $empty = array() ; |
70 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
71 | - echo $mod_strings [ 'LBL_REBUILD_REL_PROC_META' ] . $focus->table_name . "..." ; |
|
71 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
72 | + echo $mod_strings [ 'LBL_REBUILD_REL_PROC_META' ] . $focus->table_name . "..." ; |
|
73 | + } |
|
72 | 74 | SugarBean::createRelationshipMeta ( $focus->getObjectName (), $db, $table_name, $empty, $focus->module_dir ) ; |
73 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
74 | - echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
75 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
76 | + echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
77 | + } |
|
75 | 78 | } |
76 | 79 | } |
77 | 80 | } |
@@ -80,7 +83,9 @@ discard block |
||
80 | 83 | foreach ( $GLOBALS['beanFiles'] as $bean => $file ) |
81 | 84 | { |
82 | 85 | //skip this file if it does not exist |
83 | - if(!file_exists($file)) continue; |
|
86 | + if(!file_exists($file)) { |
|
87 | + continue; |
|
88 | + } |
|
84 | 89 | |
85 | 90 | if (! class_exists ( $bean )) |
86 | 91 | { |
@@ -90,11 +95,13 @@ discard block |
||
90 | 95 | if ( $focus instanceOf SugarBean ) { |
91 | 96 | $table_name = $focus->table_name ; |
92 | 97 | $empty = array() ; |
93 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
94 | - echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $focus->table_name . "..." ; |
|
98 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
99 | + echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $focus->table_name . "..." ; |
|
100 | + } |
|
95 | 101 | SugarBean::createRelationshipMeta ( $focus->getObjectName (), $db, $table_name, $empty, $focus->module_dir, true ) ; |
96 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
97 | - echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
102 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
103 | + echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
104 | + } |
|
98 | 105 | } |
99 | 106 | } |
100 | 107 | |
@@ -111,24 +118,28 @@ discard block |
||
111 | 118 | { |
112 | 119 | $table = isset($rel_data [ 'table' ]) ? $rel_data [ 'table' ] : "" ; |
113 | 120 | |
114 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
115 | - echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $rel_name . "..." ; |
|
121 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
122 | + echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $rel_name . "..." ; |
|
123 | + } |
|
116 | 124 | SugarBean::createRelationshipMeta ( $rel_name, $db, $table, $rel_dictionary, '' ) ; |
117 | - if (empty ( $_REQUEST [ 'silent' ] )) |
|
118 | - echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
125 | + if (empty ( $_REQUEST [ 'silent' ] )) { |
|
126 | + echo $mod_strings [ 'LBL_DONE' ] . '<br>' ; |
|
127 | + } |
|
119 | 128 | } |
120 | 129 | |
121 | 130 | //clean relationship cache..will be rebuilt upon first access. |
122 | -if (empty ( $_REQUEST [ 'silent' ] )) |
|
131 | +if (empty ( $_REQUEST [ 'silent' ] )) { |
|
123 | 132 | echo $mod_strings [ 'LBL_REBUILD_REL_DEL_CACHE' ] ; |
133 | +} |
|
124 | 134 | Relationship::delete_cache () ; |
125 | 135 | |
126 | 136 | ////////////////////////////////////////////////////////////////////////////// |
127 | 137 | // Remove the "Rebuild Relationships" red text message on admin logins |
128 | 138 | |
129 | 139 | |
130 | -if (empty ( $_REQUEST [ 'silent' ] )) |
|
140 | +if (empty ( $_REQUEST [ 'silent' ] )) { |
|
131 | 141 | echo $mod_strings [ 'LBL_REBUILD_REL_UPD_WARNING' ] ; |
142 | +} |
|
132 | 143 | |
133 | 144 | // clear the database row if it exists (just to be sure) |
134 | 145 | $query = "DELETE FROM versions WHERE name='Rebuild Relationships'" ; |
@@ -153,6 +164,7 @@ discard block |
||
153 | 164 | unset ( $_SESSION [ 'rebuild_relationships' ] ) ; |
154 | 165 | } |
155 | 166 | |
156 | -if (empty ( $_REQUEST [ 'silent' ] )) |
|
167 | +if (empty ( $_REQUEST [ 'silent' ] )) { |
|
157 | 168 | echo $mod_strings [ 'LBL_DONE' ] ; |
169 | +} |
|
158 | 170 | ?> |