Ejemplo n.º 1
0
                $names[$counter - 1] = date("Y-m-d", $end);
                $values[$counter - 1] = db_result($result, 0, 0);
            }
            GraphIt($names, $values, "Number of Tasks Still Not Completed");
            echo "<P>";
            pm_footer(array());
        } else {
            if ($what == "subproject") {
                $sql1 = "SELECT project_group_list.project_name AS Subproject, count(*) AS Count " . "FROM project_group_list,project_task " . "WHERE project_group_list.group_project_id=project_task.group_project_id " . "AND project_task.status_id = '1' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Subproject";
                $sql2 = "SELECT project_group_list.project_name AS Subproject, count(*) AS Count " . "FROM project_group_list,project_task " . "WHERE project_group_list.group_project_id=project_task.group_project_id " . "AND project_task.status_id <> '3' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Subproject";
                pm_quick_report($group_id, "Tasks By Category", "Open Tasks By Category", $sql1, "All Tasks By Category", $sql2);
            } else {
                if ($what == "tech") {
                    $sql1 = "SELECT users.user_name AS Technician, count(*) AS Count " . "FROM users,project_group_list,project_task,project_assigned_to " . "WHERE users.user_id=project_assigned_to.assigned_to_id " . "AND project_assigned_to.project_task_id=project_task.project_task_id " . "AND project_task.group_project_id=project_group_list.group_project_id " . "AND project_task.status_id = '1' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Technician";
                    $sql2 = "SELECT users.user_name AS Technician, count(*) AS Count " . "FROM users,project_group_list,project_task,project_assigned_to " . "WHERE users.user_id=project_assigned_to.assigned_to_id " . "AND project_assigned_to.project_task_id=project_task.project_task_id " . "AND project_task.group_project_id=project_group_list.group_project_id " . "AND project_task.status_id <> '3' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Technician";
                    pm_quick_report($group_id, "Tasks By Technician", "Open Tasks By Technician", $sql1, "All Tasks By Technician", $sql2, "<p>Note that same task can be " . "assigned to several technicians. " . "Such task will be counted for " . "each of them.</p>");
                } else {
                    exit_missing_param();
                }
            }
        }
    } else {
        /*
        	Show main page
        */
        pm_header(array("title" => $page_title));
        echo "\n<H2>{$page_title}</H2>";
        pm_reporting_header($group_id);
        pm_footer(array());
    }
} else {
Ejemplo n.º 2
0
            $names[$counter - 1] = date("Y-m-d", $end);
            $values[$counter - 1] = db_result($result, 0, 0);
        }
        GraphIt($names, $values, _('Number of tasks still not completed'));
        echo "<p />";
        pm_footer(array());
    } else {
        if ($what == "subproject") {
            $sql1 = "SELECT project_group_list.project_name AS Subproject, count(*) AS Count " . "FROM project_group_list,project_task " . "WHERE project_group_list.group_project_id=project_task.group_project_id " . "AND project_task.status_id = '1' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Subproject";
            $sql2 = "SELECT project_group_list.project_name AS Subproject, count(*) AS Count " . "FROM project_group_list,project_task " . "WHERE project_group_list.group_project_id=project_task.group_project_id " . "AND project_task.status_id <> '3' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Subproject";
            pm_quick_report($group_id, _('Tasks By Category'), _('Open Tasks By Category'), $sql1, _('All Tasks By Category'), $sql2);
        } else {
            if ($what == "tech") {
                $sql1 = "SELECT users.user_name AS Technician, count(*) AS Count " . "FROM users,project_group_list,project_task,project_assigned_to " . "WHERE users.user_id=project_assigned_to.assigned_to_id " . "AND project_assigned_to.project_task_id=project_task.project_task_id " . "AND project_task.group_project_id=project_group_list.group_project_id " . "AND project_task.status_id = '1' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Technician";
                $sql2 = "SELECT users.user_name AS Technician, count(*) AS Count " . "FROM users,project_group_list,project_task,project_assigned_to " . "WHERE users.user_id=project_assigned_to.assigned_to_id " . "AND project_assigned_to.project_task_id=project_task.project_task_id " . "AND project_task.group_project_id=project_group_list.group_project_id " . "AND project_task.status_id <> '3' " . "AND project_group_list.group_id='{$group_id}' " . $period_clause . "GROUP BY Technician";
                pm_quick_report($group_id, _('Tasks By Assignee'), _('Open Tasks By Assignee'), $sql1, _('All Tasks By Assignee'), $sql2, _('<p>Note that same task can be assigned to several technicians. Such task will be counted for each of them.</p>'));
            } else {
                exit_missing_param();
            }
        }
    }
} else {
    /*
    	Show main page
    */
    pm_header(array("title" => $page_title));
    pm_reporting_header($group_id);
    pm_footer(array());
}
// Local Variables:
// mode: php