Index: openacs-4/contrib/packages/project-manager/project-manager.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/Attic/project-manager.info,v diff -u -r1.12.2.7 -r1.12.2.8 --- openacs-4/contrib/packages/project-manager/project-manager.info 27 Feb 2004 22:46:12 -0000 1.12.2.7 +++ openacs-4/contrib/packages/project-manager/project-manager.info 6 Mar 2004 00:29:23 -0000 1.12.2.8 @@ -8,17 +8,18 @@ f project-manager - + Jade Rubick Project management tool for OpenACS - 2004-02-27 + 2004-03-05 Track tasks, estimates and actual progress for a project. See the <a href="http://openacs.org/projects/dotwrk/project_management/">project page</a> for more information. - + + Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-drop.sql,v diff -u -r1.10.2.7 -r1.10.2.8 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 27 Feb 2004 22:46:12 -0000 1.10.2.7 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql 6 Mar 2004 00:29:23 -0000 1.10.2.8 @@ -13,6 +13,8 @@ \i project-manager-custom-drop.sql \i project-manager-notifications-drop.sql +drop table pm_task_logger_proj_map; + create function inline_0 () returns integer as ' declare Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-functions-create.sql,v diff -u -r1.8.2.8 -r1.8.2.9 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 27 Feb 2004 22:46:12 -0000 1.8.2.8 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 6 Mar 2004 00:29:23 -0000 1.8.2.9 @@ -130,9 +130,9 @@ -- is null. Otherwise a project folder will be created as a sub-folder -- of an existing project folder. -select define_function_args('pm_project__new_project_item', 'project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, customer_id, creation_date, creation_user, creation_ip, package_id'); +select define_function_args('pm_project__new_project_item', 'project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, logger_project, ongoing_p, status_id, customer_id, creation_date, creation_user, creation_ip, package_id'); -create function pm_project__new_project_item ( +create or replace function pm_project__new_project_item ( varchar, -- project_name varchar, -- project_code integer, -- parent_id @@ -142,6 +142,7 @@ timestamptz, -- planned_end_date timestamptz, -- actual_start_date timestamptz, -- actual_end_date + integer, -- logger_project char(1), -- ongoing_p integer, -- status_id integer, -- customer_id (organization_id) @@ -161,13 +162,14 @@ p_planned_end_date alias for $7; p_actual_start_date alias for $8; p_actual_end_date alias for $9; - p_ongoing_p alias for $10; - p_status_id alias for $11; - p_customer_id alias for $12; - p_creation_date alias for $13; - p_creation_user alias for $14; - p_creation_ip alias for $15; - p_package_id alias for $16; + p_logger_project alias for $10; + p_ongoing_p alias for $11; + p_status_id alias for $12; + p_customer_id alias for $13; + p_creation_date alias for $14; + p_creation_user alias for $15; + p_creation_ip alias for $16; + p_package_id alias for $17; v_item_id cr_items.item_id%TYPE; v_revision_id cr_revisions.revision_id%TYPE; @@ -225,15 +227,16 @@ project_id, project_code, goal, planned_start_date, planned_end_date, actual_start_date, actual_end_date, - ongoing_p, estimated_finish_date, + logger_project, ongoing_p, estimated_finish_date, earliest_finish_date, latest_finish_date, actual_hours_completed, estimated_hours_total, status_id, customer_id) values ( v_revision_id, p_project_code, p_goal, p_planned_start_date, p_planned_end_date, p_actual_start_date, - p_actual_end_date, p_ongoing_p, p_planned_end_date, + p_actual_end_date, p_logger_project, p_ongoing_p, + p_planned_end_date, p_planned_end_date, p_planned_end_date, ''0'', ''0'', p_status_id, p_customer_id ); @@ -278,7 +281,7 @@ end;' language 'plpgsql'; -select define_function_args('pm_project__new_project_revision', 'item_id, project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, ongoing_p, status_id, organization_id, creation_date, creation_user, creation_ip, package_id'); +select define_function_args('pm_project__new_project_revision', 'item_id, project_name, project_code, parent_id, goal, description, planned_start_date, planned_end_date, actual_start_date, actual_end_date, logger_project, ongoing_p, status_id, organization_id, creation_date, creation_user, creation_ip, package_id'); create function pm_project__new_project_revision ( integer, -- item_id @@ -291,6 +294,7 @@ timestamptz, -- planned_end_date timestamptz, -- actual_start_date timestamptz, -- actual_end_date + integer, -- logger_project char(1), -- ongoing_p integer, -- status_id integer, -- organization_id (customer) @@ -311,13 +315,14 @@ p_planned_end_date alias for $8; p_actual_start_date alias for $9; p_actual_end_date alias for $10; - p_ongoing_p alias for $11; - p_status_id alias for $12; - p_customer_id alias for $13; - p_creation_date alias for $14; - p_creation_user alias for $15; - p_creation_ip alias for $16; - p_package_id alias for $17; + p_logger_project alias for $11; + p_ongoing_p alias for $12; + p_status_id alias for $13; + p_customer_id alias for $14; + p_creation_date alias for $15; + p_creation_user alias for $16; + p_creation_ip alias for $17; + p_package_id alias for $18; v_revision_id cr_revisions.revision_id%TYPE; begin @@ -344,12 +349,14 @@ project_id, project_code, goal, planned_start_date, planned_end_date, actual_start_date, actual_end_date, + logger_project, ongoing_p, status_id, customer_id) values ( v_revision_id, p_project_code, p_goal, p_planned_start_date, p_planned_end_date, p_actual_start_date, - p_actual_end_date, p_ongoing_p, p_status_id, p_customer_id); + p_actual_end_date, + p_logger_project, p_ongoing_p, p_status_id, p_customer_id); PERFORM acs_permission__grant_permission( v_revision_id, Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-notifications-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-notifications-create.sql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-notifications-create.sql 27 Feb 2004 22:46:12 -0000 1.1.2.2 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-notifications-create.sql 6 Mar 2004 00:29:23 -0000 1.1.2.3 @@ -1,3 +1,9 @@ +-- Following directions at +-- http://openacs.org/doc/openacs-HEAD/tutorial-notifications.html + +-- using pm_task_notif_type instead of lars_blogger_notif_type +-- using project-manager instead of lars-blogger + create function inline_0() returns integer as ' declare impl_id integer; @@ -7,7 +13,7 @@ impl_id := acs_sc_impl__new ( ''NotificationType'', ''pm_task_notif_type'', - ''task'' + ''project-manager'' ); v_foo := acs_sc_impl_alias__new ( @@ -55,7 +61,7 @@ from notification_delivery_methods where short_name in (''email''); -return (0); + return (0); end; ' language 'plpgsql'; Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-table-create.sql,v diff -u -r1.15.2.8 -r1.15.2.9 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 27 Feb 2004 22:46:12 -0000 1.15.2.8 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql 6 Mar 2004 00:29:23 -0000 1.15.2.9 @@ -1,8 +1,3 @@ --- TODO: --- --- need to add in workflow (for status among other things) - --- -- packages/project-manager/sql/postgresql/project-manager-table-create.sql -- -- @author jader@bread.com @@ -56,14 +51,18 @@ ongoing_p char(1) default 'f' constraint pm_projects_ongoing_p_ck check (ongoing_p in ('t','f')), - -- denormalized, computed values - -- these are computed but stored in projects table for efficient - -- access. - estimated_finish_date timestamptz, - earliest_finish_date timestamptz, - latest_finish_date timestamptz, - actual_hours_completed numeric, - estimated_hours_total numeric + estimated_finish_date timestamptz, + earliest_finish_date timestamptz, + latest_finish_date timestamptz, + -- denormalized, taken from logger + actual_hours_completed numeric, + estimated_hours_total numeric, + -- The logger package keeps its own projects table + logger_project integer + constraint pm_projects_logger_pj_nn + not null + constraint pm_projects_logger_pj_fk + references logger_projects ); @@ -353,6 +352,25 @@ ); + +create table pm_task_logger_proj_map ( + task_item_id integer + constraint pm_task_log_proj_map_t_nn + not null + constraint pm_task_log_proj_map_t_fk + references pm_tasks + on delete cascade, + logger_entry integer + constraint pm_task_log_proj_map_l_nn + not null + constraint pm_task_log_proj_map_l_fk + references logger_entries + on delete cascade, + constraint pm_task_logger_proj_map_uq + unique (task_item_id, logger_entry) +); + + -- DEPENDENCIES -- dependency types Index: openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-manager-procs.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.3 +++ openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.4 @@ -2,18 +2,18 @@ Project Manager Projects Library - Procedures that deal with projects + Utility procedures for project manager @creation-date 2003-08-25 @author Jade Rubick @cvs-id $Id$ } -namespace eval pm::project::util {} +namespace eval pm::util {} -ad_proc -public pm::project::util::datenvl { +ad_proc -public pm::util::datenvl { -value -value_if_null -value_if_not_null 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.2.2.3 -r1.2.2.4 --- openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.2.2.3 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.2.2.4 @@ -57,6 +57,7 @@ to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'), null, null, + :logger_project, :ongoing_p, :status_id, :organization_id, @@ -95,8 +96,9 @@ - select - t.actual_hours_worked as worked, + SELECT + case when t.actual_hours_worked is null then 0 + else t.actual_hours_worked end as worked, t.estimated_hours_work as to_work, t.item_id as my_iid, to_char(end_date,'J') as task_deadline_j 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.3.2.4 -r1.3.2.5 --- openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 27 Feb 2004 22:46:13 -0000 1.3.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/project-procs.tcl 6 Mar 2004 00:29:24 -0000 1.3.2.5 @@ -12,6 +12,7 @@ namespace eval pm::project {} + ad_proc -public pm::project::get_project_id { -project_item_id:required } { @@ -54,6 +55,7 @@ } + ad_proc -public pm::project::default_status_open {} { Returns the default status value for open projects } { @@ -62,6 +64,8 @@ return $return_val } + + ad_proc -public pm::project::default_status_closed {} { Returns the default status value for closed projects } { @@ -70,6 +74,99 @@ return $return_val } + + +ad_proc -private pm::project::log_hours { + {-entry_id ""} + -logger_project_id:required + -variable_id:required + -value:required + -timestamp_ansi:required + {-description ""} + {-task_item_id ""} + {-project_item_id ""} + {-update_status_p "t"} +} { + Adds a logger entry to a project. If task_item_id is passed + in, also links it up with that task, and updates the task + hours. + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-05 + + @param entry_id If passed in, determines the entry_id for the + newly logged entry + + @param logger_project_id + + @param variable_id + + @param value + + @param timestamp_ansi Timestamp in ANSI format YYYY-MM-DD + + @param description + + @param task_item_id + + @param project_item_id If the task_item_id is passed in, the + project_item_id needs to be passed in as well + + @param update_status_p If t, then updates the database for the + task and project so that the denormalized values are updated. + This can be set to f when editing a task, because these things + are done later anyway. + + @return 0 if there no task it is logged against, otherwise returns + the total number of hours logged to that task + + @error returns -1 if there is an error in pm::task::update_hours + If a task_id is passed in, essentially passes along any errors + from pm::task::update_hours +} { + set returnval 0 + + # get a new entry_id if it's not passed in (like it would be from + # a page that was using ad_form) + if {[empty_string_p $entry_id]} { + set entry_id [db_nextval acs_object_id_seq] + } + + # add in the new entry + logger::entry::new -entry_id $entry_id \ + -project_id $logger_project_id \ + -variable_id $variable_id \ + -value $value \ + -time_stamp $timestamp_ansi \ + -description $description + + # if we have a pm_task_id, then we need to note that this + # entry is logged to a particular task. + if {[exists_and_not_null task_item_id]} { + db_dml add_logger_map " + INSERT INTO + pm_task_logger_proj_map + (task_item_id, + logger_entry) + VALUES + (:task_item_id, + :entry_id) + " + + set returnval [pm::task::update_hours \ + -task_item_id $task_item_id \ + -update_tasks_p $update_status_p] + + if {[string equal $update_status_p "t"]} { + pm::project::compute_status $project_item_id + } + } + + return $returnval +} + + + ad_proc -public pm::project::new { -project_name:required {-project_code ""} @@ -106,13 +203,131 @@ set planned_end_date "" } - set return_val [db_exec_plsql new_project_item { *SQL }] + # create a logger project + set logger_project [logger::project::new \ + -name $project_name \ + -description $description \ + -project_lead $creation_user \ + ] - return $return_val + # create a project manager project (associating the logger project + # with the logger project) + set project_revision [db_exec_plsql new_project_item { *SQL }] + + # add in the default variable (hopefully hours) + logger::project::map_variable \ + -project_id $logger_project \ + -variable_id [logger::variable::get_default_variable_id] + + return $project_revision } -ad_proc -public pm::project::latest_start { +ad_proc -public pm::project::delete { + -project_item_id:required +} { + Stub for project deletion + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-03 + + @param project_item_id + + @return + + @error +} { + + # should we delete the logger project as well? + +} + + +ad_proc -public pm::project::edit { + -project_item_id:required + -project_name:required + {-project_code ""} + {-parent_id ""} + {-goal ""} + {-description ""} + {-planned_start_date ""} + {-planned_end_date ""} + {-actual_start_date ""} + {-actual_end_date ""} + -logger_project:required + {-ongoing_p "f"} + -status_id:required + -organization_id:required + {-creation_date ""} + -creation_user:required + -creation_ip:required + -package_id:required +} { + Stub for project edit + + + + select pm_project__new_project_revision ( + :project_item_id, + :project_name, + :project_code, + :parent_id, + :goal, + :description, + to_timestamp(:planned_start_date,'YYYY MM DD HH24 MI SS'), + to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'), + null, + null, + :ongoing_p, + :status_id, + :customer_id, + now(), + :user_id, + :peeraddr, + :package_id + ); + + + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-03 + + @param project_item_id + + @param project_name + + @return + + @error +} { + +} + + +ad_proc -public pm::project::get { + -project_item_id:required + -array:required +} { + Stub for get function + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-03 + + @param project_item_id + + @param array + + @return values for this project identified by project_item_id, in + an array named array + + @error +} { + +} + + + +ad_proc -private pm::project::latest_start { {-end_date_j:required} {-hours_to_complete:required} {-hours_day:required} @@ -165,7 +380,7 @@ } -ad_proc -public pm::project::earliest_finish { +ad_proc -private pm::project::earliest_finish { earliest_start_j hours_to_complete hours_day @@ -202,7 +417,7 @@ } -ad_proc -public pm::project::my_earliest_start { +ad_proc -private pm::project::my_earliest_start { earliest_start_j hours_to_complete hours_day @@ -238,7 +453,7 @@ } -ad_proc -public pm::project::my_latest_finish { +ad_proc -private pm::project::my_latest_finish { latest_start_j hours_to_complete hours_day @@ -273,7 +488,7 @@ } -ad_proc -public pm::project::julian_to_day_of_week { +ad_proc -private pm::project::julian_to_day_of_week { julian_date } { Computes the day of the week. 0=Sunday @@ -292,7 +507,9 @@ return $day_of_week } -ad_proc -public pm::project::is_workday_p { + + +ad_proc -private pm::project::is_workday_p { date_j } { @@ -313,9 +530,12 @@ } + ad_proc -public pm::project::compute_status {project_item_id} { + Looks at tasks and subprojects, and computes the current status of a project.

+ These are the items we'd like to compute

@@ -334,24 +554,27 @@
 
     Tasks in ongoing projects are given null completion dates.
 
+    

+ The statistics are computed based on:

- project statistics are based on that project + subproject statistics + + Project statistics are based on that project + subproject statistics

- that means if a project has a subproject, then the tasks for + + 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 + 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. + For a project with subprojects, the statistics are based on the + tasks of both of those projects. -

- this function returns - a project, plus all subproject tasks. - @author Jade Rubick (jader@bread.com) @creation-date 2004-02-19 @@ -700,13 +923,13 @@ # info for these items # ----------------------------------------------------- - ns_log Notice "Starting foreach task-item $task_list" + # ns_log Notice "Starting foreach task-item $task_list" foreach task_item $task_list { if {![info exists dependent($task_item)]} { - ns_log Notice " !info exists dependent($task_item)" + # ns_log Notice " !info exists dependent($task_item)" # we check this because some tasks already have # hard deadlines set. @@ -744,7 +967,7 @@ # we specify that the task is an ongoing task if {[empty_string_p $end_date_j]} { set ongoing_task($task_item) true - ns_log Notice "NSDBAHNITD: end_date_j was empty ti:$task_item" + # ns_log Notice "NSDBAHNITD: end_date_j was empty ti:$task_item" } else { set latest_finish($task_item) $end_date_j @@ -760,7 +983,7 @@ # ns_log Notice "Begin latest_start($task_item): $latest_start($task_item) latest_finish: $latest_finish($task_item)" } else { - ns_log Notice " info exists dependent($task_item)" + #ns_log Notice " info exists dependent($task_item)" } } @@ -769,11 +992,11 @@ # stop if we have no dependencies # ------------------------------- if {[llength $present_tasks] == 0} { - ns_log Notice "No tasks with dependencies" + # ns_log Notice "No tasks with dependencies" return [list] } - ns_log Notice "LATEST present_tasks: $present_tasks" + # ns_log Notice "LATEST present_tasks: $present_tasks" # ------------------------------------------------------ # figure out the latest start and finish times @@ -785,7 +1008,7 @@ foreach task_item $present_tasks { - ns_log Notice "this task_item: $task_item" + # ns_log Notice "this task_item: $task_item" # ----------------------------------------------------- # some tasks may already have latest_start filled in. @@ -795,7 +1018,7 @@ if {[info exists dependent($task_item)]} { - ns_log Notice " info exists for dependent($task_item)" + # ns_log Notice " info exists for dependent($task_item)" # --------------------------------------------- # set the latest_start for this task = @@ -818,7 +1041,7 @@ if {[exists_and_not_null ongoing_task($dependent_item)]} { set defer_p f set my_latest_start "" - ns_log Notice "ongoing_task, no defer" + # ns_log Notice "ongoing_task, no defer" } elseif {![exists_and_not_null latest_start($dependent_item)]} { # we defer the task if the dependent item has no @@ -840,10 +1063,10 @@ # a deadline. :( if {$defer_count($task_item) > 5} { set defer_p f - ns_log Notice " no defer because defer count exceeded" + # ns_log Notice " no defer because defer count exceeded" } else { lappend future_tasks $task_item - ns_log Notice " defer" + # ns_log Notice " defer" set defer_p t } @@ -859,7 +1082,7 @@ -hours_to_complete $activity_time($task_item) \ -hours_day $hours_day] - ns_log Notice " my_latest_start: $my_latest_start" + # ns_log Notice " my_latest_start: $my_latest_start" if {$my_latest_start < $min_latest_start} { set min_latest_start $my_latest_start @@ -890,7 +1113,7 @@ set latest_start($task_item) $min_latest_start } - ns_log Notice " min_latest_start: $min_latest_start" + # ns_log Notice " min_latest_start: $min_latest_start" # we now set the latest finish. Ongoing tasks set # the latest finish to empty @@ -916,12 +1139,12 @@ } } - ns_log Notice \ - " latest_start ($task_item): $latest_start($task_item)" - ns_log Notice \ - " latest_finish($task_item): $latest_finish($task_item)" + #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" + # ns_log Notice "Deferring $task_item" } } @@ -934,7 +1157,7 @@ } } - ns_log Notice "future tasks: $future_tasks" + # ns_log Notice "future tasks: $future_tasks" set present_tasks $future_tasks } @@ -951,7 +1174,7 @@ foreach task_item $task_list { - ns_log Notice "*Latest start ($task_item): $latest_start($task_item)" + # 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) } @@ -990,7 +1213,7 @@ } - ns_log Notice "*******************" + # ns_log Notice "*******************" return $task_list @@ -1004,7 +1227,7 @@ When a project is updated, or a task updated within a project, we need to update all the projects higher in the hierarchy. } { - ns_log Notice "computing parents for $project_item_id" + # ns_log Notice "computing parents for $project_item_id" set package_id [ad_conn package_id] @@ -1022,11 +1245,36 @@ set my_item_id $parent_id } - ns_log Notice "root: $root_folder , last_item_id $last_item_id" + # ns_log Notice "root: $root_folder , last_item_id $last_item_id" set return_code [compute_status $last_item_id] return $return_code } + +ad_proc -public pm::project::get_logger_project { + -project_item_id:required +} { + Returns logger's project ID when given project manager's project ID + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-04 + + @param project_item_id + + @return logger's project_id + + @error returns no_project if no such project_item_id exists +} { + return [db_string get_logger_project " + SELECT + logger_project + FROM + pm_projects + WHERE + project_id = + (select live_revision from cr_items where item_id = :project_item_id) + " -default "no_project"] +} Index: openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs-postgresql.xql,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.1.2.5 @@ -3,7 +3,7 @@ postgresql7.3 - + SELECT i.item_id @@ -16,6 +16,17 @@ + + + SELECT + live_revision + FROM + cr_items i + WHERE + i.item_id = :task_item_id + + + select status_id @@ -42,14 +53,14 @@ - + select pm_task__new_task_revision ( :task_item_id, :project_item_id, :title, :description, - [pm::project::util::datenvl -value $end_date -value_if_null "null" -value_if_not_null "to_timestamp('$end_date','YYYY MM DD HH24 MI SS')"], + [pm::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, Index: openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs.tcl,v diff -u -r1.1.2.5 -r1.1.2.6 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.5 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.6 @@ -12,6 +12,8 @@ namespace eval pm::task {} + + ad_proc -public pm::task::dependency_delete_all { -task_item_id:required @@ -23,7 +25,6 @@ @param task_item_id The task we wish to remove the dependencies from - @return @error @@ -32,6 +33,7 @@ return 1 } + ad_proc -public pm::task::dependency_add { -task_item_id:required -parent_id:required @@ -56,7 +58,7 @@ project, then we have a loop

- the way we check for a loop is to follow the dependencies + The way we check for a loop is to follow the dependencies until we get to a task that has already been created. @author Jade Rubick (jader@bread.com) @@ -120,26 +122,8 @@ -current_task $task_item_id \ -dependency_list $dep_list] - ns_log debug "LOOPS? $valid_p" - #set passes_p f - #set my_task $task_item_id - #set my_parent $parent_id - - #while {$loop_limit >= 0} { - - #if {[exists_and_not_null dep_parent($my_task)]} { - # set my_task $dep_parent($my_task) - # } else { - # set passes_p t - # break - # } - # - # set loop_limit [expr $loop_limit - 1] - #} } - #ns_write "$loops_p" - #ad_script_abort if {[string equal $valid_p "TRUE"]} { # after it passes @@ -182,16 +166,12 @@ @error } { - ns_log Notice "in verify_no_loops current_task: $current_task dependency_list $dependency_list" - set return_val "" array set task_state [nsv_array get task_node_status] - ns_log Notice " btw: $current_task -> $task_state($current_task)" set task_state($current_task) 1 - ns_log Notice " set state $current_task -> 1" nsv_array set task_node_status [array get task_state] foreach arc $dependency_list { @@ -206,10 +186,7 @@ set used $task_state($tNode) - ns_log Notice "Used is $used" - if {[string equal $used 1]} { - ns_log Notice "we return FALSE" return FALSE } @@ -218,28 +195,25 @@ -dependency_list $dependency_list ] - ns_log Notice " return_val $return_val" - if {[string equal $return_val FALSE]} { - ns_log Notice "we return FALSE" return FALSE } } } array set task_state [nsv_array get task_node_status] - ns_log Notice " btw task_state($current_task) = $task_state($current_task)" + set task_state($current_task) 2 - ns_log Notice " set task_state($current_task) = 2" + nsv_array set task_node_status [array get task_state] return TRUE } -ad_proc -public pm::task::get_task_item_id { +ad_proc -public pm::task::get_item_id { -task_id:required } { Returns the task_item_id (item_id) when given the task_id (revision_id) @@ -253,11 +227,34 @@ @error } { - set return_val [db_string get_task_item_id { }] + set return_val [db_string get_item_id { }] return $return_val } + + +ad_proc -public pm::task::get_revision_id { + -task_item_id:required +} { + Returns task_id (revision_id) when given the task_item_id (item_id) + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-02-19 + + @param task_item_id The revision item + + @return task_item_id + + @error +} { + set return_val [db_string get_revision_id { }] + + return $return_val +} + + + ad_proc -public pm::task::default_status_open {} { Returns the default status value for open tasks } { @@ -266,6 +263,7 @@ return $return_val } + ad_proc -public pm::task::default_status_closed {} { Returns the default status value for closed tasks } { @@ -275,7 +273,8 @@ } -ad_proc -public pm::task::update { + +ad_proc -public pm::task::edit { -task_item_id:required -project_item_id:required -title:required @@ -368,30 +367,36 @@ } + ad_proc -public pm::task::get_url { object_id } { # set package_id [db_string get_package_id {}] # set package_url [site_node::get_url_from_object_id -object_id $package_id] # set package_url [site_node::get_url_from_object_id -object_id $object_id] #return "${package_url}task-one?task_id=$object_id" - return "/project-manager/task-one?task_id=$object_id" + return {} + # "/project-manager/task-one?task_id=$object_id" } + + ad_proc -public pm::task::process_reply { reply_id } { - + # return successful_p = "f" + return "f" } + ad_proc -public pm::task::slack_time { -earliest_start_j:required -today_j:required -latest_start_j:required } { + Return the amount of slack time - @author Jade Rubick (jader@bread.com) @creation-date 2004-02-20 @@ -421,3 +426,73 @@ } + + +ad_proc -private pm::task::update_hours { + {-task_item_id ""} + {-task_revision_id ""} + {-update_tasks_p "t"} +} { + The pm_tasks_revisions table contains a denormalized cache of the + total number of hours logged to it. Updates the cache from the + hours logged in logger and the pm_task_logger_proj_map table + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-03-04 + + @param task_item_id + + @param task_revision_id + + @param update_tasks_p If t, updates the current pm_tasks_revision + table in the database. + + @return total logged hours + + @error if neither task_item_id or task_revision_id is defined, + returns -1 +} { + if { \ + ![info exists task_item_id] && \ + ![info exists task_revision_id]} { + + ns_log Error "Illegal parameters in pm::task::update_hours" + return -1 + } + + if { \ + [exists_and_not_null task_item_id] && \ + ![exists_and_not_null task_revision_id]} { + + set task_revision_id [pm::task::get_revision_id \ + -task_item_id $task_item_id] + } + + if { \ + ![exists_and_not_null task_item_id] && \ + [exists_and_not_null task_revision_id]} { + + set task_item_id [pm::task::get_item_id \ + -task_id $task_revision_id] + } + + + set total_logged_hours [db_string total_hours " + select sum(le.value) from logger_entries le where entry_id in (select logger_entry from pm_task_logger_proj_map where task_item_id = :task_item_id) and le.variable_id = '[logger::variable::get_default_variable_id]' + " -default "0"] + + if {[string equal $update_tasks_p "t"]} { + + db_dml update_current_task " + UPDATE + pm_tasks_revisions + SET + actual_hours_worked = :total_logged_hours + WHERE + task_revision_id = :task_revision_id + " + } + + return $total_logged_hours + +} Index: openacs-4/contrib/packages/project-manager/www/add-edit-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-2-postgresql.xql,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/contrib/packages/project-manager/www/add-edit-2-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.1.2.3 +++ openacs-4/contrib/packages/project-manager/www/add-edit-2-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.1.2.4 @@ -17,7 +17,6 @@ UPDATE pm_projects set - WHERE project_id = :project_id Index: openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit-2.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/www/add-edit-2.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.5 @@ -91,7 +91,7 @@ ad_script_abort } -edit_data { - + db_dml update_project { *SQL* } } -after_submit { 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.9.2.4 -r1.9.2.5 --- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.9.2.4 +++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.9.2.5 @@ -30,53 +30,6 @@ - - - select pm_project__new_project_item ( - :project_name, - :project_code, - :parent_id, - :goal, - :description, - to_timestamp(:planned_start_date,'YYYY MM DD HH24 MI SS'), - to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'), - null, - null, - :ongoing_p, - :status_id, - :customer_id, - now(), - :user_id, - :peeraddr, - :package_id - ); - - - - - - select pm_project__new_project_revision ( - :project_item_id, - :project_name, - :project_code, - :parent_id, - :goal, - :description, - to_timestamp(:planned_start_date,'YYYY MM DD HH24 MI SS'), - to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'), - null, - null, - :ongoing_p, - :status_id, - :customer_id, - now(), - :user_id, - :peeraddr, - :package_id - ); - - - SELECT 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.12.2.8 -r1.12.2.9 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.12.2.8 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.12.2.9 @@ -123,21 +123,9 @@ {options {[db_list_of_lists get_status_codes { }]}} } - } \ - -new_request { - - if {[string equal $ongoing_by_default_p t]} { - set ongoing_p t - } - - set planned_end_date [util::date acquire clock [clock scan $planned_end_date]] - - set planned_start_date [util::date acquire clock [clock scan $planned_start_date]] - } - if {[exists_and_not_null project_id]} { if {![empty_string_p [category_tree::get_mapped_trees $package_id]]} { ad_form -extend -name add_edit -form { @@ -187,9 +175,21 @@ set user_id [ad_conn user_id] set peeraddr [ad_conn peeraddr] + + } \ + -new_request { - } -new_data { + if {[string equal $ongoing_by_default_p t]} { + set ongoing_p t + } + set planned_end_date [util::date acquire clock [clock scan $planned_end_date]] + + set planned_start_date [util::date acquire clock [clock scan $planned_start_date]] + + } \ + -new_data { + set project_id [pm::project::new \ -project_name $project_name \ -project_code $project_code \ @@ -230,6 +230,25 @@ # it until it is edited. So we need to pull in these values set old_project_id $project_id + set project_id [pm::project::edit \ + -project_item_id $project_item_id \ + -project_name $project_name \ + -project_code $project_code \ + -parent_id $parent_id \ + -goal $goal \ + -description $description \ + -planned_start_date $planned_start_date \ + -planned_end_date $planned_end_date \ + -actual_start_date "" \ + -actual_end_date "" \ + -logger_project $logger_project \ + -ongoing_p $ongoing_p \ + -status_id $status_id \ + -organization_id $customer_id \ + -creation_user $user_id \ + -creation_ip $peeraddr \ + -package_id $package_id] + set project_id [db_exec_plsql new_project_revision { *SQL* }] pm::project::compute_parent_status $project_item_id @@ -246,4 +265,3 @@ } } -ns_log Notice "end of it all" 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.8.2.7 -r1.8.2.8 --- openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.8.2.7 +++ openacs-4/contrib/packages/project-manager/www/index-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.8.2.8 @@ -25,7 +25,6 @@ to_char(p.latest_finish_date, 'MM/DD/YY') as latest_finish_date, case when o.name is null then '--no customer--' else o.name end as customer_name, - case when f.name is null then '--no facility--' else f.name end as facility_name, o.organization_id as customer_id FROM pm_projectsx p LEFT JOIN organizations o ON p.customer_id = 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.17.2.3 -r1.17.2.4 --- openacs-4/contrib/packages/project-manager/www/index.adp 27 Feb 2004 22:46:13 -0000 1.17.2.3 +++ openacs-4/contrib/packages/project-manager/www/index.adp 6 Mar 2004 00:29:24 -0000 1.17.2.4 @@ -1,4 +1,4 @@ - + @@ -9,12 +9,6 @@ - - - - - - @category_select;noquote@ @@ -23,6 +17,12 @@ + + + + + + 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.9.2.9 -r1.9.2.10 --- openacs-4/contrib/packages/project-manager/www/index.tcl 27 Feb 2004 22:46:13 -0000 1.9.2.9 +++ openacs-4/contrib/packages/project-manager/www/index.tcl 6 Mar 2004 00:29:24 -0000 1.9.2.10 @@ -152,7 +152,7 @@ } earliest_finish_date { label "Earliest finish" - display_template "@projects.earliest_finish_date@@projects.earliest_finish_date@" + display_template "@projects.earliest_finish_date@@projects.earliest_finish_date@" } latest_finish_date { label "Latest Finish" @@ -168,13 +168,10 @@ } } \ -actions { - "Tasks" "tasks" "View list of tasks" - "Processes" "processes" "View and use processes" "Add project" "add-edit" "Add project" "Customers" "/organization" "View customers" - "Admin" "admin/" "Administration pages" } \ - -main_class { + -sub_class { narrow } \ -filters { Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/log.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/log.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/log.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.19.2.6 -r1.19.2.7 --- openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.19.2.6 +++ openacs-4/contrib/packages/project-manager/www/one-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.19.2.7 @@ -1,29 +1,6 @@ - - - SELECT - p.item_id as project_item_id - FROM - pm_projectsx p - WHERE - p.project_id = :project_id - - - - - - SELECT - p.project_id - FROM - pm_projectsx p, cr_items i - WHERE - p.item_id = :project_item_id and - p.revision_id = i.live_revision - - - SELECT @@ -35,6 +12,7 @@ p.description, to_char(p.planned_start_date,'YYYY-MM-DD HH24:MI') as planned_start_date, to_char(p.planned_end_date,'YYYY-MM-DD HH24:MI') as planned_end_date, + p.logger_project, p.ongoing_p, i.live_revision, to_char(p.estimated_finish_date,'YYYY-MM-DD HH24:MI') as estimated_finish_date, 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.27.2.7 -r1.27.2.8 --- openacs-4/contrib/packages/project-manager/www/one.adp 27 Feb 2004 22:46:13 -0000 1.27.2.7 +++ openacs-4/contrib/packages/project-manager/www/one.adp 6 Mar 2004 00:29:24 -0000 1.27.2.8 @@ -1,57 +1,56 @@ - + + + - - -@project_term@ #@project_item_id@: @project.project_name;noquote@ -@context_bar;noquote@ - - + @project_term@ #@project_item_id@: @project.project_name;noquote@ + @context@ + +

(not current, select live version below)

- - -
+ +
+
- +
+ +   @project_term@ - - - - + + - + @@ -142,7 +140,7 @@

-

- + Edit + alt="Edit" /> - @project_term@
- + - + - + - + - + @@ -61,22 +60,22 @@
Name @project.project_name@
Code @project.project_code@
Goal @project.goal@
Description @project.description@
- +

- - + +
- +
Dates
- + @@ -86,7 +85,7 @@ - + @@ -96,7 +95,7 @@ - + @@ -106,22 +105,22 @@ - + - + - +
Start @project.planned_start_date@
Earliest finish Ongoing
Deadline Ongoing
Latest finish Ongoing
Hours completedTask hours completed @project.actual_hours_completed@ of @project.estimated_hours_total@
- +

- +
@@ -133,7 +132,6 @@ -
Project information
Customer @custom.customer_name@

+
@@ -169,30 +167,45 @@
Categories

- Add subproject - Subprojects: - - + + + + + + + + +
Subprojects
Add subproject + + + +
+

- - +
- + + + +
Tasks@task_term@
- +
  • @@ -210,9 +223,36 @@
+

+ + + + + + + + + + + + + + +
Logged hours
+ + Log hours + + + @log_note@ +
+ +

-
@@ -221,4 +261,3 @@
- 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.26.2.8 -r1.26.2.9 --- openacs-4/contrib/packages/project-manager/www/one.tcl 27 Feb 2004 22:46:13 -0000 1.26.2.8 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 6 Mar 2004 00:29:24 -0000 1.26.2.9 @@ -1,11 +1,12 @@ ad_page_contract { - Main view page for one project. + Main view page for one project. Also shows logged time, and allows a + user to log time @author jader@bread.com, ncarroll@ee.usyd.edu.au @creation-date 2003-05-15 @cvs-id $Id$ - @return context_bar Context bar. + @return context Context bar. @return versions a multirow holding versions of the project @return live_revision the project_id of the live_revision @@ -30,7 +31,7 @@ } -properties { categories:onelist - context_bar:onevalue + context:onevalue project:multirow tasks:multirow people:multirow @@ -45,15 +46,20 @@ use_project_code_p:onevalue use_uncertain_completion_times_P:onevalue use_project_customizations_p:onevalue + task_term:onevalue + then_ansi:onevalue + edit_url:onevalue } -validate { project_item_id_exists { if {![exists_and_not_null project_item_id]} { - set project_item_id [db_string get_item_id { }] + set project_item_id [pm::project::get_project_item_id \ + -project_id $project_id] } } project_id_exists { if {![exists_and_not_null project_id]} { - set project_id [db_string get_project_id { }] + set project_id [pm::project::get_project_id \ + -project_item_id $project_item_id] } } } @@ -66,11 +72,13 @@ set package_id [ad_conn package_id] set user_id [ad_maybe_redirect_for_registration] + # terminology set project_term [parameter::get -parameter "ProjectName" -default "Project"] set project_term_lower [parameter::get -parameter "projectname" -default "project"] -set use_goal_p [parameter::get -parameter "UseGoalP" -default "1"] -set use_project_code_p [parameter::get -parameter "UseUserProjectCodesP" -default "1"] +set task_term [parameter::get -parameter "TaskName" -default "Task"] +set use_goal_p [parameter::get -parameter "UseGoalP" -default "1"] +set use_project_code_p [parameter::get -parameter "UseUserProjectCodesP" -default "1"] set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] set use_project_customizations_p [parameter::get -parameter "UseProjectCustomizationsP" -default "0"] @@ -80,9 +88,9 @@ set write_p [permission::permission_p -object_id $package_id -privilege write] set create_p [permission::permission_p -object_id $package_id -privilege create] + # categories - set categories [list] set cat_list [category::get_mapped_categories $project_item_id] foreach cat $cat_list { @@ -97,13 +105,25 @@ set project(estimated_finish_date) [lc_time_fmt $project(estimated_finish_date) "%x"] set project(earliest_finish_date) [lc_time_fmt $project(earliest_finish_date) "%x"] set project(latest_finish_date) [lc_time_fmt $project(latest_finish_date) "%x"] +set project(logger_variable_id) [logger::variable::get_default_variable_id] +set log_url "[ad_conn package_url]log?project_id=$project(logger_project)&pm_project_id=$project_item_id" + +set then_ansi [db_string get_now_julian "select to_char(current_timestamp - '30 days'::INTERVAL,'YYYY-MM-DD')"] + + +set log_note "Last 30 days" + + + +set edit_url "[ad_conn package_url]add-edit?[export_url_vars project_item_id]" + # set up context bar, needs parent_id if {[string equal $project(parent_id) $project_root]} { - set context_bar [ad_context_bar "View"] + set context [list "View"] } else { - set context_bar [ad_context_bar [list "one?project_item_id=$project(parent_id)" "Parent"] "View"] + set context [list [list "one?project_item_id=$project(parent_id)" "Parent"] "View"] } # Tasks, using list-builder --------------------------------- @@ -165,7 +185,9 @@ } } \ - -actions [list "Use process" $process_link "Use a process" "Projects" "index" "View list of tasks" "Tasks" "tasks" "View tasks for all projects" "Processes" "processes" "View and use processes" "Admin" "admin/" "Administration pages"]\ + -actions { + "Use process" $process_link "Use a process" + } \ -bulk_actions { "Edit" "task-add-edit" "Edit tasks" } \ @@ -174,7 +196,7 @@ project_id {my_key 1} } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -232,7 +254,7 @@ label "Hours completed" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -275,7 +297,7 @@ label "Role" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -323,7 +345,7 @@ label "Deadline" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -356,9 +378,17 @@ db_1row custom_query { } -column_array custom +set custom(item_code_issued) [lc_time_fmt $custom(item_code_issued) "%x"] + # end of customizations +# ----------------------------------------------------------------- +# Logger forms and so on - shows time logged, and allows you to log +# other time +# ----------------------------------------------------------------- + + ad_return_template # ------------------------- END OF FILE ------------------------- # Index: openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-add-edit.tcl,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.7 @@ -92,11 +92,3 @@ } -ns_log notice end of my page! -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} Index: openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-dependency-add-edit.tcl,v diff -u -r1.3.2.6 -r1.3.2.7 --- openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.3.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.3.2.7 @@ -1,14 +1,3 @@ -ns_log notice depedency page -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - - - ad_page_contract { Form to add task dependencies @@ -60,7 +49,6 @@ if {![exists_and_not_null use_dependency]} { - ns_log Notice "Redirecting" ad_returnredirect "process-one?[export_url_vars process_id]" ad_script_abort } @@ -113,7 +101,6 @@ set process_task_id $process_task_id_pass foreach tsk_id $process_task_id { - ns_log Notice "new: deleting dependency for task $tsk_id" db_dml delete_dependency { } } @@ -135,7 +122,6 @@ set process_task_id $process_task_id_pass foreach tsk_id $process_task_id { - ns_log Notice "edit: deleting dependency for task $tsk_id" db_dml delete_dependency { } } @@ -193,8 +179,6 @@ } } - ns_log Notice "parent: $tasks(parent_task_id)" - append add_edit_definition " {task_id.$tasks(task_id):text(hidden) {value {$tasks(task_id)}} Index: openacs-4/contrib/packages/project-manager/www/process-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-one.tcl,v diff -u -r1.6.2.6 -r1.6.2.7 --- openacs-4/contrib/packages/project-manager/www/process-one.tcl 27 Feb 2004 22:46:13 -0000 1.6.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-one.tcl 6 Mar 2004 00:29:24 -0000 1.6.2.7 @@ -96,7 +96,7 @@ process_id project_id } \ - -main_class { + -sub_class { narrow } \ -filters { Index: openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-add-edit-2.tcl,v diff -u -r1.4.2.6 -r1.4.2.7 --- openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl 27 Feb 2004 22:46:13 -0000 1.4.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-task-add-edit-2.tcl 6 Mar 2004 00:29:24 -0000 1.4.2.7 @@ -1,12 +1,3 @@ -ns_log notice process-task-add-edit-2 -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - ad_page_contract { Add/edit form for process tasks, page 2 @@ -94,8 +85,6 @@ set edit_p [db_string editing_process_tasks_p { } -default "0"] -ns_log Notice "edit_p: $edit_p" - if {[string equal $edit_p "0"]} { # ----------------------------- @@ -180,8 +169,6 @@ # do the actual edit db_dml edit_task { } - ns_log Notice "edited process task" - if {[info exists use_dependency_p($i)] && [string equal $use_dependency_p($i) "t"]} { lappend revision_has_dependencies $this_revision_id } else { Index: openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-add-edit.tcl,v diff -u -r1.6.2.6 -r1.6.2.7 --- openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.6.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-task-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.6.2.7 @@ -1,12 +1,3 @@ -ns_log notice process-task-add-edit -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - ad_page_contract { Add/edit form for process tasks @@ -97,8 +88,6 @@ set estimated_hours_work_min_v($i) $estimated_hours_work_min set estimated_hours_work_max_v($i) $estimated_hours_work_max - ns_log Notice "Dt: $dependency_type" - if {[exists_and_not_null dependency_type]} { set checked_v($i) "checked" } else { @@ -139,8 +128,6 @@ set process_task_id_tmp [lindex $process_task_id [expr $i-1]] } - ns_log Notice "process_task_id_tmp $process_task_id_tmp ($process_task_id)" - template::multirow append num $process_task_id_tmp $one_line_v($i) $description_v($i) $estimated_hours_work_v($i) $estimated_hours_work_min_v($i) $estimated_hours_work_max_v($i) $checked_v($i) } Index: openacs-4/contrib/packages/project-manager/www/process-task-assign-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-task-assign-add-edit.tcl,v diff -u -r1.6.2.6 -r1.6.2.7 --- openacs-4/contrib/packages/project-manager/www/process-task-assign-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.6.2.6 +++ openacs-4/contrib/packages/project-manager/www/process-task-assign-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.6.2.7 @@ -1,12 +1,3 @@ -ns_log notice process-task-add-edit -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - ad_page_contract { Form to add in assignments to process tasks @@ -192,7 +183,6 @@ set process_task_id_pass [string map {"-" " "} $process_task_id_pass] set process_task_id $process_task_id_pass - ns_log Notice "deleting assignments process_task_id: $process_task_id" db_dml delete_assignments { } foreach pl $party_list { @@ -203,8 +193,6 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) - ns_log Notice "add tid: $t_id rid: $r_id pid: $p_id" - db_dml add_assignment { } } @@ -281,8 +269,6 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) - ns_log Notice "edit tid: $t_id rid: $r_id pid: $p_id" - db_dml add_assignment { } } @@ -343,11 +329,3 @@ } -ns_log notice it's my page, but later! -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} Index: openacs-4/contrib/packages/project-manager/www/processes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/processes.adp,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/contrib/packages/project-manager/www/processes.adp 4 Dec 2003 21:00:13 -0000 1.4.2.1 +++ openacs-4/contrib/packages/project-manager/www/processes.adp 6 Mar 2004 00:29:24 -0000 1.4.2.2 @@ -1,9 +1,9 @@ - + Processes -@context_bar;noquote@ +@context_bar@ Index: openacs-4/contrib/packages/project-manager/www/processes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/processes.tcl,v diff -u -r1.4.2.6 -r1.4.2.7 --- openacs-4/contrib/packages/project-manager/www/processes.tcl 27 Feb 2004 22:46:13 -0000 1.4.2.6 +++ openacs-4/contrib/packages/project-manager/www/processes.tcl 6 Mar 2004 00:29:24 -0000 1.4.2.7 @@ -16,7 +16,7 @@ } -properties { - context_bar:onevalue + context:onevalue processes:multirow write_p:onevalue create_p:onevalue @@ -36,7 +36,7 @@ set project_term_lower [parameter::get -parameter "projectname" -default "project"] # set up context bar -set context_bar [ad_context_bar "Processes"] +set context_bar [list "Processes"] # the unique identifier for this package set package_id [ad_conn package_id] @@ -81,9 +81,7 @@ narrow } \ -actions { - "Projects" "index" "View projects" "Add process" "process-add-edit" "Add a process" - "Admin" "admin/" "Administration pages" } \ -filters { orderby_process {} Index: openacs-4/contrib/packages/project-manager/www/task-add-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit-postgresql.xql,v diff -u -r1.11.2.5 -r1.11.2.6 --- openacs-4/contrib/packages/project-manager/www/task-add-edit-postgresql.xql 27 Feb 2004 22:46:13 -0000 1.11.2.5 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.11.2.6 @@ -27,7 +27,7 @@ :project_item_id, :p_task_title, :p_description, - [pm::project::util::datenvl -value [set end_date_$i] -value_if_null "null," -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS'),"] + [pm::util::datenvl -value [set end_date_$i] -value_if_null "null," -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS'),"] :p_percent, :p_work, :p_work_min, Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.adp,v diff -u -r1.10.2.3 -r1.10.2.4 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 27 Feb 2004 22:46:13 -0000 1.10.2.3 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 6 Mar 2004 00:29:24 -0000 1.10.2.4 @@ -1,11 +1,11 @@ - + @title;noquote@ - @context_bar;noquote@ + @context@
- +
@@ -18,9 +18,9 @@ - + - -
 #@num.rownum@   #@num.rownum@  Subject:*
+
Subject:*

@@ -29,15 +29,6 @@

- Description:
- - -
- Error -
-
-

- Skip this task?
@@ -49,18 +40,30 @@ + Description:
+ + +
+ Error +
+
+

+

+ + - - + + - - - + + - - - + + - - + -
Work required:*
Work required: + *

+

Min: +
Min: hrs @@ -71,9 +74,9 @@
Max: +
Max: hrs @@ -100,25 +103,75 @@
+

[i] You must enter a number here (make your best guess)

-

- - + + + + + + + + + + + + + + + + +

Log entry

+

Complete: + + + Error + + % +
Time: + + + Error + + hours +
Description: + + + Error + + +
+ + + + + Error + + +

+ - - - Deadline:
+ + + + + + + + + + + +
+ Deadline: + Error @@ -131,10 +184,18 @@

+ + + + + + + -
+ Dependency: -
@@ -158,55 +219,19 @@
-
- - - - - - - - - - -
Percent complete: - - - - -
Hours worked: - - - - -
-
- - - - - - - - - - - + Error - + + - - - <% ns_log Notice error: [export_vars formerror]%> -
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.23.2.8 -r1.23.2.9 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.23.2.8 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.23.2.9 @@ -1,16 +1,3 @@ -set debug 1 - -if {[string equal $debug 1]} { - ns_log notice task add edit page - set mypage [ns_getform] - if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page - } else { - ns_log notice the following form was submitted on my page - ns_set print $mypage - } -} - ad_page_contract { Add/edit form for tasks @@ -19,7 +6,7 @@ @creation-date 2003-07-28 @cvs-id $Id$ - @return context_bar Context bar. + @return context Context bar @return title Page title. @return num A multirow datasource to iterate over the ad_form elements @return edit_p if t then we are editing. Used to show different portions of the form @@ -54,6 +41,8 @@ end_date:array,optional percent_complete:array,optional actual_hours_worked:array,optional + new_hours_logged:array,optional + new_description_logged:array,optional estimated_hours_work:array,optional estimated_hours_work_min:array,optional estimated_hours_work_max:array,optional @@ -64,7 +53,7 @@ } -properties { - context_bar:onevalue + context:onevalue title:onevalue num:multirow use_uncertain_completion_times_p:onevalue @@ -226,19 +215,21 @@ for {set i 1} {$i <= $number} {incr i} { # set up date variable names set end_date_$i [list $end_date_year($i) $end_date_month($i) $end_date_day($i) {} {} {}] - ns_log Notice "End date $i: [set end_date_$i]" } } # --------------------------------------------------------------- # # permissions and title setup, etc -# we should update the permissions to not just use package_id +# we should update the permissions to not just use package_id, so +# users can have permissions on particular tasks but not others. +# Right now it's an open system. If you have write permissions on +# the package_id, you have permissions to write anywhere # --------------------------------------------------------------- # if {[exists_and_not_null task_id]} { set title "Edit a $task_term_lower" - set context_bar [ad_context_bar [list "one?item_id=$project_item_id&project_id=$project_id" "One $project_term"] "Edit $task_term"] + set context [list [list "one?item_id=$project_item_id&project_id=$project_id" "One $project_term"] "Edit $task_term"] permission::require_permission \ -party_id $user_id \ -object_id $package_id \ @@ -247,7 +238,7 @@ } else { set title "Add a $task_term_lower" - set context_bar [ad_context_bar [list "one?item_id=$project_item_id&project_id=$project_id" "One $project_term"] "New $task_term"] + set context [list [list "one?item_id=$project_item_id&project_id=$project_id" "One $project_term"] "New $task_term"] permission::require_permission \ -party_id $user_id \ -object_id $package_id \ @@ -312,7 +303,8 @@ # ----------------------------------------------------- # if we are editing the tasks, then we want to show the - # percent_complete + # percent_complete, and give the users the chance to + # log hours as well. # ----------------------------------------------------- ad_form -extend \ @@ -323,12 +315,15 @@ {html {size 4}} \ {value {$percent_complete_arr($i)}} \ ] \ - [list actual_hours_worked.$i:text \ - {label "Hours worked"} \ + [list new_hours_logged.$i:text,optional \ + {label "Hours logged"} \ {html {size 4}} \ - {value {$actual_hours_worked_arr($i)}} \ - ] - ] + ] \ + [list new_description_logged.$i:text,optional \ + {label "Description"} \ + {html {size 30}} \ + ] \ + ] # -------------------------------------- # we don't skip tasks when we're editing @@ -429,12 +424,7 @@ {html {size 4}} \ {value {$percent_complete_arr($i)}} \ ] \ - [list actual_hours_worked.$i:text(hidden) \ - {label "Hours worked"} \ - {html {size 6}} \ - {value {$actual_hours_worked_arr($i)}} \ - ] - ] + ] } } @@ -508,26 +498,20 @@ set process_depend "XXX" } - # ns_log Notice "proces_depend $process_depend" - # lsearch gives us the index value inside the # process_tasks list. That corresponds to the task minus # one. So we add one to this index, as long as the value # is not -1 (which indicates that process_depend is not in # the process_tasks list) - # ns_log Notice "lsearch [lsearch $process_tasks $process_depend]" + set which_dep_task [lsearch $process_tasks $process_depend] - # ns_log Notice "process_tasks: $process_tasks" - if {$which_dep_task >= 0} { incr which_dep_task } - # ns_log Notice "which_dep_task $which_dep_task $i" if {$which_dep_task == $process_index} { set dependency_arr($i) "num$which_dep_task" - # ns_log Notice "num$which_dep_task" } } @@ -566,7 +550,7 @@ [list \ task_title.$i:text \ {label "Subject \#$i"} \ - {html {size 39}} \ + {html {size 40}} \ {value {$task_title_arr($i)}} ] \ [list task_item_id.$i:text(hidden) \ @@ -646,8 +630,6 @@ } -new_data { - ns_log Notice "new data" - # -------------------------------------------------------------- # each task we add in returns a task_revision_id # -------------------------------------------------------------- @@ -683,16 +665,14 @@ set p_parent_task_id $dependency_task_id($i) set p_skip_p $skip_task_p($i) - # ns_log Notice "adding task: pii: $project_item_id tt:$p_task_title d:$p_description ed: end_date($i) w:$p_work m:$p_work_min mx:$p_work_max dep_type:$p_dep_type parent:$p_parent_task_id" - # add in the new task if {[string equal $p_skip_p "f"]} { set this_revision_id [pm::task::new \ -project_id $project_item_id \ -title $p_task_title \ -description $p_description \ - -end_date [pm::project::util::datenvl -value [set end_date_$i] -value_if_null "" -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS')"] \ + -end_date [pm::util::datenvl -value [set end_date_$i] -value_if_null "" -value_if_not_null "to_timestamp('[set end_date_$i]','YYYY MM DD HH24 MI SS')"] \ -percent_complete "0" \ -estimated_hours_work $p_work \ -estimated_hours_work_min $p_work_min \ @@ -728,7 +708,7 @@ # add in the new dependency pm::task::dependency_add \ -task_item_id $this_task_id \ - -parent_id $parent_task_id \ + -parent_id $p_parent_task_id \ -dependency_type $p_dep_type \ -project_item_id $project_item_id } @@ -751,7 +731,7 @@ if {[info exists dependent_task_id($dep_parent($dep_task))]} { set parent_task_id $dependent_task_id($dep_parent($dep_task)) set p_dep_type $dep_type($dep_task) - + pm::task::dependency_add \ -task_item_id $this_task_id \ -parent_id $parent_task_id \ @@ -763,36 +743,36 @@ } - ns_log Notice "Project_item_id $project_item_id" pm::project::compute_parent_status $project_item_id } -edit_data { - ns_log Notice "edit_data" + set timestamp_ansi [db_string get_today " + SELECT + to_char(current_date, 'YYYY-MM-DD')"] # -------------------------------------------------------------- # each task we edit returns a task_revision_id # -------------------------------------------------------------- for {set i 1} {$i <= $number} {incr i} { + if {![exists_and_not_null end_date_$i]} { + set end_date_$i "{} {} {} {} {} {}" + } + if {![exists_and_not_null estimated_hours_work($i)]} { set estimated_hours_work($i) [expr .5 * ($estimated_hours_work_max($i) - $estimated_hours_work_min($i)) + $estimated_hours_work_min($i)] } - + if {![exists_and_not_null estimated_hours_work_min($i)]} { - set estimated_hours_work_min($i) $estimated_hours_work($i) + set estimated_hours_work_min($i) $estimated_hours_work($i) } - + if {![exists_and_not_null estimated_hours_work_max($i)]} { set estimated_hours_work_max($i) $estimated_hours_work($i) } - if {![exists_and_not_null end_date_$i]} { - set end_date_$i "{} {} {} {} {} {}" - } - - # set up variables, pulling from arrays set p_task_item_id $task_item_id($i) set p_task_title $task_title($i) @@ -801,11 +781,41 @@ set p_work $estimated_hours_work($i) set p_work_min $estimated_hours_work_min($i) set p_work_max $estimated_hours_work_max($i) - set p_hours $actual_hours_worked($i) set p_parent_task_id $dependency_task_id($i) + set p_new_hours $new_hours_logged($i) + set p_new_description $new_description_logged($i) + + if {![empty_string_p $p_new_hours] && \ + $p_new_hours > 0} { + + set logger_project [pm::project::get_logger_project \ + -project_item_id $project_item_id] + set variable_id [logger::variable::get_default_variable_id] + + # add in the new log entry + set p_hours [pm::project::log_hours \ + -logger_project_id $logger_project \ + -variable_id $variable_id \ + -value $p_new_hours \ + -description $p_new_description \ + -timestamp_ansi $timestamp_ansi \ + -task_item_id $p_task_item_id \ + -project_item_id $project_item_id \ + -update_status_p f] + + if {[string equal p_hours -1]} { + ns_log Error "Error in logging hours in task-add-edit" + set p_hours 0 + } + } else { + set p_hours [pm::task::update_hours \ + -task_item_id $p_task_item_id \ + -update_tasks_p f] + } + # do the actual edit - set this_revision_id [pm::task::update \ + set this_revision_id [pm::task::edit \ -task_item_id $p_task_item_id \ -project_item_id $project_item_id \ -title $p_task_title \ @@ -821,41 +831,26 @@ -package_id $package_id] - # set this_revision_id [db_exec_plsql new_task_revision { }] - - # ns_log Notice "Added in $this_revision_id" - lappend revisions $this_revision_id - # ns_log Notice "in new: task_id $task_id" - - # BUG: we need to make sure we take care of deleting dependencies - # if unchecked, adding dependencies, etc.. - pm::task::dependency_delete_all \ -task_item_id $p_task_item_id - ns_log Notice "p_parent_task_id $p_parent_task_id" - if {![empty_string_p $p_parent_task_id]} { pm::task::dependency_add \ -task_item_id $p_task_item_id \ -parent_id $p_parent_task_id \ - -dependency_type fdsafeafes \ + -dependency_type jfdsafesa\ -project_item_id $project_item_id } } pm::project::compute_parent_status $project_item_id - ns_log Notice "computed parent pre redirect" - } -after_submit { - ns_log Notice "TASK_ID: $task_id" - ad_returnredirect "task-assign-add-edit?[export_vars -url {project_item_id process_task_id:multiple revisions:multiple task_id:multiple}]" ad_script_abort Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit.tcl,v diff -u -r1.5.2.7 -r1.5.2.8 --- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 27 Feb 2004 22:46:13 -0000 1.5.2.7 +++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 6 Mar 2004 00:29:24 -0000 1.5.2.8 @@ -1,13 +1,3 @@ -ns_log notice task assign add edit page -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} - - ad_page_contract { Form to add and edit assignments to a task @@ -119,7 +109,6 @@ } -new_data { - ns_log Notice "new_data" #role_id #party_id @@ -212,8 +201,6 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) - ns_log Notice "tid: $t_id rid: $r_id pid: $p_id" - set subject "New Task \#$t_id: $one_lines($t_id)" if {[string equal $use_uncertain_completion_times_p 1]} { @@ -261,7 +248,7 @@ notification::new \ -type_id [notification::type::get_type_id -short_name pm_task_notif] \ -object_id $t_id \ - -response_id $user_id \ + -response_id $t_id \ -notif_subject $subject \ -notif_text $notification_text @@ -271,7 +258,6 @@ } -edit_data { - ns_log Notice "edit_data" # do something #role_id #party_id @@ -313,7 +299,7 @@ # keyname looks like 2308.1 - 2308.10 # first element is task_id, second is 1-10 - # if keyvalu is not empty, then we pay attention to it. + # if keyvalu is not empty, then we pay attention to it. if {[exists_and_not_null keyvalu]} { @@ -338,8 +324,6 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) - ns_log Notice "tid: $t_id rid: $r_id pid: $p_id" - db_dml add_assignment { } } @@ -353,8 +337,6 @@ # we create a terrible monster array -ns_log Notice "process_task_id: $process_task_id " - set index 0 foreach tiid $task_id { @@ -373,8 +355,6 @@ lappend users_values $pid } - ns_log Notice "roles_values: $roles_values" - ns_log Notice "users_values: $users_values" } set users_length [string length $users_values] @@ -412,11 +392,3 @@ } -ns_log notice it's my page, but later! -set mypage [ns_getform] -if {[string equal "" $mypage]} { - ns_log notice no form was submitted on my page -} else { - ns_log notice the following form was submitted on my page - ns_set print $mypage -} 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.16.2.2 -r1.16.2.3 --- openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 4 Feb 2004 20:17:19 -0000 1.16.2.2 +++ openacs-4/contrib/packages/project-manager/www/task-one-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.16.2.3 @@ -1,28 +1,5 @@ - - - SELECT - t.item_id - FROM - pm_tasks_revisionsx t - WHERE - t.revision_id = :task_revision_id - - - - - - SELECT - t.revision_id as task_revision_id - FROM - pm_tasks_revisionsx t, cr_items i - WHERE - t.item_id = :task_id and - i.live_revision = t.revision_id - - - SELECT @@ -119,7 +96,7 @@ i.live_revision, d.parent_task_id, d.dependency_type, - d.task_id + d.task_id as d_task_id FROM pm_tasks_revisionsx t, cr_items i, pm_task_dependency d WHERE 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.19.2.3 -r1.19.2.4 --- openacs-4/contrib/packages/project-manager/www/task-one.adp 4 Feb 2004 20:17:19 -0000 1.19.2.3 +++ openacs-4/contrib/packages/project-manager/www/task-one.adp 6 Mar 2004 00:29:24 -0000 1.19.2.4 @@ -1,114 +1,209 @@ - + - + -@task_term@ #@item_id@: @task_info.task_title@ -@context_bar;noquote@ + @task_term@ #@item_id@: @task_info.task_title@ + @context@ + +
+ +
+ + + + + + + + + + + + + +
+ + Edit + + + Print + + @task_term@ #@item_id@: @task_info.task_title@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Description
@task_info.description;noquote@
-- @task_info.creation_user@
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@
+
+ +

+ + + @notification_chunk;noquote@ + + +

+ +
+ + + + + + + + +
Assignees
+ +
+ +

+ + + + + + + + +
@task_term@(s) this depends on.
+ +
+ +

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

+

+ + + + + + + + -
+
-
Logged hours
+ Total work: + + @task_info.estimated_hours_work_min@ - + @task_info.estimated_hours_work_max@ hrs estimated + + + @task_info.estimated_hours_work@ hrs estimated + + + @task_info.percent_complete@% complete
+ Slack: @task_info.slack_time@
+
+ - - + + - + + + - - - + + +
- Edit - Print
+ + Log hours + + @task_term@ #@item_id@: @task_info.task_title@ + @log_note@ +
+ +
+ +
+ +

+ +
+ +
+ + +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Description
@task_info.description;noquote@ -
-- @task_info.creation_user@
Work
@task_info.percent_complete@% complete
@task_info.estimated_hours_work_min@ - @task_info.estimated_hours_work_max@ hrs estimated
@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@
- - -

- -Breakdown - -

- -
- - - -

- -

@task_term@(s) this depends on.
- -

- -

@task_term@(s) depending on this @task_term@
- - -
- -
- -
- - - - -@comments;noquote@ -

-@comments_link;noquote@ - -

+ + + @comments;noquote@ +

+ @comments_link;noquote@ + +

+ 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.22.2.7 -r1.22.2.8 --- openacs-4/contrib/packages/project-manager/www/task-one.tcl 27 Feb 2004 22:46:13 -0000 1.22.2.7 +++ openacs-4/contrib/packages/project-manager/www/task-one.tcl 6 Mar 2004 00:29:24 -0000 1.22.2.8 @@ -27,10 +27,11 @@ orderby_dependency2:optional } -properties { + notification_chunk:onevalue task_info:onerow project_item_id:onevalue project_id:onevalue - context_bar:onevalue + context:onevalue write_p:onevalue create_p:onevalue revisions:multirow @@ -43,15 +44,18 @@ watcher_term:onevalue comments:onevalue comments_link:onevalue + use_uncertain_completion_times_p:onevalue } -validate { task_id_exists { if {![info exists task_id]} { - set task_id [db_string get_task_id { }] + set task_id [pm::task::get_item_id \ + -task_id $task_revision_id] } } revision_id_exists { if {![info exists task_revision_id]} { - set task_revision_id [db_string get_revision_id { }] + set task_revision_id [pm::task::get_revision_id \ + -task_item_id $task_id] } } } @@ -65,10 +69,11 @@ set assignee_term [parameter::get -parameter "AssigneeName" -default "Assignee"] set watcher_term [parameter::get -parameter "WatcherName" -default "Watcher"] set project_term [parameter::get -parameter "ProjectName" -default "Project"] +set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] db_1row get_project_ids { } -set context_bar [ad_context_bar "one?project_item_id=$project_item_id $project_term" "View"] +set context [list "one?project_item_id=$project_item_id $project_term" "View"] # the unique identifier for this package @@ -87,21 +92,39 @@ set write_p [permission::permission_p -object_id $package_id -privilege write] set create_p [permission::permission_p -object_id $package_id -privilege create] + + # Task info ---------------------------------------------------------- db_1row task_query { } -column_array task_info set task_info(description) [ad_text_to_html -- $task_info(description)] if {[exists_and_not_null task_info(earliest_start_j)]} { - if {$task_info(earliest_start_j) < $task_info(today_j)} { - set task_info(slack_time) "[expr $task_info(latest_start_j) - $task_info(today_j)] days" - } else { - set task_info(slack_time) "[expr $task_info(latest_start_j) - $task_info(earliest_start_j)] days" - } -} else { - set task_info(slack_time) "n/a" + set task_info(slack_time) [pm::task::slack_time \ + -earliest_start_j $task_info(earliest_start_j) \ + -today_j $task_info(today_j) \ + -latest_start_j $task_info(latest_start_j)] } +set logger_project [pm::project::get_logger_project \ + -project_item_id $project_item_id] +set logger_variable_id [logger::variable::get_default_variable_id] + +set log_url "[ad_conn package_url]log?project_id=$logger_project&pm_project_id=$project_item_id&pm_task_id=$task_id" + +set log_note "Task logged time listed below" + +# ------------------ +# Notifications info +# ------------------ +set notification_chunk [notification::display::request_widget \ + -type pm_task_notif \ + -object_id $task_id \ + -pretty_name "$task_info(task_title)" \ + -url "[ad_conn url]?[ad_conn query]" \ + ] + + # Task Revisions, using list-builder --------------------------------- template::list::create \ @@ -142,7 +165,7 @@ default_value revision_id,desc } \ -orderby_name orderby_revisions \ - -main_class { + -sub_class { narrow } \ -filters { @@ -165,7 +188,7 @@ template::list::create \ -name dependency \ -multirow dependency \ - -key task_id \ + -key d_task_id \ -elements { dependency_type { label "Type" @@ -184,7 +207,7 @@ } } - task_id { + d_task_id { label "Task" display_col task_title link_url_col item_url @@ -203,7 +226,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency \ - -main_class { + -sub_class { narrow } \ -filters { @@ -217,15 +240,15 @@ db_multirow -extend { item_url } dependency dependency_query { } { - set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id }] + set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id $d_task_id }] } # Dependency info (dependency other task have on this task) ------ template::list::create \ -name dependency2 \ -multirow dependency2 \ - -key task_id \ + -key d_task_id \ -elements { dependency_type { label "Type" @@ -244,10 +267,10 @@ } } - task_id { + d_task_id { label "Task" display_col task_title - link_url_eval {task-one?task_id=$task_id} + link_url_eval {task-one?task_id=$d_task_id} link_html { title "View this task" } } percent_complete { @@ -263,7 +286,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency2 \ - -main_class { + -sub_class { narrow } \ -filters { @@ -303,7 +326,7 @@ display_template "@people.one_line@" } } \ - -main_class { + -sub_class { narrow } \ -filters { @@ -319,10 +342,10 @@ } \ -orderby_name orderby_people \ -html { + width 100% } - db_multirow -extend { item_url } subproject task_people_query { } { Index: openacs-4/contrib/packages/project-manager/www/task-print-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-print-postgresql.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/project-manager/www/task-print-postgresql.xql 5 Feb 2004 21:15:54 -0000 1.1.2.1 +++ openacs-4/contrib/packages/project-manager/www/task-print-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.1.2.2 @@ -3,48 +3,50 @@ - SELECT + SELECT t.revision_id as task_revision_id - FROM - pm_tasks_revisionsx t, cr_items i - WHERE + FROM + pm_tasks_revisionsx t, cr_items i + WHERE t.item_id = :task_id and i.live_revision = t.revision_id - SELECT + SELECT t.parent_id as project_item_id - FROM - pm_tasks_revisionsx t, cr_items i - WHERE + FROM + pm_tasks_revisionsx t, cr_items i + WHERE i.item_id = t.item_id and t.revision_id = :task_revision_id - SELECT + SELECT t.item_id, t.title as task_title, t.description, - 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, - to_char(t.latest_start-t.earliest_start,'DD') || ' days' as slack_time, + 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_start,'J') as earliest_start_j, + 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_start,'J') as latest_start_j, + to_char(t.latest_finish,'Mon DD ''YY') as latest_finish, + to_char(current_date,'J') as today_j, t.estimated_hours_work, t.estimated_hours_work_min, t.estimated_hours_work_max, t.percent_complete, i.live_revision - FROM - pm_tasks_revisionsx t, cr_items i - WHERE + FROM + pm_tasks_revisionsx t, cr_items i + WHERE t.item_id = :task_id and t.revision_id = :task_revision_id and t.item_id = i.item_id @@ -54,16 +56,16 @@ - SELECT + SELECT t.title as task_title, - to_char(t.end_date,'MM/DD/YYYY') as end_date, + to_char(t.end_date,'MM/DD/YYYY') as end_date, t.percent_complete, i.live_revision, d.parent_task_id, d.dependency_type - FROM - pm_tasks_revisionsx t, cr_items i, pm_task_dependency d - WHERE + FROM + pm_tasks_revisionsx t, cr_items i, pm_task_dependency d + WHERE d.task_id = :task_id and d.parent_task_id = t.item_id and t.revision_id = i.live_revision and @@ -74,17 +76,17 @@ - SELECT + SELECT t.title as task_title, - to_char(t.end_date,'MM/DD/YYYY') as end_date, + to_char(t.end_date,'MM/DD/YYYY') as end_date, t.percent_complete, i.live_revision, d.parent_task_id, d.dependency_type, d.task_id - FROM - pm_tasks_revisionsx t, cr_items i, pm_task_dependency d - WHERE + FROM + pm_tasks_revisionsx t, cr_items i, pm_task_dependency d + WHERE d.task_id = t.item_id and d.parent_task_id = :task_id and t.revision_id = i.live_revision and Index: openacs-4/contrib/packages/project-manager/www/task-print.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-print.adp,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/project-manager/www/task-print.adp 5 Feb 2004 21:15:54 -0000 1.1.2.1 +++ openacs-4/contrib/packages/project-manager/www/task-print.adp 6 Mar 2004 00:29:24 -0000 1.1.2.2 @@ -36,7 +36,7 @@ -@task_info.slack_time@ slack +Slack time: @task_info.slack_time@ Index: openacs-4/contrib/packages/project-manager/www/task-print.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-print.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/contrib/packages/project-manager/www/task-print.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.3 +++ openacs-4/contrib/packages/project-manager/www/task-print.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.4 @@ -91,8 +91,11 @@ db_1row task_query { } -column_array task_info set task_info(description) [ad_text_to_html -- $task_info(description)] +set task_info(slack_time) [pm::task::slack_time \ + -earliest_start_j $task_info(earliest_start_j) \ + -today_j $task_info(today_j) \ + -latest_start_j $task_info(latest_start_j)] - # Dependency info ------------------------------------------------ template::list::create \ @@ -136,7 +139,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency \ - -main_class { + -sub_class { narrow } \ -filters { @@ -196,7 +199,7 @@ end_date {orderby end_date} } \ -orderby_name orderby_dependency2 \ - -main_class { + -sub_class { narrow } \ -filters { @@ -236,7 +239,7 @@ display_template "@people.one_line@" } } \ - -main_class { + -sub_class { narrow } \ -filters { Index: openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks-postgresql.xql,v diff -u -r1.1.2.5 -r1.1.2.6 --- openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 5 Feb 2004 23:57:49 -0000 1.1.2.5 +++ openacs-4/contrib/packages/project-manager/www/tasks-postgresql.xql 6 Mar 2004 00:29:24 -0000 1.1.2.6 @@ -19,7 +19,8 @@ t.estimated_hours_work, t.estimated_hours_work_min, t.estimated_hours_work_max, - t.actual_hours_worked, + case when t.actual_hours_worked is null then 0 + else t.actual_hours_worked end as actual_hours_worked, to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, Index: openacs-4/contrib/packages/project-manager/www/tasks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks.adp,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/contrib/packages/project-manager/www/tasks.adp 5 Feb 2004 23:57:49 -0000 1.1.2.4 +++ openacs-4/contrib/packages/project-manager/www/tasks.adp 6 Mar 2004 00:29:24 -0000 1.1.2.5 @@ -1,29 +1,21 @@ - + - + -@task_term@s -@context_bar;noquote@ + @task_term@s + @context@ + + + + + + +
- + My tasks
+ Other tasks +

- - - - -
- Search:
Index: openacs-4/contrib/packages/project-manager/www/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/tasks.tcl,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/contrib/packages/project-manager/www/tasks.tcl 27 Feb 2004 22:46:13 -0000 1.1.2.8 +++ openacs-4/contrib/packages/project-manager/www/tasks.tcl 6 Mar 2004 00:29:24 -0000 1.1.2.9 @@ -22,7 +22,7 @@ {status_id ""} } -properties { task_term:onevalue - context_bar:onevalue + context:onevalue tasks:multirow } @@ -35,7 +35,7 @@ set project_term_lower [parameter::get -parameter "projectname" -default "project"] # set up context bar -set context_bar [ad_context_bar "Tasks"] +set context [list "Tasks"] # the unique identifier for this package set package_id [ad_conn package_id] @@ -78,9 +78,6 @@ label "Who" display_template "unassigned@tasks.full_name@ (@tasks.role@)" } - description { - label "Description" - } slack_time { label "Slack time" display_template "@tasks.slack_time@@tasks.slack_time@" @@ -97,18 +94,16 @@ } } \ -actions { - "Projects" "index" "View list of tasks" - "Processes" "processes" "View and use processes" "Add task" "task-select-project" "Add a task" - "Admin" "admin/" "Administration pages" } \ - -main_class { + -sub_class { narrow } \ -filters { searchterm { label "Search" } + party_id { label "People" values {[db_list_of_lists get_people "select distinct(first_names || ' ' || last_name) as fullname, u.person_id from persons u, pm_task_assignment a where u.person_id = a.party_id order by fullname"]} @@ -121,9 +116,13 @@ values {[db_list_of_lists get_status_values "select description, status_id from pm_task_status order by status_type desc, description"]} where_clause {ts.status = :status_id} } + + mine_p { + label "Show others' tasks" + } } \ -orderby { - default_value task_number,asc + default_value latest_start_pretty,asc task_number { label "Task \#" orderby_desc "ts.task_number desc" Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/entries-table-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/entries-table.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/entries-table.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/entries-table.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/master.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/master.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/nav-bar.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/contrib/packages/project-manager/www/lib/nav-bar.tcl'. Fisheye: No comparison available. Pass `N' to diff?