예제 #1
0
			periodicity = "%s", estimated_cost = "%f",
			id_parent_task = %d, count_hours = %d,
			cc = "%s"
			WHERE id = %d', $name, $description, $priority, $completion, $start, $end, $hours, $periodicity, $estimated_cost, $parent, $count_hours, $cc, $id_task);
    if ($id_task != $parent) {
        $result = process_sql($sql);
    } else {
        $result = false;
    }
    //Update task links
    $links_0 = get_parameter("links_0");
    $links_1 = get_parameter("links_1");
    $links_2 = get_parameter("links_2");
    projects_update_task_links($id_task, $links_0, 0);
    projects_update_task_links($id_task, $links_1, 1);
    projects_update_task_links($id_task, $links_2, 2);
    if ($result !== false) {
        $result_output = '<h3 class="suc">' . __('Successfully updated') . '</h3>';
        audit_db($config['id_user'], $config["REMOTE_ADDR"], "Task updated", "Task '{$name}' updated to project '{$id_project}'");
        $operation = "view";
        task_tracking($id_task, TASK_UPDATED);
        // ONLY recalculate the complete if count hours flag is activated
        if ($count_hours) {
            $hours = set_task_completion($id_task);
        }
    } else {
        $result_output = "<h3 class='error'>" . __('Could not be updated') . "</h3>";
    }
    if ($gantt_editor) {
        echo $result_output;
        exit;
예제 #2
0
    $ret = array("res" => $res, "msg" => $msg);
    echo json_encode($ret);
    exit;
}
if ($update_task_parent) {
    $target = get_parameter("target");
    $source = get_parameter("source");
    $type = get_parameter("type");
    /**
    		link types:
    			0: start to finish
    			1: start to start
    			2: finish to finish
    	**/
    $links = array($source);
    $res = projects_update_task_links($target, $links, $type, false);
    if ($res) {
        $msg = __("Task updated");
    } else {
        $msg = __("Error updating task");
    }
    $ret = array("res" => $res, "msg" => $msg);
    echo json_encode($ret);
    exit;
}
if ($get_task_links) {
    $type = (int) get_parameter("type");
    $id_project = get_parameter("id_project");
    $id_task = get_parameter("id_task");
    $task_aux = projects_get_task_available_links($id_project, $id_task, $type);
    $table_link->class = 'databox';