Index: openacs-4/packages/project-manager/tcl/calendar-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/calendar-procs-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/project-manager/tcl/calendar-procs-postgresql.xql 30 Jul 2005 00:26:33 -0000 1.7 +++ openacs-4/packages/project-manager/tcl/calendar-procs-postgresql.xql 19 Feb 2007 15:56:54 -0000 1.8 @@ -59,8 +59,8 @@ ts.task_id = t.item_id and i.item_id = t.item_id and t.task_revision_id = i.live_revision and - t.latest_start >= :first_of_month_date and - t.latest_start <= :last_of_month_date and + t.end_date >= :first_of_month_date and + t.end_date <= :last_of_month_date and t.parent_id = projecti.item_id and o.object_id=t.item_id and projecti.live_revision = projectr.revision_id @@ -75,65 +75,42 @@ - SELECT - ts.task_id, - ts.task_id as item_id, - ts.task_number, - t.task_revision_id, - t.title, - t.parent_id as project_item_id, - o.package_id as instance_id, - to_char(t.earliest_start,'J') as earliest_start_j, - to_char(current_timestamp,'J') as today_j, - to_char(t.end_date,'J') as latest_start_j, - to_char(t.latest_finish,'J') as latest_finish_j, - to_char(t.end_date,'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.end_date,'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 || ' (' || - substring(r.one_line from 1 for 1) || ')' as full_name, - p.person_id, - s.status_type as status, - r.is_lead_p, - projectr.title as project_name - FROM - pm_tasks_active ts, - pm_task_status s, - cr_items i, - acs_objects o, - 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 projecti, - cr_revisions projectr - WHERE - ts.status = s.status_id and - ts.task_id = t.item_id and - i.item_id = t.item_id and - t.task_revision_id = i.live_revision and - t.end_date >= :first_of_month_date and - t.end_date <= :last_of_month_date and - t.parent_id = projecti.item_id and - o.object_id= t.item_id and - projecti.live_revision = projectr.revision_id - $selected_users_clause - $instance_clause + SELECT t.item_id as task_id, + t.parent_id as project_item_id, + t.title, + to_char(t.end_date,'YYYY-MM-DD HH24:MI:SS') as day_date, + to_char(t.end_date,'J') as day_date_j, + s.status_type as status, + s.description as status_description, + t.priority, + t.parent_id, + r.is_lead_p, + op.title as project_name, + op.package_id as instance_id, + ta.party_id as person_id + FROM + (select tr.* + from cr_items ci, pm_tasks_revisionsx tr + -- get only live revisions + where ci.live_revision = tr.task_revision_id) t, + pm_tasks_active ti, + pm_task_status s, + pm_task_assignment ta, + pm_roles r, + cr_items cp, + acs_objects op + where t.parent_id = cp.item_id and + t.item_id = ti.task_id and + ti.status = s.status_id + and cp.live_revision = op.object_id + and t.item_id = ta.task_id and ta.role_id = r.role_id and ta.party_id in ([join $selected_users ","]) + and s.status_type = 'o' $hide_closed_clause + $instance_clause + and t.end_date >= :first_of_month_date + and t.end_date <= :last_of_month_date ORDER BY - t.end_date, ts.task_id, r.role_id, p.first_names, p.last_name + t.end_date