Location: PHPKode > projects > O - OpenSource GroupWare > osgw/tasklist/view_task.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Author:	Ryan Thompson(hide@address.com)
***************************************************************************/
/*$Id: view_task.php,v 1.3 2003/12/09 21:56:07 rthomp Exp $*/

include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");
include($here. "/class.tasklist.php");
$tasks = new tasklist;

echo $layout->page_header;
echo $layout->service_header($text['service_name'], $tasks->nav_buttons(), $text['view_task']);

if(isset($_GET['s']))
{
	$sql = "SELECT o_users.username, o_tasklist.user_id, o_tasklist.* FROM o_tasklist 
		LEFT JOIN o_share ON o_share.share_item=o_tasklist.task_id
		LEFT JOIN o_users ON o_tasklist.user_id=o_users.user_id
		WHERE o_share.service='tl' AND o_share.user_id='{$user->user_id}' AND o_tasklist.task_id='{$_GET['tid']}'";
} else {
	$sql = "SELECT o_users.username, o_tasklist.* FROM o_tasklist 
		LEFT JOIN o_users ON  o_tasklist.user_id=o_users.user_id
		WHERE task_id='{$_GET['tid']}' AND o_tasklist.user_id='{$user->user_id}'";
}

$db->query($sql);

$db->fetch_results();
$task_data = $db->record;

$sql = "SELECT o_categories.category FROM o_categories 
	LEFT JOIN o_categorize ON o_categorize.category=o_categories.category_id WHERE o_categorize.service='tl' AND
	o_categorize.id='{$_GET['tid']}'";
$db->query($sql);

$db->fetch_results();
if($task_data['user_id'] != $user->user_id)
{
	$display = "none";
} else {
	$display = "inline";
}
if(empty($db->record['category']))
{
	$db->record['category'] = 'Unknown';	
}

if($task_data['task_due'] < time())
{
	
	if($task_data['complete'] != 100 && $task_data['status'] != '3' && $task_data['status'] != '4')
	{
		$overdue = "<td class=\"overdue\">This task is over due</td>";
	}
}
	

	$status_list = explode(':', $text['status_list']);

	echo $html->create_list(
			array("TASK_ID"=>$task_data['task_id'],
				"SUMMARY_TEXT"=>$text['summary'],
				"SUMMARY"=>$task_data['subject'],
				"TASK_OWNER_TEXT"=>$text['task_owner'],
				"TASK_OWNER"=>$task_data['username'],
				"CATEGORY_TEXT"=>$text['category'],
				"CATEGORY"=>$db->record['category'],
				"DESC_TEXT"=>$text['description'],
				"DESCRIPTION"=>$task_data['description'],
				"DUE_DATE_TEXT"=>$text['due_date'],
				"DUE_DATE"=>date($date->long_date, $task_data['task_due']),
				"PRIORITY_TEXT"=>$text['priority'],
				"PRIORITY"=>$task_data['priority'],
				"COMPLETE_TEXT"=>$text['complete'],
				"COMPLETE"=>$task_data['complete'],
				"STATUS_TEXT"=>$text['status'],
				"STATUS"=>$status_list[$task_data['status']],
				"EDIT_TASK"=>$text['edit_task'],
				"EDIT_DISPLAY"=>$display,
				"OVERDUE"=>$overdue
				),
			"{$layout->service_theme}/view_task.html");

echo $layout->create_footer();
?>
Return current item: O - OpenSource GroupWare