= '$today' AND date_start < '$later') OR (date_start < '$today')) OR (recurringevents.recurringdate between '$today' and '$later') ) AND salesmanactivityrel.smid ='{$current_user->id}'"; //$list_query = getListQuery("Activities",$where); //echo $list_query."

END

"; $list_result = $adb->limitQuery($list_query,0,5); $open_activity_list = array(); $noofrows = $adb->num_rows($list_result); if (count($list_result)>0) for($i=0;$i<$noofrows;$i++) { $parent_name=getRelatedTo("Activities",$list_result,$i); $open_activity_list[] = Array('name' => $adb->query_result($list_result,$i,'subject'), 'id' => $adb->query_result($list_result,$i,'activityid'), 'type' => $adb->query_result($list_result,$i,'activitytype'), 'module' => $adb->query_result($list_result,$i,'setype'), 'status' => $adb->query_result($list_result,$i,'status'), 'firstname' => $adb->query_result($list_result,$i,'firstname'), 'lastname' => $adb->query_result($list_result,$i,'lastname'), 'accountname' => $adb->query_result($list_result,$i,'accountname'), 'accountid' => $adb->query_result($list_result, $i, 'accountid'), 'contactid' => $adb->query_result($list_result,$i,'contactid'), 'date_start' => getDisplayDate($adb->query_result($list_result,$i,'date_start')), 'due_date' => getDisplayDate($adb->query_result($list_result,$i,'due_date')), 'recurringtype' => getDisplayDate($adb->query_result($list_result,$i,'recurringtype')), 'recurringdate' => getDisplayDate($adb->query_result($list_result,$i,'recurringdate')), 'parent'=> $parent_name, ); } $xtpl=new XTemplate ('modules/Activities/OpenListView.html'); $xtpl->assign("MOD", $current_module_strings); $xtpl->assign("APP", $app_strings); // Stick the form header out there. $later_day = getDisplayDate(date("Y-m-d", strtotime("$today + 7 days"))); echo get_form_header($current_module_strings['LBL_UPCOMING'], "
".$current_module_strings['LBL_TODAY'].$later_day."
", false); $xtpl->assign("IMAGE_PATH", $image_path); $xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=" . ((is_object($focus)) ? $focus->id : "")); $oddRow = true; #if (count($open_activity_list) > 0) $open_activity_list = array_csort($open_activity_list, 'date_start', 'time_start', SORT_ASC); foreach($open_activity_list as $event) { $recur_date=ereg_replace('--','',$event['recurringdate']); if($recur_date!="") $event['date_start']=$event['recurringdate']; $activity_fields = array( 'ID' => $event['id'], 'CONTACT_ID' => $event['contactid'], 'NAME' => $event['name'], 'TYPE' => $event['type'], 'MODULE' => $event['module'], 'STATUS' => $event['status'], 'CONTACT_NAME' => $event['firstname'].' '.$event['lastname'], 'ACCOUNT_NAME' => $event['accountname'], 'TIME' => $event['date_start'], 'RECURRINGTYPE' => ereg_replace('--','',$event['recurringtype']), 'DUEDATE' => ereg_replace('--','',$event['due_date']), 'RECURRINGDATE' => ereg_replace('--','',$event['recurringdate']), 'PARENT_NAME' => $event['parent'], ); $end_date=$event['due_date']; //included for getting the OverDue Activities in the Upcoming Activities $start_date=$event['date_start']; switch ($event['type']) { case 'Call': $activity_fields['SET_COMPLETE'] = "X"; break; case 'Meeting': $activity_fields['SET_COMPLETE'] = "X"; case 'Task': $activity_fields['SET_COMPLETE'] = "X"; break; } if($event['type'] == 'Call' || $event['type'] == 'Meeting') $activity_fields['MODE'] = 'Events'; else $activity_fields['MODE'] = 'Task'; $xtpl->assign("ACTIVITY", $activity_fields); //Code included for showing Overdue Activities in Upcoming Activities -Jaguar $end_date=getDBInsertDateValue($end_date); if($end_date== '0000-00-00' OR $end_date =="") { $end_date=$start_date; } if($recur_date!="") { $recur_date=getDBInsertDateValue($recur_date); $end=explode("-",$recur_date); } else { $end=explode("-",$end_date); } $current_date=date("Y-m-d",mktime(date("m"),date("d"),date("Y"))); $curr=explode("-",$current_date); $date_diff= mktime(0,0,0,date("$curr[1]"),date("$curr[2]"),date("$curr[0]")) - mktime(0,0,0,date("$end[1]"),date("$end[2]"),date("$end[0]")); if($date_diff>0) { $x="pending"; } else { if($oddRow) { $x="oddListRow"; } else { $x="evenListRow"; } } // Code by Jaguar Ends if($oddRow) { //todo move to themes $xtpl->assign("ROW_COLOR", $x); //$xtpl->assign("ROW_COLOR", 'oddListRow'); } else { //todo move to themes $xtpl->assign("ROW_COLOR", $x); //$xtpl->assign("ROW_COLOR", 'evenListRow'); } $oddRow = !$oddRow; $xtpl->parse("open_activity.row"); // Put the rows in. } $xtpl->parse("open_activity"); if (count($open_activity_list)>0) $xtpl->out("open_activity"); else echo "".$current_module_strings['NTC_NONE_SCHEDULED'].""; echo "
"; // Stick on the form footer echo get_form_footer(); ?>