Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
include/generic/SugarWidgets/SugarWidgetField.php 1 patch
Indentation   +139 added lines, -139 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!defined('sugarEntry') || !sugarEntry)
3
-	die('Not A Valid Entry Point');
3
+    die('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -46,166 +46,166 @@  discard block
 block discarded – undo
46 46
 
47 47
 class SugarWidgetField extends SugarWidget {
48 48
 
49
-	function SugarWidgetField(&$layout_manager) {
49
+    function SugarWidgetField(&$layout_manager) {
50 50
         parent::SugarWidget($layout_manager);
51 51
     }
52 52
 
53
-	function display($layout_def) {
54
-		//print $layout_def['start_link_wrapper']."===";
55
-		$context = $this->layout_manager->getAttribute('context'); //_ppd($context);
56
-		$func_name = 'display'.$context;
53
+    function display($layout_def) {
54
+        //print $layout_def['start_link_wrapper']."===";
55
+        $context = $this->layout_manager->getAttribute('context'); //_ppd($context);
56
+        $func_name = 'display'.$context;
57 57
 
58
-		if (!empty ($context) && method_exists($this, $func_name)) {
59
-			return $this-> $func_name ($layout_def);
60
-		} else {
61
-			return 'display not found:'.$func_name;
62
-		}
63
-	}
58
+        if (!empty ($context) && method_exists($this, $func_name)) {
59
+            return $this-> $func_name ($layout_def);
60
+        } else {
61
+            return 'display not found:'.$func_name;
62
+        }
63
+    }
64 64
 
65
-	function _get_column_alias($layout_def) {
66
-		$alias_arr = array ();
65
+    function _get_column_alias($layout_def) {
66
+        $alias_arr = array ();
67 67
 
68
-		if (!empty ($layout_def['name']) && $layout_def['name'] == 'count') {
69
-			return 'count';
70
-		}
68
+        if (!empty ($layout_def['name']) && $layout_def['name'] == 'count') {
69
+            return 'count';
70
+        }
71 71
 
72
-		if (!empty ($layout_def['table_alias'])) {
73
-			array_push($alias_arr, $layout_def['table_alias']);
74
-		}
72
+        if (!empty ($layout_def['table_alias'])) {
73
+            array_push($alias_arr, $layout_def['table_alias']);
74
+        }
75 75
 
76
-		if (!empty ($layout_def['name'])) {
77
-			array_push($alias_arr, $layout_def['name']);
78
-		}
76
+        if (!empty ($layout_def['name'])) {
77
+            array_push($alias_arr, $layout_def['name']);
78
+        }
79 79
 
80
-		return $this->getTruncatedColumnAlias(implode("_", $alias_arr));
81
-	}
80
+        return $this->getTruncatedColumnAlias(implode("_", $alias_arr));
81
+    }
82 82
 
83
-	function & displayDetailLabel(& $layout_def) {
83
+    function & displayDetailLabel(& $layout_def) {
84 84
 
85
-		return '';
86
-	}
85
+        return '';
86
+    }
87 87
 
88
-	function & displayDetail($layout_def) {
88
+    function & displayDetail($layout_def) {
89 89
 
90 90
         $layout_def = '';
91
-		return $layout_def;
92
-	}
91
+        return $layout_def;
92
+    }
93 93
 	
94
-	function displayHeaderCellPlain($layout_def) 
95
-	{
96
-		if (!empty ($layout_def['label'])) {
97
-			return $layout_def['label'];
98
-		}
99
-		if (!empty ($layout_def['vname'])) {
100
-			return translate($layout_def['vname'], $this->layout_manager->getAttribute('module_name'));
101
-		}
102
-		return '';
103
-	}
104
-
105
-	function displayHeaderCell($layout_def) {
106
-		$module_name = $this->layout_manager->getAttribute('module_name');
107
-
108
-		$this->local_current_module = $_REQUEST['module'];
109
-		$this->is_dynamic = true;
110
-		// don't show sort links if name isn't defined
111
-		if ((empty ($layout_def['name']) || (isset ($layout_def['sortable']) && !$layout_def['sortable']))
94
+    function displayHeaderCellPlain($layout_def) 
95
+    {
96
+        if (!empty ($layout_def['label'])) {
97
+            return $layout_def['label'];
98
+        }
99
+        if (!empty ($layout_def['vname'])) {
100
+            return translate($layout_def['vname'], $this->layout_manager->getAttribute('module_name'));
101
+        }
102
+        return '';
103
+    }
104
+
105
+    function displayHeaderCell($layout_def) {
106
+        $module_name = $this->layout_manager->getAttribute('module_name');
107
+
108
+        $this->local_current_module = $_REQUEST['module'];
109
+        $this->is_dynamic = true;
110
+        // don't show sort links if name isn't defined
111
+        if ((empty ($layout_def['name']) || (isset ($layout_def['sortable']) && !$layout_def['sortable']))
112 112
         && !empty ($layout_def['label'])) {
113
-			return $layout_def['label'];
114
-		}
115
-		if (isset ($layout_def['sortable']) && !$layout_def['sortable']) {
116
-			return $this->displayHeaderCellPlain($layout_def);
117
-		}
118
-
119
-		$header_cell_text = $this->displayHeaderCellPlain($layout_def);
120
-
121
-		$subpanel_module = $layout_def['subpanel_module'];
122
-		$html_var = $subpanel_module . "_CELL";
123
-		if (empty ($this->base_URL)) {
124
-			$objListView = new ListView();
125
-			$this->base_URL = $objListView -> getBaseURL($html_var);
126
-			$split_url = explode('&to_pdf=true&action=SubPanelViewer&subpanel=', $this->base_URL);
127
-			$this->base_URL = $split_url[0];
128
-			$this->base_URL .= '&inline=true&to_pdf=true&action=SubPanelViewer&subpanel=';
129
-		}
130
-		$sort_by_name = $layout_def['name'];
131
-		if (isset ($layout_def['sort_by'])) {
132
-			$sort_by_name = $layout_def['sort_by'];
133
-		}
134
-
135
-		$objListView = new ListView();
136
-		$sort_by = $objListView->getSessionVariableName($html_var, "ORDER_BY").'='.$sort_by_name;
137
-
138
-		$start = (empty ($layout_def['start_link_wrapper'])) ? '' : $layout_def['start_link_wrapper'];
139
-		$end = (empty ($layout_def['end_link_wrapper'])) ? '' : $layout_def['end_link_wrapper'];
140
-
141
-		$header_cell = "<a class=\"listViewThLinkS1\" href=\"".$start.$this->base_URL.$subpanel_module.'&'.$sort_by.$end."\">";
142
-		$header_cell .= $header_cell_text;
143
-
144
-		$imgArrow = '';
145
-
146
-		if (isset ($layout_def['sort'])) {
147
-			$imgArrow = $layout_def['sort'];
148
-		}
149
-		$arrow_start = $objListView->getArrowUpDownStart($imgArrow);
150
-		$arrow_end = $objListView->getArrowUpDownEnd($imgArrow);
151
-		$header_cell .= " ".$arrow_start.$arrow_end."</a>";
152
-
153
-		return $header_cell;
154
-
155
-	}
156
-
157
-	function displayList($layout_def) {
158
-		return $this->displayListPlain($layout_def);
159
-	}
160
-
161
-	function displayListPlain($layout_def) {
162
-		$value= $this->_get_list_value($layout_def);
163
-		if (isset($layout_def['widget_type']) && $layout_def['widget_type'] =='checkbox') {
164
-			if ($value != '' &&  ($value == 'on' || intval($value) == 1 || $value == 'yes'))
165
-			{
166
-				return "<input name='checkbox_display' class='checkbox' type='checkbox' disabled='true' checked>";
167
-			}
168
-			return "<input name='checkbox_display' class='checkbox' type='checkbox' disabled='true'>";
169
-		}
170
-		return $value;
171
-	}
172
-
173
-	function _get_list_value(& $layout_def) 
174
-	{
175
-		$key = '';
176
-		if ( isset($layout_def['varname']) ) {
177
-		    $key = strtoupper($layout_def['varname']);
178
-		} 
179
-		else {
180
-			$key = strtoupper($this->_get_column_alias($layout_def));
181
-		}
182
-
183
-		if ( isset($layout_def['fields'][$key]) ) {
184
-			return $layout_def['fields'][$key];
185
-		}
113
+            return $layout_def['label'];
114
+        }
115
+        if (isset ($layout_def['sortable']) && !$layout_def['sortable']) {
116
+            return $this->displayHeaderCellPlain($layout_def);
117
+        }
118
+
119
+        $header_cell_text = $this->displayHeaderCellPlain($layout_def);
120
+
121
+        $subpanel_module = $layout_def['subpanel_module'];
122
+        $html_var = $subpanel_module . "_CELL";
123
+        if (empty ($this->base_URL)) {
124
+            $objListView = new ListView();
125
+            $this->base_URL = $objListView -> getBaseURL($html_var);
126
+            $split_url = explode('&to_pdf=true&action=SubPanelViewer&subpanel=', $this->base_URL);
127
+            $this->base_URL = $split_url[0];
128
+            $this->base_URL .= '&inline=true&to_pdf=true&action=SubPanelViewer&subpanel=';
129
+        }
130
+        $sort_by_name = $layout_def['name'];
131
+        if (isset ($layout_def['sort_by'])) {
132
+            $sort_by_name = $layout_def['sort_by'];
133
+        }
134
+
135
+        $objListView = new ListView();
136
+        $sort_by = $objListView->getSessionVariableName($html_var, "ORDER_BY").'='.$sort_by_name;
137
+
138
+        $start = (empty ($layout_def['start_link_wrapper'])) ? '' : $layout_def['start_link_wrapper'];
139
+        $end = (empty ($layout_def['end_link_wrapper'])) ? '' : $layout_def['end_link_wrapper'];
140
+
141
+        $header_cell = "<a class=\"listViewThLinkS1\" href=\"".$start.$this->base_URL.$subpanel_module.'&'.$sort_by.$end."\">";
142
+        $header_cell .= $header_cell_text;
143
+
144
+        $imgArrow = '';
145
+
146
+        if (isset ($layout_def['sort'])) {
147
+            $imgArrow = $layout_def['sort'];
148
+        }
149
+        $arrow_start = $objListView->getArrowUpDownStart($imgArrow);
150
+        $arrow_end = $objListView->getArrowUpDownEnd($imgArrow);
151
+        $header_cell .= " ".$arrow_start.$arrow_end."</a>";
152
+
153
+        return $header_cell;
154
+
155
+    }
156
+
157
+    function displayList($layout_def) {
158
+        return $this->displayListPlain($layout_def);
159
+    }
160
+
161
+    function displayListPlain($layout_def) {
162
+        $value= $this->_get_list_value($layout_def);
163
+        if (isset($layout_def['widget_type']) && $layout_def['widget_type'] =='checkbox') {
164
+            if ($value != '' &&  ($value == 'on' || intval($value) == 1 || $value == 'yes'))
165
+            {
166
+                return "<input name='checkbox_display' class='checkbox' type='checkbox' disabled='true' checked>";
167
+            }
168
+            return "<input name='checkbox_display' class='checkbox' type='checkbox' disabled='true'>";
169
+        }
170
+        return $value;
171
+    }
172
+
173
+    function _get_list_value(& $layout_def) 
174
+    {
175
+        $key = '';
176
+        if ( isset($layout_def['varname']) ) {
177
+            $key = strtoupper($layout_def['varname']);
178
+        } 
179
+        else {
180
+            $key = strtoupper($this->_get_column_alias($layout_def));
181
+        }
182
+
183
+        if ( isset($layout_def['fields'][$key]) ) {
184
+            return $layout_def['fields'][$key];
185
+        }
186 186
 		
187
-		return '';
188
-	}
187
+        return '';
188
+    }
189 189
 
190
-	function & displayEditLabel($layout_def) {
191
-		return '';
192
-	}
190
+    function & displayEditLabel($layout_def) {
191
+        return '';
192
+    }
193 193
 
194
-	function & displayEdit($layout_def) {
195
-		return '';
196
-	}
194
+    function & displayEdit($layout_def) {
195
+        return '';
196
+    }
197 197
 
198
-	function & displaySearchLabel($layout_def) {
199
-		return '';
200
-	}
198
+    function & displaySearchLabel($layout_def) {
199
+        return '';
200
+    }
201 201
 
202
-	function & displaySearch($layout_def) {
203
-		return '';
204
-	}
202
+    function & displaySearch($layout_def) {
203
+        return '';
204
+    }
205 205
 
206
-	function displayInput($layout_def) {
207
-		return ' -- Not Implemented --';
208
-	}
206
+    function displayInput($layout_def) {
207
+        return ' -- Not Implemented --';
208
+    }
209 209
 
210 210
     function getVardef($layout_def) {
211 211
         $myName = $layout_def['column_key'];
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFielddatepicker.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
 class SugarWidgetFieldDatePicker extends SugarWidgetFieldDateTime
45 45
 {
46
-	function displayInput($layout_def)
46
+    function displayInput($layout_def)
47 47
     {
48 48
         global $timedate;
49 49
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelEmailLink.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -45,62 +45,62 @@  discard block
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelEmailLink extends SugarWidgetField {
47 47
 
48
-	function displayList($layout_def) {
49
-		global $current_user;
50
-		global $beanList;
51
-		global $focus;
52
-		global $sugar_config;
53
-		global $locale;
54
-
55
-		if(isset($layout_def['varname'])) {
56
-			$key = strtoupper($layout_def['varname']);
57
-		} else {
58
-			$key = $this->_get_column_alias($layout_def);
59
-			$key = strtoupper($key);
60
-		}
61
-		$value = $layout_def['fields'][$key];
62
-
63
-
64
-
65
-			if(isset($_REQUEST['action'])) $action = $_REQUEST['action'];
66
-			else $action = '';
67
-
68
-			if(isset($_REQUEST['module'])) $module = $_REQUEST['module'];
69
-			else $module = '';
70
-
71
-			if(isset($_REQUEST['record'])) $record = $_REQUEST['record'];
72
-			else $record = '';
73
-
74
-			if (!empty($focus->name)) {
75
-				$name = $focus->name;
76
-			} else {
77
-				if( !empty($focus->first_name) && !empty($focus->last_name)) {
78
-					$name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name);
79
-					}
80
-				if(empty($name)) {
81
-					$name = '*';
82
-				}
83
-			}
84
-
85
-			$userPref = $current_user->getPreference('email_link_type');
86
-			$defaultPref = $sugar_config['email_default_client'];
87
-			if($userPref != '') {
88
-				$client = $userPref;
89
-			} else {
90
-				$client = $defaultPref;
91
-			}
92
-
93
-			if($client == 'sugar')
94
-			{
95
-			    $composeData = array(
96
-			        'load_id' => $layout_def['fields']['ID'],
48
+    function displayList($layout_def) {
49
+        global $current_user;
50
+        global $beanList;
51
+        global $focus;
52
+        global $sugar_config;
53
+        global $locale;
54
+
55
+        if(isset($layout_def['varname'])) {
56
+            $key = strtoupper($layout_def['varname']);
57
+        } else {
58
+            $key = $this->_get_column_alias($layout_def);
59
+            $key = strtoupper($key);
60
+        }
61
+        $value = $layout_def['fields'][$key];
62
+
63
+
64
+
65
+            if(isset($_REQUEST['action'])) $action = $_REQUEST['action'];
66
+            else $action = '';
67
+
68
+            if(isset($_REQUEST['module'])) $module = $_REQUEST['module'];
69
+            else $module = '';
70
+
71
+            if(isset($_REQUEST['record'])) $record = $_REQUEST['record'];
72
+            else $record = '';
73
+
74
+            if (!empty($focus->name)) {
75
+                $name = $focus->name;
76
+            } else {
77
+                if( !empty($focus->first_name) && !empty($focus->last_name)) {
78
+                    $name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name);
79
+                    }
80
+                if(empty($name)) {
81
+                    $name = '*';
82
+                }
83
+            }
84
+
85
+            $userPref = $current_user->getPreference('email_link_type');
86
+            $defaultPref = $sugar_config['email_default_client'];
87
+            if($userPref != '') {
88
+                $client = $userPref;
89
+            } else {
90
+                $client = $defaultPref;
91
+            }
92
+
93
+            if($client == 'sugar')
94
+            {
95
+                $composeData = array(
96
+                    'load_id' => $layout_def['fields']['ID'],
97 97
                     'load_module' => $this->layout_manager->defs['module_name'],
98 98
                     'parent_type' => $this->layout_manager->defs['module_name'],
99 99
                     'parent_id' => $layout_def['fields']['ID'],
100
-			        'return_module' => $module,
101
-			        'return_action' => $action,
102
-			        'return_id' => $record
103
-			    );
100
+                    'return_module' => $module,
101
+                    'return_action' => $action,
102
+                    'return_id' => $record
103
+                );
104 104
                 if(isset($layout_def['fields']['FULL_NAME'])){
105 105
                     $composeData['parent_name'] = $layout_def['fields']['FULL_NAME'];
106 106
                     $composeData['to_email_addrs'] = sprintf("%s <%s>", $layout_def['fields']['FULL_NAME'], $layout_def['fields']['EMAIL1']);
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
                 $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, http_build_query($composeData), true);
113 113
 
114 114
                 $link = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init($j_quickComposeOptions);'>";
115
-			} else {
116
-				$link = '<a href="mailto:' . $value .'" >';
117
-			}
115
+            } else {
116
+                $link = '<a href="mailto:' . $value .'" >';
117
+            }
118 118
 
119
-			return $link.$value.'</a>';
119
+            return $link.$value.'</a>';
120 120
 
121
-	}
121
+    }
122 122
 } // end class def
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateTaskButton.php 1 patch
Indentation   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -45,121 +45,121 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopCreateTaskButton extends SugarWidgetSubPanelTopButtonQuickCreate
47 47
 {
48
-	function &_get_form($defines, $additionalFormFields = null, $asUrl = false)
49
-	{
50
-		global $app_strings;
51
-		global $currentModule;
52
-
53
-		$this->module="Tasks";
54
-		$this->subpanelDiv = "activities";
55
-
56
-		// Create the additional form fields with real values if they were not passed in
57
-		if(empty($additionalFormFields) && $this->additional_form_fields)
58
-		{
59
-			foreach($this->additional_form_fields as $key=>$value)
60
-			{
61
-				if(!empty($defines['focus']->$value))
62
-				{
63
-					$additionalFormFields[$key] = $defines['focus']->$value;
64
-				}
65
-				else
66
-				{
67
-					$additionalFormFields[$key] = '';
68
-				}
69
-			}
70
-		}
71
-
72
-		if(!empty($this->module))
73
-		{
74
-			$defines['child_module_name'] = $this->module;
75
-		}
76
-		else
77
-		{
78
-			$defines['child_module_name'] = $defines['module'];
79
-		}
80
-
81
-		if(empty($defines['subpanelDiv']))
82
-		{
83
-			$defines['subpanelDiv'] = $this->subpanelDiv;
84
-		}
85
-
86
-		$defines['parent_bean_name'] = get_class( $defines['focus']);
87
-
88
-		$form = 'form' . $defines['child_module_name'];
89
-		$button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
90
-
91
-		//module_button is used to override the value of module name
92
-		$button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
93
-		$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
94
-
95
-		if(isset($defines['focus']->name))
96
-		{
97
-			$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
98
-		}
99
-
100
-		$button .= '<input type="hidden" name="to_pdf" value="true" />';
48
+    function &_get_form($defines, $additionalFormFields = null, $asUrl = false)
49
+    {
50
+        global $app_strings;
51
+        global $currentModule;
52
+
53
+        $this->module="Tasks";
54
+        $this->subpanelDiv = "activities";
55
+
56
+        // Create the additional form fields with real values if they were not passed in
57
+        if(empty($additionalFormFields) && $this->additional_form_fields)
58
+        {
59
+            foreach($this->additional_form_fields as $key=>$value)
60
+            {
61
+                if(!empty($defines['focus']->$value))
62
+                {
63
+                    $additionalFormFields[$key] = $defines['focus']->$value;
64
+                }
65
+                else
66
+                {
67
+                    $additionalFormFields[$key] = '';
68
+                }
69
+            }
70
+        }
71
+
72
+        if(!empty($this->module))
73
+        {
74
+            $defines['child_module_name'] = $this->module;
75
+        }
76
+        else
77
+        {
78
+            $defines['child_module_name'] = $defines['module'];
79
+        }
80
+
81
+        if(empty($defines['subpanelDiv']))
82
+        {
83
+            $defines['subpanelDiv'] = $this->subpanelDiv;
84
+        }
85
+
86
+        $defines['parent_bean_name'] = get_class( $defines['focus']);
87
+
88
+        $form = 'form' . $defines['child_module_name'];
89
+        $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
90
+
91
+        //module_button is used to override the value of module name
92
+        $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
93
+        $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
94
+
95
+        if(isset($defines['focus']->name))
96
+        {
97
+            $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
98
+        }
99
+
100
+        $button .= '<input type="hidden" name="to_pdf" value="true" />';
101 101
         $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
102
-		$button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
103
-		$button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
104
-		$button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
105
-		$button .= '<input type="hidden" name="record" value="" />';
106
-
107
-		// TODO: move this out and get $additionalFormFields working properly
108
-		if(empty($additionalFormFields['parent_type']))
109
-		{
110
-			if($defines['focus']->object_name=='Contact') {
111
-				$additionalFormFields['parent_type'] = 'Accounts';
112
-			}
113
-			else {
114
-				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115
-			}
116
-		}
117
-		if(empty($additionalFormFields['parent_name']))
118
-		{
119
-			if($defines['focus']->object_name=='Contact') {
120
-				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
121
-				$additionalFormFields['account_name'] = $defines['focus']->account_name;
122
-			}
123
-			else {
124
-				$additionalFormFields['parent_name'] = $defines['focus']->name;
125
-			}
126
-		}
127
-		if(empty($additionalFormFields['parent_id']))
128
-		{
129
-			if($defines['focus']->object_name=='Contact') {
130
-				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
131
-				$additionalFormFields['account_id'] = $defines['focus']->account_id;
132
-			}
133
-			else {
134
-				$additionalFormFields['parent_id'] = $defines['focus']->id;
135
-			}
136
-		}
137
-
138
-		$button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
139
-		$button .= '<input type="hidden" name="module" value="Home" />' . "\n";
140
-		$button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
141
-
142
-		// fill in additional form fields for all but action
143
-		foreach($additionalFormFields as $key => $value)
144
-		{
145
-			if($key != 'action')
146
-			{
147
-				$button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
148
-			}
149
-		}
150
-
151
-		return $button;
152
-	}
153
-
154
-
155
-	function display($defines, $additionalFormFields = null, $nonbutton = false)
156
-	{
157
-	    $focus = new Task;
158
-		if ( !$focus->ACLAccess('EditView') ) {
159
-		    return '';
160
-	    }
102
+        $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
103
+        $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
104
+        $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
105
+        $button .= '<input type="hidden" name="record" value="" />';
106
+
107
+        // TODO: move this out and get $additionalFormFields working properly
108
+        if(empty($additionalFormFields['parent_type']))
109
+        {
110
+            if($defines['focus']->object_name=='Contact') {
111
+                $additionalFormFields['parent_type'] = 'Accounts';
112
+            }
113
+            else {
114
+                $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115
+            }
116
+        }
117
+        if(empty($additionalFormFields['parent_name']))
118
+        {
119
+            if($defines['focus']->object_name=='Contact') {
120
+                $additionalFormFields['parent_name'] = $defines['focus']->account_name;
121
+                $additionalFormFields['account_name'] = $defines['focus']->account_name;
122
+            }
123
+            else {
124
+                $additionalFormFields['parent_name'] = $defines['focus']->name;
125
+            }
126
+        }
127
+        if(empty($additionalFormFields['parent_id']))
128
+        {
129
+            if($defines['focus']->object_name=='Contact') {
130
+                $additionalFormFields['parent_id'] = $defines['focus']->account_id;
131
+                $additionalFormFields['account_id'] = $defines['focus']->account_id;
132
+            }
133
+            else {
134
+                $additionalFormFields['parent_id'] = $defines['focus']->id;
135
+            }
136
+        }
137
+
138
+        $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
139
+        $button .= '<input type="hidden" name="module" value="Home" />' . "\n";
140
+        $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
141
+
142
+        // fill in additional form fields for all but action
143
+        foreach($additionalFormFields as $key => $value)
144
+        {
145
+            if($key != 'action')
146
+            {
147
+                $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
148
+            }
149
+        }
150
+
151
+        return $button;
152
+    }
153
+
154
+
155
+    function display($defines, $additionalFormFields = null, $nonbutton = false)
156
+    {
157
+        $focus = new Task;
158
+        if ( !$focus->ACLAccess('EditView') ) {
159
+            return '';
160
+        }
161 161
 		
162
-		return parent::display($defines, $additionalFormFields);
163
-	}
162
+        return parent::display($defines, $additionalFormFields);
163
+    }
164 164
 }
165 165
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelEditButton.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,16 +48,16 @@
 block discarded – undo
48 48
     protected static $defs = array();
49 49
     protected static $edit_icon_html;
50 50
 
51
-	function displayHeaderCell($layout_def)
52
-	{
53
-		return '';
54
-	}
51
+    function displayHeaderCell($layout_def)
52
+    {
53
+        return '';
54
+    }
55 55
 
56
-	function displayList($layout_def)
57
-	{
58
-		global $app_strings;
56
+    function displayList($layout_def)
57
+    {
58
+        global $app_strings;
59 59
         global $subpanel_item_count;
60
-		$unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512
60
+        $unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512
61 61
 
62 62
         if ($layout_def['EditView']) {
63 63
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldtime.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 global $timedate;
47 47
                 // i guess qualifier and column_function are the same..
48 48
                 if (! empty($layout_def['column_function']))
49
-                 {
49
+                    {
50 50
                         $func_name = 'displayList'.$layout_def['column_function'];
51 51
                         if ( method_exists($this,$func_name))
52 52
                         {
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
                 $content = $this->displayListPlain($layout_def);
63 63
                 
64 64
                 if(!empty($date)) { // able to get the date context of the time            	
65
-                	$td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content));
66
-	                return $td[1];
65
+                    $td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content));
66
+                    return $td[1];
67 67
                 }
68 68
                 else { // assume there is no time context
69
-                 	return $timedate->to_display_time($content);
69
+                        return $timedate->to_display_time($content);
70 70
                 }
71 71
         }
72 72
 }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelSelectAllButton.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     function display($defines, $additionalFormFields = null)
46 46
     {
47 47
         $button  = "<form method='post' action='/index.php?module=MODULE_NAME&action=CUSTOM_ACTION'>";
48
-       // $button .= "<input id='custom_hidden_1' type='hidden' name='custom_hidden_1' value=''/>";
48
+        // $button .= "<input id='custom_hidden_1' type='hidden' name='custom_hidden_1' value=''/>";
49 49
         $button .= "<input class='button' type='submit' name='Custom Save' value='Select All' />\n</form>";
50 50
         return $button;
51 51
     }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldlong.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@
 block discarded – undo
51 51
 
52 52
 class SugarWidgetFieldLong extends SugarWidgetFieldDecimal
53 53
 {
54
-	function SugarWidgetFieldLong(&$layout_manager) {
55
-		parent::SugarWidgetFieldDecimal($layout_manager);
56
-	}	
54
+    function SugarWidgetFieldLong(&$layout_manager) {
55
+        parent::SugarWidgetFieldDecimal($layout_manager);
56
+    }	
57 57
 }
58 58
 
59 59
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldid.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@
 block discarded – undo
42 42
 class SugarWidgetFieldId extends SugarWidgetReportField
43 43
 {
44 44
 
45
- function queryFilterIs(&$layout_def)
46
- {
47
-		return $this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n";
48
- }
45
+    function queryFilterIs(&$layout_def)
46
+    {
47
+        return $this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."'\n";
48
+    }
49 49
 
50 50
 
51 51
 }
Please login to merge, or discard this patch.