]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Activities/SubPanelView.php
Release 6.4.0
[Github/sugarcrm.git] / modules / Activities / SubPanelView.php
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-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38 /*********************************************************************************
39
40  * Description:  TODO: To be written.
41  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
42  * All Rights Reserved.
43  * Contributor(s): ______________________________________..
44  ********************************************************************************/
45
46
47
48 require_once("include/upload_file.php");
49
50 global $currentModule;
51
52 global $theme;
53 global $focus;
54 global $action;
55
56 global $app_strings;
57 global $app_list_strings;
58 //we don't want the parent module's string file, but rather the string file specifc to this subpanel
59 global $current_language;
60 $current_module_strings = return_module_language($current_language, 'Activities');
61 global $timedate;
62
63
64
65 // history_list is the means of passing data to a SubPanelView.
66 global $focus_tasks_list;
67 global $focus_meetings_list;
68 global $focus_calls_list;
69 global $focus_emails_list;
70
71 $open_activity_list = Array();
72 $history_list = Array();
73
74 foreach ($focus_tasks_list as $task) {
75         if ($task->status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") {
76                 $history_list[] = Array('name' => $task->name,
77                                                                          'id' => $task->id,
78                                                                          'type' => "Task",
79                                                                          'direction' => '',
80                                                                          'module' => "Tasks",
81                                                                          'status' => $task->status,
82                                                                          'parent_id' => $task->parent_id,
83                                                                          'parent_type' => $task->parent_type,
84                                                                          'parent_name' => $task->parent_name,
85                                                                          'contact_id' => $task->contact_id,
86                                                                          'contact_name' => $task->contact_name,
87                                                                          'date_modified' => $timedate->to_display_date($task->date_modified, true),
88                                                                          );
89         }
90         else {
91                 if ($task->date_due == '0000-00-00') $date_due = '';
92                 else {
93                         $date_due = $task->date_due;
94
95                 }
96                 $open_activity_list[] = Array('name' => $task->name,
97                                                                          'id' => $task->id,
98                                                                          'type' => "Task",
99                                                                          'direction' => '',
100                                                                          'module' => "Tasks",
101                                                                          'status' => $task->status,
102                                                                          'parent_id' => $task->parent_id,
103                                                                          'parent_type' => $task->parent_type,
104                                                                          'parent_name' => $task->parent_name,
105                                                                          'contact_id' => $task->contact_id,
106                                                                          'contact_name' => $task->contact_name,
107                                                                          'date_due' => $date_due
108                                                                          );
109         }
110 }
111
112 foreach ($focus_meetings_list as $meeting) {
113                 if ($meeting->status != "Planned") {
114                 $history_list[] = Array('name' => $meeting->name,
115                                                                          'id' => $meeting->id,
116                                                                          'type' => "Meeting",
117                                                                          'direction' => '',
118                                                                          'module' => "Meetings",
119                                                                          'status' => $meeting->status,
120                                                                          'parent_id' => $meeting->parent_id,
121                                                                          'parent_type' => $meeting->parent_type,
122                                                                          'parent_name' => $meeting->parent_name,
123                                                                          'contact_id' => $meeting->contact_id,
124                                                                          'contact_name' => $meeting->contact_name,
125                                                                          'date_modified' => $meeting->date_modified
126                                                                          );
127         }
128         else {
129                 $open_activity_list[] = Array('name' => $meeting->name,
130                                                                          'id' => $meeting->id,
131                                                                          'type' => "Meeting",
132                                                                          'direction' => '',
133                                                                          'module' => "Meetings",
134                                                                          'status' => $meeting->status,
135                                                                          'parent_id' => $meeting->parent_id,
136                                                                          'parent_type' => $meeting->parent_type,
137                                                                          'parent_name' => $meeting->parent_name,
138                                                                          'contact_id' => $meeting->contact_id,
139                                                                          'contact_name' => $meeting->contact_name,
140                                                                          'date_due' => $meeting->date_start
141                                                                          );
142         }
143 }
144
145 foreach ($focus_calls_list as $call) {
146         if ($call->status != "Planned") {
147                 $history_list[] = Array('name' => $call->name,
148                                                                          'id' => $call->id,
149                                                                          'type' => "Call",
150                                                                          'direction' => $call->direction,
151                                                                          'module' => "Calls",
152                                                                          'status' => $call->status,
153                                                                          'parent_id' => $call->parent_id,
154                                                                          'parent_type' => $call->parent_type,
155                                                                          'parent_name' => $call->parent_name,
156                                                                          'contact_id' => $call->contact_id,
157                                                                          'contact_name' => $call->contact_name,
158                                                                          'date_modified' => $call->date_modified
159                                                                          );
160         }
161         else {
162                 $open_activity_list[] = Array('name' => $call->name,
163                                                                          'id' => $call->id,
164                                                                          'direction' => $call->direction,
165                                                                          'type' => "Call",
166                                                                          'module' => "Calls",
167                                                                          'status' => $call->status,
168                                                                          'parent_id' => $call->parent_id,
169                                                                          'parent_type' => $call->parent_type,
170                                                                          'parent_name' => $call->parent_name,
171                                                                          'contact_id' => $call->contact_id,
172                                                                          'contact_name' => $call->contact_name,
173                                                                          'date_due' => $call->date_start
174                                                                          );
175         }
176 }
177
178 foreach ($focus_emails_list as $email) {
179         $history_list[] = Array('name' => $email->name,
180                                                                          'id' => $email->id,
181                                                                          'type' => "Email",
182                                                                          'direction' => '',
183                                                                          'module' => "Emails",
184                                                                          'status' => '',
185                                                                          'parent_id' => $email->parent_id,
186                                                                          'parent_type' => $email->parent_type,
187                                                                          'parent_name' => $email->parent_name,
188                                                                          'contact_id' => $email->contact_id,
189                                                                          'contact_name' => $email->contact_name,
190                                                                          'date_modified' => $email->date_start." ".$email->time_start
191                                                                          );
192 }
193
194 foreach ($focus_notes_list as $note) {
195         $history_list[] = Array('name' => $note->name,
196                                                                          'id' => $note->id,
197                                                                          'type' => "Note",
198                                                                          'direction' => '',
199                                                                          'module' => "Notes",
200                                                                          'status' => '',
201                                                                          'parent_id' => $note->parent_id,
202                                                                          'parent_type' => $note->parent_type,
203                                                                          'parent_name' => $note->parent_name,
204                                                                          'contact_id' => $note->contact_id,
205                                                                          'contact_name' => $note->contact_name,
206                                                                          'date_modified' => $note->date_modified
207                                                                          );
208         if (!empty($note->filename))
209         {
210                 $count = count($history_list);
211                 $count--;
212                 $history_list[$count]['filename'] = $note->filename;
213                 $history_list[$count]['fileurl'] = UploadFile::get_upload_url($note);
214         }
215
216 }
217
218 if ($currentModule == 'Contacts')
219 {
220         $xtpl=new XTemplate ('modules/Activities/SubPanelViewContacts.html');
221         $xtpl->assign("CONTACT_ID", $focus->id);
222 }
223 else
224 {
225         $xtpl=new XTemplate ('modules/Activities/SubPanelView.html');
226 }
227
228 $xtpl->assign("DELETE_INLINE_PNG",  SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"', null,null,'.gif',$app_strings['LNK_DELETE']));
229 $xtpl->assign("EDIT_INLINE_PNG",  SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"', null,null,'.gif',$app_strings['LNK_EDIT']));
230
231 $xtpl->assign("MOD", $current_module_strings);
232 $xtpl->assign("APP", $app_strings);
233
234 $button  = "<form border='0' action='index.php' method='post' name='form' id='form'>\n";
235 $button .= "<input type='hidden' name='module'>\n";
236 $button .= "<input type='hidden' name='type'>\n";
237 if ($currentModule == 'Accounts')
238 {
239         $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
240 }
241 elseif ($currentModule == 'Opportunities')
242 {
243         $button .= "<input type='hidden' name='parent_type' value='Opportunities'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
244 }
245 elseif ($currentModule == 'Cases')
246 {
247         $button .= "<input type='hidden' name='parent_type' value='Cases'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
248 }
249 elseif ($currentModule == 'Contacts')
250 {
251         $button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n<input type='hidden' name='contact_name' value='$focus->first_name $focus->last_name'>\n";
252         $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->account_id'>\n<input type='hidden' name='parent_name' value='$focus->account_name'>\n";
253         $button .= "<input type='hidden' name='to_email_addrs' value='$focus->email1'>\n";
254 }
255 else
256 {
257         $button .= "<input type='hidden' name='parent_type' value='$currentModule'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
258 }
259
260 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
261 $button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
262 $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
263 $button .= "<input type='hidden' name='type' value='out'>\n";
264 $button .= "<input type='hidden' name='action'>\n";
265
266 if($currentModule != 'Project' && $currentModule != 'ProjectTask')
267 {
268         $button .= "<input title='".$current_module_strings['LBL_NEW_TASK_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_TASK_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Tasks'\" type='submit' name='button' value='".$current_module_strings['LBL_NEW_TASK_BUTTON_LABEL']."'>\n";
269 }
270
271 $button .= "<input title='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Meetings'\" type='submit' name='button' value='".$current_module_strings['LBL_SCHEDULE_MEETING_BUTTON_LABEL']."'>\n";
272
273 $button .= "<input title='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_LABEL']."' accessKey='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Calls'\" type='submit' name='button' value='".$current_module_strings['LBL_SCHEDULE_CALL_BUTTON_LABEL']."'>\n";
274
275 $button .= "<input title='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY']."' class='button' onclick=\"this.form.type.value='out';this.form.action.value='EditView';this.form.module.value='Emails';\" type='submit' name='button' value='".$app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL']."'>\n";
276
277 $button .= "</form>\n";
278
279 // Stick the form header out there.
280 echo get_form_header($current_module_strings['LBL_OPEN_ACTIVITIES'], $button, false);
281
282 $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
283
284 $oddRow = true;
285 if (count($open_activity_list) > 0) $open_activity_list = array_csort($open_activity_list, 'date_due', SORT_DESC);
286 foreach($open_activity_list as $activity)
287 {
288         $activity_fields = array(
289                 'ID' => $activity['id'],
290                 'NAME' => $activity['name'],
291                 'MODULE' => $activity['module'],
292                 'CONTACT_NAME' => $activity['contact_name'],
293                 'CONTACT_ID' => $activity['contact_id'],
294                 'PARENT_TYPE' => $activity['parent_type'],
295                 'PARENT_NAME' => $activity['parent_name'],
296                 'PARENT_ID' => $activity['parent_id'],
297                 'DATE' => $activity['date_due']
298         );
299
300         if (empty($activity['direction'])) {
301                 $activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
302         }
303         else {
304                 $activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']];
305         }
306         if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type'];
307         switch ($activity['type']) {
308                 case 'Call':
309                         $activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Calls&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'",null,null,'.gif',$mod_strings['LBL_LIST_CLOSE'])."</a>";
310                         $activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
311                         break;
312                 case 'Meeting':
313                         $activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Meetings&status=Held&record=".$activity['id']."&status=Held'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'", null,null,'.gif',$mod_strings['LBL_LIST_CLOSE'])."</a>";
314                         $activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
315                         break;
316                 case 'Task':
317                         $activity_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$focus->id&action=EditView&module=Tasks&status=Completed&record=".$activity['id']."&status=Completed'>".SugarThemeRegistry::current()->getImage("close_inline","title=".translate('LBL_LIST_CLOSE','Activities')." border='0'", null,null,'.gif',$mod_strings['LBL_LIST_CLOSE'])."</a>";
318                         $activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
319                         break;
320         }
321
322  global $odd_bg;
323  global $even_bg;
324  global $hilite_bg;
325  global $click_bg;
326 $xtpl->assign("BG_HILITE", $hilite_bg);
327 $xtpl->assign("BG_CLICK", $click_bg);
328 $xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0"', null,null,'.gif',$activity_fields['NAME']));
329         $xtpl->assign("ACTIVITY", $activity_fields);
330
331         if($oddRow)
332     {
333         //todo move to themes
334                 $xtpl->assign("ROW_COLOR", 'oddListRow');
335                 $xtpl->assign("BG_COLOR", $odd_bg);
336     }
337     else
338     {
339         //todo move to themes
340                 $xtpl->assign("ROW_COLOR", 'evenListRow');
341                 $xtpl->assign("BG_COLOR", $even_bg);
342     }
343     $oddRow = !$oddRow;
344
345         $xtpl->parse("open_activity.row");
346 // Put the rows in.
347 }
348
349 $xtpl->parse("open_activity");
350 $xtpl->out("open_activity");
351 echo "<BR>";
352
353
354 //requestdata
355 $popup_request_data = array(
356                 'call_back_function' => 'set_return',
357                 'form_name' => 'EditView',
358                 'field_to_name_array' => array(),
359                 );
360
361 $json = getJSONobj();
362 $encoded_popup_request_data = $json->encode($popup_request_data);
363
364 $button  = "<form border='0' action='index.php' method='post' name='form' id='form'>\n";
365 $button .= "<input type='hidden' name='module'>\n";
366 $button .= "<input type='hidden' name='type' value='archived'>\n";
367 if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
368 if ($currentModule == 'Opportunities') $button .= "<input type='hidden' name='parent_type' value='Opportunities'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
369 elseif ($currentModule == 'Cases') $button .= "<input type='hidden' name='parent_type' value='Cases'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
370 elseif ($currentModule == 'Contacts') {
371         $button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n<input type='hidden' name='contact_name' value='$focus->first_name $focus->last_name'>\n";
372   $button .= "<input type='hidden' name='to_email_addrs' value='$focus->email1'>\n";
373         $button .= "<input type='hidden' name='parent_type' value='Accounts'>\n<input type='hidden' name='parent_id' value='$focus->account_id'>\n<input type='hidden' name='parent_name' value='$focus->account_name'>\n";
374 }else{
375         $button .= "<input type='hidden' name='parent_type' value='$currentModule'>\n<input type='hidden' name='parent_id' value='$focus->id'>\n<input type='hidden' name='parent_name' value='$focus->name'>\n";
376 }
377 $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
378 $button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
379 $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
380 $button .= "<input type='hidden' name='action'>\n";
381 $button .= "<input title='".$current_module_strings['LBL_NEW_NOTE_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_NOTE_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView';this.form.module.value='Notes'\" type='submit' name='button' value='".$current_module_strings['LBL_NEW_NOTE_BUTTON_LABEL']."'>\n";
382 $button .= "<input title='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_KEY']."' class='button' onclick=\"this.form.type.value='archived';this.form.action.value='EditView';this.form.module.value='Emails'\" type='submit' name='button' value='".$current_module_strings['LBL_TRACK_EMAIL_BUTTON_LABEL']."'>\n";
383 $button .= "<input title='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_KEY']."' class='button' type='button' onclick='open_popup(\"Activities\", \"600\", \"400\", \"&record=$focus->id&module_name=$currentModule\", true, false, $encoded_popup_request_data);' name='button' value='".$current_module_strings['LBL_ACCUMULATED_HISTORY_BUTTON_LABEL']."'>\n";
384 $button .= "</form>\n";
385
386 // Stick the form header out there.
387 echo get_form_header($current_module_strings['LBL_HISTORY'], $button, false);
388
389 $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
390
391 $oddRow = true;
392 if (count($history_list) > 0) $history_list = array_csort($history_list, 'date_modified', SORT_DESC);
393 foreach($history_list as $activity)
394 {
395         $activity_fields = array(
396                 'ID' => $activity['id'],
397                 'NAME' => $activity['name'],
398                 'MODULE' => $activity['module'],
399                 'CONTACT_NAME' => $activity['contact_name'],
400                 'CONTACT_ID' => $activity['contact_id'],
401                 'PARENT_TYPE' => $activity['parent_type'],
402                 'PARENT_NAME' => $activity['parent_name'],
403                 'PARENT_ID' => $activity['parent_id'],
404                 'DATE' => $activity['date_modified'],
405         );
406         if (empty($activity['direction'])) {
407                 $activity_fields['TYPE'] = $app_list_strings['activity_dom'][$activity['type']];
408         }
409         else {
410                 $activity_fields['TYPE'] = $app_list_strings['call_direction_dom'][$activity['direction']].' '.$app_list_strings['activity_dom'][$activity['type']];
411         }
412
413         switch ($activity['type']) {
414                 case 'Call':
415                         $activity_fields['STATUS'] = $app_list_strings['call_status_dom'][$activity['status']];
416                         break;
417                 case 'Meeting':
418                         $activity_fields['STATUS'] = $app_list_strings['meeting_status_dom'][$activity['status']];
419                         break;
420                 case 'Task':
421                         $activity_fields['STATUS'] = $app_list_strings['task_status_dom'][$activity['status']];
422                         break;
423         }
424
425         if (isset($activity['location'])) $activity_fields['LOCATION'] = $activity['location'];
426         if (isset($activity['filename'])) {
427                 $activity_fields['ATTACHMENT'] = "<a href='".$activity['fileurl']."' target='_blank'>".SugarThemeRegistry::current()->getImage("attachment","border='0' align='absmiddle'",null,null,'.gif',$activity['filename'])."</a>";
428     }
429
430         if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $activity['parent_type'];
431
432         $xtpl->assign("ACTIVITY", $activity_fields);
433         $xtpl->assign("ACTIVITY_MODULE_PNG", SugarThemeRegistry::current()->getImage($activity_fields['MODULE'].'','border="0"', null,null,'.gif',$activity_fields['NAME']));
434
435         if($oddRow)
436     {
437         //todo move to themes
438                 $xtpl->assign("ROW_COLOR", 'oddListRow');
439                 $xtpl->assign("BG_COLOR", $odd_bg);
440     }
441     else
442     {
443         //todo move to themes
444                 $xtpl->assign("ROW_COLOR", 'evenListRow');
445                 $xtpl->assign("BG_COLOR", $even_bg);
446     }
447     $oddRow = !$oddRow;
448
449         $xtpl->parse("history.row");
450 // Put the rows in.
451 }
452
453 $xtpl->parse("history");
454 $xtpl->out("history");
455
456 ?>