Index: openacs-4/packages/tasks/lib/tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks-postgresql.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/tasks/lib/tasks-postgresql.xql 21 Oct 2005 20:18:37 -0000 1.9 +++ openacs-4/packages/tasks/lib/tasks-postgresql.xql 7 Nov 2005 17:44:03 -0000 1.10 @@ -14,10 +14,10 @@ p.process_id, tasks__relative_date(t.due_date) as due_date, tasks__relative_date(t.completed_date) as completed_date, - ao.creation_user, t.status_id, t.process_instance_id, - contact__name(ao.creation_user) as creation_name, + t.assignee_id, + contact__name(t.assignee_id) as assignee_name, contact__name(t.party_id) as contact_name, CASE WHEN t.due_date < now() THEN 't' ELSE 'f' END as due_date_passed_p, s.title as status, @@ -36,7 +36,7 @@ and ao.package_id = :package_id and t.start_date < now() and t.due_date < ( now() + '$tasks_interval days'::interval ) - and ao.creation_user = :user_id + and t.assignee_id = :user_id and t.party_id in ( select parties.party_id from parties left join cr_items on (parties.party_id = cr_items.item_id) @@ -61,7 +61,7 @@ and ao.package_id = :package_id and t.start_date < now() and t.due_date < ( now() + '$tasks_interval days'::interval ) - and ao.creation_user = :user_id + and t.assignee_id = :user_id and t.party_id in ( select parties.party_id from parties left join cr_items on (parties.party_id = cr_items.item_id) @@ -87,10 +87,10 @@ p.process_id, tasks__relative_date(t.due_date) as due_date, tasks__relative_date(t.completed_date) as completed_date, - ao.creation_user, t.status_id, t.process_instance_id, - contact__name(ao.creation_user) as creation_name, + t.assignee_id, + contact__name(t.assignee_id) as assignee_name, contact__name(t.party_id) as contact_name, CASE WHEN t.due_date < now() THEN 't' ELSE 'f' END as due_date_passed_p, s.title as status, Index: openacs-4/packages/tasks/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/tasks/lib/tasks.tcl 26 Oct 2005 18:54:29 -0000 1.18 +++ openacs-4/packages/tasks/lib/tasks.tcl 7 Nov 2005 17:44:03 -0000 1.19 @@ -2,7 +2,7 @@ # } } - creation_user { - label "[_ tasks.Created_By]" + assignee { + label "[_ tasks.Assignee]" display_template { - class="done">@tasks.creation_name@ + class="done">@tasks.assignee_name@ } } } \ @@ -235,10 +235,10 @@ orderby_asc "lower(contact__name(t.party_id)) asc, t.due_date asc, t.priority, lower(t.title)" default_direction asc } - creation_user { - label "[_ tasks.Created_By]" - orderby_desc "lower(contact__name(ao.creation_user)) desc, t.due_date asc, t.priority, lower(t.title)" - orderby_asc "lower(contact__name(ao.creation_user)) asc, t.due_date asc, t.priority, lower(t.title)" + assignee { + label "[_ tasks.Assiggnee]" + orderby_desc "lower(contact__name(t.assignee_id)) desc, t.due_date asc, t.priority, lower(t.title)" + orderby_asc "lower(contact__name(.assignee_id)) asc, t.due_date asc, t.priority, lower(t.title)" default_direction asc } } -formats { @@ -249,10 +249,10 @@ } } -db_multirow -extend {creation_user_url contact_url complete_url done_p task_plus_url task_minus_url description_html task_url} -unclobber tasks $query_name {} { +db_multirow -extend {assignee_url contact_url complete_url done_p task_plus_url task_minus_url description_html task_url} -unclobber tasks $query_name {} { set contact_url [contact::url -party_id $party_id] - set creation_user_url [contact::url -party_id $creation_user] - regsub -all "/tasks/" $creation_user_url "/contacts/" creation_user_url + set assignee_url [contact::url -party_id $assignee_id] + regsub -all "/tasks/" $assignee_url "/contacts/" assignee_url set complete_url [export_vars -base "${tasks_url}mark-completed" -url {task_id orderby {party_id $contact_id} return_url}] if { $status_id == "2" } { set done_p 1 Index: openacs-4/packages/tasks/tcl/tasks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/tcl/tasks-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/tasks/tcl/tasks-procs.tcl 26 Oct 2005 18:54:29 -0000 1.6 +++ openacs-4/packages/tasks/tcl/tasks-procs.tcl 7 Nov 2005 17:44:04 -0000 1.7 @@ -142,6 +142,10 @@ set context_id $package_id } + if { [empty_string_p $assignee_id] } { + set assignee_id [ad_conn user_id] + } + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {task_id process_instance_id process_task_id party_id object_id title description mime_type comment status_id priority start_date due_date package_id context_id assignee_id} set task_id [package_instantiate_object -extra_vars $extra_vars tasks_task] @@ -201,6 +205,11 @@ if { [empty_string_p $package_id] } { set package_id [ad_conn package_id] } + + if { [empty_string_p $assignee_id] } { + set assignee_id [ad_conn user_id] + } + set extra_vars [ns_set create] set context_id $package_id