Esempio n. 1
0
}
if (!isset($_GET['m'])) {
    $_GET['m'] = date('m');
}
if (!isset($_GET['d'])) {
    $_GET['d'] = date('d');
}
if ($loggedin_user->hasRight('admin') && isset($_REQUEST['user_id'])) {
    $user_id = $_REQUEST['user_id'];
} else {
    $user_id = $loggedin_user->id;
}
// Instantiate the Month class
$month = new Month($_GET['y'], $_GET['m'], "Sunday");
// Get the details of the months as timestamps
$last = $month->lastMonth(true);
$next = $month->nextMonth(true);
$thisMonth = $month->thisMonth(true);
// Get the task data
$task = new SI_Task();
$tasks = $task->getCalendarTasks($user_id, $thisMonth, $next, 'day');
if ($tasks === FALSE) {
    $error_msg .= "Could not retrieve Tasks!\n";
    debug_message($task->getLastError());
}
// Get the activity data
$ta = new SI_TaskActivity();
$activities = $ta->getCalendarActivities($user_id, $thisMonth, $next, 'day');
if ($activities === FALSE) {
    $error_msg .= "Could not retrieve activities!\n";
    debug_message($ta->getLastError());