Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
include/generic/SugarWidgets/SugarWidgetSubPanelTopMessage.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,8 +46,8 @@
 block discarded – undo
46 46
 
47 47
 class SugarWidgetSubPanelTopMessage extends SugarWidgetSubPanelTopButton
48 48
 {
49
-	function display($defines)
50
-	{
49
+    function display($defines)
50
+    {
51 51
         return $defines['message'];
52
-	}
52
+    }
53 53
 }
54 54
\ No newline at end of file
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldenum.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -58,39 +58,39 @@  discard block
 block discarded – undo
58 58
     }
59 59
 
60 60
     public function queryFilteris($layout_def) {
61
-		$input_name0 = $layout_def['input_name0'];
62
-		if (is_array($layout_def['input_name0'])) {
63
-			$input_name0 = $layout_def['input_name0'][0];
64
-		}
65
-		return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n";
66
-	}
67
-
68
-	public function queryFilteris_not($layout_def) {
69
-		$input_name0 = $layout_def['input_name0'];
70
-		if (is_array($layout_def['input_name0'])) {
71
-			$input_name0 = $layout_def['input_name0'][0];
72
-		}
73
-		return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n";
74
-	}
75
-
76
-	public function queryFilterone_of($layout_def) {
77
-		$arr = array ();
78
-		foreach ($layout_def['input_name0'] as $value) {
79
-			$arr[] = $this->reporter->db->quoted($value);
80
-		}
81
-		$str = implode(",", $arr);
82
-		return $this->_get_column_select($layout_def)." IN (".$str.")\n";
83
-	}
84
-
85
-	public function queryFilternot_one_of($layout_def) {
86
-		$arr = array ();
87
-		foreach ($layout_def['input_name0'] as $value) {
88
-			$arr[] = $this->reporter->db->quoted($value);
89
-		}
90
-	    $reporter = $this->layout_manager->getAttribute("reporter");
91
-		$str = implode(",", $arr);
92
-		return $this->_get_column_select($layout_def)." NOT IN (".$str.")\n";
93
-	}
61
+        $input_name0 = $layout_def['input_name0'];
62
+        if (is_array($layout_def['input_name0'])) {
63
+            $input_name0 = $layout_def['input_name0'][0];
64
+        }
65
+        return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n";
66
+    }
67
+
68
+    public function queryFilteris_not($layout_def) {
69
+        $input_name0 = $layout_def['input_name0'];
70
+        if (is_array($layout_def['input_name0'])) {
71
+            $input_name0 = $layout_def['input_name0'][0];
72
+        }
73
+        return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n";
74
+    }
75
+
76
+    public function queryFilterone_of($layout_def) {
77
+        $arr = array ();
78
+        foreach ($layout_def['input_name0'] as $value) {
79
+            $arr[] = $this->reporter->db->quoted($value);
80
+        }
81
+        $str = implode(",", $arr);
82
+        return $this->_get_column_select($layout_def)." IN (".$str.")\n";
83
+    }
84
+
85
+    public function queryFilternot_one_of($layout_def) {
86
+        $arr = array ();
87
+        foreach ($layout_def['input_name0'] as $value) {
88
+            $arr[] = $this->reporter->db->quoted($value);
89
+        }
90
+        $reporter = $this->layout_manager->getAttribute("reporter");
91
+        $str = implode(",", $arr);
92
+        return $this->_get_column_select($layout_def)." NOT IN (".$str.")\n";
93
+    }
94 94
 
95 95
     function & displayList($layout_def) {
96 96
         if(!empty($layout_def['column_key'])){
@@ -116,84 +116,84 @@  discard block
 block discarded – undo
116 116
                 $field_type = $field_def['type'];
117 117
                 $div_id = $field_def['module'] ."&$record&$field_name";
118 118
                 $str = "<div id='$div_id'>" . $cell . "&nbsp;"
119
-                     . SugarThemeRegistry::current()->getImage(
119
+                        . SugarThemeRegistry::current()->getImage(
120 120
                         "edit_inline",
121 121
                         "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(" .
122 122
                         "\"$div_id\",\"$cell\",\"$module\",\"$record\",\"$field_name\",\"$field_type\");'"
123
-                       )
124
-                     . "</div>";
123
+                        )
124
+                        . "</div>";
125 125
             }
126 126
         }
127 127
         return $str;
128 128
     }
129
-	function & displayListPlain($layout_def) {
130
-		if(!empty($layout_def['column_key'])){
131
-			$field_def = $this->reporter->all_fields[$layout_def['column_key']];
132
-		}else if(!empty($layout_def['fields'])){
133
-			$field_def = $layout_def['fields'];
134
-		}
135
-
136
-		if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){
137
-			$value = $this->_get_list_value($layout_def);
138
-		}else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){
139
-			$key = strtoupper($layout_def['name']);
140
-			$value = $layout_def['fields'][$key];
141
-		}
142
-		$cell = '';
143
-
144
-			if(isset($field_def['options'])){
145
-				$cell = translate($field_def['options'], $field_def['module'], $value);
146
-			}else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){
147
-	            global $beanFiles;
148
-	            if(empty($beanFiles)) {
149
-	                include('include/modules.php');
150
-	            }
151
-	            $bean_name = get_singular_bean_name($field_def['module']);
152
-	            require_once($beanFiles[$bean_name]);
153
-	            $list = $field_def['function']();
154
-	            $cell = $list[$value];
155
-	        }
156
-		if (is_array($cell)) {
157
-
158
-			//#22632
159
-			$value = unencodeMultienum($value);
160
-			$cell=array();
161
-			foreach($value as $val){
162
-				$returnVal = translate($field_def['options'],$field_def['module'],$val);
163
-				if(!is_array($returnVal)){
164
-					array_push( $cell, translate($field_def['options'],$field_def['module'],$val));
165
-				}
166
-			}
167
-			$cell = implode(", ",$cell);
168
-		}
169
-		return $cell;
170
-	}
171
-
172
-	public function queryOrderBy($layout_def) {
173
-		$field_def = $this->reporter->all_fields[$layout_def['column_key']];
174
-		if (!empty ($field_def['sort_on'])) {
175
-			$order_by = $layout_def['table_alias'].".".$field_def['sort_on'];
176
-		} else {
177
-			$order_by = $this->_get_column_select($layout_def);
178
-		}
179
-		$list = array();
129
+    function & displayListPlain($layout_def) {
130
+        if(!empty($layout_def['column_key'])){
131
+            $field_def = $this->reporter->all_fields[$layout_def['column_key']];
132
+        }else if(!empty($layout_def['fields'])){
133
+            $field_def = $layout_def['fields'];
134
+        }
135
+
136
+        if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){
137
+            $value = $this->_get_list_value($layout_def);
138
+        }else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){
139
+            $key = strtoupper($layout_def['name']);
140
+            $value = $layout_def['fields'][$key];
141
+        }
142
+        $cell = '';
143
+
144
+            if(isset($field_def['options'])){
145
+                $cell = translate($field_def['options'], $field_def['module'], $value);
146
+            }else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){
147
+                global $beanFiles;
148
+                if(empty($beanFiles)) {
149
+                    include('include/modules.php');
150
+                }
151
+                $bean_name = get_singular_bean_name($field_def['module']);
152
+                require_once($beanFiles[$bean_name]);
153
+                $list = $field_def['function']();
154
+                $cell = $list[$value];
155
+            }
156
+        if (is_array($cell)) {
157
+
158
+            //#22632
159
+            $value = unencodeMultienum($value);
160
+            $cell=array();
161
+            foreach($value as $val){
162
+                $returnVal = translate($field_def['options'],$field_def['module'],$val);
163
+                if(!is_array($returnVal)){
164
+                    array_push( $cell, translate($field_def['options'],$field_def['module'],$val));
165
+                }
166
+            }
167
+            $cell = implode(", ",$cell);
168
+        }
169
+        return $cell;
170
+    }
171
+
172
+    public function queryOrderBy($layout_def) {
173
+        $field_def = $this->reporter->all_fields[$layout_def['column_key']];
174
+        if (!empty ($field_def['sort_on'])) {
175
+            $order_by = $layout_def['table_alias'].".".$field_def['sort_on'];
176
+        } else {
177
+            $order_by = $this->_get_column_select($layout_def);
178
+        }
179
+        $list = array();
180 180
         if(isset($field_def['options'])) {
181
-		    $list = translate($field_def['options'], $field_def['module']);
181
+            $list = translate($field_def['options'], $field_def['module']);
182 182
         } elseif(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) {
183
-	        global $beanFiles;
184
-		    if(empty($beanFiles)) {
185
-		        include('include/modules.php');
186
-		    }
187
-		    $bean_name = get_singular_bean_name($field_def['module']);
188
-		    require_once($beanFiles[$bean_name]);
183
+            global $beanFiles;
184
+            if(empty($beanFiles)) {
185
+                include('include/modules.php');
186
+            }
187
+            $bean_name = get_singular_bean_name($field_def['module']);
188
+            require_once($beanFiles[$bean_name]);
189 189
             $list = $field_def['function']();
190 190
         }
191
-		if (empty ($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') {
192
-			$order_dir = "ASC";
193
-		} else {
194
-			$order_dir = "DESC";
195
-		}
196
-		return $this->reporter->db->orderByEnum($order_by, $list, $order_dir);
191
+        if (empty ($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') {
192
+            $order_dir = "ASC";
193
+        } else {
194
+            $order_dir = "DESC";
195
+        }
196
+        return $this->reporter->db->orderByEnum($order_by, $list, $order_dir);
197 197
     }
198 198
 
199 199
     public function displayInput($layout_def) {
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
                 $ops = $layout_def['options'];
205 205
             }
206 206
             elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){
207
-            	$ops = $app_list_strings[$layout_def['options']];
207
+                $ops = $app_list_strings[$layout_def['options']];
208 208
                 if(array_key_exists('', $app_list_strings[$layout_def['options']])) {
209
-             	   unset($ops['']);
210
-	            }
209
+                    unset($ops['']);
210
+                }
211 211
             }
212 212
             else{
213
-            	$ops = array();
213
+                $ops = array();
214 214
             }
215 215
         }
216 216
         else {
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectUsersButton.php 1 patch
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -45,137 +45,137 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopSelectUsersButton extends SugarWidgetSubPanelTopSelectButton
47 47
 {
48
-	//button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
-	function SugarWidgetSubPanelTopSelectUsersButton($button_properties=array())
50
-	{
51
-		$this->button_properties=$button_properties;
52
-	}
48
+    //button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
+    function SugarWidgetSubPanelTopSelectUsersButton($button_properties=array())
50
+    {
51
+        $this->button_properties=$button_properties;
52
+    }
53 53
 
54 54
     function getDisplayName()
55 55
     {
56 56
         return $GLOBALS['app_strings']['LBL_SELECT_USER_BUTTON_LABEL'];
57 57
     }
58
-	//widget_data is the collection of attributes associated with the button in the layout_defs file.
59
-	function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
60
-	{
61
-		global $app_strings;
62
-		$initial_filter = '';
63
-
64
-		$this->title = $app_strings['LBL_SELECT_USER_BUTTON_TITLE'];
65
-		//$this->accesskey = $app_strings['LBL_SELECT_USER_BUTTON_KEY'];
66
-		$this->value = $this->getDisplayName();
67
-
68
-		$this->module_name = 'Users';
69
-
70
-		if (is_array($this->button_properties)) {
71
-			if( isset($this->button_properties['title'])) {
72
-				$this->title = $app_strings[$this->button_properties['title']];
73
-			}
74
-			if( isset($this->button_properties['accesskey'])) {
75
-				//$this->accesskey = $app_strings[$this->button_properties['accesskey']];
76
-			}
77
-			if( isset($this->button_properties['form_value'])) {
78
-				$this->value = $app_strings[$this->button_properties['form_value']];
79
-			}
80
-			if( isset($this->button_properties['module'])) {
81
-				$this->module_name = $this->button_properties['module'];
82
-			}
83
-		}
84
-
85
-		$focus = $widget_data['focus'];
86
-		if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
87
-			$button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
88
-			. ' title="' . $this->title . '"'
89
-			. ' value="' . $this->value . "\"\n"
90
-			.' disabled />';
91
-			return $button;
92
-		}
93
-
94
-		//refresh the whole page after end of action?
95
-		$refresh_page = 0;
96
-		if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
97
-			$refresh_page = 1;
98
-		}
99
-
100
-		$subpanel_definition = $widget_data['subpanel_definition'];
101
-
102
-		$button_definition = $subpanel_definition->get_buttons();
103
-		$subpanel_name = $subpanel_definition->get_module_name();
104
-		if (empty($this->module_name)) {
105
-			$this->module_name = $subpanel_name;
106
-		}
107
-
108
-		if ($subpanel_name == 'Project'){
109
-			$link_field_name = 'project_users_1';
110
-		}
111
-		else{
112
-			$link_field_name = $subpanel_definition->get_data_source_name(true);
113
-		}
114
-
115
-		$popup_mode='Single';
116
-		if(isset($widget_data['mode'])){
117
-			$popup_mode=$widget_data['mode'];
118
-		}
119
-		if(isset($widget_data['initial_filter_fields'])){
120
-			if (is_array($widget_data['initial_filter_fields'])) {
121
-				foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
122
-					if (isset($focus->$value) and !empty($focus->$value)) {
123
-						$initial_filter.="&".$alias . '='.urlencode($focus->$value);
124
-					}
125
-				}
126
-			}
127
-		}
128
-
129
-		if (!empty($widget_data['filter_out_is_admin'])) {
58
+    //widget_data is the collection of attributes associated with the button in the layout_defs file.
59
+    function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
60
+    {
61
+        global $app_strings;
62
+        $initial_filter = '';
63
+
64
+        $this->title = $app_strings['LBL_SELECT_USER_BUTTON_TITLE'];
65
+        //$this->accesskey = $app_strings['LBL_SELECT_USER_BUTTON_KEY'];
66
+        $this->value = $this->getDisplayName();
67
+
68
+        $this->module_name = 'Users';
69
+
70
+        if (is_array($this->button_properties)) {
71
+            if( isset($this->button_properties['title'])) {
72
+                $this->title = $app_strings[$this->button_properties['title']];
73
+            }
74
+            if( isset($this->button_properties['accesskey'])) {
75
+                //$this->accesskey = $app_strings[$this->button_properties['accesskey']];
76
+            }
77
+            if( isset($this->button_properties['form_value'])) {
78
+                $this->value = $app_strings[$this->button_properties['form_value']];
79
+            }
80
+            if( isset($this->button_properties['module'])) {
81
+                $this->module_name = $this->button_properties['module'];
82
+            }
83
+        }
84
+
85
+        $focus = $widget_data['focus'];
86
+        if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
87
+            $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
88
+            . ' title="' . $this->title . '"'
89
+            . ' value="' . $this->value . "\"\n"
90
+            .' disabled />';
91
+            return $button;
92
+        }
93
+
94
+        //refresh the whole page after end of action?
95
+        $refresh_page = 0;
96
+        if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
97
+            $refresh_page = 1;
98
+        }
99
+
100
+        $subpanel_definition = $widget_data['subpanel_definition'];
101
+
102
+        $button_definition = $subpanel_definition->get_buttons();
103
+        $subpanel_name = $subpanel_definition->get_module_name();
104
+        if (empty($this->module_name)) {
105
+            $this->module_name = $subpanel_name;
106
+        }
107
+
108
+        if ($subpanel_name == 'Project'){
109
+            $link_field_name = 'project_users_1';
110
+        }
111
+        else{
112
+            $link_field_name = $subpanel_definition->get_data_source_name(true);
113
+        }
114
+
115
+        $popup_mode='Single';
116
+        if(isset($widget_data['mode'])){
117
+            $popup_mode=$widget_data['mode'];
118
+        }
119
+        if(isset($widget_data['initial_filter_fields'])){
120
+            if (is_array($widget_data['initial_filter_fields'])) {
121
+                foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
122
+                    if (isset($focus->$value) and !empty($focus->$value)) {
123
+                        $initial_filter.="&".$alias . '='.urlencode($focus->$value);
124
+                    }
125
+                }
126
+            }
127
+        }
128
+
129
+        if (!empty($widget_data['filter_out_is_admin'])) {
130 130
             $initial_filter.="&is_admin_advanced=0";
131 131
         }
132 132
 
133
-		$create="true";
134
-		if(isset($widget_data['create'])){
135
-			$create=$widget_data['create'];
136
-		}
137
-		$return_module = $_REQUEST['module'];
138
-		$return_action = 'SubPanelViewer';
139
-		$return_id = $_REQUEST['record'];
140
-
141
-		//field_to_name_array
142
-		$fton_array= array('id' => 'subpanel_id');
143
-		if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
144
-			$fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
145
-		}
146
-
147
-		$return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
148
-
149
-		$popup_request_data = array(
150
-			'call_back_function' => 'set_return_and_save_background',
151
-			'form_name' => 'DetailView',
152
-			'field_to_name_array' => $fton_array,
153
-			'passthru_data' => array(
154
-				'child_field' => $this->module_name,
155
-				'return_url' => urlencode($return_url),
156
-				'link_field_name' => $link_field_name,
157
-				'module_name' => $this->module_name,
158
-				'refresh_page' => 1,
159
-			),
160
-		);
161
-
162
-		if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) {
163
-			$popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']);
164
-		}
165
-
166
-		if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
167
-
168
-			if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
169
-				$initial_filter = "&module_name=". urlencode($widget_data['module']);
170
-			}
171
-		}
172
-		$json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data);
173
-
174
-		return '<form action="index.php">' . "\n"
175
-			. ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
176
-				. ' title="' . $this->title . '"'
177
-			. ' value="' . $this->value . "\"\n"
178
-			. " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n";
179
-	}
133
+        $create="true";
134
+        if(isset($widget_data['create'])){
135
+            $create=$widget_data['create'];
136
+        }
137
+        $return_module = $_REQUEST['module'];
138
+        $return_action = 'SubPanelViewer';
139
+        $return_id = $_REQUEST['record'];
140
+
141
+        //field_to_name_array
142
+        $fton_array= array('id' => 'subpanel_id');
143
+        if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
144
+            $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
145
+        }
146
+
147
+        $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
148
+
149
+        $popup_request_data = array(
150
+            'call_back_function' => 'set_return_and_save_background',
151
+            'form_name' => 'DetailView',
152
+            'field_to_name_array' => $fton_array,
153
+            'passthru_data' => array(
154
+                'child_field' => $this->module_name,
155
+                'return_url' => urlencode($return_url),
156
+                'link_field_name' => $link_field_name,
157
+                'module_name' => $this->module_name,
158
+                'refresh_page' => 1,
159
+            ),
160
+        );
161
+
162
+        if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) {
163
+            $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']);
164
+        }
165
+
166
+        if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
167
+
168
+            if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
169
+                $initial_filter = "&module_name=". urlencode($widget_data['module']);
170
+            }
171
+        }
172
+        $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data);
173
+
174
+        return '<form action="index.php">' . "\n"
175
+            . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
176
+                . ' title="' . $this->title . '"'
177
+            . ' value="' . $this->value . "\"\n"
178
+            . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n";
179
+    }
180 180
 }
181 181
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelEditRoleButton.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -45,33 +45,33 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelEditRoleButton extends SugarWidgetField
47 47
 {
48
-	function displayHeaderCell(&$layout_def)
49
-	{
50
-		return '&nbsp;';
51
-	}
48
+    function displayHeaderCell(&$layout_def)
49
+    {
50
+        return '&nbsp;';
51
+    }
52 52
 
53
-	function displayList(&$layout_def)
54
-	{
55
-		global $app_strings;
53
+    function displayList(&$layout_def)
54
+    {
55
+        global $app_strings;
56 56
         global $subpanel_item_count;
57 57
         $unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512
58 58
 	
59
-		$href = 'index.php?module=' . $layout_def['module']
60
-			. '&action=' . 'ContactOpportunityRelationshipEdit'
61
-			. '&record=' . $layout_def['fields']['OPPORTUNITY_ROLE_ID']
62
-			. '&return_module=' . $_REQUEST['module']
63
-			. '&return_action=' . 'DetailView'
64
-			. '&return_id=' . $_REQUEST['record'];
59
+        $href = 'index.php?module=' . $layout_def['module']
60
+            . '&action=' . 'ContactOpportunityRelationshipEdit'
61
+            . '&record=' . $layout_def['fields']['OPPORTUNITY_ROLE_ID']
62
+            . '&return_module=' . $_REQUEST['module']
63
+            . '&return_action=' . 'DetailView'
64
+            . '&return_id=' . $_REQUEST['record'];
65 65
 			
66
-	//based on listview since that lets you select records
67
-	if($layout_def['ListView']){
68
-		return '<a href="' . $href . '"'
66
+    //based on listview since that lets you select records
67
+    if($layout_def['ListView']){
68
+        return '<a href="' . $href . '"'
69 69
             . "id=\"$unique_id\""
70
-			. 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a>&nbsp;';
71
-	}else{
72
-		return '';
73
-	}
74
-	}
70
+            . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a>&nbsp;';
71
+    }else{
72
+        return '';
73
+    }
74
+    }
75 75
 }
76 76
 
77 77
 ?>
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateNoteButton.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -45,121 +45,121 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopCreateNoteButton 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="Notes";
54
-		$this->subpanelDiv = "history";
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($this->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="Notes";
54
+        $this->subpanelDiv = "history";
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($this->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 Note;
158
-		if ( !$focus->ACLAccess('EditView') ) {
159
-		    return '';
160
-	    }
161
-
162
-		return parent::display($defines, $additionalFormFields);
163
-	}
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 Note;
158
+        if ( !$focus->ACLAccess('EditView') ) {
159
+            return '';
160
+        }
161
+
162
+        return parent::display($defines, $additionalFormFields);
163
+    }
164 164
 }
165 165
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldtext.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     function queryFilterEquals($layout_def)
51 51
     {
52 52
         return $this->reporter->db->convert($this->_get_column_select($layout_def), "text2char").
53
-        	" = ".$this->reporter->db->quoted($layout_def['input_name0']);
53
+            " = ".$this->reporter->db->quoted($layout_def['input_name0']);
54 54
     }
55 55
 
56 56
     function queryFilterNot_Equals_Str($layout_def)
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectContactsButton.php 1 patch
Indentation   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -45,133 +45,133 @@
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopSelectContactsButton extends SugarWidgetSubPanelTopSelectButton
47 47
 {
48
-	//button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
-	function SugarWidgetSubPanelTopSelectContactsButton($button_properties=array())
50
-	{
51
-		$this->button_properties=$button_properties;
52
-	}
48
+    //button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
+    function SugarWidgetSubPanelTopSelectContactsButton($button_properties=array())
50
+    {
51
+        $this->button_properties=$button_properties;
52
+    }
53 53
 
54 54
     public function getWidgetId($buttonSuffix = true)
55 55
     {
56 56
         return parent::getWidgetId() . '_select_button';
57 57
     }
58 58
 
59
-	//widget_data is the collection of attributes associated with the button in the layout_defs file.
60
-	function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
61
-	{
62
-		global $app_strings;
63
-		$initial_filter = '';
64
-
65
-		$this->title = $app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE'];
66
-		//$this->accesskey = $app_strings['LBL_SELECT_CONTACT_BUTTON_KEY'];
67
-		$this->value = $app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL'];
68
-
69
-		$this->module_name = 'Contacts';
70
-
71
-		if (is_array($this->button_properties)) {
72
-			if( isset($this->button_properties['title'])) {
73
-				$this->title = $app_strings[$this->button_properties['title']];
74
-			}
75
-			if( isset($this->button_properties['accesskey'])) {
76
-				//$this->accesskey = $app_strings[$this->button_properties['accesskey']];
77
-			}
78
-			if( isset($this->button_properties['form_value'])) {
79
-				$this->value = $app_strings[$this->button_properties['form_value']];
80
-			}
81
-			if( isset($this->button_properties['module'])) {
82
-				$this->module_name = $this->button_properties['module'];
83
-			}
84
-		}
85
-
86
-		$focus = $widget_data['focus'];
87
-		if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
88
-			$button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
89
-			. ' title="' . $this->title . '"'
90
-			. ' value="' . $this->value . "\"\n"
91
-			.' disabled />';
92
-			return $button;
93
-		}
94
-
95
-		//refresh the whole page after end of action?
96
-		$refresh_page = 0;
97
-		if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
98
-			$refresh_page = 1;
99
-		}
100
-
101
-		$subpanel_definition = $widget_data['subpanel_definition'];
102
-
103
-		$button_definition = $subpanel_definition->get_buttons();
104
-		$subpanel_name = $subpanel_definition->get_module_name();
105
-		if (empty($this->module_name)) {
106
-			$this->module_name = $subpanel_name;
107
-		}
108
-
109
-		if ($subpanel_name == 'Project'){
110
-			$link_field_name = 'project_contacts_1';
111
-		}
112
-		else{
113
-			$link_field_name = $subpanel_definition->get_data_source_name(true);
114
-		}
115
-
116
-		$popup_mode='Single';
117
-		if(isset($widget_data['mode'])){
118
-			$popup_mode=$widget_data['mode'];
119
-		}
120
-		if(isset($widget_data['initial_filter_fields'])){
121
-			if (is_array($widget_data['initial_filter_fields'])) {
122
-				foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
123
-					if (isset($focus->$value) and !empty($focus->$value)) {
124
-						$initial_filter.="&".$alias . '='.urlencode($focus->$value);
125
-					}
126
-				}
127
-			}
128
-		}
129
-		$create="true";
130
-		if(isset($widget_data['create'])){
131
-			$create=$widget_data['create'];
132
-		}
133
-		$return_module = $_REQUEST['module'];
134
-		$return_action = 'SubPanelViewer';
135
-		$return_id = $_REQUEST['record'];
136
-
137
-		//field_to_name_array
138
-		$fton_array= array('id' => 'subpanel_id');
139
-		if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
140
-			$fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
141
-		}
142
-
143
-		$return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
144
-
145
-		$popup_request_data = array(
146
-			'call_back_function' => 'set_return_and_save_background',
147
-			'form_name' => 'DetailView',
148
-			'field_to_name_array' => $fton_array,
149
-			'passthru_data' => array(
150
-				'child_field' => $this->module_name,
151
-				'return_url' => urlencode($return_url),
152
-				'link_field_name' => $link_field_name,
153
-				'module_name' => $this->module_name,
154
-				'refresh_page' => 1,
155
-			),
156
-		);
157
-
158
-		if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) {
159
-			$popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']);
160
-		}
161
-
162
-		if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
163
-
164
-			if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
165
-				$initial_filter = "&module_name=". urlencode($widget_data['module']);
166
-			}
167
-		}
168
-		$json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data);
169
-
170
-		return '<form action="index.php">' . "\n"
171
-			. ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
172
-				. ' title="' . $this->title . '"'
173
-			. ' value="' . $this->value . "\"\n"
174
-			. " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n";
175
-	}
59
+    //widget_data is the collection of attributes associated with the button in the layout_defs file.
60
+    function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
61
+    {
62
+        global $app_strings;
63
+        $initial_filter = '';
64
+
65
+        $this->title = $app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE'];
66
+        //$this->accesskey = $app_strings['LBL_SELECT_CONTACT_BUTTON_KEY'];
67
+        $this->value = $app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL'];
68
+
69
+        $this->module_name = 'Contacts';
70
+
71
+        if (is_array($this->button_properties)) {
72
+            if( isset($this->button_properties['title'])) {
73
+                $this->title = $app_strings[$this->button_properties['title']];
74
+            }
75
+            if( isset($this->button_properties['accesskey'])) {
76
+                //$this->accesskey = $app_strings[$this->button_properties['accesskey']];
77
+            }
78
+            if( isset($this->button_properties['form_value'])) {
79
+                $this->value = $app_strings[$this->button_properties['form_value']];
80
+            }
81
+            if( isset($this->button_properties['module'])) {
82
+                $this->module_name = $this->button_properties['module'];
83
+            }
84
+        }
85
+
86
+        $focus = $widget_data['focus'];
87
+        if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
88
+            $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
89
+            . ' title="' . $this->title . '"'
90
+            . ' value="' . $this->value . "\"\n"
91
+            .' disabled />';
92
+            return $button;
93
+        }
94
+
95
+        //refresh the whole page after end of action?
96
+        $refresh_page = 0;
97
+        if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
98
+            $refresh_page = 1;
99
+        }
100
+
101
+        $subpanel_definition = $widget_data['subpanel_definition'];
102
+
103
+        $button_definition = $subpanel_definition->get_buttons();
104
+        $subpanel_name = $subpanel_definition->get_module_name();
105
+        if (empty($this->module_name)) {
106
+            $this->module_name = $subpanel_name;
107
+        }
108
+
109
+        if ($subpanel_name == 'Project'){
110
+            $link_field_name = 'project_contacts_1';
111
+        }
112
+        else{
113
+            $link_field_name = $subpanel_definition->get_data_source_name(true);
114
+        }
115
+
116
+        $popup_mode='Single';
117
+        if(isset($widget_data['mode'])){
118
+            $popup_mode=$widget_data['mode'];
119
+        }
120
+        if(isset($widget_data['initial_filter_fields'])){
121
+            if (is_array($widget_data['initial_filter_fields'])) {
122
+                foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
123
+                    if (isset($focus->$value) and !empty($focus->$value)) {
124
+                        $initial_filter.="&".$alias . '='.urlencode($focus->$value);
125
+                    }
126
+                }
127
+            }
128
+        }
129
+        $create="true";
130
+        if(isset($widget_data['create'])){
131
+            $create=$widget_data['create'];
132
+        }
133
+        $return_module = $_REQUEST['module'];
134
+        $return_action = 'SubPanelViewer';
135
+        $return_id = $_REQUEST['record'];
136
+
137
+        //field_to_name_array
138
+        $fton_array= array('id' => 'subpanel_id');
139
+        if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
140
+            $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
141
+        }
142
+
143
+        $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
144
+
145
+        $popup_request_data = array(
146
+            'call_back_function' => 'set_return_and_save_background',
147
+            'form_name' => 'DetailView',
148
+            'field_to_name_array' => $fton_array,
149
+            'passthru_data' => array(
150
+                'child_field' => $this->module_name,
151
+                'return_url' => urlencode($return_url),
152
+                'link_field_name' => $link_field_name,
153
+                'module_name' => $this->module_name,
154
+                'refresh_page' => 1,
155
+            ),
156
+        );
157
+
158
+        if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) {
159
+            $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']);
160
+        }
161
+
162
+        if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
163
+
164
+            if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
165
+                $initial_filter = "&module_name=". urlencode($widget_data['module']);
166
+            }
167
+        }
168
+        $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data);
169
+
170
+        return '<form action="index.php">' . "\n"
171
+            . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n"
172
+                . ' title="' . $this->title . '"'
173
+            . ' value="' . $this->value . "\"\n"
174
+            . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n";
175
+    }
176 176
 }
177 177
 ?>
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectAccountButton.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,21 +44,21 @@
 block discarded – undo
44 44
 
45 45
 
46 46
 class SugarWidgetSubPanelTopSelectAccountButton extends SugarWidgetSubPanelTopSelectButton {
47
-	function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
48
-	{
49
-		/*
47
+    function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
48
+    {
49
+        /*
50 50
 		* i.dymovsky
51 51
 		* Because when user role can't edit Accounts, it also can't edit Membership Organizations. Select button leads to change MO list
52 52
 		* See bug 25633
53 53
 		* Bug25633 code change start
54 54
 		*/
55
-		if (!ACLController::checkAccess($widget_data["module"], "edit", true)) {
56
-			return ;
57
-		}
58
-		/*
55
+        if (!ACLController::checkAccess($widget_data["module"], "edit", true)) {
56
+            return ;
57
+        }
58
+        /*
59 59
 		* Bug25633 code change end
60 60
 		*/
61 61
 		
62
-		return parent::display($widget_data);
63
-	}
62
+        return parent::display($widget_data);
63
+    }
64 64
 }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectButton.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 
46 46
 class SugarWidgetSubPanelTopSelectButton extends SugarWidgetSubPanelTopButton
47 47
 {
48
-	//button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
-	function SugarWidgetSubPanelTopSelectButton($button_properties=array())
50
-	{
51
-		$this->button_properties=$button_properties;
52
-	}
48
+    //button_properties is a collection of properties associated with the widget_class definition. layoutmanager
49
+    function SugarWidgetSubPanelTopSelectButton($button_properties=array())
50
+    {
51
+        $this->button_properties=$button_properties;
52
+    }
53 53
 
54 54
     public function getWidgetId($buttonSuffix = true)
55 55
     {
@@ -60,96 +60,96 @@  discard block
 block discarded – undo
60 60
     {
61 61
         return $GLOBALS['app_strings']['LBL_SELECT_BUTTON_LABEL'];
62 62
     }
63
-	//widget_data is the collection of attributes associated with the button in the layout_defs file.
64
-	function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
65
-	{
66
-		global $app_strings;
67
-		$initial_filter = '';
63
+    //widget_data is the collection of attributes associated with the button in the layout_defs file.
64
+    function display($widget_data, $additionalFormFields = NULL, $nonbutton = false)
65
+    {
66
+        global $app_strings;
67
+        $initial_filter = '';
68 68
 
69
-	    $this->title     = $this->getTitle();
69
+        $this->title     = $this->getTitle();
70 70
         $this->accesskey = $this->getAccesskey();
71 71
         $this->value     = $this->getDisplayName();
72 72
 
73
-		if (is_array($this->button_properties)) {
74
-			if( isset($this->button_properties['title'])) {
75
-				$this->title = $app_strings[$this->button_properties['title']];
76
-			}
77
-			if( isset($this->button_properties['accesskey'])) {
78
-				$this->accesskey = $app_strings[$this->button_properties['accesskey']];
79
-			}
80
-			if( isset($this->button_properties['form_value'])) {
81
-				$this->value = $app_strings[$this->button_properties['form_value']];
82
-			}
83
-			if( isset($this->button_properties['module'])) {
84
-				$this->module_name = $this->button_properties['module'];
85
-			}
86
-		}
87
-
88
-
89
-		$focus = $widget_data['focus'];
90
-		if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
91
-			$button = ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n"
92
-			. ' title="' . $this->title . '"'
93
-			. ' value="' . $this->value . "\"\n"
94
-			.' disabled />';
95
-			return $button;
96
-		}
97
-
98
-		//refresh the whole page after end of action?
99
-		$refresh_page = 0;
100
-		if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
101
-			$refresh_page = 1;
102
-		}
103
-
104
-		$subpanel_definition = $widget_data['subpanel_definition'];
105
-		$button_definition = $subpanel_definition->get_buttons();
73
+        if (is_array($this->button_properties)) {
74
+            if( isset($this->button_properties['title'])) {
75
+                $this->title = $app_strings[$this->button_properties['title']];
76
+            }
77
+            if( isset($this->button_properties['accesskey'])) {
78
+                $this->accesskey = $app_strings[$this->button_properties['accesskey']];
79
+            }
80
+            if( isset($this->button_properties['form_value'])) {
81
+                $this->value = $app_strings[$this->button_properties['form_value']];
82
+            }
83
+            if( isset($this->button_properties['module'])) {
84
+                $this->module_name = $this->button_properties['module'];
85
+            }
86
+        }
87
+
88
+
89
+        $focus = $widget_data['focus'];
90
+        if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){
91
+            $button = ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n"
92
+            . ' title="' . $this->title . '"'
93
+            . ' value="' . $this->value . "\"\n"
94
+            .' disabled />';
95
+            return $button;
96
+        }
97
+
98
+        //refresh the whole page after end of action?
99
+        $refresh_page = 0;
100
+        if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){
101
+            $refresh_page = 1;
102
+        }
103
+
104
+        $subpanel_definition = $widget_data['subpanel_definition'];
105
+        $button_definition = $subpanel_definition->get_buttons();
106 106
 
107 107
         $subpanel_name = $subpanel_definition->get_name();
108
-		if (empty($this->module_name)) {
109
-			$this->module_name = $subpanel_definition->get_module_name();
110
-		}
111
-		$link_field_name = $subpanel_definition->get_data_source_name(true);
112
-		$popup_mode='Single';
113
-		if(isset($widget_data['mode'])){
114
-			$popup_mode=$widget_data['mode'];
115
-		}
116
-		if(isset($widget_data['initial_filter_fields'])){
117
-			if (is_array($widget_data['initial_filter_fields'])) {
118
-				foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
119
-					if (isset($focus->$value) and !empty($focus->$value)) {
120
-						$initial_filter.="&".$alias . '='.urlencode($focus->$value);
121
-					}
122
-				}
123
-			}
124
-		}
125
-		$create="true";
126
-		if(isset($widget_data['create'])){
127
-			$create=$widget_data['create'];
128
-		}
129
-		$return_module = $_REQUEST['module'];
130
-		$return_action = 'SubPanelViewer';
131
-		$return_id = $_REQUEST['record'];
132
-
133
-		//field_to_name_array
134
-		$fton_array= array('id' => 'subpanel_id');
135
-		if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
136
-			$fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
137
-		}
138
-
139
-		$return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
140
-
141
-		$popup_request_data = array(
142
-			'call_back_function' => 'set_return_and_save_background',
143
-			'form_name' => 'DetailView',
144
-			'field_to_name_array' => $fton_array,
145
-			'passthru_data' => array(
146
-				'child_field' => $subpanel_name,
147
-				'return_url' => urlencode($return_url),
148
-				'link_field_name' => $link_field_name,
149
-				'module_name' => $subpanel_name,
150
-				'refresh_page'=>$refresh_page,
151
-			),
152
-		);
108
+        if (empty($this->module_name)) {
109
+            $this->module_name = $subpanel_definition->get_module_name();
110
+        }
111
+        $link_field_name = $subpanel_definition->get_data_source_name(true);
112
+        $popup_mode='Single';
113
+        if(isset($widget_data['mode'])){
114
+            $popup_mode=$widget_data['mode'];
115
+        }
116
+        if(isset($widget_data['initial_filter_fields'])){
117
+            if (is_array($widget_data['initial_filter_fields'])) {
118
+                foreach ($widget_data['initial_filter_fields'] as $value=>$alias) {
119
+                    if (isset($focus->$value) and !empty($focus->$value)) {
120
+                        $initial_filter.="&".$alias . '='.urlencode($focus->$value);
121
+                    }
122
+                }
123
+            }
124
+        }
125
+        $create="true";
126
+        if(isset($widget_data['create'])){
127
+            $create=$widget_data['create'];
128
+        }
129
+        $return_module = $_REQUEST['module'];
130
+        $return_action = 'SubPanelViewer';
131
+        $return_id = $_REQUEST['record'];
132
+
133
+        //field_to_name_array
134
+        $fton_array= array('id' => 'subpanel_id');
135
+        if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){
136
+            $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']);
137
+        }
138
+
139
+        $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1";
140
+
141
+        $popup_request_data = array(
142
+            'call_back_function' => 'set_return_and_save_background',
143
+            'form_name' => 'DetailView',
144
+            'field_to_name_array' => $fton_array,
145
+            'passthru_data' => array(
146
+                'child_field' => $subpanel_name,
147
+                'return_url' => urlencode($return_url),
148
+                'link_field_name' => $link_field_name,
149
+                'module_name' => $subpanel_name,
150
+                'refresh_page'=>$refresh_page,
151
+            ),
152
+        );
153 153
 
154 154
                 // bugfix #57850 add marketing_id to the request data to allow filtering based on it
155 155
                 if (!empty($_REQUEST['mkt_id']))
@@ -162,35 +162,35 @@  discard block
 block discarded – undo
162 162
                     $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']);
163 163
                 }
164 164
 
165
-		if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
165
+        if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) {
166 166
 
167
-			if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
168
-				$initial_filter = "&module_name=". urlencode($widget_data['module']);
169
-			}
170
-		}
167
+            if ($this->button_properties['add_to_passthru_data']['return_type']=='report') {
168
+                $initial_filter = "&module_name=". urlencode($widget_data['module']);
169
+            }
170
+        }
171 171
         //acl_roles_users_selectuser_button
172 172
 
173 173
         $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data);
174
-		return ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n"
175
-				. ' title="' . $this->title . '"'
176
-			. ' value="' . $this->value . "\"\n"
177
-			. " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' />\n";
178
-	}
174
+        return ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n"
175
+                . ' title="' . $this->title . '"'
176
+            . ' value="' . $this->value . "\"\n"
177
+            . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' />\n";
178
+    }
179 179
 
180 180
     /**
181
-    * @return string
182
-    */
181
+     * @return string
182
+     */
183 183
     protected function getTitle()
184 184
     {
185
-       return translate('LBL_SELECT_BUTTON_TITLE');
185
+        return translate('LBL_SELECT_BUTTON_TITLE');
186 186
     }
187 187
 
188 188
     /**
189
-    * @return string
190
-    */
189
+     * @return string
190
+     */
191 191
     protected function getAccesskey()
192 192
     {
193
-       return translate('LBL_SELECT_BUTTON_KEY');
193
+        return translate('LBL_SELECT_BUTTON_KEY');
194 194
     }
195 195
 
196 196
 }
Please login to merge, or discard this patch.