Completed
Push — master ( 58f496...a833c2 )
by Adam
18:52
created
modules/AOR_Reports/metadata/searchdefs.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -22,21 +22,21 @@
 block discarded – undo
22 22
  * @author SalesAgility <[email protected]>
23 23
  */
24 24
  
25
-  $searchdefs['AOR_Reports'] = array(
26
-					'templateMeta' => array(
27
-							'maxColumns' => '3',
28
-  							'maxColumnsBasic' => '4', 
25
+    $searchdefs['AOR_Reports'] = array(
26
+                    'templateMeta' => array(
27
+                            'maxColumns' => '3',
28
+                                'maxColumnsBasic' => '4', 
29 29
                             'widths' => array('label' => '10', 'field' => '30'),                 
30
-                           ),
30
+                            ),
31 31
                     'layout' => array(  					
32
-						'basic_search' => array(
33
-							'name', 
34
-							array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
35
-							),
36
-						'advanced_search' => array(
37
-							'name', 
38
-							array('name' => 'assigned_user_id', 'label' => 'LBL_ASSIGNED_TO', 'type' => 'enum', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
39
-						),
40
-					),
41
- 			   );
32
+                        'basic_search' => array(
33
+                            'name', 
34
+                            array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
35
+                            ),
36
+                        'advanced_search' => array(
37
+                            'name', 
38
+                            array('name' => 'assigned_user_id', 'label' => 'LBL_ASSIGNED_TO', 'type' => 'enum', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
39
+                        ),
40
+                    ),
41
+                );
42 42
 ?>
Please login to merge, or discard this patch.
modules/AOR_Reports/metadata/subpanels/default.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,36 +25,36 @@
 block discarded – undo
25 25
 
26 26
 
27 27
 $subpanel_layout = array(
28
-	'top_buttons' => array(
29
-		array('widget_class' => 'SubPanelTopCreateButton'),
30
-		array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'AOR_Reports'),
31
-	),
28
+    'top_buttons' => array(
29
+        array('widget_class' => 'SubPanelTopCreateButton'),
30
+        array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'AOR_Reports'),
31
+    ),
32 32
 
33
-	'where' => '',
33
+    'where' => '',
34 34
 
35
-	'list_fields' => array(
36
-		'name'=>array(
37
-	 		'vname' => 'LBL_NAME',
38
-			'widget_class' => 'SubPanelDetailViewLink',
39
-	 		'width' => '45%',
40
-		),
41
-		'date_modified'=>array(
42
-	 		'vname' => 'LBL_DATE_MODIFIED',
43
-	 		'width' => '45%',
44
-		),
45
-		'edit_button'=>array(
35
+    'list_fields' => array(
36
+        'name'=>array(
37
+                'vname' => 'LBL_NAME',
38
+            'widget_class' => 'SubPanelDetailViewLink',
39
+                'width' => '45%',
40
+        ),
41
+        'date_modified'=>array(
42
+                'vname' => 'LBL_DATE_MODIFIED',
43
+                'width' => '45%',
44
+        ),
45
+        'edit_button'=>array(
46 46
             'vname' => 'LBL_EDIT_BUTTON',
47
-			'widget_class' => 'SubPanelEditButton',
48
-		 	'module' => 'AOR_Reports',
49
-	 		'width' => '4%',
50
-		),
51
-		'remove_button'=>array(
47
+            'widget_class' => 'SubPanelEditButton',
48
+                'module' => 'AOR_Reports',
49
+                'width' => '4%',
50
+        ),
51
+        'remove_button'=>array(
52 52
             'vname' => 'LBL_REMOVE',
53
-			'widget_class' => 'SubPanelRemoveButton',
54
-		 	'module' => 'AOR_Reports',
55
-			'width' => '5%',
56
-		),
57
-	),
53
+            'widget_class' => 'SubPanelRemoveButton',
54
+                'module' => 'AOR_Reports',
55
+            'width' => '5%',
56
+        ),
57
+    ),
58 58
 );
59 59
 
60 60
 ?>
Please login to merge, or discard this patch.
modules/AOR_Conditions/vardefs.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 $dictionary['AOR_Condition'] = array(
26
-	'table'=>'aor_conditions',
27
-	'audited'=>false,
28
-	'duplicate_merge'=>true,
29
-	'fields'=>array (
30
-  'aor_report_id' =>
31
-  array (
26
+    'table'=>'aor_conditions',
27
+    'audited'=>false,
28
+    'duplicate_merge'=>true,
29
+    'fields'=>array (
30
+    'aor_report_id' =>
31
+    array (
32 32
     'required' => false,
33 33
     'name' => 'aor_report_id',
34 34
     'vname' => 'LBL_AOR_REPORT_ID',
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
     'merge_filter' => 'disabled',
46 46
     'len' => 36,
47 47
     'size' => '20',
48
-  ),
49
-  'condition_order' => 
50
-  array (
48
+    ),
49
+    'condition_order' => 
50
+    array (
51 51
     'required' => false,
52 52
     'name' => 'condition_order',
53 53
     'vname' => 'LBL_ORDER',
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     'size' => '20',
67 67
     'enable_range_search' => false,
68 68
     'disable_num_format' => '',
69
-  ),
69
+    ),
70 70
         'logic_op' => array(
71 71
             'name' => 'logic_op',
72 72
             'vname' => 'LBL_LOGIC_OP',
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
             'vname' => 'LBL_PARENTHESIS',
79 79
             'type' => 'varchar',
80 80
         ),
81
-  'module_path' =>
82
-  array (
81
+    'module_path' =>
82
+    array (
83 83
     'name' => 'module_path',
84 84
     'type' => 'longtext',
85 85
     'vname' => 'LBL_MODULE_PATH',
86 86
     'isnull' => true,
87
-  ),
88
-  'field' => 
89
-  array (
87
+    ),
88
+    'field' => 
89
+    array (
90 90
     'required' => false,
91 91
     'name' => 'field',
92 92
     'vname' => 'LBL_FIELD',
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
     'options' => 'user_type_dom',
107 107
     'studio' => 'visible',
108 108
     'dependency' => false,
109
-  ),
110
-  'operator' => 
111
-  array (
109
+    ),
110
+    'operator' => 
111
+    array (
112 112
     'required' => false,
113 113
     'name' => 'operator',
114 114
     'vname' => 'LBL_OPERATOR',
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     'options' => 'aor_operator_list',
130 130
     'studio' => 'visible',
131 131
     'dependency' => false,
132
-  ),
132
+    ),
133 133
     'value_type' =>
134 134
     array (
135 135
     'required' => false,
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
     'options' => 'aor_condition_type_list',
153 153
     'studio' => 'visible',
154 154
     'dependency' => false,
155
-  ),
156
-  'value' => 
157
-  array (
155
+    ),
156
+    'value' => 
157
+    array (
158 158
     'required' => false,
159 159
     'name' => 'value',
160 160
     'vname' => 'LBL_VALUE',
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     'merge_filter' => 'disabled',
172 172
     'len' => '255',
173 173
     'size' => '20',
174
-  ),
174
+    ),
175 175
         'parameter' =>
176 176
             array (
177 177
                 'required' => false,
@@ -190,17 +190,17 @@  discard block
 block discarded – undo
190 190
                 'merge_filter' => 'disabled',
191 191
                 'studio' => 'visible',
192 192
             ),
193
-  'aor_reports' =>
194
-  array (
193
+    'aor_reports' =>
194
+    array (
195 195
     'name' => 'aor_reports',
196 196
     'type' => 'link',
197 197
     'relationship' => 'aor_report_aor_conditions',
198 198
     'module'=>'AOR_Reports',
199 199
     'bean_name'=>'AOR_Reports',
200 200
     'source'=>'non-db',
201
-  ),
201
+    ),
202 202
 ),
203
-	'relationships'=>array (
203
+    'relationships'=>array (
204 204
 ),
205 205
     'indices' => array(
206 206
         array(
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
             'fields' => array('aor_report_id'),
210 210
         ),
211 211
     ),
212
-	'optimistic_locking'=>true,
213
-	'unified_search'=>true,
212
+    'optimistic_locking'=>true,
213
+    'unified_search'=>true,
214 214
 );
215 215
 
216 216
 if (!class_exists('VardefManager')){
Please login to merge, or discard this patch.
modules/Home/UnifiedSearchAdvanced.php 1 patch
Indentation   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -69,95 +69,95 @@  discard block
 block discarded – undo
69 69
         $this->cache_display = sugar_cached('modules/unified_search_modules_display.php');
70 70
     }
71 71
 
72
-	function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') {
73
-		global $app_list_strings, $app_strings;
72
+    function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') {
73
+        global $app_list_strings, $app_strings;
74 74
 
75
-		if(!file_exists($this->cache_search))
76
-		{
77
-			$this->buildCache();
78
-		}
75
+        if(!file_exists($this->cache_search))
76
+        {
77
+            $this->buildCache();
78
+        }
79 79
 
80
-		$unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();
80
+        $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();
81 81
 
82
-		global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $beanList;
83
-		$users_modules = $current_user->getPreference('globalSearch', 'search');
82
+        global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $beanList;
83
+        $users_modules = $current_user->getPreference('globalSearch', 'search');
84 84
 
85
-		// preferences are empty, select all
86
-		if(empty($users_modules)) {
87
-			$users_modules = array();
88
-			foreach($unified_search_modules_display as $module=>$data) {
89
-				if (!empty($data['visible']) ) {
85
+        // preferences are empty, select all
86
+        if(empty($users_modules)) {
87
+            $users_modules = array();
88
+            foreach($unified_search_modules_display as $module=>$data) {
89
+                if (!empty($data['visible']) ) {
90 90
                     $users_modules[$module] = $beanList[$module];
91 91
                 }
92
-			}
93
-			$current_user->setPreference('globalSearch', $users_modules, 0, 'search');
94
-		}
92
+            }
93
+            $current_user->setPreference('globalSearch', $users_modules, 0, 'search');
94
+        }
95 95
 
96
-		$sugar_smarty = new Sugar_Smarty();
96
+        $sugar_smarty = new Sugar_Smarty();
97 97
 
98
-		$modules_to_search = array();
98
+        $modules_to_search = array();
99 99
 
100
-		foreach($users_modules as $key=>$module)
101
-		{
100
+        foreach($users_modules as $key=>$module)
101
+        {
102 102
             if(ACLController::checkAccess($key, 'list', true))
103 103
             {
104 104
                 $modules_to_search[$key]['checked'] = true;
105 105
             }
106
-		}
107
-
108
-		if(!empty($this->query_string))
109
-		{
110
-			$sugar_smarty->assign('query_string', securexss($this->query_string));
111
-		} else {
112
-			$sugar_smarty->assign('query_string', '');
113
-		}
114
-
115
-		$sugar_smarty->assign('MOD', return_module_language($GLOBALS['current_language'], 'Administration'));
116
-		$sugar_smarty->assign('APP', $app_strings);
117
-		$sugar_smarty->assign('USE_SEARCH_GIF', 0);
118
-		$sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']);
119
-		$sugar_smarty->assign('LBL_SEARCH_BUTTON_TITLE', $app_strings['LBL_SEARCH_BUTTON_TITLE']);
120
-		$sugar_smarty->assign('LBL_SEARCH', $app_strings['LBL_SEARCH']);
121
-
122
-		$json_enabled = array();
123
-		$json_disabled = array();
124
-
125
-		//Now add the rest of the modules that are searchable via Global Search settings
126
-		foreach($unified_search_modules_display as $module=>$data)
127
-		{
128
-			if(!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true))
129
-			{
130
-			   $modules_to_search[$module]['checked'] = false;
131
-			} else if (isset($modules_to_search[$module]) && !$data['visible']) {
132
-			   unset($modules_to_search[$module]);
133
-			}
134
-		}
135
-
136
-		//Create the two lists (doing it this way preserves the user's ordering choice for enabled modules)
137
-		foreach($modules_to_search as $module=>$data)
138
-		{
139
-			$label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module;
140
-			if(!empty($data['checked']))
141
-			{
142
-				$json_enabled[] = array("module" => $module, 'label' => $label);
143
-			} else {
144
-				$json_disabled[] = array("module" => $module, 'label' => $label);
145
-			}
146
-		}
147
-
148
-		$sugar_smarty->assign('enabled_modules', json_encode($json_enabled));
149
-		$sugar_smarty->assign('disabled_modules', json_encode($json_disabled));
150
-
151
-		$showDiv = $current_user->getPreference('showGSDiv', 'search');
152
-		if(!isset($showDiv))
153
-		{
154
-		   $showDiv = 'no';
155
-		}
156
-
157
-		$sugar_smarty->assign('SHOWGSDIV', $showDiv);
158
-		$sugar_smarty->debugging = true;
159
-		return $sugar_smarty->fetch($tpl);
160
-	}
106
+        }
107
+
108
+        if(!empty($this->query_string))
109
+        {
110
+            $sugar_smarty->assign('query_string', securexss($this->query_string));
111
+        } else {
112
+            $sugar_smarty->assign('query_string', '');
113
+        }
114
+
115
+        $sugar_smarty->assign('MOD', return_module_language($GLOBALS['current_language'], 'Administration'));
116
+        $sugar_smarty->assign('APP', $app_strings);
117
+        $sugar_smarty->assign('USE_SEARCH_GIF', 0);
118
+        $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']);
119
+        $sugar_smarty->assign('LBL_SEARCH_BUTTON_TITLE', $app_strings['LBL_SEARCH_BUTTON_TITLE']);
120
+        $sugar_smarty->assign('LBL_SEARCH', $app_strings['LBL_SEARCH']);
121
+
122
+        $json_enabled = array();
123
+        $json_disabled = array();
124
+
125
+        //Now add the rest of the modules that are searchable via Global Search settings
126
+        foreach($unified_search_modules_display as $module=>$data)
127
+        {
128
+            if(!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true))
129
+            {
130
+                $modules_to_search[$module]['checked'] = false;
131
+            } else if (isset($modules_to_search[$module]) && !$data['visible']) {
132
+                unset($modules_to_search[$module]);
133
+            }
134
+        }
135
+
136
+        //Create the two lists (doing it this way preserves the user's ordering choice for enabled modules)
137
+        foreach($modules_to_search as $module=>$data)
138
+        {
139
+            $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module;
140
+            if(!empty($data['checked']))
141
+            {
142
+                $json_enabled[] = array("module" => $module, 'label' => $label);
143
+            } else {
144
+                $json_disabled[] = array("module" => $module, 'label' => $label);
145
+            }
146
+        }
147
+
148
+        $sugar_smarty->assign('enabled_modules', json_encode($json_enabled));
149
+        $sugar_smarty->assign('disabled_modules', json_encode($json_disabled));
150
+
151
+        $showDiv = $current_user->getPreference('showGSDiv', 'search');
152
+        if(!isset($showDiv))
153
+        {
154
+            $showDiv = 'no';
155
+        }
156
+
157
+        $sugar_smarty->assign('SHOWGSDIV', $showDiv);
158
+        $sugar_smarty->debugging = true;
159
+        return $sugar_smarty->fetch($tpl);
160
+    }
161 161
 
162 162
 
163 163
     /**
@@ -170,70 +170,70 @@  discard block
 block discarded – undo
170 170
      *
171 171
      *
172 172
      */
173
-	function search() {
173
+    function search() {
174 174
 
175 175
         $unified_search_modules = $this->getUnifiedSearchModules();
176
-		$unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();
176
+        $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();
177 177
 
178 178
 
179
-		require_once 'include/ListView/ListViewSmarty.php';
179
+        require_once 'include/ListView/ListViewSmarty.php';
180 180
 
181
-		global $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings;
182
-		$home_mod_strings = return_module_language($current_language, 'Home');
181
+        global $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings;
182
+        $home_mod_strings = return_module_language($current_language, 'Home');
183 183
 
184
-		$this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH'))));
184
+        $this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH'))));
185 185
 
186
-		if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') {
187
-			$modules_to_search = array();
188
-			if(!empty($_REQUEST['search_modules']))
189
-			{
190
-			    foreach(explode (',', $_REQUEST['search_modules'] ) as $key)
191
-	            {
186
+        if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') {
187
+            $modules_to_search = array();
188
+            if(!empty($_REQUEST['search_modules']))
189
+            {
190
+                foreach(explode (',', $_REQUEST['search_modules'] ) as $key)
191
+                {
192 192
                     if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible']))
193 193
                     {
194 194
                         $modules_to_search[$key] = $beanList[$key];
195 195
                     }
196
-	            }
197
-			}
198
-
199
-			$current_user->setPreference('showGSDiv', isset($_REQUEST['showGSDiv']) ? $_REQUEST['showGSDiv'] : 'no', 0, 'search');
200
-			$current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference
201
-		} else {
202
-			$users_modules = $current_user->getPreference('globalSearch', 'search');
203
-			$modules_to_search = array();
204
-
205
-			if(!empty($users_modules)) {
206
-				// use user's previous selections
207
-			    foreach ( $users_modules as $key => $value ) {
208
-			    	if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) {
209
-		            	$modules_to_search[$key] = $beanList[$key];
210
-		        	}
211
-			    }
212
-			} else {
213
-				foreach($unified_search_modules_display as $module=>$data) {
214
-				    if (!empty($data['visible']) ) {
215
-				        $modules_to_search[$module] = $beanList[$module];
216
-				    }
217
-				}
218
-			}
219
-			$current_user->setPreference('globalSearch', $modules_to_search, 'search');
220
-		}
221
-
222
-
223
-		$templateFile = 'modules/Home/UnifiedSearchAdvancedForm.tpl';
224
-		if(file_exists('custom/' . $templateFile))
225
-		{
226
-		   $templateFile = 'custom/'.$templateFile;
227
-		}
228
-
229
-		echo $this->getDropDownDiv($templateFile);
230
-
231
-		$module_results = array();
232
-		$module_counts = array();
233
-		$has_results = false;
234
-
235
-		if(!empty($this->query_string)) {
236
-			foreach($modules_to_search as $moduleName => $beanName) {
196
+                }
197
+            }
198
+
199
+            $current_user->setPreference('showGSDiv', isset($_REQUEST['showGSDiv']) ? $_REQUEST['showGSDiv'] : 'no', 0, 'search');
200
+            $current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference
201
+        } else {
202
+            $users_modules = $current_user->getPreference('globalSearch', 'search');
203
+            $modules_to_search = array();
204
+
205
+            if(!empty($users_modules)) {
206
+                // use user's previous selections
207
+                foreach ( $users_modules as $key => $value ) {
208
+                    if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) {
209
+                        $modules_to_search[$key] = $beanList[$key];
210
+                    }
211
+                }
212
+            } else {
213
+                foreach($unified_search_modules_display as $module=>$data) {
214
+                    if (!empty($data['visible']) ) {
215
+                        $modules_to_search[$module] = $beanList[$module];
216
+                    }
217
+                }
218
+            }
219
+            $current_user->setPreference('globalSearch', $modules_to_search, 'search');
220
+        }
221
+
222
+
223
+        $templateFile = 'modules/Home/UnifiedSearchAdvancedForm.tpl';
224
+        if(file_exists('custom/' . $templateFile))
225
+        {
226
+            $templateFile = 'custom/'.$templateFile;
227
+        }
228
+
229
+        echo $this->getDropDownDiv($templateFile);
230
+
231
+        $module_results = array();
232
+        $module_counts = array();
233
+        $has_results = false;
234
+
235
+        if(!empty($this->query_string)) {
236
+            foreach($modules_to_search as $moduleName => $beanName) {
237 237
                 require_once $beanFiles[$beanName] ;
238 238
                 $seed = new $beanName();
239 239
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
                 //retrieve the original list view defs and store for processing in case of custom layout changes
245 245
                 require('modules/'.$seed->module_dir.'/metadata/listviewdefs.php');
246
-				$orig_listViewDefs = $listViewDefs;
246
+                $orig_listViewDefs = $listViewDefs;
247 247
 
248 248
                 if(file_exists('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php'))
249 249
                 {
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
                     continue;
256 256
                 }
257 257
 
258
-			    $unifiedSearchFields = array () ;
258
+                $unifiedSearchFields = array () ;
259 259
                 $innerJoins = array();
260 260
                 foreach ( $unified_search_modules[ $moduleName ]['fields'] as $field=>$def )
261 261
                 {
262
-                	$listViewCheckField = strtoupper($field);
263
-                	//check to see if the field is in listview defs
264
-					if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {
265
-						//check to see if field is in original list view defs (in case we are using custom layout defs)
266
-						if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {
267
-							//if we are here then the layout has been customized, but the field is still needed for query creation
268
-							$listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField];
269
-						}
262
+                    $listViewCheckField = strtoupper($field);
263
+                    //check to see if the field is in listview defs
264
+                    if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {
265
+                        //check to see if field is in original list view defs (in case we are using custom layout defs)
266
+                        if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) {
267
+                            //if we are here then the layout has been customized, but the field is still needed for query creation
268
+                            $listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField];
269
+                        }
270 270
 
271
-					}
271
+                    }
272 272
 
273 273
                     //bug: 34125 we might want to try to use the LEFT JOIN operator instead of the INNER JOIN in the case we are
274 274
                     //joining against a field that has not been populated.
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                 require_once $beanFiles[$beanName] ;
303 303
                 $seed = new $beanName();
304 304
                 
305
-				require_once $this->searchFormPath;
305
+                require_once $this->searchFormPath;
306 306
                 $searchForm = new $this->searchFormClass ( $seed, $moduleName ) ;
307 307
 
308 308
                 $searchForm->setup (array ( $moduleName => array() ) , $unifiedSearchFields , '' , 'saved_views' /* hack to avoid setup doing further unwanted processing */ ) ;
@@ -311,11 +311,11 @@  discard block
 block discarded – undo
311 311
                 $params = array('custom_select' => "");
312 312
                 foreach($innerJoins as $field=>$def) {
313 313
                     if (isset ($def['db_field'])) {
314
-                      foreach($def['db_field'] as $dbfield)
315
-                          $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'";
316
-                          $params['custom_select'] .= ", $dbfield";
317
-                          $params['distinct'] = true;
318
-                          //$filterFields[$dbfield] = $dbfield;
314
+                        foreach($def['db_field'] as $dbfield)
315
+                            $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'";
316
+                            $params['custom_select'] .= ", $dbfield";
317
+                            $params['distinct'] = true;
318
+                            //$filterFields[$dbfield] = $dbfield;
319 319
                     }
320 320
                 }
321 321
 
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 
342 342
                 if(count($displayColumns) > 0)
343 343
                 {
344
-                	$lv->displayColumns = $displayColumns;
344
+                    $lv->displayColumns = $displayColumns;
345 345
                 } else {
346
-                	$lv->displayColumns = $listViewDefs[$seed->module_dir];
346
+                    $lv->displayColumns = $listViewDefs[$seed->module_dir];
347 347
                 }
348 348
 
349 349
                 $lv->export = false;
@@ -368,56 +368,56 @@  discard block
 block discarded – undo
368 368
                     $module_results[$moduleName] .= $lv->display(false, false);
369 369
                 }
370 370
 
371
-			}
372
-		}
371
+            }
372
+        }
373 373
 
374
-		if($has_results) {
375
-			foreach($module_counts as $name=>$value) {
376
-				echo $module_results[$name];
377
-			}
378
-		} else if(empty($_REQUEST['form_only'])) {
379
-			echo $home_mod_strings['LBL_NO_RESULTS'];
380
-			echo $home_mod_strings['LBL_NO_RESULTS_TIPS'];
381
-		}
374
+        if($has_results) {
375
+            foreach($module_counts as $name=>$value) {
376
+                echo $module_results[$name];
377
+            }
378
+        } else if(empty($_REQUEST['form_only'])) {
379
+            echo $home_mod_strings['LBL_NO_RESULTS'];
380
+            echo $home_mod_strings['LBL_NO_RESULTS_TIPS'];
381
+        }
382 382
 
383
-	}
383
+    }
384 384
 
385
-	function buildCache()
386
-	{
385
+    function buildCache()
386
+    {
387 387
 
388
-		global $beanList, $beanFiles, $dictionary;
388
+        global $beanList, $beanFiles, $dictionary;
389 389
 
390
-		$supported_modules = array();
390
+        $supported_modules = array();
391 391
 
392
-		foreach($beanList as $moduleName=>$beanName)
393
-		{
394
-			if (!isset($beanFiles[$beanName]))
395
-				continue;
392
+        foreach($beanList as $moduleName=>$beanName)
393
+        {
394
+            if (!isset($beanFiles[$beanName]))
395
+                continue;
396 396
 
397
-			$beanName = BeanFactory::getObjectName($moduleName);
398
-			$manager = new VardefManager ( );
399
-			$manager->loadVardef( $moduleName , $beanName ) ;
397
+            $beanName = BeanFactory::getObjectName($moduleName);
398
+            $manager = new VardefManager ( );
399
+            $manager->loadVardef( $moduleName , $beanName ) ;
400 400
 
401
-			// obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php)
402
-			if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){
401
+            // obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php)
402
+            if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){
403 403
                 require('custom/modules/'.$moduleName.'/metadata/metafiles.php');
404 404
             }elseif(file_exists('modules/'.$moduleName.'/metadata/metafiles.php')){
405 405
                 require('modules/'.$moduleName.'/metadata/metafiles.php');
406 406
             }
407 407
 
408 408
 
409
-			if(!empty($metafiles[$moduleName]['searchfields']))
410
-			{
411
-				require $metafiles[$moduleName]['searchfields'] ;
412
-			} else if(file_exists("modules/{$moduleName}/metadata/SearchFields.php")) {
413
-				require "modules/{$moduleName}/metadata/SearchFields.php" ;
414
-			}
409
+            if(!empty($metafiles[$moduleName]['searchfields']))
410
+            {
411
+                require $metafiles[$moduleName]['searchfields'] ;
412
+            } else if(file_exists("modules/{$moduleName}/metadata/SearchFields.php")) {
413
+                require "modules/{$moduleName}/metadata/SearchFields.php" ;
414
+            }
415 415
 
416
-			//Load custom SearchFields.php if it exists
417
-			if(file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php"))
418
-			{
419
-				require "custom/modules/{$moduleName}/metadata/SearchFields.php" ;
420
-			}				
416
+            //Load custom SearchFields.php if it exists
417
+            if(file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php"))
418
+            {
419
+                require "custom/modules/{$moduleName}/metadata/SearchFields.php" ;
420
+            }				
421 421
 
422 422
             //If there are $searchFields are empty, just continue, there are no search fields defined for the module
423 423
             if(empty($searchFields[$moduleName]))
@@ -425,34 +425,34 @@  discard block
 block discarded – undo
425 425
                 continue;
426 426
             }
427 427
 
428
-			$isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i' , $moduleName);
429
-
430
-			//If the bean supports unified search or if it's a custom module bean and unified search is not defined
431
-			if(!empty($dictionary[$beanName]['unified_search']) || $isCustomModule)
432
-			{
433
-				$fields = array();
434
-				foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def )
435
-				{
436
-					// We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email'
437
-					// the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search.
438
-					// So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter
439
-
440
-					if (strpos($field,'email') !== false)
441
-					{
442
-						$field = 'email' ;
443
-					}
444
-
445
-					//bug: 38139 - allow phone to be searched through Global Search
446
-					if (strpos($field,'phone') !== false)
447
-					{
448
-						$field = 'phone' ;
449
-					}
450
-
451
-					if ( !empty($def['unified_search']) && isset ( $searchFields [ $moduleName ] [ $field ]  ))
452
-					{
453
-						$fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ;
454
-					}
455
-				}
428
+            $isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i' , $moduleName);
429
+
430
+            //If the bean supports unified search or if it's a custom module bean and unified search is not defined
431
+            if(!empty($dictionary[$beanName]['unified_search']) || $isCustomModule)
432
+            {
433
+                $fields = array();
434
+                foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def )
435
+                {
436
+                    // We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email'
437
+                    // the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search.
438
+                    // So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter
439
+
440
+                    if (strpos($field,'email') !== false)
441
+                    {
442
+                        $field = 'email' ;
443
+                    }
444
+
445
+                    //bug: 38139 - allow phone to be searched through Global Search
446
+                    if (strpos($field,'phone') !== false)
447
+                    {
448
+                        $field = 'phone' ;
449
+                    }
450
+
451
+                    if ( !empty($def['unified_search']) && isset ( $searchFields [ $moduleName ] [ $field ]  ))
452
+                    {
453
+                        $fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ;
454
+                    }
455
+                }
456 456
 
457 457
                 foreach ($searchFields[$moduleName] as $field => $def)
458 458
                 {
@@ -465,23 +465,23 @@  discard block
 block discarded – undo
465 465
                     }
466 466
                 }
467 467
 
468
-				if(count($fields) > 0) {
469
-					$supported_modules [$moduleName] ['fields'] = $fields;
470
-					if (isset($dictionary[$beanName]['unified_search_default_enabled']) && $dictionary[$beanName]['unified_search_default_enabled'] === TRUE)
471
-					{
468
+                if(count($fields) > 0) {
469
+                    $supported_modules [$moduleName] ['fields'] = $fields;
470
+                    if (isset($dictionary[$beanName]['unified_search_default_enabled']) && $dictionary[$beanName]['unified_search_default_enabled'] === TRUE)
471
+                    {
472 472
                         $supported_modules [$moduleName]['default'] = true;
473 473
                     } else {
474 474
                         $supported_modules [$moduleName]['default'] = false;
475 475
                     }
476
-				}
476
+                }
477 477
 
478
-			}
478
+            }
479 479
 
480
-		}
480
+        }
481 481
 
482
-		ksort($supported_modules);
483
-		write_array_to_file('unified_search_modules', $supported_modules, $this->cache_search);
484
-	}
482
+        ksort($supported_modules);
483
+        write_array_to_file('unified_search_modules', $supported_modules, $this->cache_search);
484
+    }
485 485
 
486 486
     /**
487 487
      * Retrieve the enabled and disabled modules used for global search.
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
                 $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module;
526 526
                 if($data['default'])
527 527
                 {
528
-                  $json_enabled[] = array("module" => $module, 'label' => $label);
528
+                    $json_enabled[] = array("module" => $module, 'label' => $label);
529 529
                 } else {
530
-                  $json_disabled[] = array("module" => $module, 'label' => $label);
530
+                    $json_disabled[] = array("module" => $module, 'label' => $label);
531 531
                 }
532 532
             }
533 533
         }
@@ -536,47 +536,47 @@  discard block
 block discarded – undo
536 536
     }
537 537
 
538 538
 
539
-	/**
540
-	 * saveGlobalSearchSettings
541
-	 * This method handles the administrator's request to save the searchable modules selected and stores
542
-	 * the results in the unified_search_modules_display.php file
543
-	 *
544
-	 */
545
-	function saveGlobalSearchSettings()
546
-	{
547
-		if(isset($_REQUEST['enabled_modules']))
548
-		{
539
+    /**
540
+     * saveGlobalSearchSettings
541
+     * This method handles the administrator's request to save the searchable modules selected and stores
542
+     * the results in the unified_search_modules_display.php file
543
+     *
544
+     */
545
+    function saveGlobalSearchSettings()
546
+    {
547
+        if(isset($_REQUEST['enabled_modules']))
548
+        {
549 549
             $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay();
550 550
 
551
-			$new_unified_search_modules_display = array();
551
+            $new_unified_search_modules_display = array();
552 552
 
553 553
             foreach(explode (',', $_REQUEST['enabled_modules'] ) as $module)
554 554
             {
555 555
                 $new_unified_search_modules_display[$module]['visible'] = true;
556 556
             }
557 557
 
558
-			foreach($unified_search_modules_display as $module=>$data)
559
-			{
560
-				if(!isset($new_unified_search_modules_display[$module]))
561
-				{
562
-				   $new_unified_search_modules_display[$module]['visible'] = false;
563
-				}
564
-			}
565
-
566
-			$this->writeUnifiedSearchModulesDisplayFile($new_unified_search_modules_display);
567
-		}
568
-	}
569
-
570
-
571
-	public static function unlinkUnifiedSearchModulesFile() {
572
-		//clear the unified_search_module.php file
573
-		$cache_search = sugar_cached('modules/unified_search_modules.php');
574
-    	if(file_exists($cache_search))
575
-    	{
576
-    		$GLOBALS['log']->info("unlink {$cache_search}");
577
-    		unlink($cache_search);
578
-    	}
579
-	}
558
+            foreach($unified_search_modules_display as $module=>$data)
559
+            {
560
+                if(!isset($new_unified_search_modules_display[$module]))
561
+                {
562
+                    $new_unified_search_modules_display[$module]['visible'] = false;
563
+                }
564
+            }
565
+
566
+            $this->writeUnifiedSearchModulesDisplayFile($new_unified_search_modules_display);
567
+        }
568
+    }
569
+
570
+
571
+    public static function unlinkUnifiedSearchModulesFile() {
572
+        //clear the unified_search_module.php file
573
+        $cache_search = sugar_cached('modules/unified_search_modules.php');
574
+        if(file_exists($cache_search))
575
+        {
576
+            $GLOBALS['log']->info("unlink {$cache_search}");
577
+            unlink($cache_search);
578
+        }
579
+    }
580 580
     
581 581
 
582 582
     /**
@@ -589,21 +589,21 @@  discard block
 block discarded – undo
589 589
      */
590 590
     public function getUnifiedSearchModules()
591 591
     {
592
-		//Make directory if it doesn't exist
592
+        //Make directory if it doesn't exist
593 593
         $cachedir = sugar_cached('modules');
594
-		if(!file_exists($cachedir))
595
-		{
596
-		   mkdir_recursive($cachedir);
597
-		}
594
+        if(!file_exists($cachedir))
595
+        {
596
+            mkdir_recursive($cachedir);
597
+        }
598 598
 
599
-		//Load unified_search_modules.php file
599
+        //Load unified_search_modules.php file
600 600
         $cachedFile = sugar_cached('modules/unified_search_modules.php');
601
-		if(!file_exists($cachedFile))
602
-		{
603
-			$this->buildCache();
604
-		}
601
+        if(!file_exists($cachedFile))
602
+        {
603
+            $this->buildCache();
604
+        }
605 605
 
606
-		include $cachedFile;
606
+        include $cachedFile;
607 607
         return $unified_search_modules;
608 608
     }
609 609
 
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
      */
619 619
     public function getUnifiedSearchModulesDisplay()
620 620
     {
621
-		if(!file_exists('custom/modules/unified_search_modules_display.php'))
622
-		{
621
+        if(!file_exists('custom/modules/unified_search_modules_display.php'))
622
+        {
623 623
             $unified_search_modules = $this->getUnifiedSearchModules();
624 624
 
625 625
             $unified_search_modules_display = array();
@@ -633,13 +633,13 @@  discard block
 block discarded – undo
633 633
             }
634 634
 
635 635
             $this->writeUnifiedSearchModulesDisplayFile($unified_search_modules_display);
636
-		}
636
+        }
637 637
 
638
-		include('custom/modules/unified_search_modules_display.php');
638
+        include('custom/modules/unified_search_modules_display.php');
639 639
         return $unified_search_modules_display;
640 640
     }
641 641
 
642
-	/*
642
+    /*
643 643
 	 * writeUnifiedSearchModulesDisplayFile
644 644
 	 * Private method to handle writing the unified_search_modules_display value to file
645 645
 	 *
@@ -647,35 +647,35 @@  discard block
 block discarded – undo
647 647
 	 * @return boolean value indication whether or not file was successfully written
648 648
 	 * @throws Exception Thrown if the file write operation fails
649 649
 	 */
650
-	private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display)
651
-	{
652
-		if(is_null($unified_search_modules_display) || empty($unified_search_modules_display))
653
-		{
654
-		   return false;
655
-		}
656
-
657
-	    if(!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php'))
658
-	    {
659
-	    	//Log error message and throw Exception
660
-	    	global $app_strings;
661
-	    	$msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php'));
662
-	    	$GLOBALS['log']->error($msg);
663
-	    	throw new Exception($msg);
664
-	    }
665
-
666
-	    return true;
667
-	}
650
+    private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display)
651
+    {
652
+        if(is_null($unified_search_modules_display) || empty($unified_search_modules_display))
653
+        {
654
+            return false;
655
+        }
656
+
657
+        if(!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php'))
658
+        {
659
+            //Log error message and throw Exception
660
+            global $app_strings;
661
+            $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php'));
662
+            $GLOBALS['log']->error($msg);
663
+            throw new Exception($msg);
664
+        }
665
+
666
+        return true;
667
+    }
668 668
 }
669 669
 
670 670
 
671 671
 function unified_search_modules_cmp($a, $b) {
672
-	if(!isset($a['translated']) || !isset($b['translated']))
673
-	{
674
-	   return 0;
675
-	}
672
+    if(!isset($a['translated']) || !isset($b['translated']))
673
+    {
674
+        return 0;
675
+    }
676 676
 
677
-	$name1 = strtolower($a['translated']);
678
-	$name2 = strtolower($b['translated']);
677
+    $name1 = strtolower($a['translated']);
678
+    $name2 = strtolower($b['translated']);
679 679
 
680
-	return $name1 < $name2 ? -1 : 1;
680
+    return $name1 < $name2 ? -1 : 1;
681 681
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefields.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -45,20 +45,20 @@  discard block
 block discarded – undo
45 45
     var $mbModule;
46 46
     
47 47
     /**
48
-	 * @see SugarView::_getModuleTitleParams()
49
-	 */
50
-	protected function _getModuleTitleParams($browserTitle = false)
51
-	{
52
-	    global $mod_strings;
48
+     * @see SugarView::_getModuleTitleParams()
49
+     */
50
+    protected function _getModuleTitleParams($browserTitle = false)
51
+    {
52
+        global $mod_strings;
53 53
 	    
54
-    	return array(
55
-    	   translate('LBL_MODULE_NAME','Administration'),
56
-    	   ModuleBuilderController::getModuleTitle(),
57
-    	   );
54
+        return array(
55
+            translate('LBL_MODULE_NAME','Administration'),
56
+            ModuleBuilderController::getModuleTitle(),
57
+            );
58 58
     }
59 59
 
60
-	function display()
61
-	{
60
+    function display()
61
+    {
62 62
         $smarty = new Sugar_Smarty();
63 63
         global $mod_strings;
64 64
         $bak_mod_strings=$mod_strings;
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
                 if ($this->isValidStudioField($def))
93 93
                 {
94 94
                     $def['label'] = translate($def['vname'], $module_name);
95
-					//Custom relate fields will have a non-db source, but custom_module set
96
-                	if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97
-                       $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98
-                       $def['custom'] = true;
95
+                    //Custom relate fields will have a non-db source, but custom_module set
96
+                    if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97
+                        $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98
+                        $def['custom'] = true;
99 99
                     } else {
100
-                       $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def;
101
-                       $def['custom'] = false;
100
+                        $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def;
101
+                        $def['custom'] = false;
102 102
                     }
103 103
 
104 104
                     $def['type'] = isset($fieldTypes[$def['type']]) ? $fieldTypes[$def['type']] : ucfirst($def['type']);
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
                     {
184 184
                         if (isset($loadedFields[$field]))
185 185
                         {
186
-                           unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]);
186
+                            unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]);
187 187
                         } else {
188
-                           $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field;
189
-                           $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false;
190
-                           $loadedFields[$field] = true;
188
+                            $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field;
189
+                            $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false;
190
+                            $loadedFields[$field] = true;
191 191
 
192
-                           $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'];
193
-                           $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type);
194
-                           $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field];
192
+                            $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'];
193
+                            $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type);
194
+                            $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field];
195 195
                         }
196 196
                     }
197 197
                 }
@@ -249,29 +249,29 @@  discard block
 block discarded – undo
249 249
     function isValidStudioField(
250 250
         $def
251 251
         )
252
-	{
253
-    	if (isset($def['studio'])) {
252
+    {
253
+        if (isset($def['studio'])) {
254 254
             if (is_array($def [ 'studio' ]))
255 255
             {
256
-    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
256
+                if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
257 257
                     return true;
258
-    			if (isset($def['studio']['required']) && $def['studio']['required'])
258
+                if (isset($def['studio']['required']) && $def['studio']['required'])
259 259
                     return true;
260 260
                     
261
-    		} else
262
-    		{
263
-    			if ($def['studio'] == 'visible')
261
+            } else
262
+            {
263
+                if ($def['studio'] == 'visible')
264 264
                     return true;
265 265
                 if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
266 266
                     return false;
267 267
             }
268 268
         }
269
-    	if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
270
-		{
271
-    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
272
-		  return true;
273
-		}
269
+        if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
270
+        {
271
+            if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
272
+            return true;
273
+        }
274 274
 		
275
-		return false;
276
-	}
275
+        return false;
276
+    }
277 277
 }
278 278
\ No newline at end of file
Please login to merge, or discard this patch.
data/SugarBean.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
      * Internal Function, do not override.
580 580
      */
581 581
     public static function get_union_related_list($parentbean, $order_by = "", $sort_order = '', $where = "",
582
-                                           $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0, $subpanel_def)
582
+                                            $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0, $subpanel_def)
583 583
     {
584 584
         $secondary_queries = array();
585 585
         global $layout_edit_mode;
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
      * @return array $fetched data.
846 846
      */
847 847
     public function process_union_list_query($parent_bean, $query,
848
-                                      $row_offset, $limit = -1, $max_per_page = -1, $where = '', $subpanel_def, $query_row_count = '', $secondary_queries = array())
848
+                                        $row_offset, $limit = -1, $max_per_page = -1, $where = '', $subpanel_def, $query_row_count = '', $secondary_queries = array())
849 849
     {
850 850
         $db = DBManagerFactory::getInstance('listviews');
851 851
         /**
@@ -3345,16 +3345,16 @@  discard block
 block discarded – undo
3345 3345
         return $ret_array['select'] . $ret_array['from'] . $ret_array['where'] . $ret_array['order_by'];
3346 3346
     }
3347 3347
 
3348
-	public function get_relationship_field($field)
3349
-	{
3350
-		foreach ($this->field_defs as $field_def => $value) {
3351
-			if (isset($value['relationship_fields']) && 
3352
-				in_array($field, $value['relationship_fields']) &&
3348
+    public function get_relationship_field($field)
3349
+    {
3350
+        foreach ($this->field_defs as $field_def => $value) {
3351
+            if (isset($value['relationship_fields']) && 
3352
+                in_array($field, $value['relationship_fields']) &&
3353 3353
                 (!isset($value['link_type']) || $value['link_type'] != 'relationship_info')
3354 3354
             ) {
3355 3355
                 return $field_def;
3356 3356
             }
3357
-		}
3357
+        }
3358 3358
 
3359 3359
         return false;
3360 3360
     }
@@ -4326,7 +4326,7 @@  discard block
 block discarded – undo
4326 4326
      * Internal function, do not override.
4327 4327
      */
4328 4328
     public function get_related_list($child_seed, $related_field_name, $order_by = "", $where = "",
4329
-                              $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0)
4329
+                                $row_offset = 0, $limit = -1, $max = -1, $show_deleted = 0)
4330 4330
     {
4331 4331
         global $layout_edit_mode;
4332 4332
 
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.quick_radius.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@  discard block
 block discarded – undo
4 4
 
5 5
 class Jjwg_MapsViewQuick_Radius extends SugarView {
6 6
 
7
- 	function __construct() {
8
- 		parent::__construct();
9
- 	}
7
+        function __construct() {
8
+            parent::__construct();
9
+        }
10 10
 
11
-	function display() {
11
+    function display() {
12 12
 
13 13
         if (!isset($_REQUEST['quick_address'])) $_REQUEST['quick_address'] = '';
14 14
 ?>
@@ -66,5 +66,5 @@  discard block
 block discarded – undo
66 66
 </form>
67 67
 
68 68
 <?php
69
-  }
69
+    }
70 70
 }
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.map_markers.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@  discard block
 block discarded – undo
4 4
 
5 5
 class Jjwg_MapsViewMap_Markers extends SugarView {
6 6
 
7
-  function __construct() {
7
+    function __construct() {
8 8
     parent::__construct();
9
-  }
9
+    }
10 10
 
11
-  function display() {
11
+    function display() {
12 12
 
13 13
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
14 14
 
@@ -125,22 +125,22 @@  discard block
 block discarded – undo
125 125
     // Define Dir of Group Icons
126 126
     $icons_dir_base = 'themes/default/images/jjwg_Maps/';
127 127
     if ($num_groups <= 10) {
128
-      $icons_dir = $icons_dir_base.'0-10/';
128
+        $icons_dir = $icons_dir_base.'0-10/';
129 129
     } elseif ($num_groups <= 25) {
130
-      $icons_dir = $icons_dir_base.'0-25/';
130
+        $icons_dir = $icons_dir_base.'0-25/';
131 131
     } elseif ($num_groups <= 100) {
132
-      $icons_dir = $icons_dir_base.'0-100/';
132
+        $icons_dir = $icons_dir_base.'0-100/';
133 133
     } elseif ($num_groups <= 216) {
134
-      $icons_dir = $icons_dir_base.'0-216/';
134
+        $icons_dir = $icons_dir_base.'0-216/';
135 135
     } else {
136
-      $icons_dir = $icons_dir_base.'0-10/'; // Demo Version
136
+        $icons_dir = $icons_dir_base.'0-10/'; // Demo Version
137 137
     }
138 138
 
139 139
     // Define Custom Markers Dir and Common Icons
140 140
     $custom_markers_dir = 'custom/themes/default/images/jjwg_Markers/';
141 141
     $custom_markers_icons = array();
142 142
     foreach($this->bean->custom_markers as $marker) {
143
-      $custom_markers_icons[] = $marker['image'];
143
+        $custom_markers_icons[] = $marker['image'];
144 144
     }
145 145
     $num_custom_markers = count($this->bean->custom_markers);
146 146
     $custom_markers_icons = array_unique($custom_markers_icons);
@@ -890,21 +890,21 @@  discard block
 block discarded – undo
890 890
   <br clear="all" />
891 891
 
892 892
 <?php
893
-  if (!empty($this->bean->map_center) || $num_markers > 0) {
893
+    if (!empty($this->bean->map_center) || $num_markers > 0) {
894 894
 ?>
895 895
   <div id="legend">
896 896
   <b><?php echo $GLOBALS['mod_strings']['LBL_MAP_LEGEND']; ?></b><br/>
897 897
 <?php
898
-  if (!empty($this->bean->map_center)) {
898
+    if (!empty($this->bean->map_center)) {
899 899
 ?>
900 900
     <img src="<?php echo './'.$icons_dir.'/marker_0.png'; ?>" align="middle" />
901 901
     <?php echo $this->bean->map_center['name']; ?><br/>
902 902
 <?php
903
-  }
903
+    }
904 904
 ?>
905 905
   <!-- <b><?php echo $GLOBALS['mod_strings']['LBL_MAP_USER_GROUPS']; ?> </b><br/> -->
906 906
 <?php
907
-  foreach($group_name_to_num as $group_name => $group_number) {
907
+    foreach($group_name_to_num as $group_name => $group_number) {
908 908
 ?>
909 909
     <img src="<?php echo './'.$icons_dir.'/marker_'.$group_number.'.png'; ?>"
910 910
          rel="<?php echo $group_number; ?>" align="middle" />
@@ -916,15 +916,15 @@  discard block
 block discarded – undo
916 916
     }
917 917
     ?><br/>
918 918
 <?php
919
-  }
919
+    }
920 920
 ?>
921 921
   </div>
922 922
 <?php
923
-  }
923
+    }
924 924
 ?>
925 925
 
926 926
 <?php
927
-  if ($num_markers > 0) {
927
+    if ($num_markers > 0) {
928 928
 ?>
929 929
     <div id="DataTable">
930 930
         <table cellpadding="3" cellspacing="0" border="1" width="100%" class="list view" id="displayDataTable">
@@ -947,11 +947,11 @@  discard block
 block discarded – undo
947 947
         </table>
948 948
     </div>
949 949
 <?php
950
-  }
950
+    }
951 951
 ?>
952 952
 
953 953
 <?php
954
-  if (in_array($this->bean->display_object->module_name, array('Accounts', 'Contacts', 'Leads', 'Prospects', 'Users')) &&
954
+    if (in_array($this->bean->display_object->module_name, array('Accounts', 'Contacts', 'Leads', 'Prospects', 'Users')) &&
955 955
           ($GLOBALS['current_user']->isAdmin() || $this->bean->ACLAccess('list')) &&
956 956
           empty($_REQUEST['list_id']) && !empty($this->bean->list_array)) {
957 957
 ?>
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
     </form>
973 973
 </div>
974 974
 <?php
975
-  }
975
+    }
976 976
 ?>
977 977
 
978 978
 </body>
@@ -992,5 +992,5 @@  discard block
 block discarded – undo
992 992
 </html>
993 993
 <?php
994 994
 
995
-   }
995
+    }
996 996
 }
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.geocoded_counts.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@  discard block
 block discarded – undo
4 4
 
5 5
 class Jjwg_MapsViewGeocoded_Counts extends SugarView {
6 6
 
7
-   function __construct() {
8
-     parent::__construct();
9
-   }
7
+    function __construct() {
8
+        parent::__construct();
9
+    }
10 10
 
11
-  function display() {
11
+    function display() {
12 12
 
13 13
     echo '<div class="moduleTitle"><h2>'.$GLOBALS['mod_strings']['LBL_GEOCODED_COUNTS'].'</h2><div class="clear"></div></div>';
14 14
     echo '<div class="clear"></div>';
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 
18 18
     // Display last status code, if set.
19 19
     if (!empty($_REQUEST['last_status']) && preg_match('/[A-Z\_]/', $_REQUEST['last_status'])) {
20
-      echo '<div><b>'.$GLOBALS['mod_strings']['LBL_MAP_LAST_STATUS'].': '.$_REQUEST['last_status'].'</b></div>';
21
-      echo '<br /><br />';
20
+        echo '<div><b>'.$GLOBALS['mod_strings']['LBL_MAP_LAST_STATUS'].': '.$_REQUEST['last_status'].'</b></div>';
21
+        echo '<br /><br />';
22 22
     }
23 23
 
24 24
     echo '<table cellspacing="0" cellpadding="0" border="0" class="list view" style="width: 50% !important;"><tbody>';
25 25
     echo '<tr><th>'.$GLOBALS['mod_strings']['LBL_MODULE_HEADING'].'</th>';
26 26
     foreach ($this->bean->geocoded_headings as $heading) {
27
-      echo '<th>'.$heading.'</th>';
27
+        echo '<th>'.$heading.'</th>';
28 28
     }
29 29
     echo '<th>'.$GLOBALS['mod_strings']['LBL_MODULE_TOTAL_HEADING'].'</th>';
30 30
     echo '<th>'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</th>';
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
 
33 33
     foreach ($GLOBALS['jjwg_config']['valid_geocode_modules'] as $module) {
34 34
 
35
-      $geocode_url = './index.php?module=jjwg_Maps&action=geocode_addresses&display_module='.$module;
36
-      $reset_url = './index.php?module=jjwg_Maps&action=reset_geocoding&display_module='.$module;
35
+        $geocode_url = './index.php?module=jjwg_Maps&action=geocode_addresses&display_module='.$module;
36
+        $reset_url = './index.php?module=jjwg_Maps&action=reset_geocoding&display_module='.$module;
37 37
 
38
-      echo '<tr>';
39
-      echo '<td><strong><a href="'.htmlspecialchars($geocode_url).'">'.$GLOBALS['app_list_strings']['moduleList'][$module].'</a></strong></td>';
40
-      foreach ($this->bean->geocoded_headings as $heading) {
38
+        echo '<tr>';
39
+        echo '<td><strong><a href="'.htmlspecialchars($geocode_url).'">'.$GLOBALS['app_list_strings']['moduleList'][$module].'</a></strong></td>';
40
+        foreach ($this->bean->geocoded_headings as $heading) {
41 41
         echo '<td>'.$this->bean->geocoded_counts[$module][$heading].'</td>';
42
-      }
43
-      echo '<td><strong>'.$this->bean->geocoded_module_totals[$module].'</strong></td>';
44
-      echo '<td><strong><a href="'.htmlspecialchars($reset_url).'">'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</a.</strong></td>';
45
-      echo '</tr>'."\n";
42
+        }
43
+        echo '<td><strong>'.$this->bean->geocoded_module_totals[$module].'</strong></td>';
44
+        echo '<td><strong><a href="'.htmlspecialchars($reset_url).'">'.$GLOBALS['mod_strings']['LBL_MODULE_RESET_HEADING'].'</a.</strong></td>';
45
+        echo '</tr>'."\n";
46 46
     }
47 47
 
48 48
     echo '</tbody></table>';
@@ -87,6 +87,6 @@  discard block
 block discarded – undo
87 87
     $delete_url = './index.php?module=jjwg_Maps&action=delete_all_address_cache';
88 88
     echo '<a href="'.htmlspecialchars($delete_url).'">'.$GLOBALS['app_strings']['LBL_DELETE'].' - '.$GLOBALS['mod_strings']['LBL_ADDRESS_CACHE'].'</a>';
89 89
 
90
-  }
90
+    }
91 91
 }
92 92
 
Please login to merge, or discard this patch.