@@ -45,83 +45,83 @@ |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelRemoveButtonProjects 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 | |
57 | - global $current_user; |
|
57 | + global $current_user; |
|
58 | 58 | |
59 | - $parent_record_id = $_REQUEST['record']; |
|
60 | - $parent_module = $_REQUEST['module']; |
|
59 | + $parent_record_id = $_REQUEST['record']; |
|
60 | + $parent_module = $_REQUEST['module']; |
|
61 | 61 | |
62 | - if ($layout_def['module'] == 'Holidays'){ |
|
63 | - $action = 'DeleteHolidayRelationship'; |
|
64 | - } |
|
65 | - else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
66 | - $action = 'DeleteResourceRelationship'; |
|
67 | - } |
|
68 | - else{ |
|
69 | - $action = 'DeleteRelationship'; |
|
70 | - } |
|
62 | + if ($layout_def['module'] == 'Holidays'){ |
|
63 | + $action = 'DeleteHolidayRelationship'; |
|
64 | + } |
|
65 | + else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
66 | + $action = 'DeleteResourceRelationship'; |
|
67 | + } |
|
68 | + else{ |
|
69 | + $action = 'DeleteRelationship'; |
|
70 | + } |
|
71 | 71 | |
72 | - $record = $layout_def['fields']['ID']; |
|
73 | - $current_module=$layout_def['module']; |
|
74 | - $hideremove=false; |
|
72 | + $record = $layout_def['fields']['ID']; |
|
73 | + $current_module=$layout_def['module']; |
|
74 | + $hideremove=false; |
|
75 | 75 | |
76 | - $return_module = $_REQUEST['module']; |
|
77 | - $return_action = 'SubPanelViewer'; |
|
78 | - $subpanel = $layout_def['subpanel_id']; |
|
79 | - $return_id = $_REQUEST['record']; |
|
76 | + $return_module = $_REQUEST['module']; |
|
77 | + $return_action = 'SubPanelViewer'; |
|
78 | + $subpanel = $layout_def['subpanel_id']; |
|
79 | + $return_id = $_REQUEST['record']; |
|
80 | 80 | |
81 | 81 | |
82 | - $focus = new Project(); |
|
82 | + $focus = new Project(); |
|
83 | 83 | |
84 | - $focus->retrieve($return_id); |
|
84 | + $focus->retrieve($return_id); |
|
85 | 85 | |
86 | - if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
|
87 | - $is_owner = true; |
|
88 | - } |
|
89 | - else{ |
|
90 | - $is_owner = false; |
|
91 | - } |
|
86 | + if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
|
87 | + $is_owner = true; |
|
88 | + } |
|
89 | + else{ |
|
90 | + $is_owner = false; |
|
91 | + } |
|
92 | 92 | |
93 | - if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
94 | - $linked_field= $layout_def['linked_field_set'] ; |
|
95 | - } else { |
|
96 | - $linked_field = $layout_def['linked_field']; |
|
97 | - } |
|
98 | - $refresh_page = 0; |
|
99 | - if(!empty($layout_def['refresh_page'])){ |
|
100 | - $refresh_page = 1; |
|
101 | - } |
|
102 | - $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1"; |
|
93 | + if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
94 | + $linked_field= $layout_def['linked_field_set'] ; |
|
95 | + } else { |
|
96 | + $linked_field = $layout_def['linked_field']; |
|
97 | + } |
|
98 | + $refresh_page = 0; |
|
99 | + if(!empty($layout_def['refresh_page'])){ |
|
100 | + $refresh_page = 1; |
|
101 | + } |
|
102 | + $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1"; |
|
103 | 103 | |
104 | - $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); |
|
105 | - $icon_remove_html = SugarThemeRegistry::current()->getImage( 'delete_inline', 'align="absmiddle" border="0"',null,null,'.gif','');//setting alt to blank on purpose on subpanels for 508 |
|
106 | - $remove_url = $layout_def['start_link_wrapper'] |
|
107 | - . "index.php?module=$parent_module" |
|
108 | - . "&action=$action" |
|
109 | - . "&record=$parent_record_id" |
|
110 | - . "&linked_field=$linked_field" |
|
111 | - . "&linked_id=$record" |
|
112 | - . "&return_url=" . urlencode(urlencode($return_url)) |
|
113 | - . "&refresh_page=1" |
|
114 | - . $layout_def['end_link_wrapper']; |
|
115 | - $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; |
|
116 | - //based on listview since that lets you select records |
|
117 | - if($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
118 | - return '<a href="' . $remove_url . '"' |
|
119 | - . ' class="listViewTdToolsS1"' |
|
120 | - . " onclick=\"return confirm('$remove_confirmation_text');\"" |
|
121 | - . ">$icon_remove_html $icon_remove_text</a>"; |
|
122 | - }else{ |
|
123 | - return ''; |
|
124 | - } |
|
125 | - } |
|
104 | + $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); |
|
105 | + $icon_remove_html = SugarThemeRegistry::current()->getImage( 'delete_inline', 'align="absmiddle" border="0"',null,null,'.gif','');//setting alt to blank on purpose on subpanels for 508 |
|
106 | + $remove_url = $layout_def['start_link_wrapper'] |
|
107 | + . "index.php?module=$parent_module" |
|
108 | + . "&action=$action" |
|
109 | + . "&record=$parent_record_id" |
|
110 | + . "&linked_field=$linked_field" |
|
111 | + . "&linked_id=$record" |
|
112 | + . "&return_url=" . urlencode(urlencode($return_url)) |
|
113 | + . "&refresh_page=1" |
|
114 | + . $layout_def['end_link_wrapper']; |
|
115 | + $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; |
|
116 | + //based on listview since that lets you select records |
|
117 | + if($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
118 | + return '<a href="' . $remove_url . '"' |
|
119 | + . ' class="listViewTdToolsS1"' |
|
120 | + . " onclick=\"return confirm('$remove_confirmation_text');\"" |
|
121 | + . ">$icon_remove_html $icon_remove_text</a>"; |
|
122 | + }else{ |
|
123 | + return ''; |
|
124 | + } |
|
125 | + } |
|
126 | 126 | } |
127 | 127 | ?> |
128 | 128 | \ 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. |
@@ -59,19 +59,19 @@ discard block |
||
59 | 59 | $parent_record_id = $_REQUEST['record']; |
60 | 60 | $parent_module = $_REQUEST['module']; |
61 | 61 | |
62 | - if ($layout_def['module'] == 'Holidays'){ |
|
62 | + if ($layout_def['module'] == 'Holidays') { |
|
63 | 63 | $action = 'DeleteHolidayRelationship'; |
64 | 64 | } |
65 | - else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
65 | + else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts') { |
|
66 | 66 | $action = 'DeleteResourceRelationship'; |
67 | 67 | } |
68 | - else{ |
|
68 | + else { |
|
69 | 69 | $action = 'DeleteRelationship'; |
70 | 70 | } |
71 | 71 | |
72 | 72 | $record = $layout_def['fields']['ID']; |
73 | - $current_module=$layout_def['module']; |
|
74 | - $hideremove=false; |
|
73 | + $current_module = $layout_def['module']; |
|
74 | + $hideremove = false; |
|
75 | 75 | |
76 | 76 | $return_module = $_REQUEST['module']; |
77 | 77 | $return_action = 'SubPanelViewer'; |
@@ -83,43 +83,43 @@ discard block |
||
83 | 83 | |
84 | 84 | $focus->retrieve($return_id); |
85 | 85 | |
86 | - if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
|
86 | + if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)) { |
|
87 | 87 | $is_owner = true; |
88 | 88 | } |
89 | - else{ |
|
89 | + else { |
|
90 | 90 | $is_owner = false; |
91 | 91 | } |
92 | 92 | |
93 | 93 | if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
94 | - $linked_field= $layout_def['linked_field_set'] ; |
|
94 | + $linked_field = $layout_def['linked_field_set']; |
|
95 | 95 | } else { |
96 | 96 | $linked_field = $layout_def['linked_field']; |
97 | 97 | } |
98 | 98 | $refresh_page = 0; |
99 | - if(!empty($layout_def['refresh_page'])){ |
|
99 | + if (!empty($layout_def['refresh_page'])) { |
|
100 | 100 | $refresh_page = 1; |
101 | 101 | } |
102 | 102 | $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1"; |
103 | 103 | |
104 | 104 | $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); |
105 | - $icon_remove_html = SugarThemeRegistry::current()->getImage( 'delete_inline', 'align="absmiddle" border="0"',null,null,'.gif','');//setting alt to blank on purpose on subpanels for 508 |
|
105 | + $icon_remove_html = SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', ''); //setting alt to blank on purpose on subpanels for 508 |
|
106 | 106 | $remove_url = $layout_def['start_link_wrapper'] |
107 | 107 | . "index.php?module=$parent_module" |
108 | 108 | . "&action=$action" |
109 | 109 | . "&record=$parent_record_id" |
110 | 110 | . "&linked_field=$linked_field" |
111 | 111 | . "&linked_id=$record" |
112 | - . "&return_url=" . urlencode(urlencode($return_url)) |
|
112 | + . "&return_url=".urlencode(urlencode($return_url)) |
|
113 | 113 | . "&refresh_page=1" |
114 | 114 | . $layout_def['end_link_wrapper']; |
115 | 115 | $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; |
116 | 116 | //based on listview since that lets you select records |
117 | - if($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
118 | - return '<a href="' . $remove_url . '"' |
|
117 | + if ($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
118 | + return '<a href="'.$remove_url.'"' |
|
119 | 119 | . ' class="listViewTdToolsS1"' |
120 | 120 | . " onclick=\"return confirm('$remove_confirmation_text');\"" |
121 | 121 | . ">$icon_remove_html $icon_remove_text</a>"; |
122 | - }else{ |
|
122 | + } else { |
|
123 | 123 | return ''; |
124 | 124 | } |
125 | 125 | } |
@@ -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,11 +63,9 @@ discard block |
||
61 | 63 | |
62 | 64 | if ($layout_def['module'] == 'Holidays'){ |
63 | 65 | $action = 'DeleteHolidayRelationship'; |
64 | - } |
|
65 | - else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
66 | + } else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
66 | 67 | $action = 'DeleteResourceRelationship'; |
67 | - } |
|
68 | - else{ |
|
68 | + } else{ |
|
69 | 69 | $action = 'DeleteRelationship'; |
70 | 70 | } |
71 | 71 | |
@@ -85,8 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
87 | 87 | $is_owner = true; |
88 | - } |
|
89 | - else{ |
|
88 | + } else{ |
|
90 | 89 | $is_owner = false; |
91 | 90 | } |
92 | 91 | |
@@ -119,7 +118,7 @@ discard block |
||
119 | 118 | . ' class="listViewTdToolsS1"' |
120 | 119 | . " onclick=\"return confirm('$remove_confirmation_text');\"" |
121 | 120 | . ">$icon_remove_html $icon_remove_text</a>"; |
122 | - }else{ |
|
121 | + } else{ |
|
123 | 122 | return ''; |
124 | 123 | } |
125 | 124 | } |
@@ -41,26 +41,26 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | class SugarWidgetFieldMultiEnum extends SugarWidgetFieldEnum { |
44 | - public function queryFilternot_one_of(&$layout_def) { |
|
45 | - $arr = array (); |
|
46 | - foreach ($layout_def['input_name0'] as $value) { |
|
47 | - array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
|
48 | - } |
|
49 | - $reporter = $this->layout_manager->getAttribute("reporter"); |
|
44 | + public function queryFilternot_one_of(&$layout_def) { |
|
45 | + $arr = array (); |
|
46 | + foreach ($layout_def['input_name0'] as $value) { |
|
47 | + array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
|
48 | + } |
|
49 | + $reporter = $this->layout_manager->getAttribute("reporter"); |
|
50 | 50 | |
51 | - $col_name = $this->_get_column_select($layout_def) . " NOT LIKE " ; |
|
52 | - $arr_count = count($arr); |
|
53 | - $query = ""; |
|
54 | - foreach($arr as $key=>$val) { |
|
55 | - $query .= $col_name; |
|
56 | - $value = preg_replace("/^'/", "'%", $val, 1); |
|
57 | - $value = preg_replace("/'$/", "%'", $value, 1); |
|
58 | - $query .= $value; |
|
59 | - if ($key != ($arr_count - 1)) |
|
60 | - $query.= " OR " ; |
|
61 | - } |
|
62 | - return '('.$query.')'; |
|
63 | - } |
|
51 | + $col_name = $this->_get_column_select($layout_def) . " NOT LIKE " ; |
|
52 | + $arr_count = count($arr); |
|
53 | + $query = ""; |
|
54 | + foreach($arr as $key=>$val) { |
|
55 | + $query .= $col_name; |
|
56 | + $value = preg_replace("/^'/", "'%", $val, 1); |
|
57 | + $value = preg_replace("/'$/", "%'", $value, 1); |
|
58 | + $query .= $value; |
|
59 | + if ($key != ($arr_count - 1)) |
|
60 | + $query.= " OR " ; |
|
61 | + } |
|
62 | + return '('.$query.')'; |
|
63 | + } |
|
64 | 64 | |
65 | 65 | public function queryFilterone_of(&$layout_def) { |
66 | 66 | //Fix for inaccurate filtering of contacts in Contacts dashlet on multiselects. |
@@ -72,47 +72,47 @@ discard block |
||
72 | 72 | array_push($arr, "'^^'"); |
73 | 73 | } |
74 | 74 | } |
75 | - $reporter = $this->layout_manager->getAttribute("reporter"); |
|
75 | + $reporter = $this->layout_manager->getAttribute("reporter"); |
|
76 | 76 | |
77 | - $col_name = $this->_get_column_select($layout_def) . " LIKE " ; |
|
78 | - $arr_count = count($arr); |
|
79 | - $query = ""; |
|
80 | - foreach($arr as $key=>$val) { |
|
81 | - $query .= $col_name; |
|
82 | - $value = preg_replace("/^'/", "'%", $val, 1); |
|
83 | - $value = preg_replace("/'$/", "%'", $value, 1); |
|
84 | - $query .= $value; |
|
85 | - if ($key != ($arr_count - 1)) |
|
86 | - $query.= " OR " ; |
|
87 | - } |
|
88 | - return '('.$query.')'; |
|
89 | - } |
|
77 | + $col_name = $this->_get_column_select($layout_def) . " LIKE " ; |
|
78 | + $arr_count = count($arr); |
|
79 | + $query = ""; |
|
80 | + foreach($arr as $key=>$val) { |
|
81 | + $query .= $col_name; |
|
82 | + $value = preg_replace("/^'/", "'%", $val, 1); |
|
83 | + $value = preg_replace("/'$/", "%'", $value, 1); |
|
84 | + $query .= $value; |
|
85 | + if ($key != ($arr_count - 1)) |
|
86 | + $query.= " OR " ; |
|
87 | + } |
|
88 | + return '('.$query.')'; |
|
89 | + } |
|
90 | 90 | |
91 | - public function queryFilteris($layout_def) { |
|
92 | - $input_name0 = $layout_def['input_name0']; |
|
93 | - if (is_array($layout_def['input_name0'])) { |
|
94 | - $input_name0 = $layout_def['input_name0'][0]; |
|
95 | - } |
|
91 | + public function queryFilteris($layout_def) { |
|
92 | + $input_name0 = $layout_def['input_name0']; |
|
93 | + if (is_array($layout_def['input_name0'])) { |
|
94 | + $input_name0 = $layout_def['input_name0'][0]; |
|
95 | + } |
|
96 | 96 | |
97 | - // Bug 40022 |
|
98 | - // IS filter doesn't add the carets (^) to multienum custom field values |
|
99 | - $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
97 | + // Bug 40022 |
|
98 | + // IS filter doesn't add the carets (^) to multienum custom field values |
|
99 | + $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
100 | 100 | |
101 | - return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n"; |
|
102 | - } |
|
101 | + return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n"; |
|
102 | + } |
|
103 | 103 | |
104 | - public function queryFilteris_not($layout_def) { |
|
105 | - $input_name0 = $layout_def['input_name0']; |
|
106 | - if (is_array($layout_def['input_name0'])) { |
|
107 | - $input_name0 = $layout_def['input_name0'][0]; |
|
108 | - } |
|
104 | + public function queryFilteris_not($layout_def) { |
|
105 | + $input_name0 = $layout_def['input_name0']; |
|
106 | + if (is_array($layout_def['input_name0'])) { |
|
107 | + $input_name0 = $layout_def['input_name0'][0]; |
|
108 | + } |
|
109 | 109 | |
110 | - // Bug 50549 |
|
111 | - // IS NOT filter doesn't add the carets (^) to multienum custom field values |
|
112 | - $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
110 | + // Bug 50549 |
|
111 | + // IS NOT filter doesn't add the carets (^) to multienum custom field values |
|
112 | + $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
113 | 113 | |
114 | - return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n"; |
|
115 | - } |
|
114 | + return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n"; |
|
115 | + } |
|
116 | 116 | |
117 | 117 | /** |
118 | 118 | * Returns an OrderBy query for multi-select. We treat multi-select the same as a normal field because |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | * @return string |
132 | 132 | */ |
133 | 133 | private function encodeMultienumCustom($layout_def, $value) { |
134 | - $field_def = $this->reporter->getFieldDefFromLayoutDef($layout_def); |
|
135 | - // Check if it is a custom field |
|
136 | - if (!empty($field_def['source']) && ($field_def['source'] == 'custom_fields' || ($field_def['source'] == 'non-db' && !empty($field_def['ext2']) && !empty($field_def['id']))) && !empty($field_def['real_table'])) |
|
137 | - { |
|
138 | - $value = encodeMultienumValue(array($value)); |
|
139 | - } |
|
140 | - return $value; |
|
134 | + $field_def = $this->reporter->getFieldDefFromLayoutDef($layout_def); |
|
135 | + // Check if it is a custom field |
|
136 | + if (!empty($field_def['source']) && ($field_def['source'] == 'custom_fields' || ($field_def['source'] == 'non-db' && !empty($field_def['ext2']) && !empty($field_def['id']))) && !empty($field_def['real_table'])) |
|
137 | + { |
|
138 | + $value = encodeMultienumValue(array($value)); |
|
139 | + } |
|
140 | + return $value; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | ?> |
@@ -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. |
@@ -42,22 +42,22 @@ discard block |
||
42 | 42 | |
43 | 43 | class SugarWidgetFieldMultiEnum extends SugarWidgetFieldEnum { |
44 | 44 | public function queryFilternot_one_of(&$layout_def) { |
45 | - $arr = array (); |
|
45 | + $arr = array(); |
|
46 | 46 | foreach ($layout_def['input_name0'] as $value) { |
47 | 47 | array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
48 | 48 | } |
49 | 49 | $reporter = $this->layout_manager->getAttribute("reporter"); |
50 | 50 | |
51 | - $col_name = $this->_get_column_select($layout_def) . " NOT LIKE " ; |
|
51 | + $col_name = $this->_get_column_select($layout_def)." NOT LIKE "; |
|
52 | 52 | $arr_count = count($arr); |
53 | 53 | $query = ""; |
54 | - foreach($arr as $key=>$val) { |
|
54 | + foreach ($arr as $key=>$val) { |
|
55 | 55 | $query .= $col_name; |
56 | 56 | $value = preg_replace("/^'/", "'%", $val, 1); |
57 | 57 | $value = preg_replace("/'$/", "%'", $value, 1); |
58 | 58 | $query .= $value; |
59 | 59 | if ($key != ($arr_count - 1)) |
60 | - $query.= " OR " ; |
|
60 | + $query .= " OR "; |
|
61 | 61 | } |
62 | 62 | return '('.$query.')'; |
63 | 63 | } |
@@ -66,24 +66,24 @@ discard block |
||
66 | 66 | //Fix for inaccurate filtering of contacts in Contacts dashlet on multiselects. |
67 | 67 | $arr = array(); |
68 | 68 | foreach ($layout_def['input_name0'] as $value) { |
69 | - if($value != ""){ |
|
69 | + if ($value != "") { |
|
70 | 70 | array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
71 | - }else{ |
|
71 | + } else { |
|
72 | 72 | array_push($arr, "'^^'"); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | $reporter = $this->layout_manager->getAttribute("reporter"); |
76 | 76 | |
77 | - $col_name = $this->_get_column_select($layout_def) . " LIKE " ; |
|
77 | + $col_name = $this->_get_column_select($layout_def)." LIKE "; |
|
78 | 78 | $arr_count = count($arr); |
79 | 79 | $query = ""; |
80 | - foreach($arr as $key=>$val) { |
|
80 | + foreach ($arr as $key=>$val) { |
|
81 | 81 | $query .= $col_name; |
82 | 82 | $value = preg_replace("/^'/", "'%", $val, 1); |
83 | 83 | $value = preg_replace("/'$/", "%'", $value, 1); |
84 | 84 | $query .= $value; |
85 | 85 | if ($key != ($arr_count - 1)) |
86 | - $query.= " OR " ; |
|
86 | + $query .= " OR "; |
|
87 | 87 | } |
88 | 88 | return '('.$query.')'; |
89 | 89 | } |
@@ -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. |
@@ -56,8 +58,9 @@ discard block |
||
56 | 58 | $value = preg_replace("/^'/", "'%", $val, 1); |
57 | 59 | $value = preg_replace("/'$/", "%'", $value, 1); |
58 | 60 | $query .= $value; |
59 | - if ($key != ($arr_count - 1)) |
|
60 | - $query.= " OR " ; |
|
61 | + if ($key != ($arr_count - 1)) { |
|
62 | + $query.= " OR " ; |
|
63 | + } |
|
61 | 64 | } |
62 | 65 | return '('.$query.')'; |
63 | 66 | } |
@@ -68,7 +71,7 @@ discard block |
||
68 | 71 | foreach ($layout_def['input_name0'] as $value) { |
69 | 72 | if($value != ""){ |
70 | 73 | array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
71 | - }else{ |
|
74 | + } else{ |
|
72 | 75 | array_push($arr, "'^^'"); |
73 | 76 | } |
74 | 77 | } |
@@ -82,8 +85,9 @@ discard block |
||
82 | 85 | $value = preg_replace("/^'/", "'%", $val, 1); |
83 | 86 | $value = preg_replace("/'$/", "%'", $value, 1); |
84 | 87 | $query .= $value; |
85 | - if ($key != ($arr_count - 1)) |
|
86 | - $query.= " OR " ; |
|
88 | + if ($key != ($arr_count - 1)) { |
|
89 | + $query.= " OR " ; |
|
90 | + } |
|
87 | 91 | } |
88 | 92 | return '('.$query.')'; |
89 | 93 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | $content = $this->displayListPlain($layout_def); |
57 | - return $content; |
|
57 | + return $content; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | function queryFilterBefore($layout_def) |
@@ -88,26 +88,26 @@ discard block |
||
88 | 88 | $this->queryDateOp($column, $end, "<=", "date").")\n"; |
89 | 89 | } |
90 | 90 | |
91 | - function queryFilterTP_yesterday($layout_def) |
|
92 | - { |
|
93 | - global $timedate; |
|
91 | + function queryFilterTP_yesterday($layout_def) |
|
92 | + { |
|
93 | + global $timedate; |
|
94 | 94 | $layout_def['input_name0'] = $timedate->asDbDate($timedate->getNow(true)->get("-1 day")); |
95 | 95 | return $this->queryFilterOn($layout_def); |
96 | - } |
|
96 | + } |
|
97 | 97 | |
98 | - function queryFilterTP_today($layout_def) |
|
99 | - { |
|
100 | - global $timedate; |
|
98 | + function queryFilterTP_today($layout_def) |
|
99 | + { |
|
100 | + global $timedate; |
|
101 | 101 | $layout_def['input_name0'] = $timedate->asDbDate($timedate->getNow(true)); |
102 | 102 | return $this->queryFilterOn($layout_def); |
103 | - } |
|
103 | + } |
|
104 | 104 | |
105 | - function queryFilterTP_tomorrow(& $layout_def) |
|
106 | - { |
|
107 | - global $timedate; |
|
108 | - $layout_def['input_name0'] = $timedate->asDbDate($timedate->getNow(true)->get("+1 day")); |
|
105 | + function queryFilterTP_tomorrow(& $layout_def) |
|
106 | + { |
|
107 | + global $timedate; |
|
108 | + $layout_def['input_name0'] = $timedate->asDbDate($timedate->getNow(true)->get("+1 day")); |
|
109 | 109 | return $this->queryFilterOn($layout_def); |
110 | - } |
|
110 | + } |
|
111 | 111 | |
112 | 112 | protected function queryMonth($layout_def, $month) |
113 | 113 | { |
@@ -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,9 +46,9 @@ discard block |
||
46 | 46 | { |
47 | 47 | global $timedate; |
48 | 48 | // i guess qualifier and column_function are the same.. |
49 | - if (! empty($layout_def['column_function'])) { |
|
49 | + if (!empty($layout_def['column_function'])) { |
|
50 | 50 | $func_name = 'displayList'.$layout_def['column_function']; |
51 | - if ( method_exists($this,$func_name)) { |
|
51 | + if (method_exists($this, $func_name)) { |
|
52 | 52 | $display = $this->$func_name($layout_def); |
53 | 53 | return $display; |
54 | 54 | } |
@@ -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. |
@@ -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. |
@@ -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,9 +48,9 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
50 | 50 | */ |
51 | - public function SugarWidgetFieldEnum($layout_manager){ |
|
51 | + public function SugarWidgetFieldEnum($layout_manager) { |
|
52 | 52 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
53 | - if(isset($GLOBALS['log'])) { |
|
53 | + if (isset($GLOBALS['log'])) { |
|
54 | 54 | $GLOBALS['log']->deprecated($deprecatedMessage); |
55 | 55 | } |
56 | 56 | else { |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | public function queryFilterEmpty($layout_def) |
64 | 64 | { |
65 | 65 | $column = $this->_get_column_select($layout_def); |
66 | - return "(coalesce(" . $this->reporter->db->convert($column, "length") . ",0) = 0 OR $column = '^^')"; |
|
66 | + return "(coalesce(".$this->reporter->db->convert($column, "length").",0) = 0 OR $column = '^^')"; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function queryFilterNot_Empty($layout_def) |
70 | 70 | { |
71 | 71 | $column = $this->_get_column_select($layout_def); |
72 | - return "(coalesce(" . $this->reporter->db->convert($column, "length") . ",0) > 0 AND $column != '^^' )\n"; |
|
72 | + return "(coalesce(".$this->reporter->db->convert($column, "length").",0) > 0 AND $column != '^^' )\n"; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function queryFilteris($layout_def) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | public function queryFilterone_of($layout_def) { |
92 | - $arr = array (); |
|
92 | + $arr = array(); |
|
93 | 93 | foreach ($layout_def['input_name0'] as $value) { |
94 | 94 | $arr[] = $this->reporter->db->quoted($value); |
95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | public function queryFilternot_one_of($layout_def) { |
101 | - $arr = array (); |
|
101 | + $arr = array(); |
|
102 | 102 | foreach ($layout_def['input_name0'] as $value) { |
103 | 103 | $arr[] = $this->reporter->db->quoted($value); |
104 | 104 | } |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | function & displayList($layout_def) { |
111 | - if(!empty($layout_def['column_key'])){ |
|
111 | + if (!empty($layout_def['column_key'])) { |
|
112 | 112 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
113 | - }else if(!empty($layout_def['fields'])){ |
|
113 | + } else if (!empty($layout_def['fields'])) { |
|
114 | 114 | $field_def = $layout_def['fields']; |
115 | 115 | } |
116 | 116 | $cell = $this->displayListPlain($layout_def); |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | $record = $layout_def['fields'][$key]; |
130 | 130 | $field_name = $field_def['name']; |
131 | 131 | $field_type = $field_def['type']; |
132 | - $div_id = $field_def['module'] ."&$record&$field_name"; |
|
133 | - $str = "<div id='$div_id'>" . $cell . " " |
|
132 | + $div_id = $field_def['module']."&$record&$field_name"; |
|
133 | + $str = "<div id='$div_id'>".$cell." " |
|
134 | 134 | . SugarThemeRegistry::current()->getImage( |
135 | 135 | "edit_inline", |
136 | - "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(" . |
|
136 | + "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(". |
|
137 | 137 | "\"$div_id\",\"$cell\",\"$module\",\"$record\",\"$field_name\",\"$field_type\");'" |
138 | 138 | ) |
139 | 139 | . "</div>"; |
@@ -142,25 +142,25 @@ discard block |
||
142 | 142 | return $str; |
143 | 143 | } |
144 | 144 | function & displayListPlain($layout_def) { |
145 | - if(!empty($layout_def['column_key'])){ |
|
145 | + if (!empty($layout_def['column_key'])) { |
|
146 | 146 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
147 | - }else if(!empty($layout_def['fields'])){ |
|
147 | + } else if (!empty($layout_def['fields'])) { |
|
148 | 148 | $field_def = $layout_def['fields']; |
149 | 149 | } |
150 | 150 | |
151 | - if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){ |
|
151 | + if (!empty($layout_def['table_key']) && (empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))) { |
|
152 | 152 | $value = $this->_get_list_value($layout_def); |
153 | - }else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
153 | + } else if (!empty($layout_def['name']) && !empty($layout_def['fields'])) { |
|
154 | 154 | $key = strtoupper($layout_def['name']); |
155 | 155 | $value = $layout_def['fields'][$key]; |
156 | 156 | } |
157 | 157 | $cell = ''; |
158 | 158 | |
159 | - if(isset($field_def['options'])){ |
|
159 | + if (isset($field_def['options'])) { |
|
160 | 160 | $cell = translate($field_def['options'], $field_def['module'], $value); |
161 | - }else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){ |
|
161 | + } else if (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
162 | 162 | global $beanFiles; |
163 | - if(empty($beanFiles)) { |
|
163 | + if (empty($beanFiles)) { |
|
164 | 164 | include('include/modules.php'); |
165 | 165 | } |
166 | 166 | $bean_name = get_singular_bean_name($field_def['module']); |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | |
173 | 173 | //#22632 |
174 | 174 | $value = unencodeMultienum($value); |
175 | - $cell=array(); |
|
176 | - foreach($value as $val){ |
|
177 | - $returnVal = translate($field_def['options'],$field_def['module'],$val); |
|
178 | - if(!is_array($returnVal)){ |
|
179 | - array_push( $cell, translate($field_def['options'],$field_def['module'],$val)); |
|
175 | + $cell = array(); |
|
176 | + foreach ($value as $val) { |
|
177 | + $returnVal = translate($field_def['options'], $field_def['module'], $val); |
|
178 | + if (!is_array($returnVal)) { |
|
179 | + array_push($cell, translate($field_def['options'], $field_def['module'], $val)); |
|
180 | 180 | } |
181 | 181 | } |
182 | - $cell = implode(", ",$cell); |
|
182 | + $cell = implode(", ", $cell); |
|
183 | 183 | } |
184 | 184 | return $cell; |
185 | 185 | } |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | $order_by = $this->_get_column_select($layout_def); |
193 | 193 | } |
194 | 194 | $list = array(); |
195 | - if(isset($field_def['options'])) { |
|
195 | + if (isset($field_def['options'])) { |
|
196 | 196 | $list = translate($field_def['options'], $field_def['module']); |
197 | - } elseif(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
197 | + } elseif (isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])) { |
|
198 | 198 | global $beanFiles; |
199 | - if(empty($beanFiles)) { |
|
199 | + if (empty($beanFiles)) { |
|
200 | 200 | include('include/modules.php'); |
201 | 201 | } |
202 | 202 | $bean_name = get_singular_bean_name($field_def['module']); |
@@ -214,17 +214,17 @@ discard block |
||
214 | 214 | public function displayInput($layout_def) { |
215 | 215 | global $app_list_strings; |
216 | 216 | |
217 | - if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
218 | - if ( isset($layout_def['options']) && is_array($layout_def['options']) ) { |
|
217 | + if (!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
218 | + if (isset($layout_def['options']) && is_array($layout_def['options'])) { |
|
219 | 219 | $ops = $layout_def['options']; |
220 | 220 | } |
221 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
221 | + elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])) { |
|
222 | 222 | $ops = $app_list_strings[$layout_def['options']]; |
223 | - if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
223 | + if (array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
224 | 224 | unset($ops['']); |
225 | 225 | } |
226 | 226 | } |
227 | - else{ |
|
227 | + else { |
|
228 | 228 | $ops = array(); |
229 | 229 | } |
230 | 230 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $ops = $app_list_strings[$layout_def['options']]; |
233 | 233 | } |
234 | 234 | |
235 | - $str = '<select multiple="true" size="3" name="' . $layout_def['name'] . '[]">'; |
|
235 | + $str = '<select multiple="true" size="3" name="'.$layout_def['name'].'[]">'; |
|
236 | 236 | $str .= get_select_options_with_id($ops, $layout_def['input_name0']); |
237 | 237 | $str .= '</select>'; |
238 | 238 | 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. |
@@ -52,8 +54,7 @@ discard block |
||
52 | 54 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
53 | 55 | if(isset($GLOBALS['log'])) { |
54 | 56 | $GLOBALS['log']->deprecated($deprecatedMessage); |
55 | - } |
|
56 | - else { |
|
57 | + } else { |
|
57 | 58 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
58 | 59 | } |
59 | 60 | self::__construct($layout_manager); |
@@ -110,7 +111,7 @@ discard block |
||
110 | 111 | function & displayList($layout_def) { |
111 | 112 | if(!empty($layout_def['column_key'])){ |
112 | 113 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
113 | - }else if(!empty($layout_def['fields'])){ |
|
114 | + } else if(!empty($layout_def['fields'])){ |
|
114 | 115 | $field_def = $layout_def['fields']; |
115 | 116 | } |
116 | 117 | $cell = $this->displayListPlain($layout_def); |
@@ -144,13 +145,13 @@ discard block |
||
144 | 145 | function & displayListPlain($layout_def) { |
145 | 146 | if(!empty($layout_def['column_key'])){ |
146 | 147 | $field_def = $this->reporter->all_fields[$layout_def['column_key']]; |
147 | - }else if(!empty($layout_def['fields'])){ |
|
148 | + } else if(!empty($layout_def['fields'])){ |
|
148 | 149 | $field_def = $layout_def['fields']; |
149 | 150 | } |
150 | 151 | |
151 | 152 | if (!empty($layout_def['table_key'] ) &&( empty ($field_def['fields']) || empty ($field_def['fields'][0]) || empty ($field_def['fields'][1]))){ |
152 | 153 | $value = $this->_get_list_value($layout_def); |
153 | - }else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
154 | + } else if(!empty($layout_def['name']) && !empty($layout_def['fields'])){ |
|
154 | 155 | $key = strtoupper($layout_def['name']); |
155 | 156 | $value = $layout_def['fields'][$key]; |
156 | 157 | } |
@@ -158,7 +159,7 @@ discard block |
||
158 | 159 | |
159 | 160 | if(isset($field_def['options'])){ |
160 | 161 | $cell = translate($field_def['options'], $field_def['module'], $value); |
161 | - }else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){ |
|
162 | + } else if(isset($field_def['type']) && $field_def['type'] == 'enum' && isset($field_def['function'])){ |
|
162 | 163 | global $beanFiles; |
163 | 164 | if(empty($beanFiles)) { |
164 | 165 | include('include/modules.php'); |
@@ -217,18 +218,15 @@ discard block |
||
217 | 218 | if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
218 | 219 | if ( isset($layout_def['options']) && is_array($layout_def['options']) ) { |
219 | 220 | $ops = $layout_def['options']; |
220 | - } |
|
221 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
221 | + } elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
222 | 222 | $ops = $app_list_strings[$layout_def['options']]; |
223 | 223 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
224 | 224 | unset($ops['']); |
225 | 225 | } |
226 | - } |
|
227 | - else{ |
|
226 | + } else{ |
|
228 | 227 | $ops = array(); |
229 | 228 | } |
230 | - } |
|
231 | - else { |
|
229 | + } else { |
|
232 | 230 | $ops = $app_list_strings[$layout_def['options']]; |
233 | 231 | } |
234 | 232 |
@@ -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 | } |