Index: openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-constraint-add-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.tcl 23 Aug 2003 00:24:34 -0000 1.5 +++ openacs-4/contrib/packages/project-manager/www/task-constraint-add-edit.tcl 27 Aug 2003 20:03:50 -0000 1.6 @@ -94,37 +94,56 @@ } -after_submit { - ad_returnredirect "one?item_id=$project_item_id" + ad_returnredirect "one?project_item_id=$project_item_id" ad_script_abort } # get constraint types - set options [list] db_foreach get_const_types { } -column_array consts { lappend options "{\"$consts(description)\" $consts(short_name)}" } -set const_options [list] +# set up list of tasks that this task can be constrained by + +set const_keys [list] + db_foreach get_const_tasks { } -column_array const_tasks { - lappend const_options "{\"$const_tasks(task_title)\" $const_tasks(item_id)}" + + set const_options($const_tasks(task_title)) $const_tasks(item_id) + + lappend const_keys $const_tasks(task_title) } +set const_keys [lsort $const_keys] + + + + + # get the information on tasks from their revision_numbers db_foreach get_task_info { } -column_array tasks { + # set up the tasks that can be viewed. Takes out the current task + set const_options_full "" + foreach key $const_keys { + if {![string equal $key $tasks(task_title)]} { + append const_options_full "{\"$key\" $const_options($key)} " + } + } + append add_edit_definition " {item_id.$tasks(revision_id):text(inform) {label \"$task_term\"} - {value $tasks(item_id)} + {value {$tasks(item_id)}} } {task_title.$tasks(revision_id):text(inform) {label \"Subject\"} - {value $tasks(task_title)} + {value {$tasks(task_title)}} } {const_type.$tasks(revision_id):text(select) @@ -135,18 +154,18 @@ {const_task_id.$tasks(revision_id):text(select) {label \"Constraint\"} - {options {[join $const_options " "]}} + {options {$const_options_full}} {help_text {$task_term the constraint is based on}} } {description.$tasks(revision_id):text(inform) {label \"Description\"} - {value $tasks(description)} + {value {$tasks(description)}} } {end_date.$tasks(revision_id):text(inform) {label \"Deadline\"} - {value $tasks(end_date)} + {value {$tasks(end_date)}} } " }