@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | |
42 | 42 | class SugarWidgetFieldFloat extends SugarWidgetFieldInt |
43 | 43 | { |
44 | - function displayList($layout_def) |
|
45 | - { |
|
44 | + function displayList($layout_def) |
|
45 | + { |
|
46 | 46 | |
47 | 47 | $vardef = $this->getVardef($layout_def); |
48 | 48 | |
@@ -51,37 +51,37 @@ discard block |
||
51 | 51 | } else { |
52 | 52 | $precision = null; |
53 | 53 | } |
54 | - return format_number(parent::displayListPlain($layout_def), $precision, $precision); |
|
55 | - } |
|
54 | + return format_number(parent::displayListPlain($layout_def), $precision, $precision); |
|
55 | + } |
|
56 | 56 | |
57 | - function displayListPlain($layout_def) |
|
58 | - { |
|
59 | - return $this->displayList($layout_def); |
|
60 | - } |
|
61 | - function queryFilterEquals(&$layout_def) |
|
62 | - { |
|
57 | + function displayListPlain($layout_def) |
|
58 | + { |
|
59 | + return $this->displayList($layout_def); |
|
60 | + } |
|
61 | + function queryFilterEquals(&$layout_def) |
|
62 | + { |
|
63 | 63 | return $this->_get_column_select($layout_def)."= ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
64 | - } |
|
64 | + } |
|
65 | 65 | |
66 | - function queryFilterNot_Equals(&$layout_def) |
|
67 | - { |
|
68 | - return $this->_get_column_select($layout_def)."!=".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
|
69 | - } |
|
66 | + function queryFilterNot_Equals(&$layout_def) |
|
67 | + { |
|
68 | + return $this->_get_column_select($layout_def)."!=".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
|
69 | + } |
|
70 | 70 | |
71 | - function queryFilterGreater(&$layout_def) |
|
72 | - { |
|
71 | + function queryFilterGreater(&$layout_def) |
|
72 | + { |
|
73 | 73 | return $this->_get_column_select($layout_def)." > ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - function queryFilterLess(&$layout_def) |
|
77 | - { |
|
78 | - return $this->_get_column_select($layout_def)." < ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
|
79 | - } |
|
76 | + function queryFilterLess(&$layout_def) |
|
77 | + { |
|
78 | + return $this->_get_column_select($layout_def)." < ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))."\n"; |
|
79 | + } |
|
80 | 80 | |
81 | - function queryFilterBetween(&$layout_def) |
|
82 | - { |
|
83 | - return $this->_get_column_select($layout_def)." BETWEEN ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0'])). " AND " . $GLOBALS['db']->quote(unformat_number($layout_def['input_name1'])) . "\n"; |
|
84 | - } |
|
81 | + function queryFilterBetween(&$layout_def) |
|
82 | + { |
|
83 | + return $this->_get_column_select($layout_def)." BETWEEN ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0'])). " AND " . $GLOBALS['db']->quote(unformat_number($layout_def['input_name1'])) . "\n"; |
|
84 | + } |
|
85 | 85 | |
86 | 86 | |
87 | 87 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $vardef = $this->getVardef($layout_def); |
48 | 48 | |
49 | - if ( isset($vardef['precision']) ) { |
|
49 | + if (isset($vardef['precision'])) { |
|
50 | 50 | $precision = $vardef['precision']; |
51 | 51 | } else { |
52 | 52 | $precision = null; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | function queryFilterBetween(&$layout_def) |
82 | 82 | { |
83 | - return $this->_get_column_select($layout_def)." BETWEEN ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0'])). " AND " . $GLOBALS['db']->quote(unformat_number($layout_def['input_name1'])) . "\n"; |
|
83 | + return $this->_get_column_select($layout_def)." BETWEEN ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name0']))." AND ".$GLOBALS['db']->quote(unformat_number($layout_def['input_name1']))."\n"; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -51,13 +51,13 @@ |
||
51 | 51 | $ops = $layout_def['options']; |
52 | 52 | } |
53 | 53 | elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
54 | - $ops = $app_list_strings[$layout_def['options']]; |
|
54 | + $ops = $app_list_strings[$layout_def['options']]; |
|
55 | 55 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
56 | - unset($ops['']); |
|
57 | - } |
|
56 | + unset($ops['']); |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | else{ |
60 | - $ops = array(); |
|
60 | + $ops = array(); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | else { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | function displayInput(&$layout_def) { |
47 | 47 | global $app_list_strings; |
48 | 48 | |
49 | - if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
50 | - if ( is_array($layout_def['options']) ) { |
|
49 | + if (!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
50 | + if (is_array($layout_def['options'])) { |
|
51 | 51 | $ops = $layout_def['options']; |
52 | 52 | } |
53 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
53 | + elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])) { |
|
54 | 54 | $ops = $app_list_strings[$layout_def['options']]; |
55 | - if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
55 | + if (array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
56 | 56 | unset($ops['']); |
57 | 57 | } |
58 | 58 | } |
59 | - else{ |
|
59 | + else { |
|
60 | 60 | $ops = array(); |
61 | 61 | } |
62 | 62 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $ops = $app_list_strings[$layout_def['options']]; |
65 | 65 | } |
66 | 66 | |
67 | - $str = '<select name="' . $layout_def['name'] . '">'; |
|
67 | + $str = '<select name="'.$layout_def['name'].'">'; |
|
68 | 68 | $str .= get_select_options_with_id($ops, $layout_def['input_name0']); |
69 | 69 | $str .= '</select>'; |
70 | 70 | return $str; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -49,18 +51,15 @@ discard block |
||
49 | 51 | if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
50 | 52 | if ( is_array($layout_def['options']) ) { |
51 | 53 | $ops = $layout_def['options']; |
52 | - } |
|
53 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
54 | + } elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
54 | 55 | $ops = $app_list_strings[$layout_def['options']]; |
55 | 56 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
56 | 57 | unset($ops['']); |
57 | 58 | } |
58 | - } |
|
59 | - else{ |
|
59 | + } else{ |
|
60 | 60 | $ops = array(); |
61 | 61 | } |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | $ops = $app_list_strings[$layout_def['options']]; |
65 | 64 | } |
66 | 65 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | function getSubClass($layout_def) |
63 | 63 | { |
64 | - if (! empty($layout_def['type'])) |
|
64 | + if (!empty($layout_def['type'])) |
|
65 | 65 | { |
66 | 66 | |
67 | 67 | if ($layout_def['type'] == 'time') { |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | { |
81 | 81 | $obj = $this->getSubClass($layout_def); |
82 | 82 | |
83 | - $context = $this->layout_manager->getAttribute('context');//_ppd($context); |
|
83 | + $context = $this->layout_manager->getAttribute('context'); //_ppd($context); |
|
84 | 84 | $func_name = 'display'.$context; |
85 | 85 | |
86 | 86 | |
87 | - if ( ! empty($context) && method_exists($obj,$func_name)) |
|
87 | + if (!empty($context) && method_exists($obj, $func_name)) |
|
88 | 88 | { |
89 | 89 | return $obj->$func_name($layout_def); |
90 | 90 | } else |
@@ -96,20 +96,20 @@ discard block |
||
96 | 96 | function _get_column_select_special($layout_def) |
97 | 97 | { |
98 | 98 | $alias = ''; |
99 | - if ( ! empty($layout_def['table_alias'])) |
|
99 | + if (!empty($layout_def['table_alias'])) |
|
100 | 100 | { |
101 | 101 | $alias = $layout_def['table_alias']; |
102 | 102 | } |
103 | 103 | |
104 | - if ($layout_def['name'] == 'weighted_sum' ) |
|
104 | + if ($layout_def['name'] == 'weighted_sum') |
|
105 | 105 | { |
106 | - return sprintf("SUM(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability","IFNULL", array(0)), |
|
107 | - $this->reporter->db->convert("$alias.amount_usdollar","IFNULL", array(0))); |
|
106 | + return sprintf("SUM(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability", "IFNULL", array(0)), |
|
107 | + $this->reporter->db->convert("$alias.amount_usdollar", "IFNULL", array(0))); |
|
108 | 108 | } |
109 | - if ($layout_def['name'] == 'weighted_amount' ) |
|
109 | + if ($layout_def['name'] == 'weighted_amount') |
|
110 | 110 | { |
111 | - return sprintf("AVG(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability","IFNULL", array(0)), |
|
112 | - $this->reporter->db->convert("$alias.amount_usdollar","IFNULL", array(0))); |
|
111 | + return sprintf("AVG(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability", "IFNULL", array(0)), |
|
112 | + $this->reporter->db->convert("$alias.amount_usdollar", "IFNULL", array(0))); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | $reportAlias = array(); |
121 | 121 | } |
122 | 122 | |
123 | - if ( ! empty($layout_def['table_alias'])) { |
|
123 | + if (!empty($layout_def['table_alias'])) { |
|
124 | 124 | $alias = $layout_def['table_alias'].".".$layout_def['name']; |
125 | - } else if (! empty($layout_def['name'])) { |
|
125 | + } else if (!empty($layout_def['name'])) { |
|
126 | 126 | $alias = $layout_def['name']; |
127 | 127 | } else { |
128 | 128 | $alias = "*"; |
129 | 129 | } |
130 | 130 | |
131 | - if ( ! empty($layout_def['group_function']) ) |
|
131 | + if (!empty($layout_def['group_function'])) |
|
132 | 132 | { |
133 | 133 | if ($layout_def['name'] == 'weighted_sum' || $layout_def['name'] == 'weighted_amount') |
134 | 134 | { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if ($layout_def['group_function'] != 'avg') { |
154 | 154 | $alias = "{$layout_def['group_function']}($alias/{$query})*{$currency->conversion_rate}"; |
155 | 155 | } else { |
156 | - $alias = $this->reporter->db->convert("$alias/$query", "AVG") . " * {$currency->conversion_rate}"; |
|
156 | + $alias = $this->reporter->db->convert("$alias/$query", "AVG")." * {$currency->conversion_rate}"; |
|
157 | 157 | } |
158 | 158 | } else { |
159 | 159 | // We need to use convert() for AVG because of Oracle |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | function queryOrderBy($layout_def) |
185 | 185 | { |
186 | 186 | $field_def = array(); |
187 | - if(!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
187 | + if (!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
188 | 188 | |
189 | 189 | if (!empty($layout_def['group_function'])) |
190 | 190 | { |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | elseif (!empty($field_def['sort_on'])) |
194 | 194 | { |
195 | 195 | $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; |
196 | - if(!empty($field_def['sort_on2'])) |
|
197 | - $order_by .= ', ' . $layout_def['table_alias'].".".$field_def['sort_on2']; |
|
196 | + if (!empty($field_def['sort_on2'])) |
|
197 | + $order_by .= ', '.$layout_def['table_alias'].".".$field_def['sort_on2']; |
|
198 | 198 | } |
199 | 199 | else { |
200 | 200 | $order_by = $this->_get_column_alias($layout_def)." \n"; |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | //use sugar db function convert on order by string to convert to varchar. This is mainly for db's |
204 | 204 | //that do not allow sorting on clob/text fields |
205 | 205 | if ($this->reporter->db->isTextType($this->reporter->db->getFieldType($field_def))) { |
206 | - $order_by = $this->reporter->db->convert($order_by,'text2char', array(10000)); // array(10000) is for db2 only |
|
206 | + $order_by = $this->reporter->db->convert($order_by, 'text2char', array(10000)); // array(10000) is for db2 only |
|
207 | 207 | } |
208 | 208 | |
209 | - if ( empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') |
|
209 | + if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') |
|
210 | 210 | { |
211 | 211 | return $order_by." ASC"; |
212 | 212 | } else { |
@@ -223,27 +223,27 @@ discard block |
||
223 | 223 | |
224 | 224 | function displayHeaderCell($layout_def) |
225 | 225 | { |
226 | - global $start_link_wrapper,$end_link_wrapper; |
|
226 | + global $start_link_wrapper, $end_link_wrapper; |
|
227 | 227 | |
228 | 228 | |
229 | 229 | // don't show sort links if name isn't defined |
230 | 230 | $no_sort = $this->layout_manager->getAttribute('no_sort'); |
231 | - if(empty($layout_def['name']) || ! empty($no_sort) || ! empty($layout_def['no_sort'])) |
|
231 | + if (empty($layout_def['name']) || !empty($no_sort) || !empty($layout_def['no_sort'])) |
|
232 | 232 | { |
233 | 233 | return $layout_def['label']; |
234 | 234 | } |
235 | 235 | |
236 | 236 | |
237 | 237 | |
238 | - $sort_by =''; |
|
239 | - if ( ! empty($layout_def['table_key']) && ! empty($layout_def['name']) ) { |
|
240 | - if (! empty($layout_def['group_function']) && $layout_def['group_function'] == 'count') { |
|
238 | + $sort_by = ''; |
|
239 | + if (!empty($layout_def['table_key']) && !empty($layout_def['name'])) { |
|
240 | + if (!empty($layout_def['group_function']) && $layout_def['group_function'] == 'count') { |
|
241 | 241 | $sort_by = $layout_def['table_key'].":".'count'; |
242 | 242 | } else { |
243 | 243 | $sort_by = $layout_def['table_key'].":".$layout_def['name']; |
244 | - if ( ! empty($layout_def['column_function'])) { |
|
244 | + if (!empty($layout_def['column_function'])) { |
|
245 | 245 | $sort_by .= ':'.$layout_def['column_function']; |
246 | - } else if ( ! empty($layout_def['group_function']) ) { |
|
246 | + } else if (!empty($layout_def['group_function'])) { |
|
247 | 247 | $sort_by .= ':'.$layout_def['group_function']; |
248 | 248 | } |
249 | 249 | } |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | return $this->displayHeaderCellPlain($layout_def); |
252 | 252 | } |
253 | 253 | |
254 | - $start = empty($start_link_wrapper) ? '': $start_link_wrapper; |
|
255 | - $end = empty($end_link_wrapper) ? '': $end_link_wrapper; |
|
254 | + $start = empty($start_link_wrapper) ? '' : $start_link_wrapper; |
|
255 | + $end = empty($end_link_wrapper) ? '' : $end_link_wrapper; |
|
256 | 256 | |
257 | 257 | // unable to retrieve the vardef here, exclude columns of type clob/text from being sortable |
258 | 258 | |
259 | - if(!in_array($layout_def['name'], array('description', 'account_description', 'lead_source_description', 'status_description', 'to_addrs', 'cc_addrs', 'bcc_addrs', 'work_log', 'objective', 'resolution'))) { |
|
259 | + if (!in_array($layout_def['name'], array('description', 'account_description', 'lead_source_description', 'status_description', 'to_addrs', 'cc_addrs', 'bcc_addrs', 'work_log', 'objective', 'resolution'))) { |
|
260 | 260 | $header_cell = "<a class=\"listViewThLinkS1\" href=\"".$start.$sort_by.$end."\">"; |
261 | 261 | $header_cell .= $this->displayHeaderCellPlain($layout_def); |
262 | 262 | $objListView = new ListView(); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $context = $this->layout_manager->getAttribute('context'); |
277 | 277 | $func_name = 'query'.$context; |
278 | 278 | |
279 | - if ( ! empty($context) && method_exists($obj,$func_name)) |
|
279 | + if (!empty($context) && method_exists($obj, $func_name)) |
|
280 | 280 | { |
281 | 281 | return $obj->$func_name($layout_def); |
282 | 282 | } else |
@@ -296,44 +296,44 @@ discard block |
||
296 | 296 | |
297 | 297 | // Bug: 44605 |
298 | 298 | // this comment is being added to trigger the upgrade package |
299 | - if ( ! empty($layout_def['group_function']) && $layout_def['group_function']=='count') |
|
299 | + if (!empty($layout_def['group_function']) && $layout_def['group_function'] == 'count') |
|
300 | 300 | { |
301 | - return $layout_def['table_alias'] . '__count'; |
|
301 | + return $layout_def['table_alias'].'__count'; |
|
302 | 302 | } |
303 | 303 | |
304 | - if ( ! empty($layout_def['table_alias'])) |
|
304 | + if (!empty($layout_def['table_alias'])) |
|
305 | 305 | { |
306 | - array_push($alias_arr,$layout_def['table_alias']); |
|
306 | + array_push($alias_arr, $layout_def['table_alias']); |
|
307 | 307 | } |
308 | 308 | |
309 | - if ( ! empty($layout_def['group_function']) && $layout_def['group_function'] != 'weighted_amount' && $layout_def['group_function'] != 'weighted_sum') |
|
309 | + if (!empty($layout_def['group_function']) && $layout_def['group_function'] != 'weighted_amount' && $layout_def['group_function'] != 'weighted_sum') |
|
310 | 310 | { |
311 | - array_push($alias_arr,$layout_def['group_function']); |
|
312 | - } else if ( ! empty($layout_def['column_function'])) |
|
311 | + array_push($alias_arr, $layout_def['group_function']); |
|
312 | + } else if (!empty($layout_def['column_function'])) |
|
313 | 313 | { |
314 | - array_push($alias_arr,$layout_def['column_function']); |
|
315 | - } else if ( ! empty($layout_def['qualifier'])) |
|
314 | + array_push($alias_arr, $layout_def['column_function']); |
|
315 | + } else if (!empty($layout_def['qualifier'])) |
|
316 | 316 | { |
317 | - array_push($alias_arr,$layout_def['qualifier']); |
|
317 | + array_push($alias_arr, $layout_def['qualifier']); |
|
318 | 318 | } |
319 | 319 | |
320 | - if ( ! empty($layout_def['name'])) |
|
320 | + if (!empty($layout_def['name'])) |
|
321 | 321 | { |
322 | - array_push($alias_arr,$layout_def['name']); |
|
322 | + array_push($alias_arr, $layout_def['name']); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | global $used_aliases, $alias_map; |
326 | 326 | |
327 | - $alias = strtolower(implode("_",$alias_arr)); |
|
327 | + $alias = strtolower(implode("_", $alias_arr)); |
|
328 | 328 | |
329 | 329 | $short_alias = $this->getTruncatedColumnAlias($alias); |
330 | 330 | |
331 | - if ( empty($used_aliases[$short_alias])) |
|
331 | + if (empty($used_aliases[$short_alias])) |
|
332 | 332 | { |
333 | 333 | $alias_map[$alias] = $short_alias; |
334 | 334 | $used_aliases[$short_alias] = 1; |
335 | 335 | return $short_alias; |
336 | - } else if ( ! empty($alias_map[$alias]) ) |
|
336 | + } else if (!empty($alias_map[$alias])) |
|
337 | 337 | { |
338 | 338 | return $alias_map[$alias]; |
339 | 339 | } else { |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | /** @var $db DBManager */ |
365 | 365 | $db = $this->reporter->db; |
366 | 366 | $column = $this->_get_column_select($layout_def); |
367 | - return "(coalesce(" . $db->convert($column, "length") . ",0) > 0)\n"; |
|
367 | + return "(coalesce(".$db->convert($column, "length").",0) > 0)\n"; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -184,19 +186,20 @@ discard block |
||
184 | 186 | function queryOrderBy($layout_def) |
185 | 187 | { |
186 | 188 | $field_def = array(); |
187 | - if(!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
189 | + if(!empty($this->reporter->all_fields[$layout_def['column_key']])) { |
|
190 | + $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
191 | + } |
|
188 | 192 | |
189 | 193 | if (!empty($layout_def['group_function'])) |
190 | 194 | { |
191 | 195 | $order_by = $this->_get_column_alias($layout_def); |
192 | - } |
|
193 | - elseif (!empty($field_def['sort_on'])) |
|
196 | + } elseif (!empty($field_def['sort_on'])) |
|
194 | 197 | { |
195 | 198 | $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; |
196 | - if(!empty($field_def['sort_on2'])) |
|
197 | - $order_by .= ', ' . $layout_def['table_alias'].".".$field_def['sort_on2']; |
|
198 | - } |
|
199 | - else { |
|
199 | + if(!empty($field_def['sort_on2'])) { |
|
200 | + $order_by .= ', ' . $layout_def['table_alias'].".".$field_def['sort_on2']; |
|
201 | + } |
|
202 | + } else { |
|
200 | 203 | $order_by = $this->_get_column_alias($layout_def)." \n"; |
201 | 204 | } |
202 | 205 |
@@ -285,6 +285,9 @@ |
||
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
288 | + /** |
|
289 | + * @return string |
|
290 | + */ |
|
288 | 291 | function _get_column_alias($layout_def) |
289 | 292 | { |
290 | 293 | $alias_arr = array(); |
@@ -54,30 +54,30 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected $reporter; |
56 | 56 | |
57 | - function __construct(&$layout_manager) { |
|
57 | + function __construct(&$layout_manager) { |
|
58 | 58 | parent::__construct($layout_manager); |
59 | 59 | $this->reporter = $this->layout_manager->getAttribute("reporter"); |
60 | 60 | } |
61 | 61 | |
62 | - function getSubClass($layout_def) |
|
63 | - { |
|
64 | - if (! empty($layout_def['type'])) |
|
65 | - { |
|
66 | - |
|
67 | - if ($layout_def['type'] == 'time') { |
|
68 | - $layout_def['widget_class'] = 'Fielddate'; |
|
69 | - } else { |
|
70 | - $layout_def['widget_class'] = 'Field'.$layout_def['type']; |
|
71 | - } |
|
72 | - return $this->layout_manager->getClassFromWidgetDef($layout_def); |
|
73 | - } else { |
|
74 | - return $this; |
|
75 | - } |
|
76 | - } |
|
77 | - |
|
78 | - |
|
79 | - function display($layout_def) |
|
80 | - { |
|
62 | + function getSubClass($layout_def) |
|
63 | + { |
|
64 | + if (! empty($layout_def['type'])) |
|
65 | + { |
|
66 | + |
|
67 | + if ($layout_def['type'] == 'time') { |
|
68 | + $layout_def['widget_class'] = 'Fielddate'; |
|
69 | + } else { |
|
70 | + $layout_def['widget_class'] = 'Field'.$layout_def['type']; |
|
71 | + } |
|
72 | + return $this->layout_manager->getClassFromWidgetDef($layout_def); |
|
73 | + } else { |
|
74 | + return $this; |
|
75 | + } |
|
76 | + } |
|
77 | + |
|
78 | + |
|
79 | + function display($layout_def) |
|
80 | + { |
|
81 | 81 | $obj = $this->getSubClass($layout_def); |
82 | 82 | |
83 | 83 | $context = $this->layout_manager->getAttribute('context');//_ppd($context); |
@@ -91,51 +91,51 @@ discard block |
||
91 | 91 | { |
92 | 92 | return 'display not found:'.$func_name; |
93 | 93 | } |
94 | - } |
|
94 | + } |
|
95 | 95 | |
96 | - function _get_column_select_special($layout_def) |
|
97 | - { |
|
98 | - $alias = ''; |
|
99 | - if ( ! empty($layout_def['table_alias'])) |
|
100 | - { |
|
101 | - $alias = $layout_def['table_alias']; |
|
102 | - } |
|
96 | + function _get_column_select_special($layout_def) |
|
97 | + { |
|
98 | + $alias = ''; |
|
99 | + if ( ! empty($layout_def['table_alias'])) |
|
100 | + { |
|
101 | + $alias = $layout_def['table_alias']; |
|
102 | + } |
|
103 | 103 | |
104 | 104 | if ($layout_def['name'] == 'weighted_sum' ) |
105 | 105 | { |
106 | 106 | return sprintf("SUM(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability","IFNULL", array(0)), |
107 | 107 | $this->reporter->db->convert("$alias.amount_usdollar","IFNULL", array(0))); |
108 | - } |
|
108 | + } |
|
109 | 109 | if ($layout_def['name'] == 'weighted_amount' ) |
110 | 110 | { |
111 | 111 | return sprintf("AVG(%s * %s * 0.01)", $this->reporter->db->convert("$alias.probability","IFNULL", array(0)), |
112 | 112 | $this->reporter->db->convert("$alias.amount_usdollar","IFNULL", array(0))); |
113 | - } |
|
114 | - } |
|
115 | - |
|
116 | - function _get_column_select($layout_def) |
|
117 | - { |
|
118 | - global $reportAlias; |
|
119 | - if (!isset($reportAlias)) { |
|
120 | - $reportAlias = array(); |
|
121 | - } |
|
122 | - |
|
123 | - if ( ! empty($layout_def['table_alias'])) { |
|
124 | - $alias = $layout_def['table_alias'].".".$layout_def['name']; |
|
125 | - } else if (! empty($layout_def['name'])) { |
|
126 | - $alias = $layout_def['name']; |
|
127 | - } else { |
|
128 | - $alias = "*"; |
|
129 | - } |
|
130 | - |
|
131 | - if ( ! empty($layout_def['group_function']) ) |
|
132 | - { |
|
133 | - if ($layout_def['name'] == 'weighted_sum' || $layout_def['name'] == 'weighted_amount') |
|
134 | - { |
|
135 | - $alias = $this->_get_column_select_special($layout_def); |
|
136 | - $reportAlias[$alias] = $layout_def; |
|
137 | - return $alias; |
|
138 | - } |
|
113 | + } |
|
114 | + } |
|
115 | + |
|
116 | + function _get_column_select($layout_def) |
|
117 | + { |
|
118 | + global $reportAlias; |
|
119 | + if (!isset($reportAlias)) { |
|
120 | + $reportAlias = array(); |
|
121 | + } |
|
122 | + |
|
123 | + if ( ! empty($layout_def['table_alias'])) { |
|
124 | + $alias = $layout_def['table_alias'].".".$layout_def['name']; |
|
125 | + } else if (! empty($layout_def['name'])) { |
|
126 | + $alias = $layout_def['name']; |
|
127 | + } else { |
|
128 | + $alias = "*"; |
|
129 | + } |
|
130 | + |
|
131 | + if ( ! empty($layout_def['group_function']) ) |
|
132 | + { |
|
133 | + if ($layout_def['name'] == 'weighted_sum' || $layout_def['name'] == 'weighted_amount') |
|
134 | + { |
|
135 | + $alias = $this->_get_column_select_special($layout_def); |
|
136 | + $reportAlias[$alias] = $layout_def; |
|
137 | + return $alias; |
|
138 | + } |
|
139 | 139 | |
140 | 140 | // Use IFNULL only if it's not AVG aggregate |
141 | 141 | // because it adds NULL rows to the count when it should not, thus getting wrong result |
@@ -164,66 +164,66 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | } |
167 | - } |
|
167 | + } |
|
168 | 168 | |
169 | - $reportAlias[$alias] = $layout_def; |
|
170 | - return $alias; |
|
171 | - } |
|
169 | + $reportAlias[$alias] = $layout_def; |
|
170 | + return $alias; |
|
171 | + } |
|
172 | 172 | |
173 | - function querySelect(&$layout_def) |
|
174 | - { |
|
173 | + function querySelect(&$layout_def) |
|
174 | + { |
|
175 | 175 | return $this->_get_column_select($layout_def)." ".$this->_get_column_alias($layout_def)."\n"; |
176 | - } |
|
176 | + } |
|
177 | 177 | |
178 | - function queryGroupBy($layout_def) |
|
179 | - { |
|
180 | - return $this->_get_column_select($layout_def)." \n"; |
|
181 | - } |
|
178 | + function queryGroupBy($layout_def) |
|
179 | + { |
|
180 | + return $this->_get_column_select($layout_def)." \n"; |
|
181 | + } |
|
182 | 182 | |
183 | 183 | |
184 | - function queryOrderBy($layout_def) |
|
185 | - { |
|
186 | - $field_def = array(); |
|
187 | - if(!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
184 | + function queryOrderBy($layout_def) |
|
185 | + { |
|
186 | + $field_def = array(); |
|
187 | + if(!empty($this->reporter->all_fields[$layout_def['column_key']])) $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
|
188 | 188 | |
189 | 189 | if (!empty($layout_def['group_function'])) |
190 | 190 | { |
191 | 191 | $order_by = $this->_get_column_alias($layout_def); |
192 | 192 | } |
193 | 193 | elseif (!empty($field_def['sort_on'])) |
194 | - { |
|
195 | - $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; |
|
194 | + { |
|
195 | + $order_by = $layout_def['table_alias'].".".$field_def['sort_on']; |
|
196 | 196 | if(!empty($field_def['sort_on2'])) |
197 | 197 | $order_by .= ', ' . $layout_def['table_alias'].".".$field_def['sort_on2']; |
198 | 198 | } |
199 | - else { |
|
200 | - $order_by = $this->_get_column_alias($layout_def)." \n"; |
|
201 | - } |
|
199 | + else { |
|
200 | + $order_by = $this->_get_column_alias($layout_def)." \n"; |
|
201 | + } |
|
202 | 202 | |
203 | - //use sugar db function convert on order by string to convert to varchar. This is mainly for db's |
|
204 | - //that do not allow sorting on clob/text fields |
|
203 | + //use sugar db function convert on order by string to convert to varchar. This is mainly for db's |
|
204 | + //that do not allow sorting on clob/text fields |
|
205 | 205 | if ($this->reporter->db->isTextType($this->reporter->db->getFieldType($field_def))) { |
206 | 206 | $order_by = $this->reporter->db->convert($order_by,'text2char', array(10000)); // array(10000) is for db2 only |
207 | 207 | } |
208 | 208 | |
209 | - if ( empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') |
|
210 | - { |
|
211 | - return $order_by." ASC"; |
|
212 | - } else { |
|
213 | - return $order_by." DESC"; |
|
214 | - } |
|
215 | - } |
|
209 | + if ( empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a') |
|
210 | + { |
|
211 | + return $order_by." ASC"; |
|
212 | + } else { |
|
213 | + return $order_by." DESC"; |
|
214 | + } |
|
215 | + } |
|
216 | 216 | |
217 | 217 | |
218 | - function queryFilter($layout_def) |
|
219 | - { |
|
220 | - $method_name = "queryFilter".$layout_def['qualifier_name']; |
|
221 | - return $this->$method_name($layout_def); |
|
222 | - } |
|
218 | + function queryFilter($layout_def) |
|
219 | + { |
|
220 | + $method_name = "queryFilter".$layout_def['qualifier_name']; |
|
221 | + return $this->$method_name($layout_def); |
|
222 | + } |
|
223 | 223 | |
224 | - function displayHeaderCell($layout_def) |
|
225 | - { |
|
226 | - global $start_link_wrapper,$end_link_wrapper; |
|
224 | + function displayHeaderCell($layout_def) |
|
225 | + { |
|
226 | + global $start_link_wrapper,$end_link_wrapper; |
|
227 | 227 | |
228 | 228 | |
229 | 229 | // don't show sort links if name isn't defined |
@@ -237,22 +237,22 @@ discard block |
||
237 | 237 | |
238 | 238 | $sort_by =''; |
239 | 239 | if ( ! empty($layout_def['table_key']) && ! empty($layout_def['name']) ) { |
240 | - if (! empty($layout_def['group_function']) && $layout_def['group_function'] == 'count') { |
|
240 | + if (! empty($layout_def['group_function']) && $layout_def['group_function'] == 'count') { |
|
241 | 241 | $sort_by = $layout_def['table_key'].":".'count'; |
242 | - } else { |
|
243 | - $sort_by = $layout_def['table_key'].":".$layout_def['name']; |
|
242 | + } else { |
|
243 | + $sort_by = $layout_def['table_key'].":".$layout_def['name']; |
|
244 | 244 | if ( ! empty($layout_def['column_function'])) { |
245 | - $sort_by .= ':'.$layout_def['column_function']; |
|
246 | - } else if ( ! empty($layout_def['group_function']) ) { |
|
247 | - $sort_by .= ':'.$layout_def['group_function']; |
|
248 | - } |
|
249 | - } |
|
245 | + $sort_by .= ':'.$layout_def['column_function']; |
|
246 | + } else if ( ! empty($layout_def['group_function']) ) { |
|
247 | + $sort_by .= ':'.$layout_def['group_function']; |
|
248 | + } |
|
249 | + } |
|
250 | 250 | } else { |
251 | - return $this->displayHeaderCellPlain($layout_def); |
|
251 | + return $this->displayHeaderCellPlain($layout_def); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | $start = empty($start_link_wrapper) ? '': $start_link_wrapper; |
255 | - $end = empty($end_link_wrapper) ? '': $end_link_wrapper; |
|
255 | + $end = empty($end_link_wrapper) ? '': $end_link_wrapper; |
|
256 | 256 | |
257 | 257 | // unable to retrieve the vardef here, exclude columns of type clob/text from being sortable |
258 | 258 | |
@@ -262,40 +262,40 @@ discard block |
||
262 | 262 | $objListView = new ListView(); |
263 | 263 | $header_cell .= $objListView->getArrowUpDownStart(isset($layout_def['sort']) ? $layout_def['sort'] : ''); |
264 | 264 | $header_cell .= $objListView->getArrowUpDownEnd(isset($layout_def['sort']) ? $layout_def['sort'] : ''); |
265 | - $header_cell .= "</a>"; |
|
266 | - return $header_cell; |
|
267 | - } |
|
265 | + $header_cell .= "</a>"; |
|
266 | + return $header_cell; |
|
267 | + } |
|
268 | 268 | |
269 | - return $this->displayHeaderCellPlain($layout_def); |
|
269 | + return $this->displayHeaderCellPlain($layout_def); |
|
270 | 270 | } |
271 | 271 | |
272 | - function query($layout_def) |
|
273 | - { |
|
274 | - $obj = $this->getSubClass($layout_def); |
|
272 | + function query($layout_def) |
|
273 | + { |
|
274 | + $obj = $this->getSubClass($layout_def); |
|
275 | 275 | |
276 | - $context = $this->layout_manager->getAttribute('context'); |
|
277 | - $func_name = 'query'.$context; |
|
276 | + $context = $this->layout_manager->getAttribute('context'); |
|
277 | + $func_name = 'query'.$context; |
|
278 | 278 | |
279 | - if ( ! empty($context) && method_exists($obj,$func_name)) |
|
280 | - { |
|
281 | - return $obj->$func_name($layout_def); |
|
282 | - } else |
|
283 | - { |
|
284 | - return ''; |
|
285 | - } |
|
286 | - } |
|
279 | + if ( ! empty($context) && method_exists($obj,$func_name)) |
|
280 | + { |
|
281 | + return $obj->$func_name($layout_def); |
|
282 | + } else |
|
283 | + { |
|
284 | + return ''; |
|
285 | + } |
|
286 | + } |
|
287 | 287 | |
288 | - function _get_column_alias($layout_def) |
|
289 | - { |
|
288 | + function _get_column_alias($layout_def) |
|
289 | + { |
|
290 | 290 | $alias_arr = array(); |
291 | 291 | |
292 | - if (!empty($layout_def['table_key']) && $layout_def['table_key'] == 'self' && !empty($layout_def['name']) && $layout_def['name'] == 'id') |
|
293 | - { |
|
294 | - return 'primaryid'; |
|
295 | - } |
|
292 | + if (!empty($layout_def['table_key']) && $layout_def['table_key'] == 'self' && !empty($layout_def['name']) && $layout_def['name'] == 'id') |
|
293 | + { |
|
294 | + return 'primaryid'; |
|
295 | + } |
|
296 | 296 | |
297 | - // Bug: 44605 |
|
298 | - // this comment is being added to trigger the upgrade package |
|
297 | + // Bug: 44605 |
|
298 | + // this comment is being added to trigger the upgrade package |
|
299 | 299 | if ( ! empty($layout_def['group_function']) && $layout_def['group_function']=='count') |
300 | 300 | { |
301 | 301 | return $layout_def['table_alias'] . '__count'; |
@@ -322,49 +322,49 @@ discard block |
||
322 | 322 | array_push($alias_arr,$layout_def['name']); |
323 | 323 | } |
324 | 324 | |
325 | - global $used_aliases, $alias_map; |
|
325 | + global $used_aliases, $alias_map; |
|
326 | 326 | |
327 | 327 | $alias = strtolower(implode("_",$alias_arr)); |
328 | 328 | |
329 | 329 | $short_alias = $this->getTruncatedColumnAlias($alias); |
330 | 330 | |
331 | - if ( empty($used_aliases[$short_alias])) |
|
332 | - { |
|
333 | - $alias_map[$alias] = $short_alias; |
|
334 | - $used_aliases[$short_alias] = 1; |
|
335 | - return $short_alias; |
|
336 | - } else if ( ! empty($alias_map[$alias]) ) |
|
337 | - { |
|
338 | - return $alias_map[$alias]; |
|
339 | - } else { |
|
340 | - $alias_map[$alias] = $short_alias.'_'.$used_aliases[$short_alias]; |
|
341 | - $used_aliases[$short_alias]++; |
|
342 | - return $alias_map[$alias]; |
|
343 | - } |
|
344 | - } |
|
345 | - |
|
346 | - function queryFilterEmpty($layout_def) |
|
347 | - { |
|
348 | - $column = $this->_get_column_select($layout_def); |
|
349 | - return "($column IS NULL OR $column = ".$this->reporter->db->emptyValue($layout_def['type']).")"; |
|
350 | - } |
|
351 | - |
|
352 | - function queryFilterIs($layout_def) |
|
353 | - { |
|
354 | - return '( '.$this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."')\n"; |
|
355 | - } |
|
356 | - |
|
357 | - function queryFilteris_not($layout_def) |
|
358 | - { |
|
359 | - return '( '.$this->_get_column_select($layout_def)."<>'".$GLOBALS['db']->quote($layout_def['input_name0'])."')\n"; |
|
360 | - } |
|
361 | - |
|
362 | - function queryFilterNot_Empty($layout_def) |
|
363 | - { |
|
364 | - /** @var $db DBManager */ |
|
365 | - $db = $this->reporter->db; |
|
366 | - $column = $this->_get_column_select($layout_def); |
|
367 | - return "(coalesce(" . $db->convert($column, "length") . ",0) > 0)\n"; |
|
368 | - } |
|
331 | + if ( empty($used_aliases[$short_alias])) |
|
332 | + { |
|
333 | + $alias_map[$alias] = $short_alias; |
|
334 | + $used_aliases[$short_alias] = 1; |
|
335 | + return $short_alias; |
|
336 | + } else if ( ! empty($alias_map[$alias]) ) |
|
337 | + { |
|
338 | + return $alias_map[$alias]; |
|
339 | + } else { |
|
340 | + $alias_map[$alias] = $short_alias.'_'.$used_aliases[$short_alias]; |
|
341 | + $used_aliases[$short_alias]++; |
|
342 | + return $alias_map[$alias]; |
|
343 | + } |
|
344 | + } |
|
345 | + |
|
346 | + function queryFilterEmpty($layout_def) |
|
347 | + { |
|
348 | + $column = $this->_get_column_select($layout_def); |
|
349 | + return "($column IS NULL OR $column = ".$this->reporter->db->emptyValue($layout_def['type']).")"; |
|
350 | + } |
|
351 | + |
|
352 | + function queryFilterIs($layout_def) |
|
353 | + { |
|
354 | + return '( '.$this->_get_column_select($layout_def)."='".$GLOBALS['db']->quote($layout_def['input_name0'])."')\n"; |
|
355 | + } |
|
356 | + |
|
357 | + function queryFilteris_not($layout_def) |
|
358 | + { |
|
359 | + return '( '.$this->_get_column_select($layout_def)."<>'".$GLOBALS['db']->quote($layout_def['input_name0'])."')\n"; |
|
360 | + } |
|
361 | + |
|
362 | + function queryFilterNot_Empty($layout_def) |
|
363 | + { |
|
364 | + /** @var $db DBManager */ |
|
365 | + $db = $this->reporter->db; |
|
366 | + $column = $this->_get_column_select($layout_def); |
|
367 | + return "(coalesce(" . $db->convert($column, "length") . ",0) > 0)\n"; |
|
368 | + } |
|
369 | 369 | |
370 | 370 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | public function getWidgetId($buttonSuffix = true) |
48 | 48 | { |
49 | - return parent::getWidgetId() . '_select_button'; |
|
49 | + return parent::getWidgetId().'_select_button'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | function display($widget_data) |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->title = $app_strings['LBL_SELECT_BUTTON_TITLE']; |
61 | 61 | $this->value = $app_strings['LBL_SELECT_BUTTON_LABEL']; |
62 | - $this->module = 'Campaigns';//'CampaignLog'; |
|
62 | + $this->module = 'Campaigns'; //'CampaignLog'; |
|
63 | 63 | $this->module_name = 'Campaigns'; |
64 | 64 | |
65 | 65 | |
@@ -68,52 +68,52 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | $focus = $widget_data['focus']; |
71 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
72 | - $button = ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n" |
|
73 | - . ' title="' . $this->title . '"' |
|
74 | - . ' value="' . $this->value . "\"\n" |
|
71 | + if (ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)) { |
|
72 | + $button = ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\n" |
|
73 | + . ' title="'.$this->title.'"' |
|
74 | + . ' value="'.$this->value."\"\n" |
|
75 | 75 | .' disabled />'; |
76 | 76 | return $button; |
77 | 77 | } |
78 | 78 | |
79 | 79 | //refresh the whole page after end of action? |
80 | 80 | $refresh_page = 0; |
81 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
81 | + if (!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])) { |
|
82 | 82 | $refresh_page = 1; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $subpanel_definition = $widget_data['subpanel_definition']; |
86 | 86 | $button_definition = $subpanel_definition->get_buttons(); |
87 | - $subpanel_name = $this->module; //"Campaigns";//$subpanel_definition->get_module_name(); |
|
87 | + $subpanel_name = $this->module; //"Campaigns";//$subpanel_definition->get_module_name(); |
|
88 | 88 | if (empty($this->module_name)) { |
89 | 89 | $this->module_name = $subpanel_name; |
90 | 90 | } |
91 | 91 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
92 | - $popup_mode='multiselect'; |
|
93 | - if(isset($widget_data['mode'])){ |
|
94 | - $popup_mode=$widget_data['mode']; |
|
92 | + $popup_mode = 'multiselect'; |
|
93 | + if (isset($widget_data['mode'])) { |
|
94 | + $popup_mode = $widget_data['mode']; |
|
95 | 95 | } |
96 | - if(isset($widget_data['initial_filter_fields'])){ |
|
96 | + if (isset($widget_data['initial_filter_fields'])) { |
|
97 | 97 | if (is_array($widget_data['initial_filter_fields'])) { |
98 | 98 | foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
99 | 99 | if (isset($focus->$value) and !empty($focus->$value)) { |
100 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
100 | + $initial_filter .= "&".$alias.'='.urlencode($focus->$value); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
104 | 104 | } |
105 | - $create="true"; |
|
106 | - if(isset($widget_data['create'])){ |
|
107 | - $create=$widget_data['create']; |
|
105 | + $create = "true"; |
|
106 | + if (isset($widget_data['create'])) { |
|
107 | + $create = $widget_data['create']; |
|
108 | 108 | } |
109 | 109 | $return_module = $_REQUEST['module']; |
110 | 110 | $return_action = 'SubPanelViewer'; |
111 | 111 | $return_id = $_REQUEST['record']; |
112 | 112 | |
113 | 113 | //field_to_name_array |
114 | - $fton_array= array('id' => 'subpanel_id'); |
|
115 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
116 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
114 | + $fton_array = array('id' => 'subpanel_id'); |
|
115 | + if (isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])) { |
|
116 | + $fton_array = array_merge($fton_array, $widget_data['field_to_name_array']); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
@@ -132,20 +132,20 @@ discard block |
||
132 | 132 | ); |
133 | 133 | |
134 | 134 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
135 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
135 | + $popup_request_data['passthru_data'] = array_merge($popup_request_data['passthru_data'], $this->button_properties['add_to_passthru_data']); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
139 | 139 | |
140 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
141 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
140 | + if ($this->button_properties['add_to_passthru_data']['return_type'] == 'report') { |
|
141 | + $initial_filter = "&module_name=".urlencode($widget_data['module']); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
145 | - return '<form action="index.php?module=CampaignLog&action=AddCampaignLog&type=contact">' . "\n" |
|
146 | - . ' <input type="button" name="' . $this->getWidgetId() . '_select_button" id="' . $this->getWidgetId() . '" class="button"' . "\n" |
|
147 | - . ' title="' . $this->title . '"' |
|
148 | - . ' value="' . $this->value . "\"\n" |
|
145 | + return '<form action="index.php?module=CampaignLog&action=AddCampaignLog&type=contact">'."\n" |
|
146 | + . ' <input type="button" name="'.$this->getWidgetId().'_select_button" id="'.$this->getWidgetId().'" class="button"'."\n" |
|
147 | + . ' title="'.$this->title.'"' |
|
148 | + . ' value="'.$this->value."\"\n" |
|
149 | 149 | . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
150 | 150 | } |
151 | 151 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -46,8 +46,8 @@ |
||
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 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -58,39 +58,39 @@ discard block |
||
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 |
||
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 . " " |
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 |
||
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 { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | public function queryFilterEmpty($layout_def) |
49 | 49 | { |
50 | 50 | $column = $this->_get_column_select($layout_def); |
51 | - return "(coalesce(" . $this->reporter->db->convert($column, "length") . ",0) = 0 OR $column = '^^')"; |
|
51 | + return "(coalesce(".$this->reporter->db->convert($column, "length").",0) = 0 OR $column = '^^')"; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function queryFilterNot_Empty($layout_def) |
55 | 55 | { |
56 | 56 | $column = $this->_get_column_select($layout_def); |
57 | - return "(coalesce(" . $this->reporter->db->convert($column, "length") . ",0) > 0 AND $column != '^^' )\n"; |
|
57 | + return "(coalesce(".$this->reporter->db->convert($column, "length").",0) > 0 AND $column != '^^' )\n"; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function queryFilteris($layout_def) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | public function queryFilterone_of($layout_def) { |
77 | - $arr = array (); |
|
77 | + $arr = array(); |
|
78 | 78 | foreach ($layout_def['input_name0'] as $value) { |
79 | 79 | $arr[] = $this->reporter->db->quoted($value); |
80 | 80 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | public function queryFilternot_one_of($layout_def) { |
86 | - $arr = array (); |
|
86 | + $arr = array(); |
|
87 | 87 | foreach ($layout_def['input_name0'] as $value) { |
88 | 88 | $arr[] = $this->reporter->db->quoted($value); |
89 | 89 | } |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | function & displayList($layout_def) { |
96 | - if(!empty($layout_def['column_key'])){ |
|
96 | + if (!empty($layout_def['column_key'])) { |
|
97 | 97 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
98 | - }else if(!empty($layout_def['fields'])){ |
|
98 | + } else if (!empty($layout_def['fields'])) { |
|
99 | 99 | $field_def = $layout_def['fields']; |
100 | 100 | } |
101 | 101 | $cell = $this->displayListPlain($layout_def); |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $record = $layout_def['fields'][$key]; |
115 | 115 | $field_name = $field_def['name']; |
116 | 116 | $field_type = $field_def['type']; |
117 | - $div_id = $field_def['module'] ."&$record&$field_name"; |
|
118 | - $str = "<div id='$div_id'>" . $cell . " " |
|
117 | + $div_id = $field_def['module']."&$record&$field_name"; |
|
118 | + $str = "<div id='$div_id'>".$cell." " |
|
119 | 119 | . SugarThemeRegistry::current()->getImage( |
120 | 120 | "edit_inline", |
121 | - "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(" . |
|
121 | + "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(". |
|
122 | 122 | "\"$div_id\",\"$cell\",\"$module\",\"$record\",\"$field_name\",\"$field_type\");'" |
123 | 123 | ) |
124 | 124 | . "</div>"; |
@@ -127,25 +127,25 @@ discard block |
||
127 | 127 | return $str; |
128 | 128 | } |
129 | 129 | function & displayListPlain($layout_def) { |
130 | - if(!empty($layout_def['column_key'])){ |
|
130 | + if (!empty($layout_def['column_key'])) { |
|
131 | 131 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
132 | - }else if(!empty($layout_def['fields'])){ |
|
132 | + } else if (!empty($layout_def['fields'])) { |
|
133 | 133 | $field_def = $layout_def['fields']; |
134 | 134 | } |
135 | 135 | |
136 | - if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){ |
|
136 | + if (!empty($layout_def['table_key']) && (empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))) { |
|
137 | 137 | $value = $this->_get_list_value($layout_def); |
138 | - }else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
138 | + } else if (!empty($layout_def['name']) && !empty($layout_def['fields'])) { |
|
139 | 139 | $key = strtoupper($layout_def['name']); |
140 | 140 | $value = $layout_def['fields'][$key]; |
141 | 141 | } |
142 | 142 | $cell = ''; |
143 | 143 | |
144 | - if(isset($field_def['options'])){ |
|
144 | + if (isset($field_def['options'])) { |
|
145 | 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'])){ |
|
146 | + } else if (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
147 | 147 | global $beanFiles; |
148 | - if(empty($beanFiles)) { |
|
148 | + if (empty($beanFiles)) { |
|
149 | 149 | include('include/modules.php'); |
150 | 150 | } |
151 | 151 | $bean_name = get_singular_bean_name($field_def['module']); |
@@ -157,14 +157,14 @@ discard block |
||
157 | 157 | |
158 | 158 | //#22632 |
159 | 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)); |
|
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 | 165 | } |
166 | 166 | } |
167 | - $cell = implode(", ",$cell); |
|
167 | + $cell = implode(", ", $cell); |
|
168 | 168 | } |
169 | 169 | return $cell; |
170 | 170 | } |
@@ -177,11 +177,11 @@ discard block |
||
177 | 177 | $order_by = $this->_get_column_select($layout_def); |
178 | 178 | } |
179 | 179 | $list = array(); |
180 | - if(isset($field_def['options'])) { |
|
180 | + if (isset($field_def['options'])) { |
|
181 | 181 | $list = translate($field_def['options'], $field_def['module']); |
182 | - } elseif(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
182 | + } elseif (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
183 | 183 | global $beanFiles; |
184 | - if(empty($beanFiles)) { |
|
184 | + if (empty($beanFiles)) { |
|
185 | 185 | include('include/modules.php'); |
186 | 186 | } |
187 | 187 | $bean_name = get_singular_bean_name($field_def['module']); |
@@ -199,17 +199,17 @@ discard block |
||
199 | 199 | public function displayInput($layout_def) { |
200 | 200 | global $app_list_strings; |
201 | 201 | |
202 | - if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
203 | - if ( isset($layout_def['options']) && is_array($layout_def['options']) ) { |
|
202 | + if (!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
203 | + if (isset($layout_def['options']) && is_array($layout_def['options'])) { |
|
204 | 204 | $ops = $layout_def['options']; |
205 | 205 | } |
206 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
206 | + elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])) { |
|
207 | 207 | $ops = $app_list_strings[$layout_def['options']]; |
208 | - if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
208 | + if (array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
209 | 209 | unset($ops['']); |
210 | 210 | } |
211 | 211 | } |
212 | - else{ |
|
212 | + else { |
|
213 | 213 | $ops = array(); |
214 | 214 | } |
215 | 215 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $ops = $app_list_strings[$layout_def['options']]; |
218 | 218 | } |
219 | 219 | |
220 | - $str = '<select multiple="true" size="3" name="' . $layout_def['name'] . '[]">'; |
|
220 | + $str = '<select multiple="true" size="3" name="'.$layout_def['name'].'[]">'; |
|
221 | 221 | $str .= get_select_options_with_id($ops, $layout_def['input_name0']); |
222 | 222 | $str .= '</select>'; |
223 | 223 | return $str; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -95,7 +97,7 @@ discard block |
||
95 | 97 | function & displayList($layout_def) { |
96 | 98 | if(!empty($layout_def['column_key'])){ |
97 | 99 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
98 | - }else if(!empty($layout_def['fields'])){ |
|
100 | + } else if(!empty($layout_def['fields'])){ |
|
99 | 101 | $field_def = $layout_def['fields']; |
100 | 102 | } |
101 | 103 | $cell = $this->displayListPlain($layout_def); |
@@ -129,13 +131,13 @@ discard block |
||
129 | 131 | function & displayListPlain($layout_def) { |
130 | 132 | if(!empty($layout_def['column_key'])){ |
131 | 133 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
132 | - }else if(!empty($layout_def['fields'])){ |
|
134 | + } else if(!empty($layout_def['fields'])){ |
|
133 | 135 | $field_def = $layout_def['fields']; |
134 | 136 | } |
135 | 137 | |
136 | 138 | if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){ |
137 | 139 | $value = $this->_get_list_value($layout_def); |
138 | - }else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
140 | + } else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
139 | 141 | $key = strtoupper($layout_def['name']); |
140 | 142 | $value = $layout_def['fields'][$key]; |
141 | 143 | } |
@@ -143,7 +145,7 @@ discard block |
||
143 | 145 | |
144 | 146 | if(isset($field_def['options'])){ |
145 | 147 | $cell = translate($field_def['options'], $field_def['module'], $value); |
146 | - }else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){ |
|
148 | + } else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){ |
|
147 | 149 | global $beanFiles; |
148 | 150 | if(empty($beanFiles)) { |
149 | 151 | include('include/modules.php'); |
@@ -202,18 +204,15 @@ discard block |
||
202 | 204 | if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
203 | 205 | if ( isset($layout_def['options']) && is_array($layout_def['options']) ) { |
204 | 206 | $ops = $layout_def['options']; |
205 | - } |
|
206 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
207 | + } elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
207 | 208 | $ops = $app_list_strings[$layout_def['options']]; |
208 | 209 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
209 | 210 | unset($ops['']); |
210 | 211 | } |
211 | - } |
|
212 | - else{ |
|
212 | + } else{ |
|
213 | 213 | $ops = array(); |
214 | 214 | } |
215 | - } |
|
216 | - else { |
|
215 | + } else { |
|
217 | 216 | $ops = $app_list_strings[$layout_def['options']]; |
218 | 217 | } |
219 | 218 |
@@ -45,33 +45,33 @@ |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelEditRoleButton extends SugarWidgetField |
47 | 47 | { |
48 | - function displayHeaderCell(&$layout_def) |
|
49 | - { |
|
50 | - return ' '; |
|
51 | - } |
|
48 | + function displayHeaderCell(&$layout_def) |
|
49 | + { |
|
50 | + return ' '; |
|
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> '; |
|
71 | - }else{ |
|
72 | - return ''; |
|
73 | - } |
|
74 | - } |
|
70 | + . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a> '; |
|
71 | + }else{ |
|
72 | + return ''; |
|
73 | + } |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | ?> |
78 | 78 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,19 +56,19 @@ discard block |
||
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 | 66 | //based on listview since that lets you select records |
67 | - if($layout_def['ListView']){ |
|
68 | - return '<a href="' . $href . '"' |
|
67 | + if ($layout_def['ListView']) { |
|
68 | + return '<a href="'.$href.'"' |
|
69 | 69 | . "id=\"$unique_id\"" |
70 | - . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a> '; |
|
71 | - }else{ |
|
70 | + . 'class="listViewTdToolsS1">'.$app_strings['LNK_EDIT'].'</a> '; |
|
71 | + } else { |
|
72 | 72 | return ''; |
73 | 73 | } |
74 | 74 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -68,7 +70,7 @@ discard block |
||
68 | 70 | return '<a href="' . $href . '"' |
69 | 71 | . "id=\"$unique_id\"" |
70 | 72 | . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a> '; |
71 | - }else{ |
|
73 | + } else{ |
|
72 | 74 | return ''; |
73 | 75 | } |
74 | 76 | } |
@@ -45,121 +45,121 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | global $app_strings; |
51 | 51 | global $currentModule; |
52 | 52 | |
53 | - $this->module="Notes"; |
|
53 | + $this->module = "Notes"; |
|
54 | 54 | $this->subpanelDiv = "history"; |
55 | 55 | |
56 | 56 | // Create the additional form fields with real values if they were not passed in |
57 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | + if (empty($additionalFormFields) && $this->additional_form_fields) |
|
58 | 58 | { |
59 | - foreach($this->additional_form_fields as $key=>$value) |
|
59 | + foreach ($this->additional_form_fields as $key=>$value) |
|
60 | 60 | { |
61 | - if(!empty($defines['focus']->$value)) |
|
61 | + if (!empty($defines['focus']->$value)) |
|
62 | 62 | { |
63 | 63 | $additionalFormFields[$key] = $defines['focus']->$value; |
64 | 64 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if(!empty($this->module)) |
|
72 | + if (!empty($this->module)) |
|
73 | 73 | { |
74 | 74 | $defines['child_module_name'] = $this->module; |
75 | 75 | } |
@@ -78,45 +78,45 @@ discard block |
||
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
80 | 80 | |
81 | - if(!empty($this->subpanelDiv)) |
|
81 | + if (!empty($this->subpanelDiv)) |
|
82 | 82 | { |
83 | 83 | $defines['subpanelDiv'] = $this->subpanelDiv; |
84 | 84 | } |
85 | 85 | |
86 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
86 | + $defines['parent_bean_name'] = get_class($defines['focus']); |
|
87 | 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"; |
|
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 | 90 | |
91 | 91 | //module_button is used to override the value of module name |
92 | 92 | $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
93 | 93 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
94 | 94 | |
95 | - if(isset($defines['focus']->name)) |
|
95 | + if (isset($defines['focus']->name)) |
|
96 | 96 | { |
97 | 97 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
98 | 98 | } |
99 | 99 | |
100 | 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"; |
|
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 | 105 | $button .= '<input type="hidden" name="record" value="" />'; |
106 | 106 | |
107 | 107 | // TODO: move this out and get $additionalFormFields working properly |
108 | - if(empty($additionalFormFields['parent_type'])) |
|
108 | + if (empty($additionalFormFields['parent_type'])) |
|
109 | 109 | { |
110 | - if($defines['focus']->object_name=='Contact') { |
|
110 | + if ($defines['focus']->object_name == 'Contact') { |
|
111 | 111 | $additionalFormFields['parent_type'] = 'Accounts'; |
112 | 112 | } |
113 | 113 | else { |
114 | 114 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
115 | 115 | } |
116 | 116 | } |
117 | - if(empty($additionalFormFields['parent_name'])) |
|
117 | + if (empty($additionalFormFields['parent_name'])) |
|
118 | 118 | { |
119 | - if($defines['focus']->object_name=='Contact') { |
|
119 | + if ($defines['focus']->object_name == 'Contact') { |
|
120 | 120 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
121 | 121 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
122 | 122 | } |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
125 | 125 | } |
126 | 126 | } |
127 | - if(empty($additionalFormFields['parent_id'])) |
|
127 | + if (empty($additionalFormFields['parent_id'])) |
|
128 | 128 | { |
129 | - if($defines['focus']->object_name=='Contact') { |
|
129 | + if ($defines['focus']->object_name == 'Contact') { |
|
130 | 130 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
131 | 131 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
132 | 132 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 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"; |
|
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 | 141 | |
142 | 142 | // fill in additional form fields for all but action |
143 | - foreach($additionalFormFields as $key => $value) |
|
143 | + foreach ($additionalFormFields as $key => $value) |
|
144 | 144 | { |
145 | - if($key != 'action') |
|
145 | + if ($key != 'action') |
|
146 | 146 | { |
147 | - $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; |
|
147 | + $button .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n"; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | function display($defines, $additionalFormFields = null, $nonbutton = false) |
156 | 156 | { |
157 | 157 | $focus = new Note; |
158 | - if ( !$focus->ACLAccess('EditView') ) { |
|
158 | + if (!$focus->ACLAccess('EditView')) { |
|
159 | 159 | return ''; |
160 | 160 | } |
161 | 161 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -61,8 +63,7 @@ discard block |
||
61 | 63 | if(!empty($defines['focus']->$value)) |
62 | 64 | { |
63 | 65 | $additionalFormFields[$key] = $defines['focus']->$value; |
64 | - } |
|
65 | - else |
|
66 | + } else |
|
66 | 67 | { |
67 | 68 | $additionalFormFields[$key] = ''; |
68 | 69 | } |
@@ -72,8 +73,7 @@ discard block |
||
72 | 73 | if(!empty($this->module)) |
73 | 74 | { |
74 | 75 | $defines['child_module_name'] = $this->module; |
75 | - } |
|
76 | - else |
|
76 | + } else |
|
77 | 77 | { |
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
@@ -109,8 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | if($defines['focus']->object_name=='Contact') { |
111 | 111 | $additionalFormFields['parent_type'] = 'Accounts'; |
112 | - } |
|
113 | - else { |
|
112 | + } else { |
|
114 | 113 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
115 | 114 | } |
116 | 115 | } |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | if($defines['focus']->object_name=='Contact') { |
120 | 119 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
121 | 120 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
122 | - } |
|
123 | - else { |
|
121 | + } else { |
|
124 | 122 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
125 | 123 | } |
126 | 124 | } |
@@ -129,8 +127,7 @@ discard block |
||
129 | 127 | if($defines['focus']->object_name=='Contact') { |
130 | 128 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
131 | 129 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
132 | - } |
|
133 | - else { |
|
130 | + } else { |
|
134 | 131 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
135 | 132 | } |
136 | 133 | } |
@@ -50,7 +50,7 @@ |
||
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) |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | function queryFilterNot_Equals_Str($layout_def) |
57 | 57 | { |
58 | 58 | $column = $this->_get_column_select($layout_def); |
59 | - return "($column IS NULL OR ". $this->reporter->db->convert($column, "text2char")." != ". |
|
59 | + return "($column IS NULL OR ".$this->reporter->db->convert($column, "text2char")." != ". |
|
60 | 60 | $this->reporter->db->quoted($layout_def['input_name0']).")"; |
61 | 61 | } |
62 | 62 |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |