Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
modules/AOR_Reports/views/view.edit.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
         //readfile('modules/AOR_Reports/css/edit.css');
39 39
         readfile('modules/AOR_Reports/js/jqtree/jqtree.css');
40 40
         echo "</style>";
41
-        if (!is_file('cache/jsLanguage/AOR_Fields/' . $GLOBALS['current_language'] . '.js')) {
41
+        if (!is_file('cache/jsLanguage/AOR_Fields/'.$GLOBALS['current_language'].'.js')) {
42 42
             require_once ('include/language/jsLanguage.php');
43 43
             jsLanguage::createModuleStringsCache('AOR_Fields', $GLOBALS['current_language']);
44 44
         }
45
-        echo '<script src="cache/jsLanguage/AOR_Fields/'. $GLOBALS['current_language'] . '.js"></script>';
45
+        echo '<script src="cache/jsLanguage/AOR_Fields/'.$GLOBALS['current_language'].'.js"></script>';
46 46
 
47
-        if (!is_file('cache/jsLanguage/AOR_Conditions/' . $GLOBALS['current_language'] . '.js')) {
47
+        if (!is_file('cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js')) {
48 48
             require_once ('include/language/jsLanguage.php');
49 49
             jsLanguage::createModuleStringsCache('AOR_Conditions', $GLOBALS['current_language']);
50 50
         }
51
-        echo '<script src="cache/jsLanguage/AOR_Conditions/'. $GLOBALS['current_language'] . '.js"></script>';
51
+        echo '<script src="cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js"></script>';
52 52
         echo '<script src="include/javascript/yui3/build/yui/yui-min.js"></script>';
53 53
 
54 54
         echo "<script>";
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
         parent::preDisplay();
70 70
     }
71 71
 
72
-    private function getConditionLines(){
73
-        if(!$this->bean->id){
72
+    private function getConditionLines() {
73
+        if (!$this->bean->id) {
74 74
             return array();
75 75
         }
76 76
         $sql = "SELECT id FROM aor_conditions WHERE aor_report_id = '".$this->bean->id."' AND deleted = 0 ORDER BY condition_order ASC";
@@ -79,20 +79,20 @@  discard block
 block discarded – undo
79 79
         while ($row = $this->bean->db->fetchByAssoc($result)) {
80 80
             $condition_name = new AOR_Condition();
81 81
             $condition_name->retrieve($row['id']);
82
-            if(!$condition_name->parenthesis) {
82
+            if (!$condition_name->parenthesis) {
83 83
                 $condition_name->module_path = implode(":", unserialize(base64_decode($condition_name->module_path)));
84 84
             }
85
-            if($condition_name->value_type == 'Date'){
85
+            if ($condition_name->value_type == 'Date') {
86 86
                 $condition_name->value = unserialize(base64_decode($condition_name->value));
87 87
             }
88 88
             $condition_item = $condition_name->toArray();
89 89
 
90
-            if(!$condition_name->parenthesis) {
90
+            if (!$condition_name->parenthesis) {
91 91
                 $display = getDisplayForField($condition_name->module_path, $condition_name->field, $this->bean->report_module);
92 92
                 $condition_item['module_path_display'] = $display['module'];
93 93
                 $condition_item['field_label'] = $display['field'];
94 94
             }
95
-            if(isset($conditions[$condition_item['condition_order']])) {
95
+            if (isset($conditions[$condition_item['condition_order']])) {
96 96
                 $conditions[] = $condition_item;
97 97
             }
98 98
             else {
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
         return $conditions;
103 103
     }
104 104
 
105
-    private function getFieldLines(){
106
-        if(!$this->bean->id){
105
+    private function getFieldLines() {
106
+        if (!$this->bean->id) {
107 107
             return array();
108 108
         }
109 109
         $sql = "SELECT id FROM aor_fields WHERE aor_report_id = '".$this->bean->id."' AND deleted = 0 ORDER BY field_order ASC";
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
         while ($row = $this->bean->db->fetchByAssoc($result)) {
114 114
             $field_name = new AOR_Field();
115 115
             $field_name->retrieve($row['id']);
116
-            $field_name->module_path = implode(":",unserialize(base64_decode($field_name->module_path)));
116
+            $field_name->module_path = implode(":", unserialize(base64_decode($field_name->module_path)));
117 117
             $arr = $field_name->toArray();
118 118
 
119
-            $arr['field_type'] = $this->getDisplayForField($field_name->module_path, $field_name->field  , $this->bean->report_module);
119
+            $arr['field_type'] = $this->getDisplayForField($field_name->module_path, $field_name->field, $this->bean->report_module);
120 120
 
121 121
             $display = getDisplayForField($field_name->module_path, $field_name->field, $this->bean->report_module);
122 122
 
@@ -127,42 +127,42 @@  discard block
 block discarded – undo
127 127
         return $fields;
128 128
     }
129 129
 
130
-    private function getChartLines(){
130
+    private function getChartLines() {
131 131
         $charts = array();
132
-        if(!$this->bean->id){
132
+        if (!$this->bean->id) {
133 133
             return array();
134 134
         }
135
-        foreach($this->bean->get_linked_beans('aor_charts','AOR_Charts') as $chart){
135
+        foreach ($this->bean->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) {
136 136
             $charts[] = $chart->toArray();
137 137
         }
138 138
         return $charts;
139 139
     }
140 140
 
141
-    public function getDisplayForField($modulePath, $field, $reportModule){
141
+    public function getDisplayForField($modulePath, $field, $reportModule) {
142 142
         $modulePathDisplay = array();
143 143
         $currentBean = BeanFactory::getBean($reportModule);
144 144
         $modulePathDisplay[] = $currentBean->module_name;
145
-        if(is_array($modulePath)) {
145
+        if (is_array($modulePath)) {
146 146
             $split = $modulePath;
147
-        }else{
147
+        } else {
148 148
             $split = explode(':', $modulePath);
149 149
         }
150 150
         if ($split && $split[0] == $currentBean->module_dir) {
151 151
             array_shift($split);
152 152
         }
153
-        foreach($split as $relName){
154
-            if(empty($relName)){
153
+        foreach ($split as $relName) {
154
+            if (empty($relName)) {
155 155
                 continue;
156 156
             }
157
-            if(!empty($currentBean->field_name_map[$relName]['vname'])){
158
-                $moduleLabel = trim(translate($currentBean->field_name_map[$relName]['vname'],$currentBean->module_dir),':');
157
+            if (!empty($currentBean->field_name_map[$relName]['vname'])) {
158
+                $moduleLabel = trim(translate($currentBean->field_name_map[$relName]['vname'], $currentBean->module_dir), ':');
159 159
             }
160 160
             $thisModule = getRelatedModule($currentBean->module_dir, $relName);
161 161
             $currentBean = BeanFactory::getBean($thisModule);
162 162
 
163
-            if(!empty($moduleLabel)){
163
+            if (!empty($moduleLabel)) {
164 164
                 $modulePathDisplay[] = $moduleLabel;
165
-            }else {
165
+            } else {
166 166
                 $modulePathDisplay[] = $currentBean->module_name;
167 167
             }
168 168
         }
Please login to merge, or discard this patch.
modules/AOR_Reports/views/view.detail.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,31 +29,31 @@  discard block
 block discarded – undo
29 29
     public function __construct() {
30 30
         parent::ViewDetail();
31 31
     }
32
-    private function getReportParameters(){
33
-        if(!$this->bean->id){
32
+    private function getReportParameters() {
33
+        if (!$this->bean->id) {
34 34
             return array();
35 35
         }
36
-        $conditions = $this->bean->get_linked_beans('aor_conditions','AOR_Conditions', 'condition_order');
36
+        $conditions = $this->bean->get_linked_beans('aor_conditions', 'AOR_Conditions', 'condition_order');
37 37
         $parameters = array();
38
-        foreach($conditions as $condition){
39
-            if(!$condition->parameter){
38
+        foreach ($conditions as $condition) {
39
+            if (!$condition->parameter) {
40 40
                 continue;
41 41
             }
42
-            $condition->module_path = implode(":",unserialize(base64_decode($condition->module_path)));
43
-            if($condition->value_type == 'Date'){
42
+            $condition->module_path = implode(":", unserialize(base64_decode($condition->module_path)));
43
+            if ($condition->value_type == 'Date') {
44 44
                 $condition->value = unserialize(base64_decode($condition->value));
45 45
             }
46 46
             $condition_item = $condition->toArray();
47 47
             $display = getDisplayForField($condition->module_path, $condition->field, $this->bean->report_module);
48 48
             $condition_item['module_path_display'] = $display['module'];
49 49
             $condition_item['field_label'] = $display['field'];
50
-            if(!empty($this->bean->user_parameters[$condition->id])){
50
+            if (!empty($this->bean->user_parameters[$condition->id])) {
51 51
                 $param = $this->bean->user_parameters[$condition->id];
52 52
                 $condition_item['operator'] = $param['operator'];
53 53
                 $condition_item['value_type'] = $param['type'];
54 54
                 $condition_item['value'] = $param['value'];
55 55
             }
56
-            if(isset($parameters[$condition_item['condition_order']])) {
56
+            if (isset($parameters[$condition_item['condition_order']])) {
57 57
                 $parameters[] = $condition_item;
58 58
             }
59 59
             else {
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
     public function preDisplay() {
67 67
         global $app_list_strings;
68 68
         parent::preDisplay();
69
-        $this->ss->assign('report_module',$this->bean->report_module);
69
+        $this->ss->assign('report_module', $this->bean->report_module);
70 70
 
71 71
 
72 72
 
73 73
         $this->bean->user_parameters = requestToUserParameters();
74 74
 
75 75
         //$reportHTML = $this->bean->build_group_report(0,true);
76
-        $reportHTML = $this->bean->buildMultiGroupReport(0,true);
76
+        $reportHTML = $this->bean->buildMultiGroupReport(0, true);
77 77
 
78 78
         $chartsHTML = $this->bean->build_report_chart(null, AOR_Report::CHART_TYPE_RGRAPH);
79 79
 
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
         $this->ss->assign('report_content', $reportHTML);
85 85
 
86 86
         echo "<input type='hidden' name='report_module' id='report_module' value='{$this->bean->report_module}'>";
87
-        if (!is_file('cache/jsLanguage/AOR_Conditions/' . $GLOBALS['current_language'] . '.js')) {
87
+        if (!is_file('cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js')) {
88 88
             require_once ('include/language/jsLanguage.php');
89 89
             jsLanguage::createModuleStringsCache('AOR_Conditions', $GLOBALS['current_language']);
90 90
         }
91
-        echo '<script src="cache/jsLanguage/AOR_Conditions/'. $GLOBALS['current_language'] . '.js"></script>';
91
+        echo '<script src="cache/jsLanguage/AOR_Conditions/'.$GLOBALS['current_language'].'.js"></script>';
92 92
 
93 93
         $params = $this->getReportParameters();
94 94
         echo "<script>var reportParameters = ".json_encode($params).";</script>";
Please login to merge, or discard this patch.
modules/DynamicFields/UpgradeFields.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -41,45 +41,45 @@  discard block
 block discarded – undo
41 41
 require_once('modules/DynamicFields/FieldCases.php');
42 42
 require_once('modules/DynamicFields/DynamicField.php');
43 43
  global $db;
44
- if(!isset($db)){
44
+ if (!isset($db)) {
45 45
  	$db = DBManagerFactory::getInstance();
46 46
  }
47
- $result = $db->query( 'SELECT * FROM fields_meta_data WHERE deleted = 0 ORDER BY custom_module');
47
+ $result = $db->query('SELECT * FROM fields_meta_data WHERE deleted = 0 ORDER BY custom_module');
48 48
  $modules = array();
49 49
  /*
50 50
   * get the real field_meta_data
51 51
   */
52
- while($row = $db->fetchByAssoc($result)){
52
+ while ($row = $db->fetchByAssoc($result)) {
53 53
  	$the_modules = $row['custom_module'];
54
- 	if(!isset($modules[$the_modules])){
54
+ 	if (!isset($modules[$the_modules])) {
55 55
  		$modules[$the_modules] = array();	
56 56
  	}
57 57
  	$modules[$the_modules][$row['name']] = $row['name'];
58 58
  }
59 59
  	
60 60
  $simulate = false;
61
- if(!isset($_REQUEST['run'])){
61
+ if (!isset($_REQUEST['run'])) {
62 62
  	$simulate = true;
63 63
  	echo "SIMULATION MODE - NO CHANGES WILL BE MADE EXCEPT CLEARING CACHE";
64 64
  }	
65 65
 
66
- foreach($modules as $the_module=>$fields){
67
-         if(isset($beanList[$the_module]))
66
+ foreach ($modules as $the_module=>$fields) {
67
+         if (isset($beanList[$the_module]))
68 68
          {
69 69
  	$class_name = $beanList[$the_module];
70 70
  	echo "<br><br>Scanning $the_module <br>";
71 71
 		
72 72
 		require_once($beanFiles[$class_name]);
73 73
 		$mod = new $class_name();
74
-		if(!$db->tableExists($mod->table_name . "_cstm")){
74
+		if (!$db->tableExists($mod->table_name."_cstm")) {
75 75
 			$mod->custom_fields = new DynamicField();
76 76
 			$mod->custom_fields->setup($mod);
77 77
 		$mod->custom_fields->createCustomTable();
78 78
 		}
79 79
 
80
-		$result = $db->query("DESCRIBE $mod->table_name" . "_cstm");
80
+		$result = $db->query("DESCRIBE $mod->table_name"."_cstm");
81 81
 		
82
-		while($row = $db->fetchByAssoc($result)){
82
+		while ($row = $db->fetchByAssoc($result)) {
83 83
 			
84 84
 			
85 85
 			$col = $row['Field'];
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
 			$the_field = get_widget($fieldDef['type']);
89 89
 			$the_field->set($fieldDef);
90 90
 				
91
-				if(!isset($fields[$col]) && $col != 'id_c'){
92
-					if(!$simulate)$db->query("ALTER TABLE $mod->table_name" . "_cstm DROP COLUMN $col");
91
+				if (!isset($fields[$col]) && $col != 'id_c') {
92
+					if (!$simulate)$db->query("ALTER TABLE $mod->table_name"."_cstm DROP COLUMN $col");
93 93
 					unset($fields[$col]);
94
-					echo "Dropping Column $col from $mod->table_name" . "_cstm for module $the_module<br>";
95
-				}	else{
96
-					if($col != 'id_c'){
97
-					if(trim($the_field->get_db_type()) != trim($type)){
94
+					echo "Dropping Column $col from $mod->table_name"."_cstm for module $the_module<br>";
95
+				} else {
96
+					if ($col != 'id_c') {
97
+					if (trim($the_field->get_db_type()) != trim($type)) {
98 98
 						
99
-					echo "Fixing Column Type for $col changing $type to ". $the_field->get_db_type() . "<br>";
100
-					if(!$simulate)$db->query($the_field->get_db_modify_alter_table($mod->table_name . '_cstm'));		
99
+					echo "Fixing Column Type for $col changing $type to ".$the_field->get_db_type()."<br>";
100
+					if (!$simulate)$db->query($the_field->get_db_modify_alter_table($mod->table_name.'_cstm'));		
101 101
 					}
102 102
 					}
103 103
 					
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 			
107 107
 		}
108 108
 			
109
-			echo sizeof($fields) . " field(s) missing from $mod->table_name" . "_cstm<br>";
110
-			foreach($fields as $field){
111
-				echo "Adding Column $field to $mod->table_name" . "_cstm<br>";
112
-				if(!$simulate){
109
+			echo sizeof($fields)." field(s) missing from $mod->table_name"."_cstm<br>";
110
+			foreach ($fields as $field) {
111
+				echo "Adding Column $field to $mod->table_name"."_cstm<br>";
112
+				if (!$simulate) {
113 113
 					$the_field = $mod->getFieldDefinition($field);
114 114
 					$field = get_widget($the_field['type']);
115 115
 					$field->set($the_field);
116
-					$query = $field->get_db_add_alter_table($mod->table_name . '_cstm');
116
+					$query = $field->get_db_add_alter_table($mod->table_name.'_cstm');
117 117
 					echo $query;
118
-            		if(!empty($query)){
118
+            		if (!empty($query)) {
119 119
                 		$mod->db->query($query);
120 120
             		}
121 121
 				}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	
127 127
 	DynamicField::deleteCache();	
128 128
 	echo '<br>Done<br>';
129
-	if($simulate){
129
+	if ($simulate) {
130 130
 		echo '<a href="index.php?module=Administration&action=UpgradeFields&run=true">Execute non-simulation mode</a>';	
131 131
 	}
132 132
 		
Please login to merge, or discard this patch.
modules/Relationships/field_arrays.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  * All Rights Reserved.
46 46
  * Contributor(s): ______________________________________..
47 47
  ********************************************************************************/
48
-$fields_array['Relationship'] = array ('column_fields' => Array(
48
+$fields_array['Relationship'] = array('column_fields' => Array(
49 49
 		'id',
50 50
 		'relationship_name',
51 51
 		'lhs_module',
Please login to merge, or discard this patch.
modules/jjwg_Maps/jjwg_Maps_Router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 require_once('include/utils.php');
5 5
 require_once('include/export_utils.php');
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
   echo '<input type="hidden" name="module" value="jjwg_Maps">'."\n";
57 57
   echo '<input type="hidden" name="action" value="map_display">'."\n";
58 58
   foreach (array_keys($_REQUEST) as $key) {
59
-    if (!in_array($key, array('action','module','entryPoint','display_module', 'quick_address'))) {
59
+    if (!in_array($key, array('action', 'module', 'entryPoint', 'display_module', 'quick_address'))) {
60 60
       echo '<input type="hidden" name="'.htmlspecialchars($key).'" value="'.htmlspecialchars($_REQUEST[$key]).'">'."\n";
61 61
     }
62 62
   }
Please login to merge, or discard this patch.
modules/SecurityGroups/VersionCheck.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 
5 5
 class VersionCheck {
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 		global $current_user;
10 10
 	
11 11
 		require_once('include/utils.php');
12
-		if(is_admin($current_user) && empty($_REQUEST['to_pdf']) && empty($_REQUEST['sugar_body_only'])) {
12
+		if (is_admin($current_user) && empty($_REQUEST['to_pdf']) && empty($_REQUEST['sugar_body_only'])) {
13 13
 			//require_once('modules/SecurityGroups/SecurityGroup.php');
14 14
 			
15 15
 			//check to see if the securitysuite version
16 16
 			//matches the sugar version. If not then display an error messag
17 17
 			
18 18
 			global $sugar_config;
19
-			if(empty($sugar_config['securitysuite_version'])
19
+			if (empty($sugar_config['securitysuite_version'])
20 20
 				|| $sugar_config['securitysuite_version'] != $sugar_config['sugar_version']
21 21
 			) {
22 22
 				$securitysuite_warning = "Warning! SecuritySuite no longer matches the version of Sugar that you are running. "
Please login to merge, or discard this patch.
modules/SecurityGroups/SaveSecurityGroupUserRelationship.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php');
5 5
 
@@ -10,29 +10,29 @@  discard block
 block discarded – undo
10 10
 
11 11
 $focus->retrieve($_REQUEST['record']);
12 12
 
13
-foreach($focus->column_fields as $field)
13
+foreach ($focus->column_fields as $field)
14 14
 {
15 15
     safe_map($field, $focus, true);
16 16
 }
17 17
 
18
-foreach($focus->additional_column_fields as $field)
18
+foreach ($focus->additional_column_fields as $field)
19 19
 {
20 20
     safe_map($field, $focus, true);
21 21
 }
22 22
 
23 23
 // send them to the edit screen.
24
-if(isset($_REQUEST['record']) && $_REQUEST['record'] != "")
24
+if (isset($_REQUEST['record']) && $_REQUEST['record'] != "")
25 25
 {
26 26
     $recordID = $_REQUEST['record'];
27 27
 }
28 28
 
29
-    if( isset($_POST['noninheritable']) && $_POST['noninheritable'] == '1') {
29
+    if (isset($_POST['noninheritable']) && $_POST['noninheritable'] == '1') {
30 30
         $focus->noninheritable = 1;
31 31
     } else {
32 32
         $focus->noninheritable = 0;
33 33
     }
34 34
 
35
-    if( isset($_POST['primary_group']) && $_POST['primary_group'] == '1') {
35
+    if (isset($_POST['primary_group']) && $_POST['primary_group'] == '1') {
36 36
         $focus->primary_group = 1;
37 37
         //unset all other primary groups for this user
38 38
         global $db;
Please login to merge, or discard this patch.
modules/SecurityGroups/SecurityGroupUserRelationshipEdit.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 require_once('XTemplate/xtpl.php');
5 5
 require_once('modules/SecurityGroups/SecurityGroupUserRelationship.php');
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 
14 14
 $focus = new SecurityGroupUserRelationship();
15 15
 
16
-if(isset($_REQUEST['record'])) {
16
+if (isset($_REQUEST['record'])) {
17 17
     $focus->retrieve($_REQUEST['record']);
18 18
 }
19 19
 
20
-if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
20
+if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
21 21
     $focus->id = "";
22 22
 }
23 23
 
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 safe_map('primary_group', $focus);
31 31
 
32 32
 
33
-$theme_path="themes/".$theme."/";
34
-$image_path=$theme_path."images/";
33
+$theme_path = "themes/".$theme."/";
34
+$image_path = $theme_path."images/";
35 35
 require_once($theme_path.'layout_utils.php');
36 36
 
37 37
 $GLOBALS['log']->info("SecurityGroup User relationship");
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 $sqs_objects = array('user_name' => $qsd->getQSParent());
43 43
 $sqs_objects['user_name']['populate_list'] = array('user_name', 'user_id');
44 44
 $quicksearch_js = $qsd->getQSScripts();
45
-$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
45
+$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = '.$json->encode($sqs_objects).'</script>';
46 46
 echo $quicksearch_js;
47 47
 
48
-$xtpl=new XTemplate ('modules/SecurityGroups/SecurityGroupUserRelationshipEdit.html');
48
+$xtpl = new XTemplate('modules/SecurityGroups/SecurityGroupUserRelationshipEdit.html');
49 49
 $xtpl->assign("MOD", $mod_strings);
50 50
 $xtpl->assign("APP", $app_strings);
51 51
 
@@ -54,25 +54,25 @@  discard block
 block discarded – undo
54 54
 $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
55 55
 $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
56 56
 $xtpl->assign("THEME", $theme);
57
-$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
57
+$xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
58 58
 $xtpl->assign("ID", $focus->id);
59
-$xtpl->assign("SECURITYGROUP",$securityGroup = Array("NAME" => $focus->securitygroup_name, "ID" => $focus->securitygroup_id));
60
-$xtpl->assign("USER",$user = Array("NAME" => $focus->user_name, "ID" => $focus->user_id));
59
+$xtpl->assign("SECURITYGROUP", $securityGroup = Array("NAME" => $focus->securitygroup_name, "ID" => $focus->securitygroup_id));
60
+$xtpl->assign("USER", $user = Array("NAME" => $focus->user_name, "ID" => $focus->user_id));
61 61
 
62 62
 echo "\n<p>\n";
63
-echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SECURITYGROUP_USER_FORM_TITLE'].": ".$securityGroup['NAME'] . " - ". $user['NAME'], true);
63
+echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SECURITYGROUP_USER_FORM_TITLE'].": ".$securityGroup['NAME']." - ".$user['NAME'], true);
64 64
 echo "\n</p>\n";
65 65
 
66 66
 // noninheritable
67 67
 $noninheritable = '';
68
-if(isset($focus->noninheritable) && $focus->noninheritable == true) {
68
+if (isset($focus->noninheritable) && $focus->noninheritable == true) {
69 69
     $noninheritable = 'CHECKED';
70 70
 } 
71 71
 $xtpl->assign('noninheritable', $noninheritable);
72 72
 
73 73
 // primary_group
74 74
 $primary_group = '';
75
-if(isset($focus->primary_group) && $focus->primary_group == true) {
75
+if (isset($focus->primary_group) && $focus->primary_group == true) {
76 76
     $primary_group = 'CHECKED';
77 77
 } 
78 78
 $xtpl->assign('primary_group', $primary_group);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 $javascript = new javascript();
86 86
 $javascript->setFormName('EditView');
87 87
 $javascript->setSugarBean($focus);
88
-$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $mod_strings['LBL_USER_NAME'], 'false', '', 'user_id');
88
+$javascript->addToValidateBinaryDependency('user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'].$mod_strings['LBL_USER_NAME'], 'false', '', 'user_id');
89 89
 echo $javascript->getScript();
90 90
 
91 91
 
Please login to merge, or discard this patch.
modules/SecurityGroups/AssignGroups.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 
4 4
 
5 5
 class AssignGroups {
@@ -9,28 +9,28 @@  discard block
 block discarded – undo
9 9
 	global $sugar_config;
10 10
 
11 11
 	//only process if action is Save (meaning a user has triggered this event and not the portal or automated process)
12
-	if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' 
12
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Save' 
13 13
 		&& isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true
14 14
 		&& empty($bean->fetched_row['id']) && $bean->module_dir != "Users" && $bean->module_dir != "SugarFeed") {		
15 15
 		//Upload an attachment to an Email Template and save. If user with multi groups - popup select option
16 16
 		//it will redirect to notes instead of EmailTemplate and relationship will fail...check below to avoid
17
-		if(!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return;
17
+		if (!empty($_REQUEST['module']) && $_REQUEST['module'] != $bean->module_dir) return;
18 18
 
19
-		if(!empty($_REQUEST['securitygroup_list'])) {
19
+		if (!empty($_REQUEST['securitygroup_list'])) {
20 20
 			require_once('modules/SecurityGroups/SecurityGroup.php');
21 21
 			$groupFocus = new SecurityGroup();
22 22
 			$security_modules = $groupFocus->getSecurityModules();
23 23
 			//sanity check
24
-			if(in_array($bean->module_dir,array_keys($security_modules))) {
24
+			if (in_array($bean->module_dir, array_keys($security_modules))) {
25 25
 				//add each group in securitygroup_list to new record
26
-				$rel_name = $groupFocus->getLinkName($bean->module_dir,"SecurityGroups");
26
+				$rel_name = $groupFocus->getLinkName($bean->module_dir, "SecurityGroups");
27 27
 
28 28
 				$bean->load_relationship($rel_name);
29
-				foreach($_REQUEST['securitygroup_list'] as $group_id) {
29
+				foreach ($_REQUEST['securitygroup_list'] as $group_id) {
30 30
 					$bean->$rel_name->add($group_id);
31 31
 				}
32 32
 			}
33
-		} else if(!empty($_REQUEST['dup_checked'])) {
33
+		} else if (!empty($_REQUEST['dup_checked'])) {
34 34
 			//well...ShowDuplicates doesn't pass through request vars unless they are defined in the module vardefs
35 35
 			//so we are screwed here...
36 36
 			global $current_language;
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 		}
41 41
 	}
42 42
 
43
-	else if(isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true
43
+	else if (isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true
44 44
 		&& empty($bean->fetched_row['id']) && $bean->module_dir == "Users"
45
-		&& isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature' ) { //Bug: 589
45
+		&& isset($_REQUEST['action']) && $_REQUEST['action'] != 'SaveSignature') { //Bug: 589
46 46
 
47 47
 		//$_REQUEST['return_module'] = $bean->module_dir;
48 48
 		//$_REQUEST['return_action'] = "DetailView";
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		
51 51
 		//$_SESSION['securitygroups_popup_'.$bean->module_dir] = $bean->id;
52 52
 		
53
-		if(!isset($_SESSION['securitygroups_popup'])) {
53
+		if (!isset($_SESSION['securitygroups_popup'])) {
54 54
 			$_SESSION['securitygroups_popup'] = array();
55 55
 		}
56 56
 		$_SESSION['securitygroups_popup'][] = array(
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 function popup_onload($event, $arguments)
65 65
 {
66
-	if(!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return;
66
+	if (!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) return;
67 67
 
68 68
 /** //test user popup
69 69
 	//always have this loaded
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 	$module = $_REQUEST['module'];
75 75
 	$action = $_REQUEST['action'];
76 76
 
77
-	if(isset($action) && ($action == "Save" || $action == "SetTimezone")) return;  
77
+	if (isset($action) && ($action == "Save" || $action == "SetTimezone")) return;  
78 78
 
79
-	if( (
79
+	if ((
80 80
 			//(isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true)
81 81
 			//|| 
82 82
 			($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true)
@@ -86,17 +86,17 @@  discard block
 block discarded – undo
86 86
 		&& !empty($_SESSION['securitygroups_popup'])
87 87
 	) {	
88 88
 
89
-		foreach($_SESSION['securitygroups_popup'] as $popup_index => $popup) {
89
+		foreach ($_SESSION['securitygroups_popup'] as $popup_index => $popup) {
90 90
 			$record_id = $popup['id'];
91 91
 			$module = $popup['module'];
92 92
 			unset($_SESSION['securitygroups_popup'][$popup_index]);
93 93
 			
94 94
 			require_once('modules/SecurityGroups/SecurityGroup.php');
95 95
 			$groupFocus = new SecurityGroup();
96
-			if($module == 'Users') {
96
+			if ($module == 'Users') {
97 97
 				$rel_name = "SecurityGroups";
98 98
 			} else {
99
-				$rel_name = $groupFocus->getLinkName($module,"SecurityGroups");
99
+				$rel_name = $groupFocus->getLinkName($module, "SecurityGroups");
100 100
 			}
101 101
 
102 102
 				//this only works if on the detail view of the record actually saved...
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
     $action = $_REQUEST['action'];
122 122
     $module = $_REQUEST['module'];
123 123
   
124
-  	$no_mass_assign_list = array("Emails"=>"Emails","ACLRoles"=>"ACLRoles"); //,"Users"=>"Users");
124
+  	$no_mass_assign_list = array("Emails"=>"Emails", "ACLRoles"=>"ACLRoles"); //,"Users"=>"Users");
125 125
     //check if security suite enabled
126 126
     $action = strtolower($action);
127
-    if(isset($module) && ($action == "list" || $action == "index" || $action == "listview") 
127
+    if (isset($module) && ($action == "list" || $action == "index" || $action == "listview") 
128 128
     	&& (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != true)
129
-    	&& !array_key_exists($module,$no_mass_assign_list)
129
+    	&& !array_key_exists($module, $no_mass_assign_list)
130 130
     	) {
131 131
    		global $current_user;
132
-   		if(is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id,"SecurityGroups", 'access') == ACL_ALLOW_ENABLED) {
132
+   		if (is_admin($current_user) || ACLAction::getUserAccessLevel($current_user->id, "SecurityGroups", 'access') == ACL_ALLOW_ENABLED) {
133 133
 
134 134
 			require_once('modules/SecurityGroups/SecurityGroup.php');
135 135
 			$groupFocus = new SecurityGroup();
136 136
 			$security_modules = $groupFocus->getSecurityModules();
137 137
 			//if(in_array($module,$security_modules)) {
138
-			if(in_array($module,array_keys($security_modules))) {
138
+			if (in_array($module, array_keys($security_modules))) {
139 139
 
140 140
 				global $app_strings;
141 141
 
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
 
145 145
 				$form_header = get_form_header($current_module_strings['LBL_MASS_ASSIGN'], '', false);
146 146
 
147
-				$groups = $groupFocus->get_list("name","",0,-99,-99);
147
+				$groups = $groupFocus->get_list("name", "", 0, -99, -99);
148 148
 				$options = array(""=>"");
149
-				foreach($groups['list'] as $group) {
149
+				foreach ($groups['list'] as $group) {
150 150
 					$options[$group->id] = $group->name;
151 151
 				}
152
-				$group_options =  get_select_options_with_id($options, "");
152
+				$group_options = get_select_options_with_id($options, "");
153 153
 
154 154
 				$mass_assign = <<<EOQ
155 155
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     }
271 271
 
272 272
 	//if after a save...
273
-	if(!empty($_SESSION['securitysuite_error'])) {
273
+	if (!empty($_SESSION['securitysuite_error'])) {
274 274
 		$lbl_securitysuite_error = $_SESSION['securitysuite_error'];
275 275
 		unset($_SESSION['securitysuite_error']);
276 276
 		echo <<<EOQ
Please login to merge, or discard this patch.