Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -5,69 +5,10 @@ party_id:integer {return_url "task?[export_url_vars task_id]"} } +wf_case_add_task_assignment \ + -task_id $task_id \ + -party_id $party_id \ + -permanent -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 -} - -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 { - set num_rows [db_string already_assigned_task " - select count(*) from wf_task_assignments - where task_id = :task_id and party_id = :party_id"] - - if { $num_rows == 0 } { - db_exec_plsql add_assignee_task { - begin - workflow_case.add_task_assignment ( - task_id => :task_id, - party_id => :party_id - ); - end; - } - } - - set num_rows [db_string already_assigned_case " - select count(*) from wf_case_assignments - where workflow_key = :workflow_key - and case_id = :case_id - and transition_key = :transition_key - and party_id = :party_id"] - - if { $num_rows == 0 } { - db_exec_plsql add_assignee_case { - begin - workflow_case.add_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - } - } -} - ad_returnredirect $return_url