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.25 -r1.26
--- openacs-4/contrib/packages/project-manager/www/one.tcl 8 Oct 2003 23:29:16 -0000 1.25
+++ openacs-4/contrib/packages/project-manager/www/one.tcl 10 Oct 2003 22:51:04 -0000 1.26
@@ -107,16 +107,16 @@
@tasks.title@
-
+
-
+
-
+
-
+
}
@@ -180,7 +180,6 @@
} \
-orderby_name orderby_tasks \
-html {
- width 100%
}
Index: openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-dependency-add-edit-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit-postgresql.xql 3 Oct 2003 23:13:15 -0000 1.2
+++ openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit-postgresql.xql 10 Oct 2003 22:51:04 -0000 1.3
@@ -5,11 +5,12 @@
select
t.process_task_id as task_id,
t.one_line as task_title,
- t.description
+ t.description,
+ d.parent_task_id
FROM
- pm_process_task t
+ pm_process_task t LEFT JOIN pm_process_task_dependency d ON t.process_task_id = d.process_task_id
WHERE
- t.process_task_id in ([join $process_task_id ", "])
+ t.process_task_id in ([join $use_dependency ", "])
@@ -39,10 +40,17 @@
+
+
+ DELETE FROM pm_process_task_dependency
+ WHERE process_task_id = :tsk_id
+
+
+
INSERT INTO pm_process_task_dependency
- (dependency_id, task_id, parent_task_id, dependency_type)
+ (dependency_id, process_task_id, parent_task_id, dependency_type)
VALUES
(:dependency_id, :tsk_id, :parent_tsk_id, :type_id)
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.2 -r1.3
--- openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 3 Oct 2003 23:13:15 -0000 1.2
+++ openacs-4/contrib/packages/project-manager/www/process-dependency-add-edit.tcl 10 Oct 2003 22:51:04 -0000 1.3
@@ -1,3 +1,14 @@
+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
@@ -15,10 +26,10 @@
} {
- {use_dependency:integer,multiple ""}
+ {use_dependency:multiple ""}
process_id:integer
dependency_id:integer,optional
- process_task_id:integer,multiple,optional
+ process_task_id:multiple,optional
dependency_type:array,optional
dependency_task_id:array,optional
{project_item_id:integer ""}
@@ -28,33 +39,28 @@
context_bar:onevalue
title:onevalue
task_term_lower:onevalue
- project_item_id:onevalue
}
# --------------------------------------------------------------- #
-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
-}
-
# HACK because there isn't a facility for exporting multiple hidden
# form variables in ad_form
set process_task_id_pass $process_task_id
set process_task_id_pass [string map {"-" " "} $process_task_id_pass]
set process_task_id $process_task_id_pass
+set use_dependency_pass $use_dependency
+set use_dependency_pass [string map {"-" " "} $use_dependency_pass]
+set use_dependency $use_dependency_pass
+
if {![exists_and_not_null use_dependency]} {
+ ns_log Notice "Redirecting"
ad_returnredirect "process-one?[export_url_vars process_id]"
}
@@ -73,8 +79,8 @@
permission::require_permission -party_id $user_id -object_id $package_id -privilege create
-set process_task_id_pass $process_task_id
set process_task_id_pass [string map {" " "-"} $process_task_id]
+set use_dependency_pass [string map {" " "-"} $use_dependency]
ad_form -name add_edit -form {
dependency_id:key(pm_process_task_dependency_seq)
@@ -83,6 +89,10 @@
{value $process_task_id_pass}
}
+ {use_dependency:text(hidden)
+ {value $use_dependency_pass}
+ }
+
{process_id:text(hidden)
{value $process_id}
}
@@ -97,24 +107,51 @@
} -new_data {
+ set process_task_id_pass $process_task_id
+ set process_task_id_pass [string map {"-" " "} $process_task_id_pass]
+ 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 { }
+ }
+
foreach tr $use_dependency {
set type_id $dependency_type($tr)
set parent_tsk_id $dependency_task_id($tr)
set dependency_id [db_nextval pm_task_dependency_seq]
set tsk_revision_id $tr
- set tsk_id [db_string get_task_id { }]
+ set tsk_id $tr
db_dml new_dependency { *SQL* }
}
- project_manager::project::compute_parent_status $project_item_id
-
} -edit_data {
+ set process_task_id_pass $process_task_id
+ set process_task_id_pass [string map {"-" " "} $process_task_id_pass]
+ 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 { }
+ }
+
+ foreach tr $use_dependency {
+
+ set type_id $dependency_type($tr)
+ set parent_tsk_id $dependency_task_id($tr)
+ set dependency_id [db_nextval pm_task_dependency_seq]
+ set tsk_revision_id $tr
+ set tsk_id [db_string get_task_id { }]
+
+ db_dml new_dependency { *SQL* }
+ }
+
} -after_submit {
- ad_returnredirect "one?project_item_id=$project_item_id"
+ ad_returnredirect [export_vars -base process-one -url {process_id}]
ad_script_abort
}
@@ -155,6 +192,8 @@
}
}
+ ns_log Notice "parent: $tasks(parent_task_id)"
+
append add_edit_definition "
{task_id.$tasks(task_id):text(hidden)
{value {$tasks(task_id)}}
@@ -179,6 +218,7 @@
{dependency_task_id.$tasks(task_id):text(select)
{label \"Dependency\"}
{options {$dependency_options_full}}
+ {value {$tasks(parent_task_id)}}
{help_text {$task_term the dependency is based on}}
}
"
Index: openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-one-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql 3 Oct 2003 22:21:45 -0000 1.1
+++ openacs-4/contrib/packages/project-manager/www/process-one-postgresql.xql 10 Oct 2003 22:51:04 -0000 1.2
@@ -4,17 +4,18 @@
SELECT
- process_task_id,
- one_line,
- description,
- end_date,
- estimated_hours_work,
- estimated_hours_work_min,
- estimated_hours_work_max
+ t.process_task_id,
+ t.one_line,
+ t.description,
+ t.end_date,
+ t.estimated_hours_work,
+ t.estimated_hours_work_min,
+ t.estimated_hours_work_max,
+ d.dependency_type
FROM
- pm_process_task
+ pm_process_task t LEFT JOIN pm_process_task_dependency d ON t.process_task_id = d.process_task_id
WHERE
- process_id = :process_id
+ t.process_id = :process_id
Index: openacs-4/contrib/packages/project-manager/www/process-one.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/process-one.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/project-manager/www/process-one.adp 3 Oct 2003 22:21:45 -0000 1.1
+++ openacs-4/contrib/packages/project-manager/www/process-one.adp 10 Oct 2003 22:51:04 -0000 1.2
@@ -8,6 +8,7 @@
Process tasks:
+ - Use this process: @use_link@
-