status != "Not Started" && $task->status != "In Progress" && $task->status != "Pending Input") { $history_list[] = Array('name' => $task->name, 'id' => $task->id, 'type' => "Task", 'module' => "Activities", 'status' => $task->status, 'parent_id' => $task->parent_id, 'parent_type' => $task->parent_type, 'parent_name' => $task->parent_name, 'contact_id' => $task->contact_id, 'contact_name' => $task->contact_name, 'date_modified' => $task->date_modified ); } else { if ($task->date_due == '0000-00-00') $date_due = ''; else $date_due = $task->date_due; $open_activity_list[] = Array('name' => $task->name, 'id' => $task->id, 'type' => "Task", 'module' => "Activities", 'status' => $task->status, 'parent_id' => $task->parent_id, 'parent_type' => $task->parent_type, 'parent_name' => $task->parent_name, 'contact_id' => $task->contact_id, 'contact_name' => $task->contact_name, 'date_due' => $date_due ); } } foreach ($focus_meetings_list as $meeting) { if ($meeting->status != "Planned") { $history_list[] = Array('name' => $meeting->name, 'id' => $meeting->id, 'type' => "Meeting", 'module' => "Meetings", 'status' => $meeting->status, 'parent_id' => $meeting->parent_id, 'parent_type' => $meeting->parent_type, 'parent_name' => $meeting->parent_name, 'contact_id' => $meeting->contact_id, 'contact_name' => $meeting->contact_name, 'date_modified' => $meeting->date_modified ); } else { $open_activity_list[] = Array('name' => $meeting->name, 'id' => $meeting->id, 'type' => "Meeting", 'module' => "Meetings", 'status' => $meeting->status, 'parent_id' => $meeting->parent_id, 'parent_type' => $meeting->parent_type, 'parent_name' => $meeting->parent_name, 'contact_id' => $meeting->contact_id, 'contact_name' => $meeting->contact_name, 'date_due' => $meeting->date_start ); } } foreach ($focus_calls_list as $call) { if ($call->status != "Planned") { $history_list[] = Array('name' => $call->name, 'id' => $call->id, 'type' => "Call", 'module' => "Calls", 'status' => $call->status, 'parent_id' => $call->parent_id, 'parent_type' => $call->parent_type, 'parent_name' => $call->parent_name, 'contact_id' => $call->contact_id, 'contact_name' => $call->contact_name, 'date_modified' => $call->date_modified ); } else { $open_activity_list[] = Array('name' => $call->name, 'id' => $call->id, 'type' => "Call", 'module' => "Calls", 'status' => $call->status, 'parent_id' => $call->parent_id, 'parent_type' => $call->parent_type, 'parent_name' => $call->parent_name, 'contact_id' => $call->contact_id, 'contact_name' => $call->contact_name, 'date_due' => $call->date_start ); } } foreach ($focus_emails_list as $email) { $history_list[] = Array('name' => $email->name, 'id' => $email->id, 'type' => "Email", 'module' => "Emails", 'status' => '', 'parent_id' => $email->parent_id, 'parent_type' => $email->parent_type, 'parent_name' => $email->parent_name, 'contact_id' => $email->contact_id, 'contact_name' => $email->contact_name, 'date_modified' => $email->date_modified ); } foreach ($focus_notes_list as $note) { $history_list[] = Array('name' => $note->name, 'id' => $note->id, 'type' => "Note", 'module' => "Notes", 'status' => '', 'parent_id' => $note->parent_id, 'parent_type' => $note->parent_type, 'parent_name' => $note->parent_name, 'contact_id' => $note->contact_id, 'contact_name' => $note->contact_name, 'date_modified' => $note->date_modified ); } if ($currentModule == 'Contacts' || $currentModule == 'Leads') { $xtpl=new XTemplate ('modules/Activities/SubPanelViewContacts.html'); $xtpl->assign("CONTACT_ID", $focus->id); } else $xtpl=new XTemplate ('modules/Activities/SubPanelView.html'); $xtpl->assign("MOD", $current_module_strings); $xtpl->assign("APP", $app_strings); $button = "\n"; $button .= "\n"; if ($currentModule == 'Accounts') $button .= "\n\n\n"; if ($currentModule == 'Opportunities') $button .= "\n\n\n"; if ($currentModule == 'Cases') $button .= "\n\n\n"; if ($currentModule == 'Contacts') { $button .= "\n\n"; $button .= "\n\n\n"; } if ($currentModule == 'Leads') { $button .= "\n\n"; $button .= "\n\n"; } $button .= "\n"; $button .= "\n"; $button .= "\n"; $button .= "\n"; $button .= ""; $button .= "\n"; $button .= "\n"; $button .= "\n"; $button .= "
 
\n"; // Stick the form header out there. echo get_form_header($current_module_strings['LBL_OPEN_ACTIVITIES'], $button, false); $xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id"); $oddRow = true; if (count($open_activity_list) > 0) $open_activity_list = array_csort($open_activity_list, 'date_due', SORT_DESC); foreach($open_activity_list as $activity) { $activity_fields = array( 'ID' => $activity['id'], 'NAME' => $activity['name'], 'TYPE' => $activity['type'], 'MODULE' => $activity['module'], 'STATUS' => $activity['status'], 'CONTACT_NAME' => $activity['contact_name'], 'CONTACT_ID' => $activity['contact_id'], 'PARENT_TYPE' => $activity['parent_type'], 'PARENT_NAME' => $activity['parent_name'], 'PARENT_ID' => $activity['parent_id'], 'DATE' => $activity['date_due'] ); if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $app_list_strings['record_type_module'][$activity['parent_type']]; switch ($activity['type']) { case 'Call': $activity_fields['SET_COMPLETE'] = "X"; break; case 'Meeting': $activity_fields['SET_COMPLETE'] = "X"; break; case 'Task': $activity_fields['SET_COMPLETE'] = "X"; break; } $xtpl->assign("ACTIVITY", $activity_fields); if($oddRow) { //todo move to themes $xtpl->assign("ROW_COLOR", 'oddListRow'); } else { //todo move to themes $xtpl->assign("ROW_COLOR", 'evenListRow'); } $oddRow = !$oddRow; $xtpl->parse("open_activity.row"); // Put the rows in. } $xtpl->parse("open_activity"); $xtpl->out("open_activity"); echo "
"; // Stick on the form footer echo get_form_footer(); $button = "\n"; $button .= "\n"; if ($currentModule == 'Accounts') $button .= "\n\n\n"; if ($currentModule == 'Opportunities') $button .= "\n\n\n"; if ($currentModule == 'Cases') $button .= "\n\n\n"; if ($currentModule == 'Contacts') { $button .= "\n\n"; $button .= "\n\n\n"; } if ($currentModule == 'Leads') { $button .= "\n\n"; $button .= "\n\n"; } $button .= "\n"; $button .= "\n"; $button .= "\n"; $button .= "\n"; $button .= ""; $button .= "\n"; $button .= "\n"; $button .= "
 
\n"; // Stick the form header out there. echo get_form_header($current_module_strings['LBL_HISTORY'], $button, false); $xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id"); $oddRow = true; if (count($history_list) > 0) $history_list = array_csort($history_list, 'date_modified', SORT_DESC); foreach($history_list as $activity) { $activity_fields = array( 'ID' => $activity['id'], 'NAME' => $activity['name'], 'TYPE' => $activity['type'], 'MODULE' => $activity['module'], 'CONTACT_NAME' => $activity['contact_name'], 'CONTACT_ID' => $activity['contact_id'], 'PARENT_TYPE' => $activity['parent_type'], 'PARENT_NAME' => $activity['parent_name'], 'PARENT_ID' => $activity['parent_id'], 'DATE' => substr($activity['date_modified'], 0, 16) ); if (isset($activity['status'])) $activity_fields['STATUS'] = $activity['status']; if (isset($activity['location'])) $activity_fields['LOCATION'] = $activity['location']; if (isset($activity['parent_type'])) $activity_fields['PARENT_MODULE'] = $app_list_strings['record_type_module'][$activity['parent_type']]; $xtpl->assign("ACTIVITY", $activity_fields); if($oddRow) { //todo move to themes $xtpl->assign("ROW_COLOR", 'oddListRow'); } else { //todo move to themes $xtpl->assign("ROW_COLOR", 'evenListRow'); } $oddRow = !$oddRow; $xtpl->parse("history.row"); // Put the rows in. } $xtpl->parse("history"); $xtpl->out("history"); require_once('modules/uploads/binaryfilelist.php'); echo '

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'.$current_module_strings['LBL_ATTACHMENTS'].'
  
'; echo getAttachmentsList($focus->id, $theme,$currentModule,''); // Stick on the form footer echo get_form_footer(); ?>