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.3 -r1.4 --- openacs-4/packages/tasks/lib/tasks-postgresql.xql 29 Sep 2005 13:17:53 -0000 1.3 +++ openacs-4/packages/tasks/lib/tasks-postgresql.xql 29 Sep 2005 13:40:22 -0000 1.4 @@ -4,8 +4,7 @@ - select - t.task_id, + select t.task_id, t.title, t.description, t.mime_type, @@ -39,55 +38,5 @@ - - - SELECT - ts.task_id as task_item_id, - ts.task_number, - t.task_revision_id, - t.title, - t.description, - t.parent_id as project_item_id, - proj_rev.logger_project, - proj_rev.title as project_name, - to_char(t.earliest_start,'J') as earliest_start_j, - to_char(current_timestamp,'J') as today_j, - to_char(t.latest_start,'J') as latest_start_j, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - t.percent_complete, - t.estimated_hours_work, - t.estimated_hours_work_min, - t.estimated_hours_work_max, - case when t.actual_hours_worked is null then 0 - else t.actual_hours_worked end as actual_hours_worked, - to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, - to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - p.first_names || ' ' || p.last_name as full_name, - r.one_line as role - FROM - pm_tasks_active ts, - cr_items i, - pm_tasks_revisionsx t - LEFT JOIN pm_task_assignment ta - ON t.item_id = ta.task_id - LEFT JOIN persons p - ON ta.party_id = p.person_id - LEFT JOIN pm_roles r - ON ta.role_id = r.role_id, - cr_items proj, - pm_projectsx proj_rev - WHERE - ts.task_id = t.item_id and - i.item_id = t.item_id and - t.task_revision_id = i.live_revision and - t.parent_id = proj.item_id and - proj.live_revision = proj_rev.revision_id - [template::list::filter_where_clauses -and -name tasks] - [template::list::orderby_clause -orderby -name tasks] - - Index: openacs-4/packages/tasks/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/tasks/lib/tasks.tcl 29 Sep 2005 13:17:53 -0000 1.3 +++ openacs-4/packages/tasks/lib/tasks.tcl 29 Sep 2005 13:40:22 -0000 1.4 @@ -2,9 +2,16 @@ # If we are not viewing the tasks of a party, view the tasks of the user if {![exists_and_not_null party_id]} { + + # the user_id is used for the filter. user_id2 for comparison set user_id [ad_conn user_id] set contact_id $user_id set user_id2 $user_id + + # We don't know if the party has been provided, so we first set it to empty + # so we can unset it later :). + set party_id "" + unset party_id } else { set contact_id $party_id set user_id2 "" Index: openacs-4/packages/tasks-portlet/www/tasks-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks-portlet/www/tasks-portlet.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/tasks-portlet/www/tasks-portlet.adp 28 Sep 2005 19:25:46 -0000 1.1 +++ openacs-4/packages/tasks-portlet/www/tasks-portlet.adp 29 Sep 2005 13:40:23 -0000 1.2 @@ -1,3 +1,3 @@ - + \ No newline at end of file Index: openacs-4/packages/tasks-portlet/www/tasks-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks-portlet/www/tasks-portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/tasks-portlet/www/tasks-portlet.tcl 28 Sep 2005 19:25:46 -0000 1.1 +++ openacs-4/packages/tasks-portlet/www/tasks-portlet.tcl 29 Sep 2005 13:40:23 -0000 1.2 @@ -6,4 +6,15 @@ } array set config $cf + +# Integration with contacts +set community_id [dotlrn_community::get_community_id_from_url] +set organization_id [lindex [application_data_link::get_linked -from_object_id $community_id -to_object_type "organization"] 0] + +if {[exists_and_not_null organization_id]} { + set contact_id $organization_id +} else { + set contact_id "" +} + set user_id [ad_conn user_id]