This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
||
3 | /********************************************************************************* |
||
4 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
6 | |||
7 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
8 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
9 | * |
||
10 | * This program is free software; you can redistribute it and/or modify it under |
||
11 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
12 | * Free Software Foundation with the addition of the following permission added |
||
13 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
14 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
15 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
16 | * |
||
17 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
18 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
19 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
20 | * details. |
||
21 | * |
||
22 | * You should have received a copy of the GNU Affero General Public License along with |
||
23 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
24 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
25 | * 02110-1301 USA. |
||
26 | * |
||
27 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
28 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
29 | * |
||
30 | * The interactive user interfaces in modified source and object code versions |
||
31 | * of this program must display Appropriate Legal Notices, as required under |
||
32 | * Section 5 of the GNU Affero General Public License version 3. |
||
33 | * |
||
34 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
35 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
36 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
37 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
38 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
39 | ********************************************************************************/ |
||
40 | |||
41 | |||
42 | require_once("include/upload_file.php"); |
||
43 | require_once('include/utils/db_utils.php'); |
||
44 | |||
45 | global $currentModule; |
||
46 | |||
47 | global $focus; |
||
48 | global $action; |
||
49 | |||
50 | global $app_strings; |
||
51 | global $app_list_strings; |
||
52 | //we don't want the parent module's string file, but rather the string file specifc to this subpanel |
||
53 | global $current_language,$beanList,$beanFiles; |
||
54 | $current_module_strings = return_module_language($current_language, 'Activities'); |
||
55 | |||
56 | // history_list is the means of passing data to a SubPanelView. |
||
57 | $bean = $beanList[$_REQUEST['module_name']]; |
||
58 | require_once($beanFiles[$bean]); |
||
59 | $focus = new $bean; |
||
60 | |||
61 | class Popup_Picker |
||
0 ignored issues
–
show
|
|||
62 | { |
||
63 | |||
64 | |||
65 | /** |
||
66 | * sole constructor |
||
67 | */ |
||
68 | function __construct() { |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
||
73 | */ |
||
74 | function Popup_Picker(){ |
||
75 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
||
76 | if(isset($GLOBALS['log'])) { |
||
77 | $GLOBALS['log']->deprecated($deprecatedMessage); |
||
78 | } |
||
79 | else { |
||
80 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
||
81 | } |
||
82 | self::__construct(); |
||
83 | } |
||
84 | |||
85 | |||
86 | /** |
||
87 | * |
||
88 | */ |
||
89 | function process_page() { |
||
90 | global $focus; |
||
91 | global $mod_strings; |
||
92 | global $app_strings; |
||
93 | global $app_list_strings; |
||
94 | global $currentModule; |
||
95 | global $odd_bg; |
||
96 | global $even_bg; |
||
97 | |||
98 | global $timedate; |
||
99 | |||
100 | |||
101 | $history_list = array(); |
||
102 | |||
103 | if(!empty($_REQUEST['record'])) { |
||
104 | $result = $focus->retrieve($_REQUEST['record']); |
||
105 | if($result == null) |
||
106 | { |
||
107 | sugar_die($app_strings['ERROR_NO_RECORD']); |
||
108 | } |
||
109 | } |
||
110 | |||
111 | $activitiesRels = array('tasks' => 'Task', 'meetings' => 'Meeting', 'calls' => 'Call', 'emails' => 'Email', 'notes' => 'Note'); |
||
112 | //Setup the arrays to store the linked records. |
||
113 | foreach($activitiesRels as $relMod => $beanName) { |
||
114 | $varname = "focus_" . $relMod . "_list"; |
||
115 | $$varname = array(); |
||
116 | } |
||
117 | foreach($focus->get_linked_fields() as $field => $def) { |
||
118 | if ($focus->load_relationship($field)) { |
||
119 | $relTable = $focus->$field->getRelatedTableName(); |
||
120 | if (in_array($relTable, array_keys($activitiesRels))) |
||
121 | { |
||
122 | $varname = "focus_" . $relTable . "_list"; |
||
123 | $$varname = sugarArrayMerge($$varname, $focus->get_linked_beans($field,$activitiesRels[$relTable])); |
||
124 | } |
||
125 | |||
126 | } |
||
127 | } |
||
128 | |||
129 | foreach ($focus_tasks_list as $task) { |
||
130 | $sort_date_time=''; |
||
131 | if (empty($task->date_due) || $task->date_due == '0000-00-00') { |
||
132 | $date_due = ''; |
||
133 | } |
||
134 | else { |
||
135 | $date_due = $task->date_due; |
||
136 | } |
||
137 | |||
138 | if ($task->status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") { |
||
139 | $ts = ''; |
||
140 | if(!empty($task->fetched_row['date_due'])) { |
||
141 | //tasks can have an empty date due field |
||
142 | $ts = $timedate->fromDb($task->fetched_row['date_due'])->ts; |
||
143 | } |
||
144 | $history_list[] = array('name' => $task->name, |
||
145 | 'id' => $task->id, |
||
146 | 'type' => "Task", |
||
147 | 'direction' => '', |
||
148 | 'module' => "Tasks", |
||
149 | 'status' => $task->status, |
||
150 | 'parent_id' => $task->parent_id, |
||
151 | 'parent_type' => $task->parent_type, |
||
152 | 'parent_name' => $task->parent_name, |
||
153 | 'contact_id' => $task->contact_id, |
||
154 | 'contact_name' => $task->contact_name, |
||
155 | 'date_modified' => $date_due, |
||
156 | 'description' => $this->getTaskDetails($task), |
||
0 ignored issues
–
show
The method
getTaskDetails() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
157 | 'date_type' => $app_strings['DATA_TYPE_DUE'], |
||
158 | 'sort_value' => $ts, |
||
159 | ); |
||
160 | } else { |
||
161 | $open_activity_list[] = array('name' => $task->name, |
||
162 | 'id' => $task->id, |
||
163 | 'type' => "Task", |
||
164 | 'direction' => '', |
||
165 | 'module' => "Tasks", |
||
166 | 'status' => $task->status, |
||
167 | 'parent_id' => $task->parent_id, |
||
168 | 'parent_type' => $task->parent_type, |
||
169 | 'parent_name' => $task->parent_name, |
||
170 | 'contact_id' => $task->contact_id, |
||
171 | 'contact_name' => $task->contact_name, |
||
172 | 'date_due' => $date_due, |
||
173 | 'description' => $this->getTaskDetails($task), |
||
0 ignored issues
–
show
The method
getTaskDetails() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
174 | 'date_type' => $app_strings['DATA_TYPE_DUE'] |
||
175 | ); |
||
176 | } |
||
177 | } // end Tasks |
||
178 | |||
179 | foreach ($focus_meetings_list as $meeting) { |
||
180 | |||
181 | if (empty($meeting->contact_id) && empty($meeting->contact_name)) { |
||
182 | $meeting_contacts = $meeting->get_linked_beans('contacts','Contact'); |
||
183 | if (!empty($meeting_contacts[0]->id) && !empty($meeting_contacts[0]->name)) { |
||
184 | $meeting->contact_id = $meeting_contacts[0]->id; |
||
185 | $meeting->contact_name = $meeting_contacts[0]->name; |
||
186 | } |
||
187 | } |
||
188 | if ($meeting->status != "Planned") { |
||
189 | $history_list[] = array('name' => $meeting->name, |
||
190 | 'id' => $meeting->id, |
||
191 | 'type' => "Meeting", |
||
192 | 'direction' => '', |
||
193 | 'module' => "Meetings", |
||
194 | 'status' => $meeting->status, |
||
195 | 'parent_id' => $meeting->parent_id, |
||
196 | 'parent_type' => $meeting->parent_type, |
||
197 | 'parent_name' => $meeting->parent_name, |
||
198 | 'contact_id' => $meeting->contact_id, |
||
199 | 'contact_name' => $meeting->contact_name, |
||
200 | 'date_modified' => $meeting->date_start, |
||
201 | 'description' => $this->formatDescription($meeting->description), |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
202 | 'date_type' => $app_strings['DATA_TYPE_START'], |
||
203 | 'sort_value' => $timedate->fromDb($meeting->fetched_row['date_start'])->ts, |
||
204 | ); |
||
205 | } else { |
||
206 | $open_activity_list[] = array('name' => $meeting->name, |
||
207 | 'id' => $meeting->id, |
||
208 | 'type' => "Meeting", |
||
209 | 'direction' => '', |
||
210 | 'module' => "Meetings", |
||
211 | 'status' => $meeting->status, |
||
212 | 'parent_id' => $meeting->parent_id, |
||
213 | 'parent_type' => $meeting->parent_type, |
||
214 | 'parent_name' => $meeting->parent_name, |
||
215 | 'contact_id' => $meeting->contact_id, |
||
216 | 'contact_name' => $meeting->contact_name, |
||
217 | 'date_due' => $meeting->date_start, |
||
218 | 'description' => $this->formatDescription($meeting->description), |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
219 | 'date_type' => $app_strings['DATA_TYPE_START'] |
||
220 | ); |
||
221 | } |
||
222 | } // end Meetings |
||
223 | |||
224 | foreach ($focus_calls_list as $call) { |
||
225 | |||
226 | if (empty($call->contact_id) && empty($call->contact_name)) { |
||
227 | $call_contacts = $call->get_linked_beans('contacts','Contact'); |
||
228 | if (!empty($call_contacts[0]->id) && !empty($call_contacts[0]->name)) { |
||
229 | $call->contact_id = $call_contacts[0]->id; |
||
230 | $call->contact_name = $call_contacts[0]->name; |
||
231 | } |
||
232 | } |
||
233 | |||
234 | if ($call->status != "Planned") { |
||
235 | $history_list[] = array('name' => $call->name, |
||
236 | 'id' => $call->id, |
||
237 | 'type' => "Call", |
||
238 | 'direction' => $call->direction, |
||
239 | 'module' => "Calls", |
||
240 | 'status' => $call->status, |
||
241 | 'parent_id' => $call->parent_id, |
||
242 | 'parent_type' => $call->parent_type, |
||
243 | 'parent_name' => $call->parent_name, |
||
244 | 'contact_id' => $call->contact_id, |
||
245 | 'contact_name' => $call->contact_name, |
||
246 | 'date_modified' => $call->date_start, |
||
247 | 'description' => $this->formatDescription($call->description), |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
248 | 'date_type' => $app_strings['DATA_TYPE_START'], |
||
249 | 'sort_value' => $timedate->fromDb($call->fetched_row['date_start'])->ts, |
||
250 | ); |
||
251 | } else { |
||
252 | $open_activity_list[] = array('name' => $call->name, |
||
253 | 'id' => $call->id, |
||
254 | 'direction' => $call->direction, |
||
255 | 'type' => "Call", |
||
256 | 'module' => "Calls", |
||
257 | 'status' => $call->status, |
||
258 | 'parent_id' => $call->parent_id, |
||
259 | 'parent_type' => $call->parent_type, |
||
260 | 'parent_name' => $call->parent_name, |
||
261 | 'contact_id' => $call->contact_id, |
||
262 | 'contact_name' => $call->contact_name, |
||
263 | 'date_due' => $call->date_start, |
||
264 | 'description' => $this->formatDescription($call->description), |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
265 | 'date_type' => $app_strings['DATA_TYPE_START'] |
||
266 | ); |
||
267 | } |
||
268 | } // end Calls |
||
269 | |||
270 | foreach ($focus_emails_list as $email) { |
||
271 | |||
272 | if (empty($email->contact_id) && empty($email->contact_name)) { |
||
273 | $email_contacts = $email->get_linked_beans('contacts','Contact'); |
||
274 | if (!empty($email_contacts[0]->id) && !empty($email_contacts[0]->name)) { |
||
275 | $email->contact_id = $email_contacts[0]->id; |
||
276 | $email->contact_name = $email_contacts[0]->name; |
||
277 | } |
||
278 | } |
||
279 | $ts = ''; |
||
280 | if(!empty($email->fetched_row['date_sent'])) { |
||
281 | //emails can have an empty date sent field |
||
282 | $ts = $timedate->fromDb($email->fetched_row['date_sent'])->ts; |
||
283 | } |
||
284 | $history_list[] = array('name' => $email->name, |
||
285 | 'id' => $email->id, |
||
286 | 'type' => "Email", |
||
287 | 'direction' => '', |
||
288 | 'module' => "Emails", |
||
289 | 'status' => '', |
||
290 | 'parent_id' => $email->parent_id, |
||
291 | 'parent_type' => $email->parent_type, |
||
292 | 'parent_name' => $email->parent_name, |
||
293 | 'contact_id' => $email->contact_id, |
||
294 | 'contact_name' => $email->contact_name, |
||
295 | 'date_modified' => $email->date_start." ".$email->time_start, |
||
296 | 'description' => $this->getEmailDetails($email), |
||
0 ignored issues
–
show
The method
getEmailDetails() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
297 | 'date_type' => $app_strings['DATA_TYPE_SENT'], |
||
298 | 'sort_value' => $ts, |
||
299 | ); |
||
300 | } //end Emails |
||
301 | |||
302 | // Bug 46439 'No email archived when clicking on View Summary' (All condition) |
||
303 | if (method_exists($focus,'get_unlinked_email_query')) |
||
304 | { |
||
305 | $queryArray = $focus->get_unlinked_email_query(array('return_as_array'=>'true')); |
||
306 | $query = $queryArray['select']; |
||
307 | $query .= $queryArray['from']; |
||
308 | if (!empty($queryArray['join_tables'])) |
||
309 | { |
||
310 | foreach ($queryArray['join_tables'] as $join_table) |
||
311 | { |
||
312 | if ($join_table != '') |
||
313 | { |
||
314 | $query .= ', '.$join_table.' '; |
||
315 | } |
||
316 | } |
||
317 | } |
||
318 | $query .= $queryArray['join']; |
||
319 | $query .= $queryArray['where']; |
||
320 | $emails = new Email(); |
||
321 | $focus_unlinked_emails_list = $emails->process_list_query($query, 0); |
||
322 | $focus_unlinked_emails_list = $focus_unlinked_emails_list['list']; |
||
323 | foreach ($focus_unlinked_emails_list as $email) |
||
324 | { |
||
325 | $email->retrieve($email->id); |
||
326 | $history_list[] = array( |
||
327 | 'name' => $email->name, |
||
328 | 'id' => $email->id, |
||
329 | 'type' => "Email", |
||
330 | 'direction' => '', |
||
331 | 'module' => "Emails", |
||
332 | 'status' => '', |
||
333 | 'parent_id' => $email->parent_id, |
||
334 | 'parent_type' => $email->parent_type, |
||
335 | 'parent_name' => $email->parent_name, |
||
336 | 'contact_id' => $email->contact_id, |
||
337 | 'contact_name' => $email->contact_name, |
||
338 | 'date_modified' => $email->date_start." ".$email->time_start, |
||
339 | 'description' => $this->getEmailDetails($email), |
||
0 ignored issues
–
show
The method
getEmailDetails() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
340 | 'date_type' => $app_strings['DATA_TYPE_SENT'], |
||
341 | 'sort_value' => strtotime($email->fetched_row['date_sent'].' GMT'), |
||
342 | ); |
||
343 | } |
||
344 | } //end Unlinked Emails |
||
345 | |||
346 | foreach ($focus_notes_list as $note) |
||
347 | { |
||
348 | if ($note->ACLAccess('view')) |
||
349 | { |
||
350 | $history_list[] = array('name' => $note->name, |
||
351 | 'id' => $note->id, |
||
352 | 'type' => "Note", |
||
353 | 'direction' => '', |
||
354 | 'module' => "Notes", |
||
355 | 'status' => '', |
||
356 | 'parent_id' => $note->parent_id, |
||
357 | 'parent_type' => $note->parent_type, |
||
358 | 'parent_name' => $note->parent_name, |
||
359 | 'contact_id' => $note->contact_id, |
||
360 | 'contact_name' => $note->contact_name, |
||
361 | 'date_modified' => $note->date_modified, |
||
362 | 'description' => $this->formatDescription($note->description), |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
363 | 'date_type' => $app_strings['DATA_TYPE_MODIFIED'], |
||
364 | 'sort_value' => strtotime($note->fetched_row['date_modified'].' GMT'), |
||
365 | ); |
||
366 | if(!empty($note->filename)) |
||
367 | { |
||
368 | $count = count($history_list); |
||
369 | $count--; |
||
370 | $history_list[$count]['filename'] = $note->filename; |
||
371 | $history_list[$count]['fileurl'] = UploadFile::get_url($note->filename,$note->id); |
||
0 ignored issues
–
show
|
|||
372 | } |
||
373 | } |
||
374 | |||
375 | } // end Notes |
||
376 | |||
377 | $xtpl=new XTemplate ('modules/Activities/Popup_picker.html'); |
||
378 | |||
379 | $xtpl->assign('MOD', $mod_strings); |
||
380 | $xtpl->assign('APP', $app_strings); |
||
381 | insert_popup_header(); |
||
382 | |||
383 | //output header |
||
384 | echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><td>"; |
||
385 | echo getClassicModuleTitle($focus->module_dir, array(translate('LBL_MODULE_NAME', $focus->module_dir),$focus->name), false); |
||
386 | echo "</td><td align='right' class='moduleTitle'>"; |
||
387 | echo "<A href='javascript:print();' class='utilsLink'>" . SugarThemeRegistry::current()->getImage('print', "border='0' align='absmiddle'", 13, 13, ".gif", $app_strings['LNK_PRINT']) . "</a> <A href='javascript:print();' class='utilsLink'>".$app_strings['LNK_PRINT']."</A>\n"; |
||
388 | echo "</td></tr></table>"; |
||
389 | |||
390 | $oddRow = true; |
||
391 | if (count($history_list) > 0) $history_list = array_csort($history_list, 'sort_value', SORT_DESC); |
||
392 | foreach($history_list as $activity) |
||
393 | { |
||
394 | $activity_fields = array( |
||
395 | 'ID' => $activity['id'], |
||
396 | 'NAME' => $activity['name'], |
||
397 | 'MODULE' => $activity['module'], |
||
398 | 'CONTACT_NAME' => $activity['contact_name'], |
||
399 | 'CONTACT_ID' => $activity['contact_id'], |
||
400 | 'PARENT_TYPE' => $activity['parent_type'], |
||
401 | 'PARENT_NAME' => $activity['parent_name'], |
||
402 | 'PARENT_ID' => $activity['parent_id'], |
||
403 | 'DATE' => $activity['date_modified'], |
||
404 | 'DESCRIPTION' => $activity['description'], |
||
405 | 'DATE_TYPE' => $activity['date_type'] |
||
406 | ); |
||
407 | if (empty($activity['direction'])) { |
||
408 | $activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']]; |
||
409 | } |
||
410 | else { |
||
411 | $activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']]; |
||
412 | } |
||
413 | |||
414 | switch ($activity['type']) { |
||
415 | case 'Call': |
||
416 | $activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']]; |
||
417 | break; |
||
418 | case 'Meeting': |
||
419 | $activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']]; |
||
420 | break; |
||
421 | case 'Task': |
||
422 | $activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']]; |
||
423 | break; |
||
424 | } |
||
425 | |||
426 | if (isset($activity['location'])) $activity_fields['LOCATION'] = $activity['location']; |
||
427 | if (isset($activity['filename'])) { |
||
428 | $activity_fields['ATTACHMENT'] = "<a href='index.php?entryPoint=download&id=".$activity['id']."&type=Notes' target='_blank'>".SugarThemeRegistry::current()->getImage("attachment","border='0' align='absmiddle'",null,null,'.gif',$activity['filename'])."</a>"; |
||
429 | } |
||
430 | |||
431 | if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type']; |
||
432 | |||
433 | $xtpl->assign("ACTIVITY", $activity_fields); |
||
434 | $xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0"', null,null,'.gif',$activity_fields['NAME'])); |
||
435 | |||
436 | if($oddRow) |
||
437 | { |
||
438 | //todo move to themes |
||
439 | $xtpl->assign("ROW_COLOR", 'oddListRow'); |
||
440 | $xtpl->assign("BG_COLOR", $odd_bg); |
||
441 | } |
||
442 | else |
||
443 | { |
||
444 | //todo move to themes |
||
445 | $xtpl->assign("ROW_COLOR", 'evenListRow'); |
||
446 | $xtpl->assign("BG_COLOR", $even_bg); |
||
447 | } |
||
448 | $oddRow = !$oddRow; |
||
449 | if(!empty($activity_fields['DESCRIPTION'])) { |
||
450 | $xtpl->parse("history.row.description"); |
||
451 | } |
||
452 | $xtpl->parse("history.row"); |
||
453 | // Put the rows in. |
||
454 | } |
||
455 | $xtpl->parse("history"); |
||
456 | $xtpl->out("history"); |
||
457 | insert_popup_footer(); |
||
458 | } |
||
459 | |||
460 | function getEmailDetails($email){ |
||
461 | $details = ""; |
||
462 | |||
463 | if(!empty($email->to_addrs)){ |
||
464 | $details .= "To: ".$email->to_addrs."<br>"; |
||
465 | } |
||
466 | if(!empty($email->from_addr)){ |
||
467 | $details .= "From: ".$email->from_addr."<br>"; |
||
468 | } |
||
469 | if(!empty($email->cc_addrs)){ |
||
470 | $details .= "CC: ".$email->cc_addrs."<br>"; |
||
471 | } |
||
472 | if(!empty($email->from_addr) || !empty($email->cc_addrs) || !empty($email->to_addrs)){ |
||
473 | $details .= "<br>"; |
||
474 | } |
||
475 | |||
476 | // cn: bug 8433 - history does not distinguish b/t text/html emails |
||
477 | $details .= empty($email->description_html) |
||
478 | ? $this->formatDescription($email->description) |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
479 | : $this->formatDescription(strip_tags(br2nl(from_html($email->description_html)))); |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
480 | |||
481 | return $details; |
||
482 | } |
||
483 | |||
484 | function getTaskDetails($task){ |
||
485 | global $app_strings; |
||
486 | |||
487 | $details = ""; |
||
488 | if (!empty($task->date_start) && $task->date_start != '0000-00-00') { |
||
489 | $details .= $app_strings['DATA_TYPE_START'].$task->date_start."<br>"; |
||
490 | $details .= "<br>"; |
||
491 | } |
||
492 | $details .= $this->formatDescription($task->description); |
||
0 ignored issues
–
show
The method
formatDescription() does not seem to exist on object<Popup_Picker> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||
493 | |||
494 | return $details; |
||
495 | } |
||
496 | |||
497 | function formatDescription($description){ |
||
498 | return nl2br($description); |
||
499 | } |
||
500 | } // end of class Popup_Picker |
||
501 | ?> |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.