Index: openacs-4/contrib/packages/project-manager/www/task-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-delete.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/contrib/packages/project-manager/www/task-delete.tcl 2 Jul 2004 23:13:49 -0000 1.1.2.1 +++ openacs-4/contrib/packages/project-manager/www/task-delete.tcl 16 Jul 2004 20:59:41 -0000 1.1.2.2 @@ -4,6 +4,7 @@ Deletes a task + @author Chris Davis (mcd@daviesinc.com) @author Jade Rubick (jader@bread.com) @creation-date 2004-03-31 @arch-tag: af0efc2f-cf78-4f80-a484-1f52f3db6a48 @@ -15,5 +16,71 @@ } -errors { } +set package_id [ad_conn package_id] + +permission::require_permission -privilege "delete" -object_id $package_id + set title "Delete task" set context [list "Delete task"] + + +set action [template::form get_action delete_task] + +if {[string equal $action delete]} { + + pm::task::delete -task_item_id $task_item_id + ad_returnredirect -message "Task $task_item_id Deleted" "index" + +} else { + + set use_uncertain_completion_times_p [parameter::get -parameter "UseUncertainCompletionTimesP" -default "1"] + + if {[string is true $use_uncertain_completion_times_p]} { + set hours_work { + {estimated_hours_work_min:text + {label "Estimated Hours (Min)"} + } + {estimated_hours_work_max:text + {label "Estimated Hours (Max)"} + } + } + } else { + set hours_work { + {estimated_hours_work:text + {label "Estimated Hours"} + } + } + } + + + set form " + task_item_id:key + {task_title:text + {label \"Title\"} + } + {description:richtext + {label \"Description\"} + } + $hours_work + {percent_complete:text + {label \"Percent Complete\"} + } + " + + ad_form -name delete_task \ + -edit_request { + + db_1row task_query { } + + set description [list $description $mime_type] + + } \ + -mode display \ + -has_submit 1 \ + -has_edit 1 \ + -actions {{"Delete this task?" delete} {"Cancel" cancel}} \ + -cancel_url "task-one?task_id=$task_item_id" \ + -form $form + +} +