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.8 -r1.9
--- openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 4 Sep 2003 22:45:23 -0000 1.8
+++ openacs-4/contrib/packages/project-manager/www/add-edit-postgresql.xql 18 Sep 2003 23:33:54 -0000 1.9
@@ -46,20 +46,22 @@
- select
- item_id as project_item_id,
- parent_id,
- project_id,
- title as project_name,
- project_code,
- goal,
- description,
- to_char(planned_start_date,'YYYY MM DD') as planned_start_date,
- to_char(planned_end_date,'YYYY MM DD') as planned_end_date,
- ongoing_p
- FROM
- pm_projectsx
- where project_id = :project_id
+ SELECT
+ p.item_id as project_item_id,
+ p.parent_id,
+ p.project_id,
+ p.title as project_name,
+ p.project_code,
+ p.goal,
+ p.description,
+ 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
+ FROM
+ pm_projectsx p
+ WHERE
+ p.item_id = :project_item_id and
+ p.project_id = :project_id
Index: openacs-4/contrib/packages/project-manager/www/add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 4 Sep 2003 22:45:23 -0000 1.11
+++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.12
@@ -12,6 +12,7 @@
} {
project_id:integer,optional
+ {project_revision_id ""}
{project_item_id ""}
{project_name ""}
{project_code ""}
@@ -115,6 +116,7 @@
} -edit_data {
set project_id [db_exec_plsql new_project_revision { *SQL* }]
+ project_manager::project::compute_parent_status $project_item_id
} -after_submit {
Index: openacs-4/contrib/packages/project-manager/www/dependency-add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/dependency-add-edit-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/project-manager/www/dependency-add-edit-postgresql.xql 29 Aug 2003 00:35:35 -0000 1.1
+++ openacs-4/contrib/packages/project-manager/www/dependency-add-edit-postgresql.xql 18 Sep 2003 23:33:54 -0000 1.2
@@ -64,9 +64,11 @@
select
- r.item_id, r.title as task_title
+ r.item_id,
+ r.title as task_title
FROM
- pm_tasks_revisionsx r, cr_items i
+ pm_tasks_revisionsx r,
+ cr_items i
WHERE
r.parent_id = :project_item_id and
r.revision_id = i.live_revision
Index: openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/dependency-add-edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl 17 Sep 2003 22:20:59 -0000 1.4
+++ openacs-4/contrib/packages/project-manager/www/dependency-add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.5
@@ -33,6 +33,16 @@
# --------------------------------------------------------------- #
+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
if {[info exists task_revisions_list]} {
@@ -47,7 +57,7 @@
}
if {![exists_and_not_null task_revisions]} {
- project_manager::project::compute_parent_status $project_item_id
+ project_manager::project::compute_parent_status $project_item_id
ad_returnredirect "one?[export_url_vars project_item_id]"
}
@@ -64,6 +74,7 @@
set title "Add $task_term_lower dependencys"
set context_bar [ad_context_bar [list "one?project_item_id=$project_item_id" "One $project_term"] "New $task_term dependency"]
+
permission::require_permission -party_id $user_id -object_id $package_id -privilege create
@@ -112,7 +123,7 @@
lappend options "{\"$dependencys(description)\" $dependencys(short_name)}"
}
-# set up list of tasks that this task can be dependencyrained by
+# set up list of tasks that this task can be depend on
set dependency_keys [list]
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.24 -r1.25
--- openacs-4/contrib/packages/project-manager/www/one.adp 18 Sep 2003 01:09:14 -0000 1.24
+++ openacs-4/contrib/packages/project-manager/www/one.adp 18 Sep 2003 23:33:54 -0000 1.25
@@ -17,7 +17,7 @@
-
+ |
|
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.22 -r1.23
--- openacs-4/contrib/packages/project-manager/www/one.tcl 18 Sep 2003 01:09:14 -0000 1.22
+++ openacs-4/contrib/packages/project-manager/www/one.tcl 18 Sep 2003 23:33:54 -0000 1.23
@@ -160,6 +160,7 @@
-bulk_action_export_vars {
project_item_id
project_id
+ {my_key 1}
} \
-main_class {
narrow
@@ -177,7 +178,7 @@
latest_start {orderby latest_start}
slack_time {orderby slack_time}
latest_finish {orderby latest_finish}
- default_value slack_time,desc
+ default_value slack_time,asc
} \
-orderby_name orderby_tasks \
-html {
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.18 -r1.19
--- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 18 Sep 2003 01:09:14 -0000 1.18
+++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.19
@@ -1,3 +1,12 @@
+ns_log notice it's 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
+}
+
ad_page_contract {
Add/edit form for tasks
@@ -16,17 +25,19 @@
@param number The number of Tasks to create
@param added_tasks
@param task_revision_id Specifies the revision this task represents (each revision of a task has a separate id)
- @param task_id Specifies the item for the task (every revision of a task shares the same task_id)
+ @param task_id Specifies the item for the task (every revision of a task shares the same task_id) Also used as the key for the ad_form. For this reason, when editing, we have to pass in task_iid instead
+ @param my_key if set, then ad_form knows that this is an edit
@param task_title
@param use_dependency_p Whether or not to use dependencies with this task
@param use_uncertain_completion_times_p Whether or not to use PERT-style completion time uncertainty 1 = yes
} {
+ my_key:integer,optional
project_item_id:integer,optional
project_id:integer,optional
{number:integer "1"}
task_revision_id:integer,optional
- task_id:multiple,integer,optional
+ task_id:integer,multiple,optional
task_item_id:array,optional
task_title:array,optional
use_dependency_p:array,optional
@@ -70,16 +81,8 @@
set project_id [db_string get_project_id { }]
}
-ns_log notice it's 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
-}
-if {[info exists task_id] && ![info exists __new_p]} {
+if {![ad_form_new_p -key task_id]} {
# create a multirow we can use to iterate
# we also set the number variable so we can use that in
# this tcl file
@@ -143,6 +146,7 @@
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]"
}
}
@@ -171,7 +175,7 @@
ad_form -name add_edit -form {
- task_id:key
+ my_key:key(acs_object_id_seq)
{project_item_id:text(hidden)
{value $project_item_id}
@@ -192,6 +196,8 @@
} -new_data {
+ ns_log Notice "new data"
+
# --------------------------------------------------------------
# each task we add in returns a task_revision_id
# we set up two lists, one for tasks that will need dependencies
@@ -217,7 +223,7 @@
set this_revision_id [db_exec_plsql new_task_item { *SQL* }]
- if {[info exists use_dependency_p($i)] && [string equal $use_dependency_p($i) "t"]} {
+ if {[info exists use_dependency_p($i)] && [string equal $use_dependency_p($i) "on"]} {
lappend revision_has_dependencies $this_revision_id
} else {
lappend revision_no_dependencies $this_revision_id
@@ -253,13 +259,15 @@
set this_revision_id [db_exec_plsql new_task_revision { }]
# set this_revision_id [db_exec_plsql new_task_item { *SQL* }]
+ ns_log Notice "Added in $this_revision_id"
+
# BUG: we need to make sure we take care of deleting dependencies
# if unchecked, adding dependencies, etc..
if {[info exists use_dependency_p($i)] && [string equal $use_dependency_p($i) "t"]} {
- #lappend revision_has_dependencies $this_revision_id
+ lappend revision_has_dependencies $this_revision_id
} else {
- #lappend revision_no_dependencies $this_revision_id
+ lappend revision_no_dependencies $this_revision_id
}
}
@@ -280,7 +288,7 @@
# we set the values for edited tasks
# ----------------------------------
-if {[info exists task_id]} {
+if {![ad_form_new_p -key task_id]} {
set i 1
@@ -356,7 +364,7 @@
] \
[list actual_hours_worked.$i:text(hidden) \
{label "Hours worked"} \
- {html {size 4}} \
+ {html {size 6}} \
{value {$actual_hours_worked_arr($i)}} \
]
]
@@ -400,7 +408,7 @@
[list \
use_dependency_p.$i:text(checkbox) \
{label "Use dependency"} \
- {options {{"" "t"}}} \
+ {options {{"" "on"}}} \
{html $use_dependency_arr($i)} \
] \
[list \
@@ -421,13 +429,13 @@
[list \
estimated_hours_work_min.$i:integer \
{label "Hours estimate - min"} \
- {html {size 3}} \
+ {html {size 5}} \
{value {$estimated_hours_min_arr($i)}} \
] \
[list \
estimated_hours_work_max.$i:integer \
{label "Hours estimate - max"} \
- {html {size 3}} \
+ {html {size 5}} \
{value {$estimated_hours_max_arr($i)}} \
] \
]
@@ -439,7 +447,7 @@
[list \
estimated_hours_work.$i:integer \
{label "Hours estimate"} \
- {html {size 3}} \
+ {html {size 5}} \
{value {$estimated_hours_arr($i)}} \
] \
]
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.2 -r1.3
--- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 12 Sep 2003 19:01:10 -0000 1.2
+++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.3
@@ -16,6 +16,7 @@
} {
+ my_key:integer,optional
revision_has_dependencies:multiple,optional
revision_no_dependencies:multiple,optional
task_id:multiple,optional
@@ -36,7 +37,7 @@
# --------------------------------------------------------------- #
-ns_log notice it's my page!
+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
@@ -124,7 +125,7 @@
ad_form -name add_edit -form {
- acs_object_id_seq:key
+ my_key:key(acs_object_id_seq)
{revision_has_dependencies:text(hidden)
{value $task_revision_dep_pass}}