@@ -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,137 +45,137 @@ |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelTopSelectUsersButton extends SugarWidgetSubPanelTopSelectButton |
| 47 | 47 | { |
| 48 | - //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
|
| 49 | - function SugarWidgetSubPanelTopSelectUsersButton($button_properties=array()) |
|
| 50 | - { |
|
| 51 | - $this->button_properties=$button_properties; |
|
| 52 | - } |
|
| 48 | + //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
|
| 49 | + function SugarWidgetSubPanelTopSelectUsersButton($button_properties=array()) |
|
| 50 | + { |
|
| 51 | + $this->button_properties=$button_properties; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | function getDisplayName() |
| 55 | 55 | { |
| 56 | 56 | return $GLOBALS['app_strings']['LBL_SELECT_USER_BUTTON_LABEL']; |
| 57 | 57 | } |
| 58 | - //widget_data is the collection of attributes associated with the button in the layout_defs file. |
|
| 59 | - function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 60 | - { |
|
| 61 | - global $app_strings; |
|
| 62 | - $initial_filter = ''; |
|
| 63 | - |
|
| 64 | - $this->title = $app_strings['LBL_SELECT_USER_BUTTON_TITLE']; |
|
| 65 | - //$this->accesskey = $app_strings['LBL_SELECT_USER_BUTTON_KEY']; |
|
| 66 | - $this->value = $this->getDisplayName(); |
|
| 67 | - |
|
| 68 | - $this->module_name = 'Users'; |
|
| 69 | - |
|
| 70 | - if (is_array($this->button_properties)) { |
|
| 71 | - if( isset($this->button_properties['title'])) { |
|
| 72 | - $this->title = $app_strings[$this->button_properties['title']]; |
|
| 73 | - } |
|
| 74 | - if( isset($this->button_properties['accesskey'])) { |
|
| 75 | - //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
|
| 76 | - } |
|
| 77 | - if( isset($this->button_properties['form_value'])) { |
|
| 78 | - $this->value = $app_strings[$this->button_properties['form_value']]; |
|
| 79 | - } |
|
| 80 | - if( isset($this->button_properties['module'])) { |
|
| 81 | - $this->module_name = $this->button_properties['module']; |
|
| 82 | - } |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - $focus = $widget_data['focus']; |
|
| 86 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 87 | - $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 88 | - . ' title="' . $this->title . '"' |
|
| 89 | - . ' value="' . $this->value . "\"\n" |
|
| 90 | - .' disabled />'; |
|
| 91 | - return $button; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - //refresh the whole page after end of action? |
|
| 95 | - $refresh_page = 0; |
|
| 96 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 97 | - $refresh_page = 1; |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - $subpanel_definition = $widget_data['subpanel_definition']; |
|
| 101 | - |
|
| 102 | - $button_definition = $subpanel_definition->get_buttons(); |
|
| 103 | - $subpanel_name = $subpanel_definition->get_module_name(); |
|
| 104 | - if (empty($this->module_name)) { |
|
| 105 | - $this->module_name = $subpanel_name; |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - if ($subpanel_name == 'Project'){ |
|
| 109 | - $link_field_name = 'project_users_1'; |
|
| 110 | - } |
|
| 111 | - else{ |
|
| 112 | - $link_field_name = $subpanel_definition->get_data_source_name(true); |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - $popup_mode='Single'; |
|
| 116 | - if(isset($widget_data['mode'])){ |
|
| 117 | - $popup_mode=$widget_data['mode']; |
|
| 118 | - } |
|
| 119 | - if(isset($widget_data['initial_filter_fields'])){ |
|
| 120 | - if (is_array($widget_data['initial_filter_fields'])) { |
|
| 121 | - foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
|
| 122 | - if (isset($focus->$value) and !empty($focus->$value)) { |
|
| 123 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 124 | - } |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - if (!empty($widget_data['filter_out_is_admin'])) { |
|
| 58 | + //widget_data is the collection of attributes associated with the button in the layout_defs file. |
|
| 59 | + function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 60 | + { |
|
| 61 | + global $app_strings; |
|
| 62 | + $initial_filter = ''; |
|
| 63 | + |
|
| 64 | + $this->title = $app_strings['LBL_SELECT_USER_BUTTON_TITLE']; |
|
| 65 | + //$this->accesskey = $app_strings['LBL_SELECT_USER_BUTTON_KEY']; |
|
| 66 | + $this->value = $this->getDisplayName(); |
|
| 67 | + |
|
| 68 | + $this->module_name = 'Users'; |
|
| 69 | + |
|
| 70 | + if (is_array($this->button_properties)) { |
|
| 71 | + if( isset($this->button_properties['title'])) { |
|
| 72 | + $this->title = $app_strings[$this->button_properties['title']]; |
|
| 73 | + } |
|
| 74 | + if( isset($this->button_properties['accesskey'])) { |
|
| 75 | + //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
|
| 76 | + } |
|
| 77 | + if( isset($this->button_properties['form_value'])) { |
|
| 78 | + $this->value = $app_strings[$this->button_properties['form_value']]; |
|
| 79 | + } |
|
| 80 | + if( isset($this->button_properties['module'])) { |
|
| 81 | + $this->module_name = $this->button_properties['module']; |
|
| 82 | + } |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + $focus = $widget_data['focus']; |
|
| 86 | + if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 87 | + $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 88 | + . ' title="' . $this->title . '"' |
|
| 89 | + . ' value="' . $this->value . "\"\n" |
|
| 90 | + .' disabled />'; |
|
| 91 | + return $button; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + //refresh the whole page after end of action? |
|
| 95 | + $refresh_page = 0; |
|
| 96 | + if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 97 | + $refresh_page = 1; |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + $subpanel_definition = $widget_data['subpanel_definition']; |
|
| 101 | + |
|
| 102 | + $button_definition = $subpanel_definition->get_buttons(); |
|
| 103 | + $subpanel_name = $subpanel_definition->get_module_name(); |
|
| 104 | + if (empty($this->module_name)) { |
|
| 105 | + $this->module_name = $subpanel_name; |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + if ($subpanel_name == 'Project'){ |
|
| 109 | + $link_field_name = 'project_users_1'; |
|
| 110 | + } |
|
| 111 | + else{ |
|
| 112 | + $link_field_name = $subpanel_definition->get_data_source_name(true); |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + $popup_mode='Single'; |
|
| 116 | + if(isset($widget_data['mode'])){ |
|
| 117 | + $popup_mode=$widget_data['mode']; |
|
| 118 | + } |
|
| 119 | + if(isset($widget_data['initial_filter_fields'])){ |
|
| 120 | + if (is_array($widget_data['initial_filter_fields'])) { |
|
| 121 | + foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
|
| 122 | + if (isset($focus->$value) and !empty($focus->$value)) { |
|
| 123 | + $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 124 | + } |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + if (!empty($widget_data['filter_out_is_admin'])) { |
|
| 130 | 130 | $initial_filter.="&is_admin_advanced=0"; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $create="true"; |
|
| 134 | - if(isset($widget_data['create'])){ |
|
| 135 | - $create=$widget_data['create']; |
|
| 136 | - } |
|
| 137 | - $return_module = $_REQUEST['module']; |
|
| 138 | - $return_action = 'SubPanelViewer'; |
|
| 139 | - $return_id = $_REQUEST['record']; |
|
| 140 | - |
|
| 141 | - //field_to_name_array |
|
| 142 | - $fton_array= array('id' => 'subpanel_id'); |
|
| 143 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 144 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
|
| 148 | - |
|
| 149 | - $popup_request_data = array( |
|
| 150 | - 'call_back_function' => 'set_return_and_save_background', |
|
| 151 | - 'form_name' => 'DetailView', |
|
| 152 | - 'field_to_name_array' => $fton_array, |
|
| 153 | - 'passthru_data' => array( |
|
| 154 | - 'child_field' => $this->module_name, |
|
| 155 | - 'return_url' => urlencode($return_url), |
|
| 156 | - 'link_field_name' => $link_field_name, |
|
| 157 | - 'module_name' => $this->module_name, |
|
| 158 | - 'refresh_page' => 1, |
|
| 159 | - ), |
|
| 160 | - ); |
|
| 161 | - |
|
| 162 | - if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
|
| 163 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
|
| 167 | - |
|
| 168 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 169 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 170 | - } |
|
| 171 | - } |
|
| 172 | - $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
| 173 | - |
|
| 174 | - return '<form action="index.php">' . "\n" |
|
| 175 | - . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 176 | - . ' title="' . $this->title . '"' |
|
| 177 | - . ' value="' . $this->value . "\"\n" |
|
| 178 | - . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
|
| 179 | - } |
|
| 133 | + $create="true"; |
|
| 134 | + if(isset($widget_data['create'])){ |
|
| 135 | + $create=$widget_data['create']; |
|
| 136 | + } |
|
| 137 | + $return_module = $_REQUEST['module']; |
|
| 138 | + $return_action = 'SubPanelViewer'; |
|
| 139 | + $return_id = $_REQUEST['record']; |
|
| 140 | + |
|
| 141 | + //field_to_name_array |
|
| 142 | + $fton_array= array('id' => 'subpanel_id'); |
|
| 143 | + if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 144 | + $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
|
| 148 | + |
|
| 149 | + $popup_request_data = array( |
|
| 150 | + 'call_back_function' => 'set_return_and_save_background', |
|
| 151 | + 'form_name' => 'DetailView', |
|
| 152 | + 'field_to_name_array' => $fton_array, |
|
| 153 | + 'passthru_data' => array( |
|
| 154 | + 'child_field' => $this->module_name, |
|
| 155 | + 'return_url' => urlencode($return_url), |
|
| 156 | + 'link_field_name' => $link_field_name, |
|
| 157 | + 'module_name' => $this->module_name, |
|
| 158 | + 'refresh_page' => 1, |
|
| 159 | + ), |
|
| 160 | + ); |
|
| 161 | + |
|
| 162 | + if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
|
| 163 | + $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
|
| 167 | + |
|
| 168 | + if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 169 | + $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 170 | + } |
|
| 171 | + } |
|
| 172 | + $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
| 173 | + |
|
| 174 | + return '<form action="index.php">' . "\n" |
|
| 175 | + . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 176 | + . ' title="' . $this->title . '"' |
|
| 177 | + . ' value="' . $this->value . "\"\n" |
|
| 178 | + . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
|
| 179 | + } |
|
| 180 | 180 | } |
| 181 | 181 | ?> |
@@ -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 | class SugarWidgetSubPanelTopSelectUsersButton extends SugarWidgetSubPanelTopSelectButton |
| 47 | 47 | { |
| 48 | 48 | //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
| 49 | - function SugarWidgetSubPanelTopSelectUsersButton($button_properties=array()) |
|
| 49 | + function SugarWidgetSubPanelTopSelectUsersButton($button_properties = array()) |
|
| 50 | 50 | { |
| 51 | - $this->button_properties=$button_properties; |
|
| 51 | + $this->button_properties = $button_properties; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | function getDisplayName() |
@@ -68,32 +68,32 @@ discard block |
||
| 68 | 68 | $this->module_name = 'Users'; |
| 69 | 69 | |
| 70 | 70 | if (is_array($this->button_properties)) { |
| 71 | - if( isset($this->button_properties['title'])) { |
|
| 71 | + if (isset($this->button_properties['title'])) { |
|
| 72 | 72 | $this->title = $app_strings[$this->button_properties['title']]; |
| 73 | 73 | } |
| 74 | - if( isset($this->button_properties['accesskey'])) { |
|
| 74 | + if (isset($this->button_properties['accesskey'])) { |
|
| 75 | 75 | //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
| 76 | 76 | } |
| 77 | - if( isset($this->button_properties['form_value'])) { |
|
| 77 | + if (isset($this->button_properties['form_value'])) { |
|
| 78 | 78 | $this->value = $app_strings[$this->button_properties['form_value']]; |
| 79 | 79 | } |
| 80 | - if( isset($this->button_properties['module'])) { |
|
| 80 | + if (isset($this->button_properties['module'])) { |
|
| 81 | 81 | $this->module_name = $this->button_properties['module']; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $focus = $widget_data['focus']; |
| 86 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 87 | - $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 88 | - . ' title="' . $this->title . '"' |
|
| 89 | - . ' value="' . $this->value . "\"\n" |
|
| 86 | + if (ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)) { |
|
| 87 | + $button = ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\"\n" |
|
| 88 | + . ' title="'.$this->title.'"' |
|
| 89 | + . ' value="'.$this->value."\"\n" |
|
| 90 | 90 | .' disabled />'; |
| 91 | 91 | return $button; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | //refresh the whole page after end of action? |
| 95 | 95 | $refresh_page = 0; |
| 96 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 96 | + if (!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])) { |
|
| 97 | 97 | $refresh_page = 1; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -105,43 +105,43 @@ discard block |
||
| 105 | 105 | $this->module_name = $subpanel_name; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if ($subpanel_name == 'Project'){ |
|
| 108 | + if ($subpanel_name == 'Project') { |
|
| 109 | 109 | $link_field_name = 'project_users_1'; |
| 110 | 110 | } |
| 111 | - else{ |
|
| 111 | + else { |
|
| 112 | 112 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $popup_mode='Single'; |
|
| 116 | - if(isset($widget_data['mode'])){ |
|
| 117 | - $popup_mode=$widget_data['mode']; |
|
| 115 | + $popup_mode = 'Single'; |
|
| 116 | + if (isset($widget_data['mode'])) { |
|
| 117 | + $popup_mode = $widget_data['mode']; |
|
| 118 | 118 | } |
| 119 | - if(isset($widget_data['initial_filter_fields'])){ |
|
| 119 | + if (isset($widget_data['initial_filter_fields'])) { |
|
| 120 | 120 | if (is_array($widget_data['initial_filter_fields'])) { |
| 121 | 121 | foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
| 122 | 122 | if (isset($focus->$value) and !empty($focus->$value)) { |
| 123 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 123 | + $initial_filter .= "&".$alias.'='.urlencode($focus->$value); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (!empty($widget_data['filter_out_is_admin'])) { |
| 130 | - $initial_filter.="&is_admin_advanced=0"; |
|
| 130 | + $initial_filter .= "&is_admin_advanced=0"; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $create="true"; |
|
| 134 | - if(isset($widget_data['create'])){ |
|
| 135 | - $create=$widget_data['create']; |
|
| 133 | + $create = "true"; |
|
| 134 | + if (isset($widget_data['create'])) { |
|
| 135 | + $create = $widget_data['create']; |
|
| 136 | 136 | } |
| 137 | 137 | $return_module = $_REQUEST['module']; |
| 138 | 138 | $return_action = 'SubPanelViewer'; |
| 139 | 139 | $return_id = $_REQUEST['record']; |
| 140 | 140 | |
| 141 | 141 | //field_to_name_array |
| 142 | - $fton_array= array('id' => 'subpanel_id'); |
|
| 143 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 144 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 142 | + $fton_array = array('id' => 'subpanel_id'); |
|
| 143 | + if (isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])) { |
|
| 144 | + $fton_array = array_merge($fton_array, $widget_data['field_to_name_array']); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
@@ -160,21 +160,21 @@ discard block |
||
| 160 | 160 | ); |
| 161 | 161 | |
| 162 | 162 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
| 163 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 163 | + $popup_request_data['passthru_data'] = array_merge($popup_request_data['passthru_data'], $this->button_properties['add_to_passthru_data']); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
| 167 | 167 | |
| 168 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 169 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 168 | + if ($this->button_properties['add_to_passthru_data']['return_type'] == 'report') { |
|
| 169 | + $initial_filter = "&module_name=".urlencode($widget_data['module']); |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
| 173 | 173 | |
| 174 | - return '<form action="index.php">' . "\n" |
|
| 175 | - . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 176 | - . ' title="' . $this->title . '"' |
|
| 177 | - . ' value="' . $this->value . "\"\n" |
|
| 174 | + return '<form action="index.php">'."\n" |
|
| 175 | + . ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\"\n" |
|
| 176 | + . ' title="'.$this->title.'"' |
|
| 177 | + . ' value="'.$this->value."\"\n" |
|
| 178 | 178 | . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -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. |
@@ -108,8 +110,7 @@ discard block |
||
| 108 | 110 | |
| 109 | 111 | if ($subpanel_name == 'Project'){ |
| 110 | 112 | $link_field_name = 'project_contacts_1'; |
| 111 | - } |
|
| 112 | - else{ |
|
| 113 | + } else{ |
|
| 113 | 114 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
| 114 | 115 | } |
| 115 | 116 | |
@@ -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 | } |
@@ -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 | |
| 50 | 50 | function displayListPlain($layout_def) { |
| 51 | - $value= $this->_get_list_value($layout_def); |
|
| 52 | - if (isset($layout_def['widget_type']) && $layout_def['widget_type'] =='checkbox') { |
|
| 53 | - if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
| 51 | + $value = $this->_get_list_value($layout_def); |
|
| 52 | + if (isset($layout_def['widget_type']) && $layout_def['widget_type'] == 'checkbox') { |
|
| 53 | + if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
| 54 | 54 | { |
| 55 | 55 | return "<input name='checkbox_display' class='checkbox' type='checkbox' disabled='true' checked>"; |
| 56 | 56 | } |
@@ -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. |
@@ -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. |
@@ -45,133 +45,133 @@ |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelTopSelectContactsButton extends SugarWidgetSubPanelTopSelectButton |
| 47 | 47 | { |
| 48 | - //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
|
| 49 | - function SugarWidgetSubPanelTopSelectContactsButton($button_properties=array()) |
|
| 50 | - { |
|
| 51 | - $this->button_properties=$button_properties; |
|
| 52 | - } |
|
| 48 | + //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
|
| 49 | + function SugarWidgetSubPanelTopSelectContactsButton($button_properties=array()) |
|
| 50 | + { |
|
| 51 | + $this->button_properties=$button_properties; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | public function getWidgetId($buttonSuffix = true) |
| 55 | 55 | { |
| 56 | 56 | return parent::getWidgetId() . '_select_button'; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - //widget_data is the collection of attributes associated with the button in the layout_defs file. |
|
| 60 | - function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 61 | - { |
|
| 62 | - global $app_strings; |
|
| 63 | - $initial_filter = ''; |
|
| 64 | - |
|
| 65 | - $this->title = $app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']; |
|
| 66 | - //$this->accesskey = $app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']; |
|
| 67 | - $this->value = $app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']; |
|
| 68 | - |
|
| 69 | - $this->module_name = 'Contacts'; |
|
| 70 | - |
|
| 71 | - if (is_array($this->button_properties)) { |
|
| 72 | - if( isset($this->button_properties['title'])) { |
|
| 73 | - $this->title = $app_strings[$this->button_properties['title']]; |
|
| 74 | - } |
|
| 75 | - if( isset($this->button_properties['accesskey'])) { |
|
| 76 | - //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
|
| 77 | - } |
|
| 78 | - if( isset($this->button_properties['form_value'])) { |
|
| 79 | - $this->value = $app_strings[$this->button_properties['form_value']]; |
|
| 80 | - } |
|
| 81 | - if( isset($this->button_properties['module'])) { |
|
| 82 | - $this->module_name = $this->button_properties['module']; |
|
| 83 | - } |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - $focus = $widget_data['focus']; |
|
| 87 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 88 | - $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 89 | - . ' title="' . $this->title . '"' |
|
| 90 | - . ' value="' . $this->value . "\"\n" |
|
| 91 | - .' disabled />'; |
|
| 92 | - return $button; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - //refresh the whole page after end of action? |
|
| 96 | - $refresh_page = 0; |
|
| 97 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 98 | - $refresh_page = 1; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - $subpanel_definition = $widget_data['subpanel_definition']; |
|
| 102 | - |
|
| 103 | - $button_definition = $subpanel_definition->get_buttons(); |
|
| 104 | - $subpanel_name = $subpanel_definition->get_module_name(); |
|
| 105 | - if (empty($this->module_name)) { |
|
| 106 | - $this->module_name = $subpanel_name; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - if ($subpanel_name == 'Project'){ |
|
| 110 | - $link_field_name = 'project_contacts_1'; |
|
| 111 | - } |
|
| 112 | - else{ |
|
| 113 | - $link_field_name = $subpanel_definition->get_data_source_name(true); |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - $popup_mode='Single'; |
|
| 117 | - if(isset($widget_data['mode'])){ |
|
| 118 | - $popup_mode=$widget_data['mode']; |
|
| 119 | - } |
|
| 120 | - if(isset($widget_data['initial_filter_fields'])){ |
|
| 121 | - if (is_array($widget_data['initial_filter_fields'])) { |
|
| 122 | - foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
|
| 123 | - if (isset($focus->$value) and !empty($focus->$value)) { |
|
| 124 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - } |
|
| 129 | - $create="true"; |
|
| 130 | - if(isset($widget_data['create'])){ |
|
| 131 | - $create=$widget_data['create']; |
|
| 132 | - } |
|
| 133 | - $return_module = $_REQUEST['module']; |
|
| 134 | - $return_action = 'SubPanelViewer'; |
|
| 135 | - $return_id = $_REQUEST['record']; |
|
| 136 | - |
|
| 137 | - //field_to_name_array |
|
| 138 | - $fton_array= array('id' => 'subpanel_id'); |
|
| 139 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 140 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
|
| 144 | - |
|
| 145 | - $popup_request_data = array( |
|
| 146 | - 'call_back_function' => 'set_return_and_save_background', |
|
| 147 | - 'form_name' => 'DetailView', |
|
| 148 | - 'field_to_name_array' => $fton_array, |
|
| 149 | - 'passthru_data' => array( |
|
| 150 | - 'child_field' => $this->module_name, |
|
| 151 | - 'return_url' => urlencode($return_url), |
|
| 152 | - 'link_field_name' => $link_field_name, |
|
| 153 | - 'module_name' => $this->module_name, |
|
| 154 | - 'refresh_page' => 1, |
|
| 155 | - ), |
|
| 156 | - ); |
|
| 157 | - |
|
| 158 | - if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
|
| 159 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 160 | - } |
|
| 161 | - |
|
| 162 | - if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
|
| 163 | - |
|
| 164 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 165 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 166 | - } |
|
| 167 | - } |
|
| 168 | - $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
| 169 | - |
|
| 170 | - return '<form action="index.php">' . "\n" |
|
| 171 | - . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 172 | - . ' title="' . $this->title . '"' |
|
| 173 | - . ' value="' . $this->value . "\"\n" |
|
| 174 | - . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
|
| 175 | - } |
|
| 59 | + //widget_data is the collection of attributes associated with the button in the layout_defs file. |
|
| 60 | + function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 61 | + { |
|
| 62 | + global $app_strings; |
|
| 63 | + $initial_filter = ''; |
|
| 64 | + |
|
| 65 | + $this->title = $app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']; |
|
| 66 | + //$this->accesskey = $app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']; |
|
| 67 | + $this->value = $app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']; |
|
| 68 | + |
|
| 69 | + $this->module_name = 'Contacts'; |
|
| 70 | + |
|
| 71 | + if (is_array($this->button_properties)) { |
|
| 72 | + if( isset($this->button_properties['title'])) { |
|
| 73 | + $this->title = $app_strings[$this->button_properties['title']]; |
|
| 74 | + } |
|
| 75 | + if( isset($this->button_properties['accesskey'])) { |
|
| 76 | + //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
|
| 77 | + } |
|
| 78 | + if( isset($this->button_properties['form_value'])) { |
|
| 79 | + $this->value = $app_strings[$this->button_properties['form_value']]; |
|
| 80 | + } |
|
| 81 | + if( isset($this->button_properties['module'])) { |
|
| 82 | + $this->module_name = $this->button_properties['module']; |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + $focus = $widget_data['focus']; |
|
| 87 | + if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 88 | + $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 89 | + . ' title="' . $this->title . '"' |
|
| 90 | + . ' value="' . $this->value . "\"\n" |
|
| 91 | + .' disabled />'; |
|
| 92 | + return $button; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + //refresh the whole page after end of action? |
|
| 96 | + $refresh_page = 0; |
|
| 97 | + if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 98 | + $refresh_page = 1; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + $subpanel_definition = $widget_data['subpanel_definition']; |
|
| 102 | + |
|
| 103 | + $button_definition = $subpanel_definition->get_buttons(); |
|
| 104 | + $subpanel_name = $subpanel_definition->get_module_name(); |
|
| 105 | + if (empty($this->module_name)) { |
|
| 106 | + $this->module_name = $subpanel_name; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + if ($subpanel_name == 'Project'){ |
|
| 110 | + $link_field_name = 'project_contacts_1'; |
|
| 111 | + } |
|
| 112 | + else{ |
|
| 113 | + $link_field_name = $subpanel_definition->get_data_source_name(true); |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + $popup_mode='Single'; |
|
| 117 | + if(isset($widget_data['mode'])){ |
|
| 118 | + $popup_mode=$widget_data['mode']; |
|
| 119 | + } |
|
| 120 | + if(isset($widget_data['initial_filter_fields'])){ |
|
| 121 | + if (is_array($widget_data['initial_filter_fields'])) { |
|
| 122 | + foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
|
| 123 | + if (isset($focus->$value) and !empty($focus->$value)) { |
|
| 124 | + $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + } |
|
| 129 | + $create="true"; |
|
| 130 | + if(isset($widget_data['create'])){ |
|
| 131 | + $create=$widget_data['create']; |
|
| 132 | + } |
|
| 133 | + $return_module = $_REQUEST['module']; |
|
| 134 | + $return_action = 'SubPanelViewer'; |
|
| 135 | + $return_id = $_REQUEST['record']; |
|
| 136 | + |
|
| 137 | + //field_to_name_array |
|
| 138 | + $fton_array= array('id' => 'subpanel_id'); |
|
| 139 | + if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 140 | + $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
|
| 144 | + |
|
| 145 | + $popup_request_data = array( |
|
| 146 | + 'call_back_function' => 'set_return_and_save_background', |
|
| 147 | + 'form_name' => 'DetailView', |
|
| 148 | + 'field_to_name_array' => $fton_array, |
|
| 149 | + 'passthru_data' => array( |
|
| 150 | + 'child_field' => $this->module_name, |
|
| 151 | + 'return_url' => urlencode($return_url), |
|
| 152 | + 'link_field_name' => $link_field_name, |
|
| 153 | + 'module_name' => $this->module_name, |
|
| 154 | + 'refresh_page' => 1, |
|
| 155 | + ), |
|
| 156 | + ); |
|
| 157 | + |
|
| 158 | + if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
|
| 159 | + $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 160 | + } |
|
| 161 | + |
|
| 162 | + if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
|
| 163 | + |
|
| 164 | + if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 165 | + $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 166 | + } |
|
| 167 | + } |
|
| 168 | + $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
|
| 169 | + |
|
| 170 | + return '<form action="index.php">' . "\n" |
|
| 171 | + . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 172 | + . ' title="' . $this->title . '"' |
|
| 173 | + . ' value="' . $this->value . "\"\n" |
|
| 174 | + . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
|
| 175 | + } |
|
| 176 | 176 | } |
| 177 | 177 | ?> |
@@ -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,14 +46,14 @@ discard block |
||
| 46 | 46 | class SugarWidgetSubPanelTopSelectContactsButton extends SugarWidgetSubPanelTopSelectButton |
| 47 | 47 | { |
| 48 | 48 | //button_properties is a collection of properties associated with the widget_class definition. layoutmanager |
| 49 | - function SugarWidgetSubPanelTopSelectContactsButton($button_properties=array()) |
|
| 49 | + function SugarWidgetSubPanelTopSelectContactsButton($button_properties = array()) |
|
| 50 | 50 | { |
| 51 | - $this->button_properties=$button_properties; |
|
| 51 | + $this->button_properties = $button_properties; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function getWidgetId($buttonSuffix = true) |
| 55 | 55 | { |
| 56 | - return parent::getWidgetId() . '_select_button'; |
|
| 56 | + return parent::getWidgetId().'_select_button'; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | //widget_data is the collection of attributes associated with the button in the layout_defs file. |
@@ -69,32 +69,32 @@ discard block |
||
| 69 | 69 | $this->module_name = 'Contacts'; |
| 70 | 70 | |
| 71 | 71 | if (is_array($this->button_properties)) { |
| 72 | - if( isset($this->button_properties['title'])) { |
|
| 72 | + if (isset($this->button_properties['title'])) { |
|
| 73 | 73 | $this->title = $app_strings[$this->button_properties['title']]; |
| 74 | 74 | } |
| 75 | - if( isset($this->button_properties['accesskey'])) { |
|
| 75 | + if (isset($this->button_properties['accesskey'])) { |
|
| 76 | 76 | //$this->accesskey = $app_strings[$this->button_properties['accesskey']]; |
| 77 | 77 | } |
| 78 | - if( isset($this->button_properties['form_value'])) { |
|
| 78 | + if (isset($this->button_properties['form_value'])) { |
|
| 79 | 79 | $this->value = $app_strings[$this->button_properties['form_value']]; |
| 80 | 80 | } |
| 81 | - if( isset($this->button_properties['module'])) { |
|
| 81 | + if (isset($this->button_properties['module'])) { |
|
| 82 | 82 | $this->module_name = $this->button_properties['module']; |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $focus = $widget_data['focus']; |
| 87 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
| 88 | - $button = ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 89 | - . ' title="' . $this->title . '"' |
|
| 90 | - . ' value="' . $this->value . "\"\n" |
|
| 87 | + if (ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)) { |
|
| 88 | + $button = ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\"\n" |
|
| 89 | + . ' title="'.$this->title.'"' |
|
| 90 | + . ' value="'.$this->value."\"\n" |
|
| 91 | 91 | .' disabled />'; |
| 92 | 92 | return $button; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | //refresh the whole page after end of action? |
| 96 | 96 | $refresh_page = 0; |
| 97 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
| 97 | + if (!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])) { |
|
| 98 | 98 | $refresh_page = 1; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,38 +106,38 @@ discard block |
||
| 106 | 106 | $this->module_name = $subpanel_name; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if ($subpanel_name == 'Project'){ |
|
| 109 | + if ($subpanel_name == 'Project') { |
|
| 110 | 110 | $link_field_name = 'project_contacts_1'; |
| 111 | 111 | } |
| 112 | - else{ |
|
| 112 | + else { |
|
| 113 | 113 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $popup_mode='Single'; |
|
| 117 | - if(isset($widget_data['mode'])){ |
|
| 118 | - $popup_mode=$widget_data['mode']; |
|
| 116 | + $popup_mode = 'Single'; |
|
| 117 | + if (isset($widget_data['mode'])) { |
|
| 118 | + $popup_mode = $widget_data['mode']; |
|
| 119 | 119 | } |
| 120 | - if(isset($widget_data['initial_filter_fields'])){ |
|
| 120 | + if (isset($widget_data['initial_filter_fields'])) { |
|
| 121 | 121 | if (is_array($widget_data['initial_filter_fields'])) { |
| 122 | 122 | foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
| 123 | 123 | if (isset($focus->$value) and !empty($focus->$value)) { |
| 124 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
| 124 | + $initial_filter .= "&".$alias.'='.urlencode($focus->$value); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | - $create="true"; |
|
| 130 | - if(isset($widget_data['create'])){ |
|
| 131 | - $create=$widget_data['create']; |
|
| 129 | + $create = "true"; |
|
| 130 | + if (isset($widget_data['create'])) { |
|
| 131 | + $create = $widget_data['create']; |
|
| 132 | 132 | } |
| 133 | 133 | $return_module = $_REQUEST['module']; |
| 134 | 134 | $return_action = 'SubPanelViewer'; |
| 135 | 135 | $return_id = $_REQUEST['record']; |
| 136 | 136 | |
| 137 | 137 | //field_to_name_array |
| 138 | - $fton_array= array('id' => 'subpanel_id'); |
|
| 139 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
| 140 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
| 138 | + $fton_array = array('id' => 'subpanel_id'); |
|
| 139 | + if (isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])) { |
|
| 140 | + $fton_array = array_merge($fton_array, $widget_data['field_to_name_array']); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
@@ -156,21 +156,21 @@ discard block |
||
| 156 | 156 | ); |
| 157 | 157 | |
| 158 | 158 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
| 159 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
| 159 | + $popup_request_data['passthru_data'] = array_merge($popup_request_data['passthru_data'], $this->button_properties['add_to_passthru_data']); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
| 163 | 163 | |
| 164 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
| 165 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
| 164 | + if ($this->button_properties['add_to_passthru_data']['return_type'] == 'report') { |
|
| 165 | + $initial_filter = "&module_name=".urlencode($widget_data['module']); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
| 169 | 169 | |
| 170 | - return '<form action="index.php">' . "\n" |
|
| 171 | - . ' <input type="button" name="' .$this->getWidgetId() . '" id="' .$this->getWidgetId() . '" class="button"' . "\"\n" |
|
| 172 | - . ' title="' . $this->title . '"' |
|
| 173 | - . ' value="' . $this->value . "\"\n" |
|
| 170 | + return '<form action="index.php">'."\n" |
|
| 171 | + . ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\"\n" |
|
| 172 | + . ' title="'.$this->title.'"' |
|
| 173 | + . ' value="'.$this->value."\"\n" |
|
| 174 | 174 | . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -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. |
@@ -108,8 +110,7 @@ discard block |
||
| 108 | 110 | |
| 109 | 111 | if ($subpanel_name == 'Project'){ |
| 110 | 112 | $link_field_name = 'project_contacts_1'; |
| 111 | - } |
|
| 112 | - else{ |
|
| 113 | + } else{ |
|
| 113 | 114 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
| 114 | 115 | } |
| 115 | 116 | |
@@ -44,21 +44,21 @@ |
||
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelTopSelectAccountButton extends SugarWidgetSubPanelTopSelectButton { |
| 47 | - function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 48 | - { |
|
| 49 | - /* |
|
| 47 | + function display($widget_data, $additionalFormFields = NULL, $nonbutton = false) |
|
| 48 | + { |
|
| 49 | + /* |
|
| 50 | 50 | * i.dymovsky |
| 51 | 51 | * Because when user role can't edit Accounts, it also can't edit Membership Organizations. Select button leads to change MO list |
| 52 | 52 | * See bug 25633 |
| 53 | 53 | * Bug25633 code change start |
| 54 | 54 | */ |
| 55 | - if (!ACLController::checkAccess($widget_data["module"], "edit", true)) { |
|
| 56 | - return ; |
|
| 57 | - } |
|
| 58 | - /* |
|
| 55 | + if (!ACLController::checkAccess($widget_data["module"], "edit", true)) { |
|
| 56 | + return ; |
|
| 57 | + } |
|
| 58 | + /* |
|
| 59 | 59 | * Bug25633 code change end |
| 60 | 60 | */ |
| 61 | 61 | |
| 62 | - return parent::display($widget_data); |
|
| 63 | - } |
|
| 62 | + return parent::display($widget_data); |
|
| 63 | + } |
|
| 64 | 64 | } |
@@ -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. |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * Bug25633 code change start |
| 54 | 54 | */ |
| 55 | 55 | if (!ACLController::checkAccess($widget_data["module"], "edit", true)) { |
| 56 | - return ; |
|
| 56 | + return; |
|
| 57 | 57 | } |
| 58 | 58 | /* |
| 59 | 59 | * Bug25633 code change end |
@@ -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. |