Index: openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 26 Aug 2003 00:06:30 -0000 1.1 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 4 Sep 2003 22:45:22 -0000 1.2 @@ -14,22 +14,27 @@ - + select - sum(p.actual_hours_completed) as projects_total_hours_worked + sum(t.actual_hours_worked) as actual_hours_completed, + sum(t.estimated_hours_work) as estimated_hours_total, + to_char(current_timestamp,'J') as today_j from - pm_projectsx p, cr_items i + pm_tasks_revisionsx t, cr_items i where - p.item_id in ([join $project_list ", "]) and - i.live_revision = p.revision_id + t.item_id in ([join $task_list ", "]) and + i.live_revision = t.revision_id select - sum(t.actual_hours_worked) as tasks_total_hours_worked + t.actual_hours_worked as worked, + t.estimated_hours_work as to_work, + t.item_id as my_iid, + to_char(end_date,'J') as task_deadline_j from pm_tasks_revisionsx t, cr_items i where @@ -38,12 +43,41 @@ + + + select + d.dependency_id, + d.task_id as task_item_id, + d.parent_task_id, + d.dependency_type + from + pm_task_dependency d + where + d.task_id in ([join $task_list ", "]) + + + + + + select + to_char(planned_start_date,'J') as start_date_j, + to_char(planned_end_date,'J') as end_date_j + from + pm_projects + where + project_id = (select live_revision from cr_items where item_id = :project_item_id) + + + update pm_projects set - actual_hours_completed = :total_hours_worked + actual_hours_completed = :actual_hours_completed, + estimated_hours_total = :estimated_hours_total, + earliest_finish_date = 'J[expr floor([set max_earliest_finish])]', + latest_finish_date = 'J[expr ceil([set min_latest_start])]' where project_id = (select live_revision from cr_items where item_id = :project_item_id) @@ -66,4 +100,18 @@ + + + update + pm_tasks_revisions + set + earliest_start = 'J[expr ceil( [set earliest_start($task_item)])]', + earliest_finish = 'J[expr ceil( [set earliest_finish($task_item)])]', + latest_start = 'J[expr floor([set latest_start($task_item)])]', + latest_finish = 'J[expr floor([set latest_finish($task_item)])]' + where + task_revision_id = (select live_revision from cr_items where item_id = :task_item) + + + Index: openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 26 Aug 2003 00:05:58 -0000 1.1 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 4 Sep 2003 22:45:22 -0000 1.2 @@ -18,78 +18,449 @@ These are the items we'd like to compute + PROJECTS: estimated_completion_date timestamptz, earliest_completion_date timestamptz, latest_completion_date timestamptz, actual_hours_completed numeric, estimated_hours_total numeric + TASKS: + earliest start(i) = max(activity_time(i-1) + earliest_start(i-1)) + earliest_finish(i) = earliest_start(i) + activity_time(i) + latest_start(i) = min(last_start(i+1) - activity_time(i) + latest_finish(i) = latest_start(i) + activity_time(i) - loop through all items that have parent_id equal to this item - if a subproject, - then call compute_status(subproject) - use statistics from that project - if a task - then use statistics + The statistics are computed based on: - after loop, then compute statistics for this project - save values to database + project statistics are based on that project + subproject statistics + + that means if a project has a subproject, then the tasks for both of those projects are put together in one list, and computed together. + + so for a project with no subprojects, the values are computed for the tasks in that project + + for a project with subprojects, the statistics are based on the tasks of both of those projects. + + this function returns a list of task_item_ids of all tasks under + a project, plus all subproject tasks. + } { - ns_log Notice "computing status for $project_item_id" - set project_list [list] - set task_list [list] + # TODO: + # + # ------------------------------------------------------------------------- + # to improve this in the future, be more intelligent about what is updated. + # i.e., this procedure updates everything, which is necessary sometimes, + # but not if you only edit one task. + # ------------------------------------------------------------------------- + # Add in resource limits. (it's not realistic that 300 tasks can be done in + # one day) + # ------------------------------------------------------------------------- + # Use dependency types -- currently they're all treated like finish_to_start + # ------------------------------------------------------------------------- + + # note if you want to understand the algorithms in this function, you + # should look at: + # http://mscmga.ms.ic.ac.uk/jeb/or/netaon.html + + ns_log Notice "-----------------------------------------" + + # -------------------------------------------------------------------- + # for now, hardcode in a day is 8 hours. Later, we want to set this by + # person + # -------------------------------------------------------------------- + set hours_day 8 + + + # ------------------------- + # get subprojects and tasks + # ------------------------- + set task_list [list] + set task_list_project [list] + foreach sub_item [db_list_of_lists select_project_children { }] { set my_id [lindex $sub_item 0] set my_type [lindex $sub_item 1] if {[string equal $my_type "pm_project"]} { + # --------------------------------------------- + # gets all tasks that are a part of subprojects + # --------------------------------------------- set project_return [project_manager::project::compute_status $my_id] - lappend project_list $my_id - ns_log Notice "added project to list $my_id" + set task_list_project [concat $task_list_project $project_return] } elseif {[string equal $my_type "pm_task"]} { lappend task_list $my_id } } - # -------------------------------- - # get information from subprojects - # -------------------------------- - set projects_total_hours_worked 0 + set task_list [concat $task_list $task_list_project] - if {[llength $project_list] > 0} { - db_1row projects_query { } - ns_log Notice "Project total hours: $projects_total_hours_worked" - } else { - ns_log Notice "No subprojects" + # ------------------------- + # no tasks for this project + # ------------------------- + if {[llength $task_list] == 0} { + return [list] } + + # -------------------------------------------------------------- + # we now have list of tasks that includes all subprojects' tasks + # -------------------------------------------------------------- - # -------------------------- - # get information from tasks - note currently no support for subtasks - # -------------------------- - set tasks_total_hours_worked 0 + # returns actual_hours_completed, estimated_hours_total, and + # today_j (julian date for today) + db_1row tasks_group_query { } - if {[llength $task_list] > 0} { - db_1row tasks_query { } - ns_log Notice "Tasks total hours: $tasks_total_hours_worked" - } else { - ns_log Notice "No tasks" + + # -------------------------------------------------------------- + # Set up activity_time for all tasks + # Also set up deadlines for tasks that have hard-coded deadlines + # -------------------------------------------------------------- + + db_foreach tasks_query { } { + + set activity_time($my_iid) [expr $to_work - $worked] + + if {[exists_and_not_null task_deadline_j]} { + + set latest_finish($my_iid) $task_deadline_j + set latest_start($my_iid) [expr $task_deadline_j - [expr $activity_time($my_iid) / double($hours_day)]] + + } } - # estimated_completion_date timestamptz, - # earliest_completion_date timestamptz, - # latest_completion_date timestamptz, - # actual_hours_completed numeric, - # estimated_hours_total numeric + # -------------------------------------------------------------------- + # We need to keep track of all the dependencies so we can meaningfully + # compute deadlines, earliest start times, etc.. + # -------------------------------------------------------------------- - # now update projects - set total_hours_worked [expr $projects_total_hours_worked + $tasks_total_hours_worked] + db_foreach dependency_query { } { + # task_item_id depends on parent_task_id + lappend depends($task_item_id) $parent_task_id + + # parent_task_id is dependent on task_item_id + lappend dependent($parent_task_id) $task_item_id + + set dependency_types($task_item_id-$parent_task_id) $dependency_type + + ns_log Notice "id: $dependency_id task: $task_item_id parent: $parent_task_id type: $dependency_type" + } + + + # -------------------------------------------------------------- + # need to get some info on this project, so that we can base the + # task information off of them + # -------------------------------------------------------------- + + # gives up planned_start_date and planned_end_date + db_1row project_info { } + + # -------------------------------------------------------------- + # task_list contains all the tasks + # a subset of those do not depend on any other tasks + # -------------------------------------------------------------- + + # ---------------------------------------------------------------------- + # we want to go through and fill in all the values for earliest start. + # the brain-dead, brute force way of doing this, would be go through the + # task_list length(task_list) times, and each time, compute the values + # for each item that depends on one of those tasks. This is extremely + # inefficient. + # ---------------------------------------------------------------------- + # Instead, we create two lists, one is of tasks we just added + # earliest_start values for, the next is a new list of ones we're going to + # add earliest_start values for. We call these lists + # present_tasks and future_tasks + # ---------------------------------------------------------------------- + + set present_tasks [list] + set future_tasks [list] + + # ----------------------------------------------------- + # make a list of tasks that don't depend on other tasks + # ----------------------------------------------------- + # while we're at it, save earliest_start and earliest_finish + # info for these items + # ----------------------------------------------------- + + foreach task_item $task_list { + + if {![info exists depends($task_item)]} { + + set earliest_start($task_item) $start_date_j + set earliest_finish($task_item) [expr $earliest_start($task_item) + [expr $activity_time($task_item) / double($hours_day)]] + + lappend present_tasks $task_item + + ns_log Notice "Begin earliest_start($task_item): $earliest_start($task_item)" + } + } + + # ------------------------------- + # stop if we have no dependencies + # ------------------------------- + if {[llength $present_tasks] == 0} { + ns_log Notice "No tasks with dependencies" + return [list] + } + + ns_log Notice "present_tasks: $present_tasks" + + # ------------------------------------------------------ + # figure out the earliest start and finish times + # ------------------------------------------------------ + + while {[llength $present_tasks] > 0} { + + set future_tasks [list] + + foreach task_item $present_tasks { + + ns_log Notice "this task_item: $task_item" + + # ----------------------------------------------------- + # some tasks may already have earliest_start filled in + # the first run of tasks, for example, had their values + # filled in earlier + # ----------------------------------------------------- + + if {![exists_and_not_null earliest_start($task_item)]} { + + ns_log Notice " info exists for $task_item" + + # --------------------------------------------- + # set the earliest_start for this task = + # max(activity_time(i-1) + earliest_start(i-1)) + # + # (i-1 means an item that this task depends on) + # --------------------------------------------- + + set max_earliest_start $today_j + + foreach dependent_item $depends($task_item) { + + set my_earliest_start [expr [expr $activity_time($dependent_item) / double($hours_day)] + $earliest_start($dependent_item)] + + if {$my_earliest_start > $max_earliest_start} { + set max_earliest_start $my_earliest_start + } + } + + set earliest_start($task_item) $max_earliest_start + set earliest_finish($task_item) [expr $max_earliest_start + [expr $activity_time($task_item) / double($hours_day)]] + + ns_log Notice \ + " earliest_start ($task_item): $earliest_start($task_item)" + ns_log Notice \ + " earliest_finish($task_item): $earliest_finish($task_item)" + + } + + # ------------------------------- + # add to list of tasks to process + # ------------------------------- + + if {[info exists dependent($task_item)]} { + set future_tasks [concat $future_tasks $dependent($task_item)] + } + } + + ns_log Notice "future tasks: $future_tasks" + + set present_tasks $future_tasks + } + + # ---------------------------------------------- + # set up earliest date project will be completed + # ---------------------------------------------- + + set max_earliest_finish $today_j + + foreach task_item $task_list { + + ns_log Notice "*Earliest start ($task_item): $earliest_start($task_item)" + if {$max_earliest_finish < $earliest_finish($task_item)} { + set max_earliest_finish $earliest_finish($task_item) + } + } + + + # ----------------------------------------------------------------- + # Now compute latest_start and latest_finish dates. + # Note the latest_finish dates may be set to an arbitrary deadline. + # ----------------------------------------------------------------- + + # ---------------------------------------------------------------------- + # we want to go through and fill in all the values for latest start + # and latest_finish. + # the brain-dead, brute force way of doing this, would be go through the + # task_list length(task_list) times, and each time, compute the values + # for each item that depends on one of those tasks. This is extremely + # inefficient. + # ---------------------------------------------------------------------- + # Instead, we create two lists, one is of tasks we just added + # latest_finish values for, the next is a new list of ones we're going to + # add latest_finish values for. We call these lists + # present_tasks and future_tasks + # ---------------------------------------------------------------------- + # The biggest problem with this algorithm is that you can have items at + # two different levels in the hierarchy. For example, + # 2155 + # / | \ + # 2161 2173 2179 + # | | + # 2167 2195 + # if you trace through this algorithm, you'll see that we'll get to 2155 + # before 2161's values have been set, which can cause an error. The + # solution we arrive at is to defer to the future_tasks list any item + # that causes an error. That should work. + + set present_tasks [list] + set future_tasks [list] + + # ----------------------------------------------------- + # make a list of tasks that don't have tasks depend on them + # ----------------------------------------------------- + # while we're at it, save latest_start and latest_finish + # info for these items + # ----------------------------------------------------- + + foreach task_item $task_list { + + if {![info exists dependent($task_item)]} { + + set latest_finish($task_item) $end_date_j + set latest_start($task_item) [expr $latest_finish($task_item) - [expr $activity_time($task_item) / double($hours_day)]] + + lappend present_tasks $task_item + + ns_log Notice "Begin latest_start($task_item): $latest_start($task_item) latest_finish: $latest_finish($task_item)" + } + } + + + # ------------------------------- + # stop if we have no dependencies + # ------------------------------- + if {[llength $present_tasks] == 0} { + ns_log Notice "No tasks with dependencies" + return [list] + } + + ns_log Notice "LATEST present_tasks: $present_tasks" + + # ------------------------------------------------------ + # figure out the latest start and finish times + # ------------------------------------------------------ + + while {[llength $present_tasks] > 0} { + + set future_tasks [list] + + foreach task_item $present_tasks { + + ns_log Notice "this task_item: $task_item" + + # ----------------------------------------------------- + # some tasks may already have latest_start filled in + # the first run of tasks, for example, had their values + # filled in earlier + # ----------------------------------------------------- + + if {[info exists dependent($task_item)]} { + + ns_log Notice " info exists for dependent($task_item)" + + # --------------------------------------------- + # set the latest_start for this task = + # min(latest_start(i+1) - activity_time(i) + # + # (i+1 means an item that depends on this task) + # (i means this task) + # --------------------------------------------- + + set min_latest_start $end_date_j + + foreach dependent_item $dependent($task_item) { + + if {![exists_and_not_null latest_start($dependent_item)]} { + # let's not do this task_item yet + lappend future_tasks $task_item + set defer_p t + } else { + + set my_latest_start [expr $latest_start($dependent_item) - [expr $activity_time($dependent_item) / double($hours_day)]] + + if {$my_latest_start < $min_latest_start} { + set min_latest_start $my_latest_start + } + + set defer_p f + } + } + + if {[string equal $defer_p f]} { + + set latest_start($task_item) $min_latest_start + set latest_finish($task_item) [expr $min_latest_start + [expr $activity_time($task_item) / double($hours_day)]] + + ns_log Notice \ + " latest_start ($task_item): $latest_start($task_item)" + ns_log Notice \ + " latest_finish($task_item): $latest_finish($task_item)" + } else { + ns_log Notice "Deferring $task_item" + } + } + + # ------------------------------- + # add to list of tasks to process + # ------------------------------- + + if {[info exists depends($task_item)]} { + set future_tasks [concat $future_tasks $depends($task_item)] + } + } + + ns_log Notice "future tasks: $future_tasks" + + set present_tasks $future_tasks + } + + # ---------------------------------------------- + # set up latest start date for project + # ---------------------------------------------- + + set min_latest_start $end_date_j + + foreach task_item $task_list { + + ns_log Notice "*Latest start ($task_item): $latest_start($task_item)" + if {$min_latest_start > $latest_start($task_item)} { + set max_earliest_finish $earliest_finish($task_item) + } + } + + + # estimated_finish_date + # latest_finish + db_dml update_project { } - return "ok" + # now we go through and save all the values for the tasks! + # this is very inefficient and stupid + + foreach task_item $task_list { + db_dml update_task { } + } + + + ns_log Notice "*******************" + + return $task_list + } @@ -120,7 +491,7 @@ ns_log Notice "root: $root_folder , last_item_id $last_item_id" - set return_code [compute_status $project_item_id] + set return_code [compute_status $last_item_id] return $return_code } Index: openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 29 Aug 2003 00:35:35 -0000 1.7 +++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.8 @@ -62,4 +62,16 @@ where project_id = :project_id + + + + SELECT + p.item_id as project_item_id + FROM + pm_projectsx p + WHERE + p.project_id = :project_id + + + Index: openacs-4/contrib/packages/project-manager/www/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 29 Aug 2003 00:35:35 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 4 Sep 2003 22:45:23 -0000 1.11 @@ -107,6 +107,7 @@ } -new_data { set project_id [db_exec_plsql new_project_item { *SQL* }] + set project_item_id [db_string get_item_id { }] ad_returnredirect "one?[export_url_vars project_item_id project_id]" ad_script_abort Index: openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/dependency-add-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl 29 Aug 2003 00:35:35 -0000 1.1 +++ openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl 4 Sep 2003 22:45:23 -0000 1.2 @@ -90,6 +90,8 @@ db_dml new_dependency { *SQL* } } + project_manager::project::compute_parent_status $project_item_id + } -edit_data { } -after_submit { Index: openacs-4/contrib/packages/project-manager/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 29 Aug 2003 00:35:35 -0000 1.6 +++ openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.7 @@ -5,24 +5,24 @@ SELECT - p.item_id, + p.item_id, p.project_id, - repeat(:indent_pattern, (tree_level(p.tree_sortkey) - 5)* :indent_factor) as indent, p.parent_id as folder_id, - p.object_type as content_type, - p.title as project_name, - p.project_code, - to_char(p.planned_start_date, 'Mon DD ''YY') as planned_start_date, - to_char(p.planned_end_date, 'Mon DD ''YY') as planned_end_date, - p.ongoing_p, + p.object_type as content_type, + p.title as project_name, + p.project_code, + to_char(p.planned_start_date, 'Mon DD ''YY') as planned_start_date, + to_char(p.planned_end_date, 'Mon DD ''YY') as planned_end_date, + p.ongoing_p, p.actual_hours_completed, p.estimated_hours_total, to_char(p.estimated_finish_date, 'Mon DD ''YY') as estimated_finish_date, to_char(p.earliest_finish_date, 'Mon DD ''YY') as earliest_finish_date, to_char(p.latest_finish_date, 'Mon DD ''YY') as latest_finish_date FROM pm_projectsx p, cr_items i - WHERE p.project_id = i.live_revision - ORDER BY i.tree_sortkey + WHERE p.project_id = i.live_revision and + p.parent_id = :root_folder + ORDER BY p.title Index: openacs-4/contrib/packages/project-manager/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.adp,v diff -u -r1.12 -r1.13 --- openacs-4/contrib/packages/project-manager/www/index.adp 29 Aug 2003 00:35:35 -0000 1.12 +++ openacs-4/contrib/packages/project-manager/www/index.adp 4 Sep 2003 22:45:23 -0000 1.13 @@ -14,8 +14,8 @@ Project Project Code Status - Start Date - End Date + Start + Deadline @@ -25,7 +25,6 @@ - @projects.indent@ @projects.project_name@ @@ -34,7 +33,8 @@  @projects.project_code@ - @projects.actual_hours_completed@ hrs + @projects.actual_hours_completed@ of + @projects.estimated_hours_total@ hrs Index: openacs-4/contrib/packages/project-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/project-manager/www/index.tcl 6 Aug 2003 20:22:18 -0000 1.5 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 4 Sep 2003 22:45:23 -0000 1.6 @@ -50,11 +50,6 @@ # root CR folder set root_folder [db_string get_root "select pm_project__get_root_folder (:package_id, 'f')"] -# set up for indentation of hierarchy -set indent_pattern " " -set indent_factor [parameter::get -parameter IndentationFactor -default 5] - - db_multirow projects project_folders {} ad_return_template Index: openacs-4/contrib/packages/project-manager/www/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one-postgresql.xql,v diff -u -r1.11 -r1.12 --- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 29 Aug 2003 00:35:35 -0000 1.11 +++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.12 @@ -84,7 +84,12 @@ SELECT t.item_id, t.title, - to_char(t.end_date,'MM/DD/YY') as end_date, + to_char(t.end_date,'Mon DD ''YY') as end_date, + to_char(t.earliest_start,'Mon DD ''YY') as earliest_start, + to_char(t.earliest_finish,'Mon DD ''YY') as earliest_finish, + to_char(t.latest_start,'Mon DD ''YY') as latest_start, + to_char(t.latest_finish,'Mon DD ''YY') as latest_finish, + t.latest_start-t.end_date as slack_time, t.percent_complete, d.parent_task_id, d.dependency_type, Index: openacs-4/contrib/packages/project-manager/www/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.adp,v diff -u -r1.18 -r1.19 --- openacs-4/contrib/packages/project-manager/www/one.adp 29 Aug 2003 00:35:35 -0000 1.18 +++ openacs-4/contrib/packages/project-manager/www/one.adp 4 Sep 2003 22:45:23 -0000 1.19 @@ -54,32 +54,28 @@ + Earliest finish + @project.earliest_finish_date@ + + + Deadline @project.planned_end_date@ - - - Earliest finish - @project.earliest_finish_date@ - - - Estimated finish @project.estimated_finish_date@ - - - Latest finish - @project.latest_finish_date@ - - + + Latest finish + @project.latest_finish_date@ + - Actual hours completed - @project.actual_hours_completed@ + Hours completed + @project.actual_hours_completed@ of @project.estimated_hours_total@ Index: openacs-4/contrib/packages/project-manager/www/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/contrib/packages/project-manager/www/one.tcl 29 Aug 2003 00:35:35 -0000 1.13 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 4 Sep 2003 22:45:23 -0000 1.14 @@ -89,9 +89,9 @@ db_multirow tasks project_tasks_query { } if {$use_uncertain_completion_times_p} { - set work_display_template "@tasks.estimated_hours_work_min@ - @tasks.estimated_hours_work_max@ hrs" + set work_display_template "@tasks.estimated_hours_work_min@ - @tasks.estimated_hours_work_max@ h" } else { - set work_display_template "@tasks.estimated_hours_work@ hrs" + set work_display_template "@tasks.estimated_hours_work@ h" } template::list::create \ @@ -104,24 +104,8 @@ display_col title link_url_col item_url link_html { title "View this task" } - } - percent_complete { - label "Status" - display_template "@tasks.percent_complete@\%" - } - actual_hours_worked { - label "Hour to date" - display_template "@tasks.actual_hours_worked@ hrs" - aggregate "sum" - } - estimated_hours_work { - label "Work estimate" - display_template "[set work_display_template]" - } - end_date { - label "Deadline" display_template { - @tasks.end_date@ + @tasks.title@ @@ -138,6 +122,29 @@ } } + percent_complete { + label "Status" + display_template "@tasks.percent_complete@\% @tasks.actual_hours_worked@/[set work_display_template]" + } + earliest_start { + label "Earliest Start" + display_template "@tasks.earliest_start@" + } + earliest_finish { + label "Earliest Finish" + display_template "@tasks.earliest_finish@" + } + latest_start { + label "Latest Start" + display_template "@tasks.latest_start@" + } + latest_finish { + label "Latest Finish" + display_template { + @tasks.latest_finish@ + ! + } + } } \ -filters { project_item_id {} Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 29 Aug 2003 00:35:35 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 4 Sep 2003 22:45:23 -0000 1.15 @@ -179,8 +179,6 @@ } } - project_manager::project::compute_parent_status $project_item_id - } -edit_data { } -select_query_name task_query -after_submit { Index: openacs-4/contrib/packages/project-manager/www/task-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-edit-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/project-manager/www/task-edit-postgresql.xql 21 Aug 2003 22:34:43 -0000 1.3 +++ openacs-4/contrib/packages/project-manager/www/task-edit-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.4 @@ -7,8 +7,9 @@ :project_item_id, :task_title, :description, - to_timestamp(:end_date,'YYYY MM DD HH24 MI SS'), + [project_manager::project::util::datenvl -value $end_date -value_if_null "null," -value_if_not_null "to_timestamp('$end_date','YYYY MM DD HH24 MI SS'),"] :percent_complete, + :estimated_hours_work, :estimated_hours_work_min, :estimated_hours_work_max, :actual_hours_worked, @@ -44,6 +45,7 @@ t.parent_id, to_char(t.end_date,'YYYY MM DD') as end_date, t.percent_complete, + t.estimated_hours_work, t.estimated_hours_work_min, t.estimated_hours_work_max, t.actual_hours_worked Index: openacs-4/contrib/packages/project-manager/www/task-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/project-manager/www/task-edit.tcl 26 Aug 2003 00:05:58 -0000 1.5 +++ openacs-4/contrib/packages/project-manager/www/task-edit.tcl 4 Sep 2003 22:45:23 -0000 1.6 @@ -21,7 +21,7 @@ description:optional name:optional parent_id:optional - end_date:date,optional + {end_date:date ""} percent_complete:optional } -properties { @@ -78,8 +78,9 @@ {parent_id:text(hidden) } - {end_date:date,to_sql(linear_date),from_sql(sql_date) + {end_date:date,to_sql(linear_date),optional {label "Deadline"} + {value {[util::date acquire clock [clock scan $end_date]]}} {format "MONTH DD YYYY"} {help} } @@ -89,6 +90,11 @@ {html {size 3}} } + {estimated_hours_work:text + {label "Estimated hours work"} + {html {size 3}} + } + {estimated_hours_work_min:text {label "Estimated hours work - min"} {html {size 3}} Index: openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one-postgresql.xql,v diff -u -r1.11 -r1.12 --- openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 22 Aug 2003 00:27:33 -0000 1.11 +++ openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.12 @@ -41,7 +41,12 @@ t.item_id, t.title as task_title, t.description, - to_char(t.end_date,'MM/DD/YYYY') as end_date, + to_char(t.end_date,'Mon DD ''YY') as end_date, + to_char(t.earliest_start,'Mon DD ''YY') as earliest_start, + to_char(t.earliest_finish,'Mon DD ''YY') as earliest_finish, + to_char(t.latest_start,'Mon DD ''YY') as latest_start, + to_char(t.latest_finish,'Mon DD ''YY') as latest_finish, + t.latest_start-t.end_date as slack_time, t.percent_complete, i.live_revision FROM @@ -75,44 +80,44 @@ - + SELECT t.title as task_title, to_char(t.end_date,'MM/DD/YYYY') as end_date, t.percent_complete, i.live_revision, - c.parent_task_id, - c.const_type + d.parent_task_id, + d.dependency_type FROM - pm_tasks_revisionsx t, cr_items i, pm_task_constraints c + pm_tasks_revisionsx t, cr_items i, pm_task_dependency d WHERE - c.task_id = :task_id and - c.parent_task_id = t.item_id and + d.task_id = :task_id and + d.parent_task_id = t.item_id and t.revision_id = i.live_revision and t.item_id = i.item_id - [template::list::orderby_clause -name consts -orderby] + [template::list::orderby_clause -name dependency -orderby] - + SELECT t.title as task_title, to_char(t.end_date,'MM/DD/YYYY') as end_date, t.percent_complete, i.live_revision, - c.parent_task_id, - c.const_type, - c.task_id + d.parent_task_id, + d.dependency_type, + d.task_id FROM - pm_tasks_revisionsx t, cr_items i, pm_task_constraints c + pm_tasks_revisionsx t, cr_items i, pm_task_dependency d WHERE - c.task_id = t.item_id and - c.parent_task_id = :task_id and + d.task_id = t.item_id and + d.parent_task_id = :task_id and t.revision_id = i.live_revision and t.item_id = i.item_id - [template::list::orderby_clause -name consts2 -orderby] + [template::list::orderby_clause -name dependency2 -orderby] Index: openacs-4/contrib/packages/project-manager/www/task-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.adp,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/packages/project-manager/www/task-one.adp 21 Aug 2003 22:34:43 -0000 1.10 +++ openacs-4/contrib/packages/project-manager/www/task-one.adp 4 Sep 2003 22:45:23 -0000 1.11 @@ -29,13 +29,37 @@ +@task_info.slack_time@ slack + + + Dates Deadline @task_info.end_date@ + +Earliest start +@task_info.earliest_start@ + + + +Earliest finish +@task_info.earliest_finish@ + + + +Latest start +@task_info.latest_start@ + + + +Latest finish +@task_info.latest_start@ + + @@ -49,11 +73,11 @@
@task_term@(s) this relies on. - +

@task_term@(s) relying on this @task_term@ - +

Index: openacs-4/contrib/packages/project-manager/www/task-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-one.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/contrib/packages/project-manager/www/task-one.tcl 23 Aug 2003 00:24:34 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 4 Sep 2003 22:45:23 -0000 1.15 @@ -9,22 +9,22 @@ @return task_term_lower Term to use for task @return assignee_term Term to use for assignee @return watcher_term Term to use for watcher - @return consts multirow that stores constraint information - @return consts multirow that stores constraint information for tasks that have constraints on this particular task + @return dependency multirow that stores dependency information + @return dependency2 multirow that stores dependency information for tasks that have dependencies on this particular task @param task_id item_id for the task @param project_item_id the item_id for the project. Used for navigational links @param project_id the revision_id for the project. Used for navigational links @param context_bar value for context bar creation @param orderby_revisions specifies how the revisions table will be sorted - @param orderby_consts specifies how the constraints will be sorted - @param orderby_consts2 specifies how the constraints will be sorted (for tasks that have constraints on this task) + @param orderby_dependency specifies how the dependencies will be sorted + @param orderby_dependency2 specifies how the dependencies will be sorted (for tasks that have dependencies on this task) } { task_id:integer,optional task_revision_id:integer,optional orderby_revisions:optional - orderby_consts:optional - orderby_consts2:optional + orderby_dependency:optional + orderby_dependency2:optional } -properties { task_info:onerow @@ -34,8 +34,8 @@ write_p:onevalue create_p:onevalue revisions:multirow - consts:multirow - consts2:multirow + dependency:multirow + dependency2:multirow task_term:onevalue task_term_lower:onevalue assignee_term:onevalue @@ -124,8 +124,8 @@ -orderby_name orderby_revisions \ -filters { task_revision_id {} - orderby_consts {} - orderby_consts2 {} + orderby_dependency {} + orderby_dependency2 {} } \ -html { width 100% @@ -137,26 +137,26 @@ set item_url [export_vars -base "task-one" -override {{task_revision_id $revision_id}} -exclude {revision_id} { revision_id task_id}] } -# Constraints info ------------------------------------------------ +# Dependency info ------------------------------------------------ template::list::create \ - -name consts \ - -multirow consts \ + -name dependency \ + -multirow dependency \ -key task_id \ -elements { - const_type { + dependency_type { label "Type" display_template { - + - + - + - + } @@ -169,7 +169,7 @@ } percent_complete { label "Status" - display_template "@consts.percent_complete@\%" + display_template "@dependency.percent_complete@\%" } end_date { label "Deadline" @@ -179,41 +179,41 @@ percent_complete {orderby percent_complete} end_date {orderby end_date} } \ - -orderby_name orderby_consts \ + -orderby_name orderby_dependency \ -filters { task_revision_id {} orderby_revisions {} - orderby_consts2 {} + orderby_dependency2 {} } \ -html { width 100% } -db_multirow -extend { item_url } consts consts_query { +db_multirow -extend { item_url } dependency dependency_query { } { set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id }] } -# Constraints info (constraints other task have on this task) ------ +# Dependency info (dependency other task have on this task) ------ template::list::create \ - -name consts2 \ - -multirow consts2 \ + -name dependency2 \ + -multirow dependency2 \ -key task_id \ -elements { - const_type { + dependency_type { label "Type" display_template { - + - + - + - + } @@ -226,7 +226,7 @@ } percent_complete { label "Status" - display_template "@consts2.percent_complete@\%" + display_template "@dependency2.percent_complete@\%" } end_date { label "Deadline" @@ -236,18 +236,18 @@ percent_complete {orderby percent_complete} end_date {orderby end_date} } \ - -orderby_name orderby_consts2 \ + -orderby_name orderby_dependency2 \ -filters { task_revision_id {} orderby_revisions {} - orderby_consts {} + orderby_dependency {} } \ -html { width 100% } -db_multirow -extend { item_url } consts2 consts2_query { +db_multirow -extend { item_url } dependency2 dependency2_query { } { }