Index: openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql 11 Nov 2004 06:39:55 -0000 1.4.2.2 +++ openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql 14 Jan 2005 01:46:02 -0000 1.4.2.3 @@ -164,6 +164,74 @@ allows user to break this assumption you'll also need to deal with this. --> + + +select q.*, + km.keyword_id, + assign_info.* +from ( + select b.bug_id, + b.bug_number, + b.summary, + lower(b.summary) as lower_summary, + b.comment_content, + b.comment_format, + b.component_id, + b.creation_date, + to_char(b.creation_date, 'fmMM/DDfm/YYYY') as creation_date_pretty, + b.creation_user as submitter_user_id, + submitter.first_names as submitter_first_names, + submitter.last_name as submitter_last_name, + submitter.email as submitter_email, + lower(submitter.first_names) as lower_submitter_first_names, + lower(submitter.last_name) as lower_submitter_last_name, + lower(submitter.email) as lower_submitter_email, + st.pretty_name as pretty_state, + st.short_name as state_short_name, + st.state_id, + st.hide_fields, + b.resolution, + b.found_in_version, + b.fix_for_version, + b.fixed_in_version, + cas.case_id + $more_columns + from $from_bug_clause, + acs_users_all submitter, + workflow_cases cas, + workflow_case_fsm cfsm, + workflow_fsm_states st + where submitter.user_id = b.creation_user + and cas.workflow_id = :workflow_id + and cas.object_id = b.bug_id + and cfsm.case_id = cas.case_id + and cfsm.parent_enabled_action_id is null + and st.state_id = cfsm.current_state + $orderby_category_where_clause + [template::list::filter_where_clauses -and -name "bugs"] +) q, + cr_item_keyword_map km, + (select cru.user_id as assigned_user_id, + aa.action_id, + aa.case_id, + wa.pretty_name as action_pretty_name, + p.first_names as assignee_first_names, + p.last_name as assignee_last_name + from workflow_case_assigned_actions aa, + workflow_case_role_user_map cru, + workflow_actions wa, + persons p + where aa.case_id = cru.case_id + and aa.role_id = cru.role_id + and cru.user_id = p.person_id + and wa.action_id = aa.action_id + ) assign_info +where q.bug_id = km.item_id (+) + and q.case_id = assign_info.case_id (+) +[template::list::orderby_clause -orderby -name "bugs"] + + + select q.*, @@ -208,8 +276,8 @@ and cfsm.parent_enabled_action_id is null and st.state_id = cfsm.current_state $orderby_category_where_clause + [template::list::page_where_clause -and -name bugs -key bug_id] [template::list::filter_where_clauses -and -name "bugs"] - [template::list::orderby_clause -orderby -name "bugs"] ) q, cr_item_keyword_map km, (select cru.user_id as assigned_user_id, @@ -229,6 +297,7 @@ ) assign_info where q.bug_id = km.item_id (+) and q.case_id = assign_info.case_id (+) +[template::list::orderby_clause -orderby -name "bugs"] Index: openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql,v diff -u -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql 10 Nov 2004 18:43:52 -0000 1.5.2.2 +++ openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql 14 Jan 2005 01:46:02 -0000 1.5.2.3 @@ -151,6 +151,76 @@ allows user to break this assumption you'll also need to deal with this. --> + + +select q.*, + km.keyword_id, + assign_info.* +from ( + select b.bug_id, + b.bug_number, + b.summary, + lower(b.summary) as lower_summary, + b.comment_content, + b.comment_format, + b.component_id, + b.creation_date, + to_char(b.creation_date, 'fmMM/DDfm/YYYY') as creation_date_pretty, + b.creation_user as submitter_user_id, + submitter.first_names as submitter_first_names, + submitter.last_name as submitter_last_name, + submitter.email as submitter_email, + lower(submitter.first_names) as lower_submitter_first_names, + lower(submitter.last_name) as lower_submitter_last_name, + lower(submitter.email) as lower_submitter_email, + st.pretty_name as pretty_state, + st.short_name as state_short_name, + st.state_id, + st.hide_fields, + b.resolution, + b.found_in_version, + b.fix_for_version, + b.fixed_in_version, + cas.case_id + $more_columns + from $from_bug_clause, + acs_users_all submitter, + workflow_cases cas, + workflow_case_fsm cfsm, + workflow_fsm_states st + where submitter.user_id = b.creation_user + and cas.workflow_id = :workflow_id + and cas.object_id = b.bug_id + and cfsm.case_id = cas.case_id + and cfsm.parent_enabled_action_id is null + and st.state_id = cfsm.current_state + $orderby_category_where_clause + [template::list::filter_where_clauses -and -name "bugs"] +) q +left outer join + cr_item_keyword_map km +on (bug_id = km.item_id) +left outer join + (select cru.user_id as assigned_user_id, + aa.action_id, + aa.case_id, + wa.pretty_name as action_pretty_name, + p.first_names as assignee_first_names, + p.last_name as assignee_last_name + from workflow_case_assigned_actions aa, + workflow_case_role_user_map cru, + workflow_actions wa, + persons p + where aa.case_id = cru.case_id + and aa.role_id = cru.role_id + and cru.user_id = p.person_id + and wa.action_id = aa.action_id + ) assign_info +on (q.case_id = assign_info.case_id) + [template::list::orderby_clause -orderby -name "bugs"] + + + select q.*, @@ -195,6 +265,7 @@ and cfsm.parent_enabled_action_id is null and st.state_id = cfsm.current_state $orderby_category_where_clause + [template::list::page_where_clause -and -name bugs -key bug_id] [template::list::filter_where_clauses -and -name "bugs"] ) q left outer join Index: openacs-4/packages/bug-tracker/tcl/bug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs.tcl,v diff -u -r1.14.2.2 -r1.14.2.3 --- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 14 Jan 2005 00:45:08 -0000 1.14.2.2 +++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 14 Jan 2005 01:46:02 -0000 1.14.2.3 @@ -840,7 +840,7 @@ -page_size 25 \ -page_groupsize 1 \ -page_flush_p 1 \ - -page_query {[bug_tracker::bug::get_query]} \ + -page_query {[bug_tracker::bug::get_query -query_name bugs_pagination]} \ -formats { table { label "Table" @@ -868,10 +868,13 @@ -selected_format $format } +ad_proc bug_tracker::bug::get_query { + {-query_name bugs} +} { + @param name Either "bugs" or "bugs_pagination" + @return The query +} { - -ad_proc bug_tracker::bug::get_query {} { - upvar #[template::adp_level] orderby orderby # Needed to handle ordering by categories @@ -896,7 +899,7 @@ set more_columns "" } - return [db_map bugs] + return [db_map $query_name] }