Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -15,85 +15,15 @@ } set user_id [ad_conn user_id] -if ![db_0or1row task_info { - select t.case_id, - t.workflow_key, - 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 -} -if ![empty_string_p $access_privilege] { - ad_require_permission $object_id $access_privilege -} +wf_case_add_task_assignment \ + -task_id $task_id \ + -party_id $user_id \ + -permanent -db_transaction { - -# First we've got to ensure that any existing assignees are in -# wf_case_assignments, so they stay assigned - -db_dml move_assignees { - insert into wf_case_assignments - (case_id, transition_key, workflow_key, party_id) - select :case_id, :transition_key, :workflow_key, ta.party_id - from wf_task_assignments ta - where task_id = :task_id - and not exists (select 1 from wf_case_assignments ca - where ca.party_id = ta.party_id - and ca.workflow_key = :workflow_key - and ca.case_id = :case_id - and ca.transition_key = :transition_key) -} - -# A dumb way to do this, but add_manual_assignment doesn't do any -# error checking - -db_dml delete_self_case { - delete from wf_case_assignments - where workflow_key = :workflow_key - and case_id = :case_id - and transition_key = :transition_key - and party_id = :user_id -} - -db_exec_plsql add_self_case { - begin - workflow_case.add_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :user_id - ); - end; -} - -db_dml delete_self_task { - delete from wf_task_assignments - where party_id = :user_id - and task_id = :task_id -} - -db_exec_plsql add_self_task { - begin - workflow_case.add_task_assignment ( - task_id => :task_id, - party_id => :user_id - ); - end; +if [empty_string_p return_url] { + ad_returnredirect task?task_id=$task_id + return } -} on_error { - - ad_return_complaint 1 "
$errmsg
" - ad_script_abort -} - -ad_returnredirect "task?[export_url_vars task_id return_url]" +ad_returnredirect $return_url \ No newline at end of file