Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -3,53 +3,15 @@ } { task_id:integer party_id:integer - {return_url "task-assignees?[export_url_vars task_id]"} + {return_url "task-assignees?[export_vars -url {task_id}]"} } # should add some check that you aren't deleting an assignment # if the person has actually started the task. -set user_id [ad_conn user_id] +wf_case_remove_task_assignment \ + -task_id $task_id \ + -party_id $party_id \ + -permanent -if ![db_0or1row task_info { - select t.case_id, - t.transition_key, - c.object_id, - wcti.access_privilege - from wf_tasks t, wf_cases c, wf_context_transition_info wcti - where wcti.context_key = c.context_key - and wcti.workflow_key = t.workflow_key - and wcti.transition_key = t.transition_key - and c.case_id = t.case_id - and t.task_id = :task_id -}] { - ad_return_complaint 1 "Called for a nonexistent task." - ad_script_abort -} - -set this_user_is_assigned_p [db_string this_user_is_assigned_p { - select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id -}] - -if { ! $this_user_is_assigned_p && ![empty_string_p $access_privilege]} { - ad_require_permission $object_id $access_privilege -} - -db_transaction { - db_exec_plsql remove_assignee_task { - begin - workflow_case.remove_task_assignment ( - task_id => :task_id, - party_id => :party_id - ); - - workflow_case.remove_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - } -} - ad_returnredirect $return_url