@@ -51,13 +51,13 @@ |
||
51 | 51 | $ops = $layout_def['options']; |
52 | 52 | } |
53 | 53 | elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
54 | - $ops = $app_list_strings[$layout_def['options']]; |
|
54 | + $ops = $app_list_strings[$layout_def['options']]; |
|
55 | 55 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
56 | - unset($ops['']); |
|
57 | - } |
|
56 | + unset($ops['']); |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | else{ |
60 | - $ops = array(); |
|
60 | + $ops = array(); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | else { |
@@ -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 |
@@ -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 { |
@@ -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 |
@@ -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 | ?> |
@@ -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) |
@@ -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 | } |
@@ -42,28 +42,28 @@ |
||
42 | 42 | |
43 | 43 | |
44 | 44 | class SugarWidgetFieldDateTimecombo extends SugarWidgetFieldDateTime { |
45 | - var $reporter; |
|
46 | - var $assigned_user=null; |
|
45 | + var $reporter; |
|
46 | + var $assigned_user=null; |
|
47 | 47 | |
48 | 48 | function SugarWidgetFieldDateTimecombo(&$layout_manager) { |
49 | 49 | parent::SugarWidgetFieldDateTime($layout_manager); |
50 | 50 | $this->reporter = $this->layout_manager->getAttribute('reporter'); |
51 | 51 | } |
52 | - //TODO:now for date time field , we just search from date start to date end. The time is from 00:00:00 to 23:59:59 |
|
53 | - //If there is requirement, we can modify report.js::addFilterInputDatetimesBetween and this function |
|
54 | - function queryFilterBetween_Datetimes(& $layout_def) { |
|
55 | - global $timedate; |
|
56 | - if($this->getAssignedUser()) { |
|
57 | - $begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user); |
|
58 | - $end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user); |
|
59 | - } |
|
60 | - else { |
|
61 | - $begin = $layout_def['input_name0']; |
|
62 | - $end = $layout_def['input_name1']; |
|
63 | - } |
|
64 | - return "(".$this->_get_column_select($layout_def).">=".$this->reporter->db->convert($this->reporter->db->quoted($begin), "datetime"). |
|
65 | - " AND\n ".$this->_get_column_select($layout_def)."<=".$this->reporter->db->convert($this->reporter->db->quoted($end), "datetime"). |
|
66 | - ")\n"; |
|
67 | - } |
|
52 | + //TODO:now for date time field , we just search from date start to date end. The time is from 00:00:00 to 23:59:59 |
|
53 | + //If there is requirement, we can modify report.js::addFilterInputDatetimesBetween and this function |
|
54 | + function queryFilterBetween_Datetimes(& $layout_def) { |
|
55 | + global $timedate; |
|
56 | + if($this->getAssignedUser()) { |
|
57 | + $begin = $timedate->handle_offset($layout_def['input_name0'], $timedate->get_db_date_time_format(), false, $this->assigned_user); |
|
58 | + $end = $timedate->handle_offset($layout_def['input_name2'], $timedate->get_db_date_time_format(), false, $this->assigned_user); |
|
59 | + } |
|
60 | + else { |
|
61 | + $begin = $layout_def['input_name0']; |
|
62 | + $end = $layout_def['input_name1']; |
|
63 | + } |
|
64 | + return "(".$this->_get_column_select($layout_def).">=".$this->reporter->db->convert($this->reporter->db->quoted($begin), "datetime"). |
|
65 | + " AND\n ".$this->_get_column_select($layout_def)."<=".$this->reporter->db->convert($this->reporter->db->quoted($end), "datetime"). |
|
66 | + ")\n"; |
|
67 | + } |
|
68 | 68 | |
69 | 69 | } |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | //TODO Rename this to edit link |
46 | 46 | class SugarWidgetSubPanelRelFieldEditButton 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 | - die("<pre>" . print_r($layout_def, true) . "</pre>"); |
|
53 | + function displayList(&$layout_def) |
|
54 | + { |
|
55 | + die("<pre>" . print_r($layout_def, true) . "</pre>"); |
|
56 | 56 | |
57 | 57 | $rel = $layout_def['linked_field']; |
58 | 58 | $module = $layout_def['module']; |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | global $app_strings; |
62 | 62 | |
63 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline', |
|
64 | - 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'); |
|
63 | + $edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline', |
|
64 | + 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'); |
|
65 | 65 | |
66 | 66 | $script = " |
67 | 67 | function editRel(name, id, module) { |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | }"; |
90 | 90 | |
91 | 91 | return "<script>$script</script>" |
92 | - . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">' |
|
93 | - . $edit_icon_html . "</div>"; |
|
94 | - } |
|
92 | + . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">' |
|
93 | + . $edit_icon_html . "</div>"; |
|
94 | + } |
|
95 | 95 | |
96 | 96 | } |
97 | 97 |