Index: openacs-4/packages/project-manager/lib/dependency-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/dependency-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/dependency-portlet-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,54 @@
+
+
+
+
+
+ SELECT
+ t.title as task_title,
+ to_char(t.end_date,'MM/DD/YYYY') as end_date,
+ t.percent_complete,
+ i.live_revision,
+ d.parent_task_id,
+ d.dependency_type,
+ t.item_id as d_task_id
+ 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
+ t.item_id = i.item_id
+ and exists (select 1 from acs_object_party_privilege_map ppm
+ where ppm.object_id = d.task_id
+ and ppm.privilege = 'read'
+ and ppm.party_id = :user_id)
+ [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,
+ d.parent_task_id,
+ d.dependency_type,
+ d.task_id as d_task_id
+ 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
+ t.item_id = i.item_id
+ and exists (select 1 from acs_object_party_privilege_map ppm
+ where ppm.object_id = d.task_id
+ and ppm.privilege = 'read'
+ and ppm.party_id = :user_id)
+ [template::list::orderby_clause -name dependency -orderby]
+
+
+
+
Index: openacs-4/packages/project-manager/lib/dependency-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/dependency-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/dependency-portlet.adp 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+
+ |
+ @headline@ |
+
+
+ |
+
+
+
+
+ |
+ |
+
+
Index: openacs-4/packages/project-manager/lib/dependency-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/dependency-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/dependency-portlet.tcl 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,80 @@
+# packages/project-manager/lib/dependency-portlet.tcl
+#
+# Portlet for task dependency information
+#
+# @author Timo Hentschel (timo@timohentschel.de)
+# @creation-date 2005-06-03
+# @arch-tag: c502a3ed-d1c0-4217-832a-6ccd86256024
+# @cvs-id $Id: dependency-portlet.tcl,v 1.1 2005/06/03 22:13:44 timoh Exp $
+
+set user_id [ad_conn user_id]
+
+if {$type == "to_other"} {
+ set query "depend_on_other"
+ set orderby_var "orderby_depend_to"
+ set headline "[_ project-manager.lt_task_terms_this_depen]"
+} else {
+ set query "depend_on_this_task"
+ set orderby_var "orderby_depend_from"
+ set headline "[_ project-manager.lt_task_terms_depending_]"
+}
+
+# Dependency info ------------------------------------------------
+
+template::list::create \
+ -name dependency \
+ -multirow dependency \
+ -key d_task_id \
+ -elements {
+ dependency_type {
+ label "[_ project-manager.Type]"
+ display_template {
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ }
+ d_task_id {
+ label "[_ project-manager.Task]"
+ display_col task_title
+ link_url_col item_url
+ link_html { title "[_ project-manager.View_this_task]" }
+ }
+ percent_complete {
+ label "[_ project-manager.Status_1]"
+ display_template "@dependency.percent_complete@\%"
+ }
+ end_date {
+ label "[_ project-manager.Deadline_1]"
+ }
+ } \
+ -orderby {
+ percent_complete {orderby percent_complete}
+ end_date {orderby end_date}
+ } \
+ -orderby_name $orderby_var \
+ -sub_class {
+ narrow
+ } \
+ -filters {
+ task_id {}
+ orderby_people {}
+ } \
+ -html {
+ width 100%
+ }
+
+db_multirow -extend { item_url } dependency $query {
+} {
+ set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id $d_task_id }]
+ # set item_url [export_vars -base "task-one" {{task_id $d_task_id}}]
+}
Index: openacs-4/packages/project-manager/lib/project-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/project-portlet.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/lib/project-portlet.adp 26 May 2005 12:47:26 -0000 1.2
+++ openacs-4/packages/project-manager/lib/project-portlet.adp 3 Jun 2005 22:13:44 -0000 1.3
@@ -52,6 +52,12 @@
#project-manager.Description_1# |
@project.description;noquote@ |
+
+
+ @dynamic_attributes.name@: |
+ @dynamic_attributes.value@ |
+
+
|
@@ -66,4 +72,3 @@
-
Index: openacs-4/packages/project-manager/lib/project-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/project-portlet.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/lib/project-portlet.tcl 26 May 2005 12:47:26 -0000 1.2
+++ openacs-4/packages/project-manager/lib/project-portlet.tcl 3 Jun 2005 22:13:44 -0000 1.3
@@ -19,9 +19,7 @@
db_1row project_query { } -column_array project
set richtext_list [list $project(description) $project(mime_type)]
-
set project(description) [template::util::richtext::get_property html_value $richtext_list]
-
set project_root [pm::util::get_root_folder]
set project(planned_start_date) [lc_time_fmt $project(planned_start_date) "%x"]
@@ -30,3 +28,10 @@
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 edit_url "[ad_conn package_url]add-edit?[export_url_vars project_item_id]"
+
+dtype::get_object -object_id $project_id -object_type pm_project -array dattr -exclude_static
+
+multirow create dynamic_attributes name value
+foreach attr [array names dattr] {
+ multirow append dynamic_attributes "[_ dynamic-types.pm_project_$attr]" $dattr($attr)
+}
Index: openacs-4/packages/project-manager/lib/project-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/project-portlet.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/lib/project-portlet.xql 26 May 2005 09:34:27 -0000 1.1
+++ openacs-4/packages/project-manager/lib/project-portlet.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -19,7 +19,6 @@
p.mime_type,
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/packages/project-manager/lib/projects.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/projects.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/lib/projects.tcl 26 May 2005 09:34:27 -0000 1.1
+++ openacs-4/packages/project-manager/lib/projects.tcl 3 Jun 2005 22:13:44 -0000 1.2
@@ -116,7 +116,7 @@
# Get the rows to display
-set row_list "project_name {}\n"
+set row_list "checkbox {}\nproject_name {}\n"
foreach element $elements {
append row_list "$element {}\n"
}
Index: openacs-4/packages/project-manager/lib/related-tasks-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/related-tasks-portlet-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/related-tasks-portlet-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,50 @@
+
+
+
+
+
+ SELECT
+ x.task_id_1 as x_task_id,
+ r.title,
+ to_char(r.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start,
+ r.earliest_start - current_date as days_to_earliest_start,
+ to_char(r.earliest_start,'J') as earliest_start_j,
+ to_char(r.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish,
+ r.earliest_finish - current_date as days_to_earliest_finish,
+ to_char(r.latest_start,'YYYY-MM-DD HH24:MI') as latest_start,
+ r.latest_start - current_date as days_to_latest_start,
+ to_char(r.latest_start,'J') as latest_start_j,
+ to_char(current_date,'J') as today_j,
+ to_char(r.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish,
+ r.latest_finish - current_date as days_to_latest_finish
+ FROM
+ pm_task_xref x, pm_tasks_revisionsx r, cr_items i
+ WHERE
+ x.task_id_2 = :task_id and
+ x.task_id_1 = r.item_id and
+ r.revision_id = i.live_revision
+ UNION
+ SELECT
+ x2.task_id_2 as x_task_id,
+ r2.title,
+ to_char(r2.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start,
+ r2.earliest_start - current_date as days_to_earliest_start,
+ to_char(r2.earliest_start,'J') as earliest_start_j,
+ to_char(r2.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish,
+ r2.earliest_finish - current_date as days_to_earliest_finish,
+ to_char(r2.latest_start,'YYYY-MM-DD HH24:MI') as latest_start,
+ r2.latest_start - current_date as days_to_latest_start,
+ to_char(r2.latest_start,'J') as latest_start_j,
+ to_char(current_date,'J') as today_j,
+ to_char(r2.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish,
+ r2.latest_finish - current_date as days_to_latest_finish
+ FROM
+ pm_task_xref x2, pm_tasks_revisionsx r2, cr_items i2
+ WHERE
+ x2.task_id_1 = :task_id and
+ x2.task_id_2 = r2.item_id and
+ i2.live_revision = r2.revision_id
+
+
+
+
Index: openacs-4/packages/project-manager/lib/related-tasks-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/related-tasks-portlet.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/related-tasks-portlet.adp 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,28 @@
+
+
+
+
+ |
+ #project-manager.Related_task_terms# |
+
+
+ |
+
+
+
+
+ |
+ |
+
+
+
+
+ |
+ |
+
+
Index: openacs-4/packages/project-manager/lib/related-tasks-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/related-tasks-portlet.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/lib/related-tasks-portlet.tcl 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,69 @@
+# packages/project-manager/lib/related-task-portlet.tcl
+#
+# Portlet for related task information
+#
+# @author Timo Hentschel (timo@timohentschel.de)
+# @creation-date 2005-06-03
+# @arch-tag: c502a3ed-d1c0-4217-832a-6ccd86256024
+# @cvs-id $Id: related-tasks-portlet.tcl,v 1.1 2005/06/03 22:13:44 timoh Exp $
+
+template::list::create \
+ -name related_tasks \
+ -multirow related_tasks \
+ -key x_task_id \
+ -elements {
+ x_task_id {
+ label "[_ project-manager.ID]"
+ }
+ title {
+ label "[_ project-manager.Task]"
+ link_url_col item_url
+ link_html { title "[_ project-manager.View_this_task]" }
+ }
+ slack_time {
+ label "[_ project-manager.Slack_1]"
+ }
+ earliest_start_pretty {
+ label "[_ project-manager.ES]"
+ }
+ earliest_finish_pretty {
+ label "[_ project-manager.EF]"
+ }
+ latest_start_pretty {
+ label "[_ project-manager.LS]"
+ }
+ latest_finish_pretty {
+ label "[_ project-manager.LF]"
+ display_template {
+ @xrefs.latest_finish_pretty@
+ }
+ }
+ } \
+ -sub_class {
+ narrow
+ } \
+ -filters {
+ task_id {}
+ orderby_people {}
+ orderby_depend_to {}
+ orderby_depend_from {}
+ } \
+ -html {
+ width 100%
+ }
+
+db_multirow -extend { item_url earliest_start_pretty earliest_finish_pretty latest_start_pretty latest_finish_pretty slack_time } related_tasks related_tasks_query {
+} {
+ set item_url [export_vars -base "task-one" -override {{task_id $x_task_id}}]
+
+ set earliest_start_pretty [lc_time_fmt $earliest_start "%x"]
+ set earliest_finish_pretty [lc_time_fmt $earliest_finish "%x"]
+ set latest_start_pretty [lc_time_fmt $latest_start "%x"]
+ set latest_finish_pretty [lc_time_fmt $latest_finish "%x"nn]
+
+ set slack_time [pm::task::slack_time \
+ -earliest_start_j $earliest_start_j \
+ -today_j $today_j \
+ -latest_start_j $latest_start_j]
+
+}
Index: openacs-4/packages/project-manager/lib/tasks-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/tasks-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/lib/tasks-postgresql.xql 26 May 2005 09:34:27 -0000 1.1
+++ openacs-4/packages/project-manager/lib/tasks-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -37,8 +37,8 @@
r.is_lead_p,
t.priority,
p.customer_id,
- p.logger_project,
- p.title as project_name
+ p.title as project_name,
+ ar.object_id_two as logger_project
FROM
(select tr.item_id,
ta.party_id,
@@ -74,12 +74,18 @@
i.item_id = d.task_id,
pm_tasks_active ti,
pm_task_status s,
- pm_projectsx p
+ pm_projectsx p,
+ acs_rels ar,
+ acs_objects o
WHERE
t.parent_id = p.item_id and
t.revision_id = i.live_revision and
t.item_id = ti.task_id and
ti.status = s.status_id
+ and ar.object_id_one = t.parent_id
+ and ar.rel_type = 'application_data_link'
+ and o.object_id = ar.object_id_two
+ and o.object_type = 'logger_project'
and exists (select 1 from acs_object_party_privilege_map ppm
where ppm.object_id = ti.task_id
and ppm.privilege = 'read'
Index: openacs-4/packages/project-manager/lib/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/tasks.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/lib/tasks.tcl 26 May 2005 12:23:12 -0000 1.2
+++ openacs-4/packages/project-manager/lib/tasks.tcl 3 Jun 2005 22:13:44 -0000 1.3
@@ -389,6 +389,7 @@
}
db_multirow -extend {item_url earliest_start_pretty earliest_finish_pretty end_date_pretty latest_start_pretty latest_finish_pretty slack_time edit_url log_url hours_remaining days_remaining actual_days_worked my_user_id user_url} tasks tasks {} {
+
set item_url [export_vars \
-base "task-one" {{task_id $task_item_id}}]
Index: openacs-4/packages/project-manager/sql/postgresql/project-manager-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/postgresql/project-manager-drop.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/sql/postgresql/project-manager-drop.sql 26 May 2005 09:34:28 -0000 1.3
+++ openacs-4/packages/project-manager/sql/postgresql/project-manager-drop.sql 3 Jun 2005 22:13:44 -0000 1.4
@@ -13,8 +13,6 @@
\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/packages/project-manager/sql/postgresql/project-manager-functions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 26 May 2005 09:34:28 -0000 1.3
+++ openacs-4/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 3 Jun 2005 22:13:44 -0000 1.4
@@ -135,7 +135,7 @@
-- 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, mime_type, 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');
+select define_function_args('pm_project__new_project_item', 'project_name, project_code, parent_id, goal, description, mime_type, 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');
create or replace function pm_project__new_project_item (
varchar, -- project_name
@@ -148,7 +148,6 @@
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)
@@ -169,14 +168,13 @@
p_planned_end_date alias for $8;
p_actual_start_date alias for $9;
p_actual_end_date alias for $10;
- 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;
+ 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;
@@ -205,7 +203,7 @@
p_creation_user, -- creation_user
p_parent_id, -- context_id
p_creation_ip, -- creation_ip
- ''content_item'', -- item_subtype
+ ''pm_project'', -- item_subtype
''pm_project'', -- content_type
p_project_name, -- title
p_description, -- description
@@ -234,15 +232,15 @@
project_id, project_code,
goal, planned_start_date,
planned_end_date, actual_start_date, actual_end_date,
- logger_project, ongoing_p, estimated_finish_date,
+ 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_logger_project, p_ongoing_p,
+ p_actual_end_date, p_ongoing_p,
p_planned_end_date,
p_planned_end_date, p_planned_end_date, ''0'',
''0'', p_status_id, p_customer_id
@@ -288,7 +286,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, logger_project, 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, ongoing_p, status_id, organization_id, creation_date, creation_user, creation_ip, package_id');
create or replace function pm_project__new_project_revision (
integer, -- item_id
@@ -301,7 +299,6 @@
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)
@@ -322,14 +319,13 @@
p_planned_end_date alias for $8;
p_actual_start_date alias for $9;
p_actual_end_date alias for $10;
- 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;
+ 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_revision_id cr_revisions.revision_id%TYPE;
begin
@@ -356,14 +352,13 @@
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_logger_project, p_ongoing_p, p_status_id, p_customer_id);
+ p_ongoing_p, p_status_id, p_customer_id);
PERFORM acs_permission__grant_permission(
v_revision_id,
@@ -493,7 +488,7 @@
p_creation_user, -- creation_user
p_package_id, -- context_id
p_creation_ip, -- creation_ip
- ''content_item'', -- item_subtype
+ ''pm_task'', -- item_subtype
''pm_task'', -- content_type
p_title, -- title
p_description, -- description
Index: openacs-4/packages/project-manager/sql/postgresql/project-manager-table-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/postgresql/project-manager-table-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/sql/postgresql/project-manager-table-create.sql 26 May 2005 09:34:28 -0000 1.2
+++ openacs-4/packages/project-manager/sql/postgresql/project-manager-table-create.sql 3 Jun 2005 22:13:44 -0000 1.3
@@ -56,13 +56,7 @@
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
+ estimated_hours_total numeric
);
@@ -393,26 +387,8 @@
priority integer default 0
);
-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)
-);
-
-
create sequence pm_task_dependency_seq;
create table pm_task_dependency (
Index: openacs-4/packages/project-manager/sql/postgresql/upgrade/upgrade-3.0d3-3.0d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/sql/postgresql/upgrade/Attic/upgrade-3.0d3-3.0d4.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/project-manager/sql/postgresql/upgrade/upgrade-3.0d3-3.0d4.sql 3 Jun 2005 22:13:44 -0000 1.1
@@ -0,0 +1,347 @@
+create function inline_0 ()
+returns integer as '
+declare
+ lp RECORD;
+begin
+ for lp in select logger_project, item_id, creation_user, creation_ip
+ from pm_projectsx
+ loop
+ select acs_rel__new (
+ null,
+ 'application_data_link',
+ lp.item_id,
+ lp.logger_project,
+ lp.item_id,
+ lp.creation_user,
+ lp.creation_ip
+ );
+
+ select acs_rel__new (
+ null,
+ 'application_data_link',
+ lp.logger_project,
+ lp.item_id,
+ lp.item_id,
+ lp.creation_user,
+ lp.creation_ip
+ );
+ end loop;
+end;' language 'plpgsql';
+
+select inline_0();
+drop function inline_0();
+
+
+alter table pm_projects drop column logger_project cascade;
+
+drop table pm_task_logger_proj_map;
+
+select define_function_args('pm_project__new_project_item', 'project_name, project_code, parent_id, goal, description, mime_type, 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');
+
+create or replace function pm_project__new_project_item (
+ varchar, -- project_name
+ varchar, -- project_code
+ integer, -- parent_id
+ varchar, -- goal
+ varchar, -- description
+ varchar, -- mime_type
+ timestamptz, -- planned_start_date
+ timestamptz, -- planned_end_date
+ timestamptz, -- actual_start_date
+ timestamptz, -- actual_end_date
+ char(1), -- ongoing_p
+ integer, -- status_id
+ integer, -- customer_id (organization_id)
+ timestamptz, -- creation_date
+ integer, -- creation_user
+ varchar, -- creation_ip
+ integer -- package_id
+) returns integer
+as '
+declare
+ p_project_name alias for $1;
+ p_project_code alias for $2;
+ p_parent_id alias for $3;
+ p_goal alias for $4;
+ p_description alias for $5;
+ p_mime_type alias for $6;
+ p_planned_start_date alias for $7;
+ 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;
+
+ v_item_id cr_items.item_id%TYPE;
+ v_revision_id cr_revisions.revision_id%TYPE;
+ v_id cr_items.item_id%TYPE;
+ v_parent_id cr_items.parent_id%TYPE;
+begin
+ select acs_object_id_seq.nextval into v_id from dual;
+
+ v_parent_id := pm_project__get_root_folder (p_package_id, ''t'');
+
+ -- raise notice ''v_parent_id (%) p_parent_id (%)'', v_parent_id, p_parent_id;
+
+ if p_parent_id is not null
+ then
+ v_parent_id = p_parent_id;
+ end if;
+
+ -- raise notice ''v_parent_id (%) p_parent_id (%)'', v_parent_id, p_parent_id;
+
+ v_item_id := content_item__new (
+ v_id::varchar, -- name
+ v_parent_id, -- parent_id
+ v_id, -- item_id
+ null, -- locale
+ now(), -- creation_date
+ p_creation_user, -- creation_user
+ p_parent_id, -- context_id
+ p_creation_ip, -- creation_ip
+ ''pm_project'', -- item_subtype
+ ''pm_project'', -- content_type
+ p_project_name, -- title
+ p_description, -- description
+ p_mime_type, -- mime_type
+ null, -- nls_language
+ null -- data
+ );
+
+ v_revision_id := content_revision__new (
+ p_project_name, -- title
+ p_description, -- description
+ now(), -- publish_date
+ p_mime_type, -- mime_type
+ NULL, -- nls_language
+ NULL, -- data
+ v_item_id, -- item_id
+ NULL, -- revision_id
+ now(), -- creation_date
+ p_creation_user, -- creation_user
+ p_creation_ip -- creation_ip
+ );
+
+ PERFORM content_item__set_live_revision (v_revision_id);
+
+ insert into pm_projects (
+ project_id, project_code,
+ goal, planned_start_date,
+ planned_end_date, actual_start_date, actual_end_date,
+ 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_planned_end_date, p_planned_end_date, ''0'',
+ ''0'', p_status_id, p_customer_id
+ );
+
+ PERFORM acs_permission__grant_permission(
+ v_revision_id,
+ p_creation_user,
+ ''admin''
+ );
+
+ return v_revision_id;
+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');
+
+create or replace function pm_project__new_project_revision (
+ integer, -- item_id
+ varchar, -- project_name
+ varchar, -- project_code
+ integer, -- parent_id
+ varchar, -- goal
+ varchar, -- description
+ timestamptz, -- planned_start_date
+ timestamptz, -- planned_end_date
+ timestamptz, -- actual_start_date
+ timestamptz, -- actual_end_date
+ char(1), -- ongoing_p
+ integer, -- status_id
+ integer, -- organization_id (customer)
+ timestamptz, -- creation_date
+ integer, -- creation_user
+ varchar, -- creation_ip
+ integer -- package_id
+) returns integer
+as '
+declare
+ p_item_id alias for $1;
+ p_project_name alias for $2;
+ p_project_code alias for $3;
+ p_parent_id alias for $4;
+ p_goal alias for $5;
+ p_description alias for $6;
+ p_planned_start_date alias for $7;
+ 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;
+
+ v_revision_id cr_revisions.revision_id%TYPE;
+begin
+
+ -- the item_id is the project_id
+
+ v_revision_id := content_revision__new (
+ p_project_name, -- title
+ p_description, -- description
+ now(), -- publish_date
+ ''text/plain'', -- mime_type
+ NULL, -- nls_language
+ NULL, -- data
+ p_item_id, -- item_id
+ NULL, -- revision_id
+ now(), -- creation_date
+ p_creation_user, -- creation_user
+ p_creation_ip -- creation_ip
+ );
+
+ PERFORM content_item__set_live_revision (v_revision_id);
+
+ insert into pm_projects (
+ project_id, project_code,
+ goal, planned_start_date,
+ planned_end_date, actual_start_date, actual_end_date,
+ 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);
+
+ PERFORM acs_permission__grant_permission(
+ v_revision_id,
+ p_creation_user,
+ ''admin''
+ );
+
+ return v_revision_id;
+end;' language 'plpgsql';
+
+
+select define_function_args('pm_task__new_task_item', 'project_id, title, description, html_p, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, status_id, process_instance_id, creation_date, creation_user, creation_ip, package_id, priority');
+
+create or replace function pm_task__new_task_item (
+ integer, -- project_id
+ varchar, -- title
+ varchar, -- description
+ varchar, -- html_p
+ timestamptz, -- end_date
+ numeric, -- percent_complete
+ numeric, -- estimated_hours_work
+ numeric, -- estimated_hours_work_min
+ numeric, -- estimated_hours_work_max,
+ integer, -- status_id
+ integer, -- process_instance_id
+ timestamptz, -- creation_date
+ integer, -- creation_user
+ varchar, -- creation_ip
+ integer, -- package_id
+ integer -- priority
+) returns integer
+as '
+declare
+ p_project_id alias for $1;
+ p_title alias for $2;
+ p_description alias for $3;
+ p_mime_type alias for $4;
+ p_end_date alias for $5;
+ p_percent_complete alias for $6;
+ p_estimated_hours_work alias for $7;
+ p_estimated_hours_work_min alias for $8;
+ p_estimated_hours_work_max alias for $9;
+ p_status_id alias for $10;
+ p_process_instance_id alias for $11;
+ p_creation_date alias for $12;
+ p_creation_user alias for $13;
+ p_creation_ip alias for $14;
+ p_package_id alias for $15;
+ p_priority alias for $16;
+
+ v_item_id cr_items.item_id%TYPE;
+ v_revision_id cr_revisions.revision_id%TYPE;
+ v_id cr_items.item_id%TYPE;
+ v_task_number integer;
+begin
+ select acs_object_id_seq.nextval into v_id from dual;
+
+ -- We want to put the task under the project item
+
+ -- create the task_number
+
+ v_item_id := content_item__new (
+ v_id::varchar, -- name
+ p_project_id, -- parent_id
+ v_id, -- item_id
+ null, -- locale
+ now(), -- creation_date
+ p_creation_user, -- creation_user
+ p_package_id, -- context_id
+ p_creation_ip, -- creation_ip
+ ''pm_task'', -- item_subtype
+ ''pm_task'', -- content_type
+ p_title, -- title
+ p_description, -- description
+ p_mime_type, -- mime_type
+ null, -- nls_language
+ null -- data
+ );
+
+ v_revision_id := content_revision__new (
+ p_title, -- title
+ p_description, -- description
+ now(), -- publish_date
+ p_mime_type, -- mime_type
+ NULL, -- nls_language
+ NULL, -- data
+ v_item_id, -- item_id
+ NULL, -- revision_id
+ now(), -- creation_date
+ p_creation_user, -- creation_user
+ p_creation_ip -- creation_ip
+ );
+
+ PERFORM content_item__set_live_revision (v_revision_id);
+
+ insert into pm_tasks (
+ task_id, task_number, status, process_instance)
+ values (
+ v_item_id, v_task_number, p_status_id, p_process_instance_id);
+
+ insert into pm_tasks_revisions (
+ task_revision_id, end_date, percent_complete, estimated_hours_work, estimated_hours_work_min, estimated_hours_work_max, actual_hours_worked, priority)
+ values (
+ v_revision_id, p_end_date, p_percent_complete, p_estimated_hours_work, p_estimated_hours_work_min, p_estimated_hours_work_max, ''0'', p_priority);
+
+ update acs_objects set context_id = p_project_id where object_id = task_id;
+
+ PERFORM acs_permission__grant_permission(
+ v_revision_id,
+ p_creation_user,
+ ''admin''
+ );
+
+ return v_revision_id;
+end;' language 'plpgsql';
Index: openacs-4/packages/project-manager/tcl/install-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/install-procs.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/project-manager/tcl/install-procs.tcl 26 May 2005 12:23:02 -0000 1.7
+++ openacs-4/packages/project-manager/tcl/install-procs.tcl 3 Jun 2005 22:13:44 -0000 1.8
@@ -31,7 +31,6 @@
content::type::attribute::new -content_type {pm_project} -attribute_name {latest_finish_date} -datatype {date} -pretty_name {Latest finish date} -pretty_plural {Latest finish dates} -column_spec {timestamptz}
content::type::attribute::new -content_type {pm_project} -attribute_name {actual_hours_completed} -datatype {number} -pretty_name {Actual hours completed} -pretty_plural {Actual hours completed} -column_spec {numeric}
content::type::attribute::new -content_type {pm_project} -attribute_name {estimated_hours_total} -datatype {number} -pretty_name {Estimated hours total} -pretty_plural {Estimated hours total} -column_spec {numeric}
- content::type::attribute::new -content_type {pm_project} -attribute_name {logger_project} -datatype {integer} -pretty_name {Linked logger project} -pretty_plural {Linked logger projects} -column_spec {integer}
content::type::attribute::new -content_type {pm_project} -attribute_name {customer_id} -datatype {integer} -pretty_name {Customer} -pretty_plural {Customers} -column_spec {integer}
## Create pm_task
@@ -81,12 +80,14 @@
ad_proc -public -callback pm::project_new {
{-package_id:required}
{-project_id:required}
+ {-data:required}
} {
}
ad_proc -public -callback pm::project_edit {
{-package_id:required}
{-project_id:required}
+ {-data:required}
} {
}
@@ -298,5 +299,8 @@
3.0d2 3.0d3 {
rel_types::new "application_data_link" "Application Data Link" "Application Data Links" acs_object 0 "" acs_object 0 ""
}
+ 3.0d3 3.0d4 {
+ content::type::attribute::delete -content_type {pm_project} -attribute_name {logger_project}
+ }
}
}
Index: openacs-4/packages/project-manager/tcl/project-manager-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-manager-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 26 May 2005 09:34:29 -0000 1.3
+++ openacs-4/packages/project-manager/tcl/project-manager-procs.tcl 3 Jun 2005 22:13:44 -0000 1.4
@@ -310,14 +310,7 @@
@error
} {
- set return_val [parameter::get -parameter "LoggerPrimaryURL" -default ""]
-
- if {[empty_string_p $return_val]} {
- ns_log Error "Project-manager: need to set up LoggerPrimaryURL in parameters"
- util_user_message -message "[_ project-manager.lt_Administrator_needs_t]"
- }
-
- return $return_val
+ return [site_node::get_url_from_object_id -object_id [lindex [application_link::get_linked -from_package_id [ad_conn package_id] -to_package_key logger] 0]]
}
Index: openacs-4/packages/project-manager/tcl/project-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-procs-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/tcl/project-procs-oracle.xql 26 May 2005 09:34:29 -0000 1.2
+++ openacs-4/packages/project-manager/tcl/project-procs-oracle.xql 3 Jun 2005 22:13:44 -0000 1.3
@@ -53,7 +53,6 @@
p_planned_end_date => to_date(:planned_end_date,'YYYY MM DD HH24 MI SS'),
p_actual_start_date => null,
p_actual_end_date => null,
- p_logger_project => :logger_project,
p_ongoing_p => :ongoing_p,
p_status_id => :status_id,
p_customer_id => :organization_id,
Index: openacs-4/packages/project-manager/tcl/project-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/tcl/project-procs-postgresql.xql 26 May 2005 09:34:29 -0000 1.2
+++ openacs-4/packages/project-manager/tcl/project-procs-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.3
@@ -45,18 +45,6 @@
-
-
- INSERT INTO
- pm_task_logger_proj_map
- (task_item_id,
- logger_entry)
- VALUES
- (:task_item_id,
- :entry_id)
-
-
-
select pm_project__new_project_item (
@@ -70,7 +58,7 @@
to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'),
null,
null,
- :logger_project,
+ null,
:ongoing_p,
:status_id,
:organization_id,
Index: openacs-4/packages/project-manager/tcl/project-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/project-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/tcl/project-procs.tcl 26 May 2005 09:34:29 -0000 1.3
+++ openacs-4/packages/project-manager/tcl/project-procs.tcl 3 Jun 2005 22:13:44 -0000 1.4
@@ -161,7 +161,7 @@
# 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_task_logger_map { }
+ application_data_link::new -this_object_id $task_item_id -target_object_id $entry_id
set returnval [pm::task::update_hours \
-task_item_id $task_item_id \
@@ -215,27 +215,7 @@
set planned_end_date ""
}
- # create a logger project
- set logger_project [logger::project::new \
- -name $project_name \
- -project_lead $creation_user \
- ]
-
- # we want the logger project to show up in logger!
- set logger_URLs [parameter::get -parameter "LoggerURLsToKeepUpToDate" -default ""]
- foreach url $logger_URLs {
- # get the package_id
- set node_id [site_node::get_node_id -url $url]
- array set node [site_node::get -node_id $node_id]
- set this_package_id $node(package_id)
-
- logger::package::map_project \
- -project_id $logger_project \
- -package_id $this_package_id
- }
-
- # create a project manager project (associating the logger project
- # with the logger project)
+ # create a project manager project
set project_revision [db_exec_plsql new_project_item { *SQL }]
set project_item_id [pm::project::get_project_item_id \
@@ -284,9 +264,6 @@
if {!$no_callback_p} {
callback pm::project_delete -package_id [ad_conn package_id] -project_id $project_item_id
}
-
- # should we delete the logger project as well?
-
}
@@ -301,7 +278,6 @@
{-planned_end_date ""}
{-actual_start_date ""}
{-actual_end_date ""}
- -logger_project:required
{-ongoing_p "f"}
-status_id:required
-organization_id:required
@@ -324,27 +300,6 @@
@error
} {
-
- # if we edit the name of the project, we need to edit the logger
- # project name too.
-
- set logger_project [pm::project::get_logger_project \
- -project_item_id $project_item_id]
-
- set active_p [pm::status::open_p -task_status_id $status_id]
- set customer_name [organizations::name -organization_id "$organization_id"]
-
- if {![empty_string_p $customer_name]} {
- append customer_name " - "
- }
-
- logger::project::edit \
- -project_id $logger_project \
- -name "$customer_name$project_name" \
- -description "$description" \
- -project_lead $creation_user \
- -active_p $active_p
-
set returnval [db_exec_plsql update_project "
select pm_project__new_project_revision (
:project_item_id,
@@ -357,7 +312,7 @@
to_timestamp(:planned_end_date,'YYYY MM DD HH24 MI SS'),
null,
null,
- :logger_project,
+ null,
:ongoing_p,
:status_id,
:organization_id,
@@ -1561,32 +1516,6 @@
-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"]
-}
-
-
ad_proc -public pm::project::get_project {
-logger_project:required
} {
Index: openacs-4/packages/project-manager/tcl/task-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/task-procs-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/tcl/task-procs-postgresql.xql 29 Apr 2005 17:43:37 -0000 1.1
+++ openacs-4/packages/project-manager/tcl/task-procs-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -197,23 +197,6 @@
-
-
- UPDATE
- logger_entries
- SET
- project_id = :logger_project
- WHERE
- entry_id in
- (select
- logger_entry
- from
- pm_task_logger_proj_map
- where
- task_item_id = :task_item_id)
-
-
-
select pm_task__new_task_item (
Index: openacs-4/packages/project-manager/tcl/task-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/task-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/tcl/task-procs.tcl 26 May 2005 09:34:29 -0000 1.3
+++ openacs-4/packages/project-manager/tcl/task-procs.tcl 3 Jun 2005 22:13:44 -0000 1.4
@@ -676,26 +676,15 @@
}
if {$percent_complete >= 100} {
-
set status_id [pm::task::default_status_closed]
-
} elseif {$percent_complete < 100} {
-
set status_id [pm::task::default_status_open]
}
- set actual_hours_worked [pm::task::update_hours \
- -task_item_id $task_item_id]
+ set actual_hours_worked [pm::task::update_hours -task_item_id $task_item_id]
set return_val [db_exec_plsql new_task_revision { *SQL }]
- # we have to update all logged hours to make sure the hours are
- # set to the correct project whenever the project is changed.
-
- set logger_project [pm::project::get_logger_project -project_item_id $project_item_id]
-
- db_dml update_logger_entries { }
-
if {!$no_callback_p} {
callback pm::task_edit -package_id $package_id -task_id $task_item_id
}
@@ -887,7 +876,7 @@
} {
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
+ hours logged in logger
@author Jade Rubick (jader@bread.com)
@creation-date 2004-03-04
@@ -928,9 +917,8 @@
-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]'
+ select sum(le.value) from logger_entries le where entry_id in (select object_id_two from acs_rels where object_id_one = :task_item_id and rel_type = 'application_data_link') and le.variable_id = '[logger::variable::get_default_variable_id]'
" -default "0"]
if {[string is true $update_tasks_p]} {
Index: openacs-4/packages/project-manager/www/add-edit-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/add-edit-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/add-edit-oracle.xql 29 Apr 2005 17:43:37 -0000 1.1
+++ openacs-4/packages/project-manager/www/add-edit-oracle.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -11,7 +11,6 @@
p.description,
p.customer_id,
p.status_id,
- p.logger_project,
to_char(p.planned_start_date,'YYYY-MM-DD') as planned_start_date,
to_char(p.planned_end_date,'YYYY-MM-DD') as planned_end_date,
p.ongoing_p
Index: openacs-4/packages/project-manager/www/add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/add-edit-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/add-edit-postgresql.xql 29 Apr 2005 17:43:37 -0000 1.1
+++ openacs-4/packages/project-manager/www/add-edit-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -12,7 +12,6 @@
p.description,
p.customer_id,
p.status_id,
- p.logger_project,
to_char(p.planned_start_date,'YYYY-MM-DD') as planned_start_date,
to_char(p.planned_end_date,'YYYY-MM-DD') as planned_end_date,
p.ongoing_p
Index: openacs-4/packages/project-manager/www/add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/add-edit.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/project-manager/www/add-edit.tcl 1 Jun 2005 05:12:30 -0000 1.5
+++ openacs-4/packages/project-manager/www/add-edit.tcl 3 Jun 2005 22:13:44 -0000 1.6
@@ -24,7 +24,6 @@
{deadline_scheduling ""}
{ongoing_p ""}
{status_id ""}
- {logger_project ""}
} -properties {
@@ -75,7 +74,7 @@
set logger_values ""
} else {
- set logger_project [pm::project::get_logger_project -project_item_id $project_item_id]
+ set logger_project [lindex [application_data_link::get_linked -from_object_id $project_item_id -to_object_type logger_project] 0]
set logger_values [logger::project::get_variables -project_id $logger_project]
}
@@ -92,10 +91,6 @@
{value $project_item_id}
}
- {logger_project:text(hidden)
- {value $logger_project}
- }
-
{project_name:text
{label "[_ project-manager.lt_set_project_term_name]"}
{value $project_name}
@@ -208,6 +203,9 @@
set user_id [ad_conn user_id]
set peeraddr [ad_conn peeraddr]
set folder_id [pm::util::get_root_folder -package_id $package_id]
+ set callback_data(organization_id) $customer_id
+ set callback_data(variables) $variables
+
set customer_name [organizations::name -organization_id $customer_id]
if {![empty_string_p $customer_name]} {
append customer_name " - "
@@ -230,41 +228,18 @@
set planned_end_date ""
}
- # create a logger project
- set logger_project [logger::project::new \
- -name "$customer_name$project_name" \
- -description $description \
- -project_lead $user_id \
- ]
-
- # we want the logger project to show up in logger!
- set logger_URLs [parameter::get -parameter "LoggerURLsToKeepUpToDate" -default ""]
- foreach url $logger_URLs {
- # get the package_id
- set node_id [site_node::get_node_id -url $url]
- array set node [site_node::get -node_id $node_id]
- set this_package_id $node(package_id)
-
- logger::package::map_project \
- -project_id $logger_project \
- -package_id $this_package_id
- }
-
- # create a project manager project (associating the logger project
- # with the logger project)
-
+ # create a project manager project
set project_id [dtype::form::process \
-prefix pm \
-object_type pm_project \
-object_id $project_id \
-form add_edit \
-cr_widget none \
- -defaults [list title $project_name description $description mime_type "text/plain" context_id $parent_id parent_id $parent_id] \
- -default_fields {project_code goal {planned_start_date $planned_start_date_sql} {planned_end_date $planned_end_date_sql} actual_start_date actual_end_date ongoing_p status_id customer_id logger_project} \
+ -defaults [list title $project_name description $description mime_type "text/plain" context_id $parent_id parent_id $parent_id object_type pm_project] \
+ -default_fields {project_code goal {planned_start_date $planned_start_date_sql} {planned_end_date $planned_end_date_sql} actual_start_date actual_end_date ongoing_p status_id customer_id} \
-exclude_static]
set project_item_id [pm::project::get_project_item_id -project_id $project_id]
- # set logger_project [pm::project::get_logger_project -project_item_id $project_item_id]
set project_role [pm::role::default]
pm::project::assign \
@@ -277,16 +252,7 @@
category::map_object -remove_old -object_id $project_item_id $category_ids
}
- if {[exists_and_not_null variables]} {
- foreach var $variables {
- logger::project::map_variable -project_id $logger_project -variable_id $var
- }
- } else {
- # add in the default variable
- logger::project::map_variable -project_id $logger_project -variable_id [logger::variable::get_default_variable_id]
- }
-
- callback pm::project_new -package_id $package_id -project_id $project_item_id
+ callback pm::project_new -package_id $package_id -project_id $project_item_id -data [array get callback_data]
}
} -edit_data {
@@ -297,43 +263,22 @@
# it until it is edited. So we need to pull in these values
set old_project_id $project_id
- set logger_project [pm::project::get_logger_project \
- -project_item_id $project_item_id]
-
- set active_p [pm::status::open_p -task_status_id $status_id]
-
- logger::project::edit \
- -project_id $logger_project \
- -name "$customer_name$project_name" \
- -description $description \
- -project_lead $user_id \
- -active_p $active_p
-
set project_id [dtype::form::process \
-prefix pm \
-object_type pm_project \
-object_id $project_id \
-form add_edit \
-cr_widget none \
- -defaults [list title $project_name description $description mime_type "text/plain" context_id $parent_id parent_id $parent_id] \
- -default_fields {project_code goal {planned_start_date $planned_start_date_sql} {planned_end_date $planned_end_date_sql} actual_start_date actual_end_date ongoing_p status_id customer_id logger_project} \
+ -defaults [list title $project_name description $description mime_type "text/plain" context_id $parent_id parent_id $parent_id object_type pm_project] \
+ -default_fields {project_code goal {planned_start_date $planned_start_date_sql} {planned_end_date $planned_end_date_sql} actual_start_date actual_end_date ongoing_p status_id customer_id} \
-exclude_static]
- set project_item_id [pm::project::get_project_item_id \
- -project_id $project_id]
+ set project_item_id [pm::project::get_project_item_id -project_id $project_id]
- # set logger_project [pm::project::get_logger_project -project_item_id $project_item_id]
-
- if {[exists_and_not_null variables]} {
- logger::project::remap_variables -project_id $logger_project -new_variable_list $variables
- } else {
- logger::project::remap_variables -project_id $logger_project -new_variable_list [logger::variable::get_default_variable_id]
- }
-
if {[exists_and_not_null category_ids]} {
category::map_object -remove_old -object_id $project_item_id $category_ids
}
- callback pm::project_edit -package_id $package_id -project_id $project_item_id
+ callback pm::project_edit -package_id $package_id -project_id $project_item_id -data [array get callback_data]
}
} -after_submit {
Index: openacs-4/packages/project-manager/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/index.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/www/index.adp 26 May 2005 09:34:29 -0000 1.2
+++ openacs-4/packages/project-manager/www/index.adp 3 Jun 2005 22:13:44 -0000 1.3
@@ -6,6 +6,3 @@
@context;noquote@
-
-
-
Index: openacs-4/packages/project-manager/www/one-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/one-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/one-oracle.xql 29 Apr 2005 17:43:37 -0000 1.1
+++ openacs-4/packages/project-manager/www/one-oracle.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -12,7 +12,6 @@
p.mime_type,
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/packages/project-manager/www/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/one-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/one-postgresql.xql 29 Apr 2005 17:43:37 -0000 1.1
+++ openacs-4/packages/project-manager/www/one-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -7,7 +7,6 @@
p.item_id,
p.project_id,
p.title as project_name,
- p.project_code,
p.goal,
p.description,
p.mime_type,
Index: openacs-4/packages/project-manager/www/one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/one.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/project-manager/www/one.tcl 26 May 2005 12:24:11 -0000 1.5
+++ openacs-4/packages/project-manager/www/one.tcl 3 Jun 2005 22:13:44 -0000 1.6
@@ -108,6 +108,8 @@
# Get Project Information
db_1row project_query { } -column_array project
+set project(logger_project) [lindex [application_data_link::get_linked -from_object_id $project_item_id -to_object_type logger_project] 0]
+
# Context Bar and Title information
set portlet_master "/packages/project-manager/lib/portlet"
set project_root [pm::util::get_root_folder -package_id $package_id]
Index: openacs-4/packages/project-manager/www/one.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/one.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/one.xql 26 May 2005 09:34:29 -0000 1.1
+++ openacs-4/packages/project-manager/www/one.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -19,7 +19,6 @@
p.mime_type,
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/packages/project-manager/www/task-add-edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-add-edit-2.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/project-manager/www/task-add-edit-2.tcl 26 May 2005 09:34:29 -0000 1.4
+++ openacs-4/packages/project-manager/www/task-add-edit-2.tcl 3 Jun 2005 22:13:44 -0000 1.5
@@ -166,9 +166,7 @@
# Log hours and other variables to task
# -------------------------------------
- set logger_project [pm::project::get_logger_project \
- -project_item_id $project_item_id($num)]
-
+ set logger_project [lindex [application_data_link::get_linked -from_object_id $project_item_id($num) -to_object_type logger_project] 0]
if {[exists_and_not_null hours($num)]} {
Index: openacs-4/packages/project-manager/www/task-add-edit-one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-add-edit-one.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/task-add-edit-one.tcl 26 May 2005 09:34:29 -0000 1.1
+++ openacs-4/packages/project-manager/www/task-add-edit-one.tcl 3 Jun 2005 22:13:44 -0000 1.2
@@ -62,7 +62,7 @@
if {[exists_and_not_null task_item_id] || ![ad_form_new_p -key task_id]} {
set edit_p t
db_1row task_data {}
- set logger_project [pm::project::get_logger_project -project_item_id $project_item_id]
+ set logger_project [lindex [application_data_link::get_linked -from_object_id $project_item_id -to_object_type logger_project] 0]
set variable_options [logger::ui::variable_options -project_id $logger_project]
set open_p [pm::project::open_p -project_item_id $project_item_id]
@@ -491,7 +491,7 @@
-object_id $task_id \
-form task_add_edit \
-cr_widget none \
- -defaults [list title $task_title description $description mime_type $description_mime_type context_id $project_item_id parent_id $project_item_id] \
+ -defaults [list title $task_title description $description mime_type $description_mime_type context_id $project_item_id parent_id $project_item_id object_type pm_task] \
-default_fields {percent_complete {end_date $end_date_sql} estimated_hours_work estimated_hours_work_min estimated_hours_work_max priority} \
-exclude_static]
@@ -553,15 +553,13 @@
# Log hours and other variables to task
# -------------------------------------
- set logger_project [pm::project::get_logger_project \
- -project_item_id $project_item_id]
-
+ set logger_project [lindex [application_data_link::get_linked -from_object_id $project_item_id -to_object_type logger_project] 0]
if {[exists_and_not_null hours]} {
pm::project::log_hours \
-logger_project_id $logger_project \
- -variable_id $logger_variable \
+ -variable_id $logger_variable_id \
-value $hours \
-description $log \
-task_item_id $task_item_id \
@@ -583,7 +581,7 @@
-object_id $task_id \
-form task_add_edit \
-cr_widget none \
- -defaults [list title $task_title description $description mime_type $description_mime_type context_id $project_item_id parent_id $project_item_id] \
+ -defaults [list title $task_title description $description mime_type $description_mime_type context_id $project_item_id parent_id $project_item_id object_type pm_task] \
-default_fields {percent_complete {end_date $end_date_sql} estimated_hours_work estimated_hours_work_min estimated_hours_work_max priority} \
-exclude_static]
Index: openacs-4/packages/project-manager/www/task-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-add-edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/project-manager/www/task-add-edit.tcl 26 May 2005 09:34:29 -0000 1.4
+++ openacs-4/packages/project-manager/www/task-add-edit.tcl 3 Jun 2005 22:13:44 -0000 1.5
@@ -187,10 +187,8 @@
-selected $this_project]
# find out the default logger variable for this project
- set logger_project [pm::project::get_logger_project \
- -project_item_id $this_project]
- set logger_variable_id [logger::project::get_primary_variable \
- -project_id $logger_project]
+ set logger_project [lindex [application_data_link::get_linked -from_object_id $this_project -to_object_type logger_project] 0]
+ set logger_variable_id [logger::project::get_primary_variable -project_id $logger_project]
set today_date [db_string today "select to_date(sysdate,'YYYY-MM-DD') from dual"]
set today_html$task "
y-m-d "
Index: openacs-4/packages/project-manager/www/task-one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-one-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/www/task-one-postgresql.xql 26 May 2005 09:34:29 -0000 1.2
+++ openacs-4/packages/project-manager/www/task-one-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.3
@@ -51,55 +51,6 @@
-
-
- SELECT
- t.title as task_title,
- 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
- 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
- and exists (select 1 from acs_object_party_privilege_map ppm
- where ppm.object_id = d.task_id
- and ppm.privilege = 'read'
- and ppm.party_id = :user_id)
- [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,
- d.parent_task_id,
- d.dependency_type,
- d.task_id as d_task_id
- 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
- t.item_id = i.item_id
- and exists (select 1 from acs_object_party_privilege_map ppm
- where ppm.object_id = d.task_id
- and ppm.privilege = 'read'
- and ppm.party_id = :user_id)
- [template::list::orderby_clause -name dependency2 -orderby]
-
-
-
select
@@ -124,50 +75,4 @@
-
-
- SELECT
- x.task_id_1 as x_task_id,
- r.title,
- to_char(r.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start,
- r.earliest_start - current_date as days_to_earliest_start,
- to_char(r.earliest_start,'J') as earliest_start_j,
- to_char(r.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish,
- r.earliest_finish - current_date as days_to_earliest_finish,
- to_char(r.latest_start,'YYYY-MM-DD HH24:MI') as latest_start,
- r.latest_start - current_date as days_to_latest_start,
- to_char(r.latest_start,'J') as latest_start_j,
- to_char(current_date,'J') as today_j,
- to_char(r.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish,
- r.latest_finish - current_date as days_to_latest_finish
- FROM
- pm_task_xref x, pm_tasks_revisionsx r, cr_items i
- WHERE
- x.task_id_2 = :task_id and
- x.task_id_1 = r.item_id and
- r.revision_id = i.live_revision
- UNION
- SELECT
- x2.task_id_2 as x_task_id,
- r2.title,
- to_char(r2.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start,
- r2.earliest_start - current_date as days_to_earliest_start,
- to_char(r2.earliest_start,'J') as earliest_start_j,
- to_char(r2.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish,
- r2.earliest_finish - current_date as days_to_earliest_finish,
- to_char(r2.latest_start,'YYYY-MM-DD HH24:MI') as latest_start,
- r2.latest_start - current_date as days_to_latest_start,
- to_char(r2.latest_start,'J') as latest_start_j,
- to_char(current_date,'J') as today_j,
- to_char(r2.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish,
- r2.latest_finish - current_date as days_to_latest_finish
- FROM
- pm_task_xref x2, pm_tasks_revisionsx r2, cr_items i2
- WHERE
- x2.task_id_1 = :task_id and
- x2.task_id_2 = r2.item_id and
- i2.live_revision = r2.revision_id
-
-
-
Index: openacs-4/packages/project-manager/www/task-one.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-one.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/www/task-one.adp 26 May 2005 09:34:29 -0000 1.3
+++ openacs-4/packages/project-manager/www/task-one.adp 3 Jun 2005 22:13:44 -0000 1.4
@@ -95,6 +95,11 @@
@task_info.description;noquote@ |
+
+
+ @dynamic_attributes.value@ |
+
+
-- @task_info.creation_user@ |
@@ -294,73 +299,24 @@
-
-
-
-
- |
- #project-manager.lt_task_terms_this_depen# |
-
-
- |
-
-
-
-
- |
- |
-
-
+
-
-
-
-
- |
- #project-manager.lt_task_terms_depending_# |
-
-
- |
-
-
-
-
- |
- |
-
-
+
-
-
-
-
- |
- #project-manager.Related_task_terms# |
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
-
-
+
Index: openacs-4/packages/project-manager/www/task-one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/task-one.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/project-manager/www/task-one.tcl 26 May 2005 09:34:29 -0000 1.4
+++ openacs-4/packages/project-manager/www/task-one.tcl 3 Jun 2005 22:13:44 -0000 1.5
@@ -9,21 +9,19 @@
@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 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_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)
+ @param orderby_depend_to specifies how the dependencies will be sorted
+ @param orderby_depend_from specifies how the dependencies will be sorted (for tasks that have dependencies on this task)
@param logger_days The number of days back to view logged entries
} {
task_id:integer,optional
task_revision_id:integer,optional
- orderby_dependency:optional
- orderby_dependency2:optional
+ {orderby_depend_to:optional ""}
+ {orderby_depend_from:optional ""}
orderby_people:optional
{logger_variable_id:integer ""}
{logger_days:integer "180"}
@@ -36,8 +34,6 @@
context:onevalue
write_p:onevalue
create_p:onevalue
- dependency:multirow
- dependency2:multirow
people:multirow
task_term:onevalue
task_term_lower:onevalue
@@ -196,8 +192,7 @@
set task_edit_url [export_vars -base task-add-edit {{task_item_id $task_id} return_url project_item_id}]
-set logger_project [pm::project::get_logger_project \
- -project_item_id $task_info(project_item_id)]
+set logger_project [lindex [application_data_link::get_linked -from_object_id $task_info(project_item_id) -to_object_type logger_project] 0]
set logger_url [pm::util::logger_url]
@@ -242,126 +237,18 @@
-url "[ad_conn url]?[ad_conn query]" \
]
+# ------------------
+# Dynamic Attributes
+# ------------------
-# Dependency info ------------------------------------------------
+dtype::get_object -object_id $task_revision_id -object_type pm_task -array dattr -exclude_static
-template::list::create \
- -name dependency \
- -multirow dependency \
- -key d_task_id \
- -elements {
- dependency_type {
- label "[_ project-manager.Type]"
- display_template {
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- d_task_id {
- label "[_ project-manager.Task]"
- display_col task_title
- link_url_col item_url
- link_html { title "[_ project-manager.View_this_task]" }
- }
- percent_complete {
- label "[_ project-manager.Status_1]"
- display_template "@dependency.percent_complete@\%"
- }
- end_date {
- label "[_ project-manager.Deadline_1]"
- }
- } \
- -orderby {
- percent_complete {orderby percent_complete}
- end_date {orderby end_date}
- } \
- -orderby_name orderby_dependency \
- -sub_class {
- narrow
- } \
- -filters {
- task_revision_id {}
- orderby_dependency2 {}
- } \
- -html {
- width 100%
- }
-
-db_multirow -extend { item_url } dependency dependency_query {
-} {
- set item_url [export_vars -base "task-one" -override {{task_id $parent_task_id}} { task_id $d_task_id }]
+multirow create dynamic_attributes name value
+foreach attr [array names dattr] {
+ multirow append dynamic_attributes "[_ dynamic-types.pm_task_$attr]" $dattr($attr)
}
-# Dependency info (dependency other task have on this task) ------
-template::list::create \
- -name dependency2 \
- -multirow dependency2 \
- -key d_task_id \
- -elements {
- dependency_type {
- label "[_ project-manager.Type]"
- display_template {
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- d_task_id {
- label "[_ project-manager.Task]"
- display_col task_title
- link_url_eval {task-one?task_id=$d_task_id}
- link_html { title "[_ project-manager.View_this_task]" }
- }
- percent_complete {
- label "[_ project-manager.Status_1]"
- display_template "@dependency2.percent_complete@\%"
- }
- end_date {
- label "[_ project-manager.Deadline_1]"
- }
- } \
- -orderby {
- percent_complete {orderby percent_complete}
- end_date {orderby end_date}
- } \
- -orderby_name orderby_dependency2 \
- -sub_class {
- narrow
- } \
- -filters {
- task_revision_id {}
- orderby_dependency {}
- } \
- -html {
- width 100%
- }
-
-
-db_multirow -extend { item_url } dependency2 dependency2_query {
-} {
-
-}
-
# People, using list-builder ---------------------------------
template::list::create \
@@ -388,9 +275,8 @@
-filters {
party_id {}
task_id {}
- orderby_subproject {}
- orderby_versions {}
- orderby_tasks {}
+ orderby_depend_to {}
+ orderby_depend_from {}
} \
-orderby {
default_value role_id,desc
@@ -413,71 +299,6 @@
db_multirow people task_people_query { }
-# Xrefs ------------------------------------------------
-
-template::list::create \
- -name xrefs \
- -multirow xrefs \
- -key x_task_id \
- -elements {
- x_task_id {
- label "[_ project-manager.ID]"
- }
- title {
- label "[_ project-manager.Task]"
- link_url_col item_url
- link_html { title "[_ project-manager.View_this_task]" }
- }
- slack_time {
- label "[_ project-manager.Slack_1]"
- }
- earliest_start_pretty {
- label "[_ project-manager.ES]"
- }
- earliest_finish_pretty {
- label "[_ project-manager.EF]"
- }
- latest_start_pretty {
- label "[_ project-manager.LS]"
- }
- latest_finish_pretty {
- label "[_ project-manager.LF]"
- display_template {
- @xrefs.latest_finish_pretty@
- }
- }
- } \
- -sub_class {
- narrow
- } \
- -filters {
- task_revision_id {}
- orderby_revision {}
- orderby_dependency {}
- orderby_dependency2 {}
- } \
- -html {
- width 100%
- }
-
-db_multirow -extend { item_url earliest_start_pretty earliest_finish_pretty latest_start_pretty latest_finish_pretty slack_time } xrefs xrefs_query {
-} {
- set item_url [export_vars -base "task-one" -override {{task_id $x_task_id}}]
-
- set earliest_start_pretty [lc_time_fmt $earliest_start "%x"]
- set earliest_finish_pretty [lc_time_fmt $earliest_finish "%x"]
- set latest_start_pretty [lc_time_fmt $latest_start "%x"]
- set latest_finish_pretty [lc_time_fmt $latest_finish "%x"nn]
-
- set slack_time [pm::task::slack_time \
- -earliest_start_j $earliest_start_j \
- -today_j $today_j \
- -latest_start_j $latest_start_j]
-
-}
-
-
ad_return_template
# ------------------------- END OF FILE ------------------------- #
-
Index: openacs-4/packages/project-manager/www/tasks-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/tasks-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/tasks-oracle.xql 29 Apr 2005 17:43:38 -0000 1.1
+++ openacs-4/packages/project-manager/www/tasks-oracle.xql 3 Jun 2005 22:13:44 -0000 1.2
@@ -10,7 +10,7 @@
t.title,
t.description,
t.parent_id as project_item_id,
- proj_rev.logger_project,
+ r.object_id_two as logger_project,
proj_rev.title as project_name,
to_char(t.earliest_start,'J') as earliest_start_j,
to_char(sysdate,'J') as today_j,
@@ -36,15 +36,21 @@
persons p ,
pm_roles r ,
cr_items proj,
- pm_projectsx proj_rev
+ pm_projectsx proj_rev,
+ acs_rels ar,
+ acs_objects o
WHERE t.item_id = ta.task_id (+) and
ta.party_id = p.person_id (+) and
ta.role_id = r.role_id (+) and
ts.task_id = t.item_id and
i.item_id = t.item_id and
t.task_revision_id = i.live_revision and
t.parent_id = proj.item_id and
- proj.live_revision = proj_rev.revision_id
+ proj.live_revision = proj_rev.revision_id and
+ ar.object_id_one = t.parent_id and
+ ar.rel_type = 'application_data_link' and
+ o.object_id = ar.object_id_two and
+ o.object_type = 'logger_project'
[template::list::filter_where_clauses -and -name tasks]
[template::list::orderby_clause -orderby -name tasks]
Index: openacs-4/packages/project-manager/www/tasks-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/tasks-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/www/tasks-postgresql.xql 26 May 2005 09:34:29 -0000 1.3
+++ openacs-4/packages/project-manager/www/tasks-postgresql.xql 3 Jun 2005 22:13:44 -0000 1.4
@@ -12,7 +12,7 @@
t.description,
tst.description as status,
t.parent_id as project_item_id,
- proj_rev.logger_project,
+ ar.object_id_two as logger_project,
proj_rev.title as project_name,
to_char(t.earliest_start,'J') as earliest_start_j,
to_char(current_timestamp,'J') as today_j,
@@ -44,7 +44,9 @@
ON ta.role_id = r.role_id,
cr_items proj,
cr_folders f,
- pm_projectsx proj_rev
+ pm_projectsx proj_rev,
+ acs_rels ar,
+ acs_objects o
WHERE
ts.task_id = t.item_id and
tst.status_id = status and
@@ -54,6 +56,10 @@
proj.live_revision = proj_rev.revision_id
and proj.parent_id = f.folder_id
and f.package_id = :package_id
+ and ar.object_id_one = t.parent_id
+ and ar.rel_type = 'application_data_link'
+ and o.object_id = ar.object_id_two
+ and o.object_type = 'logger_project'
[template::list::page_where_clause -and -name "tasks" -key "ts.task_id"]
and exists (select 1 from acs_object_party_privilege_map ppm
where ppm.object_id = ts.task_id
Index: openacs-4/packages/project-manager/www/lib/entries-table-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/lib/entries-table-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/lib/entries-table-oracle.xql 29 Apr 2005 17:43:40 -0000 1.1
+++ openacs-4/packages/project-manager/www/lib/entries-table-oracle.xql 3 Jun 2005 22:13:45 -0000 1.2
@@ -17,17 +17,15 @@
submitter.person_id as user_id,
submitter.first_names || ' ' || submitter.last_name as user_name
FROM logger_entries le ,
- (SELECT r.title,
- m.logger_entry
- FROM cr_items i,
- cr_revisions r,
- pm_task_logger_proj_map m
- WHERE r.item_id = m.task_item_id and
- i.live_revision = r.revision_id) task,
+ (SELECT r.title, ar.object_id_two
+ FROM cr_items i, cr_revisions r, acs_rels ar
+ WHERE r.item_id = ar.object_id_one
+ and ar.rel_type = 'application_data_link'
+ and i.live_revision = r.revision_id) task,
logger_projects lp,
acs_objects ao,
persons submitter
- WHERE le.entry_id = task.logger_entry (+) and
+ WHERE le.entry_id = task.object_id_two (+) and
le.project_id = lp.project_id and
ao.object_id = le.entry_id and
ao.creation_user = submitter.person_id
Index: openacs-4/packages/project-manager/www/lib/entries-table-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/lib/entries-table-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/project-manager/www/lib/entries-table-postgresql.xql 29 Apr 2005 17:43:40 -0000 1.1
+++ openacs-4/packages/project-manager/www/lib/entries-table-postgresql.xql 3 Jun 2005 22:13:45 -0000 1.2
@@ -19,17 +19,12 @@
submitter.first_names || ' ' || submitter.last_name as user_name
FROM
logger_entries le
- LEFT JOIN (select
- r.title,
- m.logger_entry
- from
- cr_items i,
- cr_revisions r,
- pm_task_logger_proj_map m
- where
- r.item_id = m.task_item_id and
- i.live_revision = r.revision_id) task
- ON le.entry_id = task.logger_entry,
+ LEFT JOIN (select r.title, ar.object_id_two
+ from cr_items i, cr_revisions r, acs_rels ar
+ where r.item_id = ar.object_id_one
+ and ar.rel_type = 'application_data_link'
+ and i.live_revision = r.revision_id) task
+ ON le.entry_id = task.object_id_two,
logger_projects lp,
acs_objects ao,
persons submitter
Index: openacs-4/packages/project-manager/www/lib/entries-table.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/lib/entries-table.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/project-manager/www/lib/entries-table.tcl 26 May 2005 09:34:30 -0000 1.2
+++ openacs-4/packages/project-manager/www/lib/entries-table.tcl 3 Jun 2005 22:13:45 -0000 1.3
@@ -58,7 +58,7 @@
# project manager task.
if { [exists_and_not_null pm_task_id] } {
- lappend where_clauses "le.entry_id in (select logger_entry from pm_task_logger_proj_map where task_item_id = :pm_task_id)"
+ lappend where_clauses "le.entry_id in (select object_id_two from acs_rels where object_id_one = :pm_task_id and rel_type = 'application_data_link')"
}
Index: openacs-4/packages/project-manager/www/lib/nav-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/lib/nav-bar.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/www/lib/nav-bar.tcl 26 May 2005 09:34:30 -0000 1.3
+++ openacs-4/packages/project-manager/www/lib/nav-bar.tcl 3 Jun 2005 22:13:45 -0000 1.4
@@ -44,7 +44,7 @@
if [empty_string_p $project_item_id] {
lappend link_list [list "[export_vars -base ${logger_url} {user_id {project_manager_url $package_url}}]"]
} else {
- set logger_project_id [pm::project::get_logger_project -project_item_id $project_item_id]
+ set logger_project_id [lindex [application_data_link::get_linked -from_object_id $project_item_id -to_object_type logger_project] 0]
lappend link_list [list "[export_vars -base ${logger_url} {{project_manager_url $package_url} {project_id $logger_project_id}}]"]
}
lappend link_list {}