</TR>

	<TR>
		<TD>
		<B>Hours:</B>
		<BR>
		<?php 
echo db_result($result, 0, 'hours');
?>
		</TD>

		<TD>
		<B>Status:</B>
		<BR>
		<?php 
echo pm_data_get_status_name(db_result($result, 0, 'status_id'));
?>
		</TD>
	</TR>

	<TR>
		<TD COLSPAN="2">
			<?php 
echo pm_show_dependent_tasks($project_task_id, $group_id, $group_project_id);
?>
		</TD>
	</TR>

	<TR>
		<TD COLSPAN="2">
			<?php 
function prepare_task_history_record(&$record)
{
    global $datetime_fmt;
    /*
        Prepare the column values in the task history  record
        Input: a row from the project_history database (passed by
                reference.
       Output: the same row with values transformed for database
    */
    // replace the modification date field with human readable dates
    $record['date'] = format_date($datetime_fmt, $record['date']);
    switch ($record['field_name']) {
        case 'start_date':
        case 'end_date':
            if ($record['old_value'] == 0) {
                $record['old_value'] = '';
            } else {
                $record['old_value'] = format_date($datetime_fmt, $record['old_value']);
            }
            break;
        case 'summary':
        case 'details':
            $record['old_value'] = prepare_textarea($record['old_value']);
            break;
        case 'status_id':
            $record['old_value'] = pm_data_get_status_name($record['old_value']);
            break;
        case 'subproject_id':
            $record['old_value'] = pm_data_get_group_name($record['old_value']);
            break;
        case 'percent_complete':
            $record['old_value'] = $record['old_value'] - 1000;
            break;
        default:
            break;
    }
}
}
//if assigned to selected, and more to where clause
if ($_assigned_to) {
    $assigned_str = "AND project_assigned_to.assigned_to_id='{$_assigned_to}'";
    //workaround for old tasks that do not have anyone assigned to them
    //should not be needed for tasks created/updated after may, 2000
    $assigned_str2 = ',project_assigned_to';
    $assigned_str3 = 'project_task.project_task_id=project_assigned_to.project_task_id AND';
} else {
    //no assigned to was chosen, so don't add it to where clause
    $assigned_str = '';
}
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
pm_header(array('title' => 'Browse Tasks' . ($_assigned_to ? ' For: ' . user_getname($_assigned_to) : '') . ($_status && $_status != 100 ? ' By Status: ' . pm_data_get_status_name($_status) : '')));
$sql = "SELECT project_task.priority,project_task.group_project_id,project_task.project_task_id," . "project_task.start_date,project_task.end_date,project_task.percent_complete,project_task.summary " . "FROM project_task {$assigned_str2} " . "WHERE {$assigned_str3} project_task.group_project_id='{$group_project_id}' " . " {$assigned_str} {$status_str} " . $order_by;
$message = "Browsing Custom Task List";
$result = db_query($sql, 51, $offset);
/*
        creating a custom technician box which includes "any" and "unassigned"
*/
$res_tech = pm_data_get_technicians($group_id);
$tech_id_arr = util_result_column_to_array($res_tech, 0);
$tech_id_arr[] = '0';
//this will be the 'any' row
$tech_name_arr = util_result_column_to_array($res_tech, 1);
$tech_name_arr[] = 'Any';
$tech_box = html_build_select_box_from_arrays($tech_id_arr, $tech_name_arr, '_assigned_to', $_assigned_to, true, 'Unassigned');
/*
	Show the new pop-up boxes to select assigned to and/or status
Beispiel #4
0
function pm_show_task_history($project_task_id)
{
    /*
    	show the project_history rows that are 
    	relevant to this project_task_id, excluding details
    */
    global $sys_datefmt;
    $sql = "select project_history.field_name,project_history.old_value,project_history.date,users.user_name " . "FROM project_history,users " . "WHERE project_history.mod_by=users.user_id AND " . "project_history.field_name <> 'details' AND project_task_id='{$project_task_id}' ORDER BY project_history.date DESC";
    $result = db_query($sql);
    $rows = db_numrows($result);
    if ($rows > 0) {
        echo '
		<H3>Task Change History</H3>
		<P>';
        $title_arr = array();
        $title_arr[] = 'Field';
        $title_arr[] = 'Old Value';
        $title_arr[] = 'Date';
        $title_arr[] = 'By';
        echo html_build_list_table_top($title_arr);
        for ($i = 0; $i < $rows; $i++) {
            $field = db_result($result, $i, 'field_name');
            echo '
				<TR BGCOLOR="' . html_get_alt_row_color($i) . '"><TD>' . $field . '</TD><TD>';
            if ($field == 'status_id') {
                echo pm_data_get_status_name(db_result($result, $i, 'old_value'));
            } else {
                if ($field == 'start_date') {
                    echo date('Y-m-d', db_result($result, $i, 'old_value'));
                } else {
                    if ($field == 'end_date') {
                        echo date('Y-m-d', db_result($result, $i, 'old_value'));
                    } else {
                        echo db_result($result, $i, 'old_value');
                    }
                }
            }
            echo '</TD>
				<TD>' . date($sys_datefmt, db_result($result, $i, 'date')) . '</TD>
				<TD>' . db_result($result, $i, 'user_name') . '</TD></TR>';
        }
        echo '
			</TABLE>';
    } else {
        echo '
			<H3>No Changes Have Been Made</H3>';
    }
}