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.3.2.1 -r1.3.2.2 --- openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql 16 Mar 2004 14:40:24 -0000 1.3.2.1 +++ openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql 29 Apr 2004 08:13:51 -0000 1.3.2.2 @@ -173,6 +173,7 @@ select b.bug_id, b.bug_number, b.summary, + upper(b.summary) as upper_summary, b.comment_content, b.comment_format, b.component_id, @@ -182,6 +183,9 @@ submitter.first_names as submitter_first_names, submitter.last_name as submitter_last_name, submitter.email as submitter_email, + upper(submitter.first_names) as upper_submitter_first_names, + upper(submitter.last_name) as upper_submitter_last_name, + upper(submitter.email) as upper_submitter_email, st.pretty_name as pretty_state, st.short_name as state_short_name, st.state_id, @@ -191,6 +195,7 @@ b.fix_for_version, b.fixed_in_version, cas.case_id + $more_columns from $from_bug_clause, acs_users_all submitter, acs_users_all assignee, 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.4.2.1 -r1.4.2.2 --- openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql 16 Mar 2004 14:40:24 -0000 1.4.2.1 +++ openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql 29 Apr 2004 08:13:52 -0000 1.4.2.2 @@ -160,6 +160,7 @@ select b.bug_id, b.bug_number, b.summary, + upper(b.summary) as upper_summary, b.comment_content, b.comment_format, b.component_id, @@ -169,6 +170,9 @@ submitter.first_names as submitter_first_names, submitter.last_name as submitter_last_name, submitter.email as submitter_email, + upper(submitter.first_names) as upper_submitter_first_names, + upper(submitter.last_name) as upper_submitter_last_name, + upper(submitter.email) as upper_submitter_email, st.pretty_name as pretty_state, st.short_name as state_short_name, st.state_id, @@ -178,6 +182,7 @@ b.fix_for_version, b.fixed_in_version, cas.case_id + $more_columns from $from_bug_clause, acs_users_all submitter, acs_users_all assignee, @@ -191,7 +196,6 @@ and st.state_id = cfsm.current_state $orderby_category_where_clause [template::list::filter_where_clauses -and -name "bugs"] - [template::list::orderby_clause -orderby -name "bugs"] ) q left outer join cr_item_keyword_map km @@ -213,6 +217,7 @@ and wa.action_id = aa.action_id ) assign_info on (q.case_id = assign_info.case_id) + [template::list::orderby_clause -orderby -name "bugs"] 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.10.2.1 -r1.10.2.2 --- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 16 Mar 2004 14:40:24 -0000 1.10.2.1 +++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 29 Apr 2004 08:13:52 -0000 1.10.2.2 @@ -746,18 +746,18 @@ default_value bug_number,desc bug_number { label "[bug_tracker::conn Bug] \#" - orderby b.bug_number + orderby bug_number default_direction desc } summary { label "Summary" - orderby_asc {upper(b.summary) asc, b.summary asc, b.bug_number asc} - orderby_desc {upper(b.summary) desc, b.summary desc, b.bug_number desc} + orderby_asc {upper_summary asc, summary asc, bug_number asc} + orderby_desc {upper_summary desc, summary desc, bug_number desc} } submitter { label "Submitter" - orderby_asc {upper(submitter.first_names) asc, upper(submitter.last_name) asc, b.bug_number asc} - orderby_asc {upper(submitter.first_names) desc, upper(submitter.last_name) desc, b.bug_number desc} + orderby_asc {upper_submitter_first_names asc, upper_submitter_last_name asc, bug_number asc} + orderby_desc {upper_submitter_first_names desc, upper_submitter_last_name desc, bug_number desc} } } @@ -782,8 +782,8 @@ lappend orderbys $name \ [list \ label $parent_heading \ - orderby_desc {kw_order.heading desc, b.bug_number desc} \ - orderby_asc {kw_order.heading asc, b.bug_number asc}] + orderby_desc {heading desc, bug_number desc} \ + orderby_asc {heading asc, bug_number asc}] } if { [bug_tracker::versions_p] } { @@ -874,6 +874,16 @@ if { [info exists orderby] && [regexp {^category_(.*),.*$} $orderby match orderby_parent_id] } { append from_bug_clause [db_map orderby_category_from_bug_clause] set orderby_category_where_clause [db_map orderby_category_where_clause] + + # Branimir: The ORDER BY clause needs to be at the very end of the + # query. That also means that we need to have in the select list every + # column we want to order by. Which colums we can afford to have in + # the select list depends on which tables are we joining against. BTW, + # all these kludges are consequence of the initial (bad, IMHO) decision + # to do the joins against cr_keywords in memory rather then in SQL. + set more_columns ", kw_order.heading as heading" + } else { + set more_columns "" } return [db_map bugs]