Skip to content

Commit

Permalink
no_spaces_after_function_name + no_spaces_inside_parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon-Brown committed Jan 25, 2019
1 parent 501ac66 commit 2d243d3
Show file tree
Hide file tree
Showing 1,096 changed files with 11,665 additions and 11,666 deletions.
244 changes: 122 additions & 122 deletions ModuleInstall/ModuleInstaller.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ModuleInstall/ModuleScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ public function sugarFileExists($path)
{
static $md5 = array();
if (empty($md5) && file_exists('files.md5')) {
include ('files.md5');
include('files.md5');
$md5 = isset($md5_string) ? $md5_string : null;
}
if ($path[0] !== '.' || $path[1] !== '/') {
Expand Down Expand Up @@ -927,6 +927,6 @@ public function checkConfig($file)
*/
function MSLoadManifest($manifest_file)
{
include( $manifest_file );
include($manifest_file);
return array($manifest, $installdefs);
}
138 changes: 69 additions & 69 deletions ModuleInstall/PackageManager/PackageManager.php

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ModuleInstall/PackageManager/PackageManagerDisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ function buildInstallGrid($view)
$description = empty($manifest['description']) ? $mod_strings['LBL_UW_NONE'] : $manifest['description'];
if (($upgrades_installed==0 || $uh->UninstallAvailable($installeds, $installed))
&& is_file($filename) && !empty($manifest['is_uninstallable'])) {
$link = urlencode( $filename );
$link = urlencode($filename);
} else {
$link = 'false';
}
Expand All @@ -609,16 +609,16 @@ function buildInstallGrid($view)
continue;
}

$target_manifest = remove_file_extension( $filename ) . "-manifest.php";
require_once( "$target_manifest" );
$target_manifest = remove_file_extension($filename) . "-manifest.php";
require_once("$target_manifest");

if (isset($manifest['icon']) && $manifest['icon'] != "") {
$manifest_copy_files_to_dir = isset($manifest['copy_files']['to_dir']) ? clean_path($manifest['copy_files']['to_dir']) : "";
$manifest_copy_files_from_dir = isset($manifest['copy_files']['from_dir']) ? clean_path($manifest['copy_files']['from_dir']) : "";
$manifest_icon = clean_path($manifest['icon']);
$icon = "<img src=\"" . $manifest_copy_files_to_dir . ($manifest_copy_files_from_dir != "" ? substr($manifest_icon, strlen($manifest_copy_files_from_dir)+1) : $manifest_icon ) . "\">";
$icon = "<img src=\"" . $manifest_copy_files_to_dir . ($manifest_copy_files_from_dir != "" ? substr($manifest_icon, strlen($manifest_copy_files_from_dir)+1) : $manifest_icon) . "\">";
} else {
$icon = getImageForType( $manifest['type'] );
$icon = getImageForType($manifest['type']);
}
$installed_objects[] = array('icon' => $icon, 'name' => $name, 'type' => $type, 'version' => $version, 'date_entered' => $date_entered, 'description' => $description, 'file' => $link);
//print( "<form action=\"" . $form_action . "_prepare\" method=\"post\">\n" );
Expand Down
2 changes: 1 addition & 1 deletion TreeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
$modulename=$params1['TREE']['module']; ///module is a required parameter for the tree.
require('include/modules.php');
if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename]) ) {
if (!empty($modulename) && !empty($func_name) && isset($beanList[$modulename])) {
require_once('modules/'.$modulename.'/TreeData.php');
$TreeDataFunctions = array(
'ProductTemplates' => array('get_node_data'=>'','get_categories_and_products'=>''),
Expand Down
48 changes: 24 additions & 24 deletions data/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function getJoin($params, $return_array =false)
$key = $this->_relationship->lhs_key;
$table = $this->_relationship->lhs_table;

if ( ! empty($params['join_table_alias'])) {
if (! empty($params['join_table_alias'])) {
$table_with_alias = $table. " ".$params['join_table_alias'];
$table = $params['join_table_alias'];
}
Expand All @@ -301,16 +301,16 @@ function getJoin($params, $return_array =false)
$key = $this->_relationship->rhs_key;
$other_table = (empty($params['left_join_table_alias']) ? $this->_relationship->lhs_table : $params['left_join_table_alias']);
$other_key = $this->_relationship->lhs_key;
if ( ! empty($params['join_table_alias'])) {
if (! empty($params['join_table_alias'])) {
$table_with_alias = $table. " ".$params['join_table_alias'];
$table = $params['join_table_alias'];
}

$join = $join_type . ' '.$table_with_alias . " ON\n".$table.'.'.$key.'= '.$other_table.'.'.$other_key ." AND ". $table.".deleted=0\n";
}

if ($this->_relationship->relationship_type=='many-to-many' ) {
if ( ! empty($params['join_table_alias'])) {
if ($this->_relationship->relationship_type=='many-to-many') {
if (! empty($params['join_table_alias'])) {
$table_with_alias = $this->_relationship->join_table. " ".$params['join_table_alias'];
$table = $params['join_table_alias'];
$rel_table_with_alias =
Expand All @@ -319,7 +319,7 @@ function getJoin($params, $return_array =false)
$rel_table = $params['join_table_link_alias'];
}

if ( $bean_is_lhs ) {
if ($bean_is_lhs) {
$other_table = (empty($params['left_join_table_alias']) ? $this->_relationship->lhs_table : $params['left_join_table_alias']);
$join .= $join_type . ' '.$rel_table_with_alias.' ON '.$other_table.".".$this->_relationship->lhs_key."=".$rel_table.".".$this->_relationship->join_key_lhs." AND ".$rel_table.".deleted=0\n";
} else {
Expand All @@ -336,16 +336,16 @@ function getJoin($params, $return_array =false)
}
$join.= "\n";
}
if ( ! empty($params['join_table_alias'])) {
if ( $bean_is_lhs ) {
if (! empty($params['join_table_alias'])) {
if ($bean_is_lhs) {
$table_with_alias = $this->_relationship->rhs_table. " ".$params['join_table_alias'];
} else {
$table_with_alias = $this->_relationship->lhs_table. " ".$params['join_table_alias'];
}
$table = $params['join_table_alias'];
}

if ( $bean_is_lhs ) {
if ($bean_is_lhs) {
if ($this->_rhs_key_override) {
$join .= $join_type . ' '.$table_with_alias.' ON '.$table.".".$this->_relationship->rhs_key."=".$rel_table.".".$this->_relationship->join_key_rhs." AND ".$table.".deleted=0";
} else {
Expand All @@ -361,7 +361,7 @@ function getJoin($params, $return_array =false)
$ret_arr = array();
$ret_arr['join'] = $join;
$ret_arr['type'] = $this->_relationship->relationship_type;
if ( $bean_is_lhs ) {
if ($bean_is_lhs) {
$ret_arr['rel_key'] = $this->_relationship->join_key_rhs;
} else {
$ret_arr['rel_key'] = $this->_relationship->join_key_lhs;
Expand Down Expand Up @@ -462,7 +462,7 @@ function getQuery($return_as_array=false, $sort_array = array(), $deleted=0, $op

//add deleted clause - but not if we're dealing with a Custom table which will lack the 'deleted' field
if (substr_count($this->_relationship->rhs_table, '_cstm') == 0) {
$where.=$this->_add_deleted_clause($deleted, 'AND', $this->_relationship->rhs_table );
$where.=$this->_add_deleted_clause($deleted, 'AND', $this->_relationship->rhs_table);
}

if ($optional_where!="") {
Expand Down Expand Up @@ -513,7 +513,7 @@ function getQuery($return_as_array=false, $sort_array = array(), $deleted=0, $op
}
}

if ($this->_relationship->relationship_type=='many-to-many' ) {
if ($this->_relationship->relationship_type=='many-to-many') {
$GLOBALS['log']->debug("Processing many-to-many.");

$swap = !$for_subpanels && $this->_swap_sides;
Expand Down Expand Up @@ -699,7 +699,7 @@ function add($rel_keys, $additional_values=array())
foreach ($keys as $key) {

//fetch the related record using the key and update.
if ($this->_relationship->relationship_type=='one-to-one' || $this->_relationship->relationship_type == 'one-to-many' ) {
if ($this->_relationship->relationship_type=='one-to-one' || $this->_relationship->relationship_type == 'one-to-many') {
$this->_add_one_to_many_table_based($key, $bean_is_lhs);
}

Expand All @@ -710,7 +710,7 @@ function add($rel_keys, $additional_values=array())
}

//insert record in the link table.
if ($this->_relationship->relationship_type=='many-to-many' ) {
if ($this->_relationship->relationship_type=='many-to-many') {
//replace existing relationships for one-to-one
if (!empty($GLOBALS['dictionary'][$this->_relationship_name]['true_relationship_type']) &&
($GLOBALS['dictionary'][$this->_relationship_name]['true_relationship_type'] == 'one-to-one')) {
Expand Down Expand Up @@ -746,7 +746,7 @@ function add($rel_keys, $additional_values=array())
if ($this->_is_self_relationship() && !empty($GLOBALS['dictionary'][$this->_relationship_name]) &&
!empty($GLOBALS['dictionary'][$this->_relationship_name]['true_relationship_type']) &&
$GLOBALS['dictionary'][$this->_relationship_name]['true_relationship_type'] == 'many-to-many' ||
(!empty($this->_relationship->reverse) && $this->_relationship->reverse == true )) {
(!empty($this->_relationship->reverse) && $this->_relationship->reverse == true)) {
//swap key values;
$temp=$additional_values[$this->_relationship->join_key_lhs];
$additional_values[$this->_relationship->join_key_lhs]=$additional_values[$this->_relationship->join_key_rhs];
Expand Down Expand Up @@ -776,9 +776,9 @@ function add($rel_keys, $additional_values=array())
$this->_bean->call_custom_logic('after_relationship_add', $custom_logic_arguments);
/**** NOW WE HAVE TO CALL THE LOGIC HOOK THE OTHER WAY SINCE IT TAKES TWO FOR A RELATIONSHIP****/
global $beanList;
if ( isset($beanList[$custom_logic_arguments['related_module']]) ) {
if (isset($beanList[$custom_logic_arguments['related_module']])) {
$class = $beanList[$custom_logic_arguments['related_module']];
if ( !empty($class) ) {
if (!empty($class)) {
$rbean = new $class();
$rbean->id = $key;
$rbean->call_custom_logic('after_relationship_add', $custom_reverse_arguments);
Expand Down Expand Up @@ -881,7 +881,7 @@ function delete($id, $related_id='')
$GLOBALS['log']->debug("Invalid relationship parameters. Exiting..");
return null;
}
if ($_relationship->relationship_type=='one-to-many' or $_relationship->relationship_type=='one-to-one' ) {
if ($_relationship->relationship_type=='one-to-many' or $_relationship->relationship_type=='one-to-one') {
if ($bean_is_lhs) {
//update rhs_table set rhs_key = null, relation_column_name = null where rhs_key= this_bean_id
$query='UPDATE '.$_relationship->rhs_table.' SET '.$_relationship->rhs_key."=NULL, date_modified='".$GLOBALS['timedate']->nowDb()."'";
Expand Down Expand Up @@ -913,7 +913,7 @@ function delete($id, $related_id='')
//to clear the relationship using the bean.
}

if ($_relationship->relationship_type=='many-to-many' ) {
if ($_relationship->relationship_type=='many-to-many') {
$use_bean_is_lhs = isset($_REQUEST['ajaxSubpanel']) || $this->_swap_sides !== true;
$query='UPDATE '.$_relationship->join_table." SET deleted=1, date_modified='".$GLOBALS['timedate']->nowDb()."'";
if ($bean_is_lhs && $use_bean_is_lhs) {
Expand Down Expand Up @@ -978,9 +978,9 @@ function delete($id, $related_id='')
$this->_bean->call_custom_logic('after_relationship_delete', $custom_logic_arguments);
//NOW THE REVERSE WAY SINCE A RELATIONSHIP TAKES TWO
global $beanList;
if ( isset($beanList[$custom_logic_arguments['related_module']]) ) {
if (isset($beanList[$custom_logic_arguments['related_module']])) {
$class = $beanList[$custom_logic_arguments['related_module']];
if ( !empty($class) ) {
if (!empty($class)) {
$rbean = new $class();
$rbean->retrieve(empty($related_id) ? $id : $related_id);
$rbean->call_custom_logic('after_relationship_delete', $custom_reverse_arguments);
Expand Down Expand Up @@ -1038,7 +1038,7 @@ function _get_alternate_key_fields($table_name)
$indices=Link::_get_link_table_definition($table_name, 'indices');
if (!empty($indices)) {
foreach ($indices as $index) {
if ( isset($index['type']) && $index['type'] == 'alternate_key' ) {
if (isset($index['type']) && $index['type'] == 'alternate_key') {
return $index['fields'];
}
}
Expand Down Expand Up @@ -1073,11 +1073,11 @@ function _get_link_table_definition($table_name, $def_name)
return ($dictionary[$this->_relationship_name][$def_name]);
}
// custom metadata is found in custom/metadata (naturally) and the naming follows the convention $relationship_name_c, and $relationship_name = $table_name$locations = array( 'metadata/' , 'custom/metadata/' ) ;
$relationshipName = preg_replace( '/_c$/', '', $table_name ) ;
$relationshipName = preg_replace('/_c$/', '', $table_name) ;

$locations = array ( 'metadata/' , 'custom/metadata/' ) ;
$locations = array( 'metadata/' , 'custom/metadata/' ) ;

foreach ( $locations as $basepath ) {
foreach ($locations as $basepath) {
$path = $basepath . $relationshipName . 'MetaData.php' ;

if (file_exists($path)) {
Expand Down
14 changes: 7 additions & 7 deletions data/Relationships/M2MRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public function __construct($def)
*/
public function getLinkedDefForModuleByRelationship($module)
{
$results = VardefManager::getLinkFieldForRelationship( $module, BeanFactory::getObjectName($module), $this->name);
$results = VardefManager::getLinkFieldForRelationship($module, BeanFactory::getObjectName($module), $this->name);
//Only a single link was found
if ( isset($results['name']) ) {
if (isset($results['name'])) {
return $results;
}
//Multiple links with same relationship name
else {
if ( is_array($results) ) {
if (is_array($results)) {
$GLOBALS['log']->error("Warning: Multiple links found for relationship {$this->name} within module {$module}");
return $this->getMostAppropriateLinkedDefinition($results);
} else {
Expand All @@ -107,13 +107,13 @@ protected function getMostAppropriateLinkedDefinition($links)
{
//First priority is to find a link name that matches the relationship name
foreach ($links as $link) {
if ( isset($link['name']) && $link['name'] == $this->name ) {
if (isset($link['name']) && $link['name'] == $this->name) {
return $link;
}
}
//Next would be a relationship that has a side defined
foreach ($links as $link) {
if ( isset($link['id_name'])) {
if (isset($link['id_name'])) {
return $link;
}
}
Expand Down Expand Up @@ -205,7 +205,7 @@ protected function getRowToInsert($lhs, $rhs, $additionalFields = array())
);


if (!empty($this->def['relationship_role_column']) && !empty($this->def['relationship_role_column_value']) && !$this->ignore_role_filter ) {
if (!empty($this->def['relationship_role_column']) && !empty($this->def['relationship_role_column_value']) && !$this->ignore_role_filter) {
$row[$this->relationship_role_column] = $this->relationship_role_column_value;
}

Expand Down Expand Up @@ -511,7 +511,7 @@ public function getJoin($link, $params = array(), $return_array = false)
$joinTableWithAlias = $joinTable . " ". $params['join_table_link_alias'];
$joinTable = $params['join_table_link_alias'];
}
if ( ! empty($params['join_table_alias'])) {
if (! empty($params['join_table_alias'])) {
$targetTableWithAlias = $targetTable . " ". $params['join_table_alias'];
$targetTable = $params['join_table_alias'];
}
Expand Down
2 changes: 1 addition & 1 deletion data/Relationships/One2MBeanRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public function getJoin($link, $params = array(), $return_array = false)
$join = '';

//Set up any table aliases required
if ( ! empty($params['join_table_alias'])) {
if (! empty($params['join_table_alias'])) {
$targetTableWithAlias = $targetTable. " ".$params['join_table_alias'];
$targetTable = $params['join_table_alias'];
}
Expand Down
2 changes: 1 addition & 1 deletion data/Relationships/One2OneBeanRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function getJoin($link, $params = array(), $return_array = false)
$join = '';

//Set up any table aliases required
if ( ! empty($params['join_table_alias'])) {
if (! empty($params['join_table_alias'])) {
$targetTableWithAlias = $targetTable . " ". $params['join_table_alias'];
$targetTable = $params['join_table_alias'];
}
Expand Down
2 changes: 1 addition & 1 deletion download.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
} else {
header('Content-type: ' . $mime_type);
if ($_REQUEST['preview'] === "yes") {
header( "Content-Disposition: inline; filename=\"".$name."\";");
header("Content-Disposition: inline; filename=\"".$name."\";");
} else {
header("Content-Disposition: attachment; filename=\"" . $name . "\";");
}
Expand Down
6 changes: 3 additions & 3 deletions export.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
header("Content-type: application/octet-stream; charset=".$GLOBALS['locale']->getExportCharset());
header("Content-Disposition: attachment; filename={$filename}.csv");
header("Content-transfer-encoding: binary");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . TimeDate::httpTime() );
header("Cache-Control: post-check=0, pre-check=0", false );
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . TimeDate::httpTime());
header("Cache-Control: post-check=0, pre-check=0", false);
if (!empty($sugar_config['export_excel_compatible'])) {
$transContent=chr(255) . chr(254) . mb_convert_encoding($transContent, 'UTF-16LE', 'UTF-8');
}
Expand Down
Loading

0 comments on commit 2d243d3

Please sign in to comment.