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 -r1.3.2.1
--- openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql	3 Oct 2003 16:54:36 -0000	1.3
+++ openacs-4/packages/bug-tracker/tcl/bug-procs-oracle.xql	16 Mar 2004 14:40:24 -0000	1.3.2.1
@@ -153,48 +153,77 @@
       </querytext>
   </partialquery>
 
+<!-- bd: the inline view assign_info returns names
+     of assignees as well as pretty_names of assigned actions.
+     I'm left-outer-joining against this view.
+
+     WARNING: In the query below I assume there can be at most one
+     person assigned to a bug.  If more people are assigned you will get
+     multiple rows per bug in the result set.  Current bug tracker
+     doesn't have UI for creating such conditions. If you add UI that
+     allows user to break this assumption you'll also need to deal with
+     this.
+-->
 <fullquery name="bug_tracker::bug::get_query.bugs">
   <querytext>
-    
-    select q.*,
-           km.keyword_id
-    from (
-        select b.bug_id,
-               b.bug_number,
-               b.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,
-               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
-        from   $from_bug_clause,
-               cc_users 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    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,
-    cr_item_keyword_map km
-  where km.item_id (+) = q.bug_id
+select q.*,
+       km.keyword_id,
+       assign_info.*
+from (
+  select b.bug_id,
+         b.bug_number,
+         b.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,
+         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
+    from $from_bug_clause,
+         acs_users_all submitter,
+         acs_users_all assignee,
+         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 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,
+  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,
+          assignee.first_names as assignee_first_names,
+          assignee.last_name as assignee_last_name
+     from workflow_case_assigned_actions aa,
+          workflow_case_role_user_map cru,
+          workflow_actions wa,
+          acs_users_all assignee
+    where aa.case_id = cru.case_id
+      and aa.role_id = cru.role_id
+      and cru.user_id = assignee.user_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 (+)
 
   </querytext>
 </fullquery>
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 -r1.4.2.1
--- openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql	3 Oct 2003 16:54:37 -0000	1.4
+++ openacs-4/packages/bug-tracker/tcl/bug-procs-postgresql.xql	16 Mar 2004 14:40:24 -0000	1.4.2.1
@@ -140,47 +140,79 @@
       </querytext>
   </partialquery>
 
+<!-- bd: the inline view assign_info returns names
+     of assignees as well as pretty_names of assigned actions.
+     I'm left-outer-joining against this view.
+
+     WARNING: In the query below I assume there can be at most one
+     person assigned to a bug.  If more people are assigned you will get
+     multiple rows per bug in the result set.  Current bug tracker
+     doesn't have UI for creating such conditions. If you add UI that
+     allows user to break this assumption you'll also need to deal with
+     this.
+-->
 <fullquery name="bug_tracker::bug::get_query.bugs">
   <querytext>
-    
-    select q.*,
-           km.keyword_id
-    from (
-        select b.bug_id,
-               b.bug_number,
-               b.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,
-               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
-        from   $from_bug_clause,
-               cc_users 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    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 on (km.item_id = q.bug_id)
+select q.*,
+       km.keyword_id,
+       assign_info.*
+from (
+  select b.bug_id,
+         b.bug_number,
+         b.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,
+         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
+    from $from_bug_clause,
+         acs_users_all submitter,
+         acs_users_all assignee,
+         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 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
+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,
+          assignee.first_names as assignee_first_names,
+          assignee.last_name as assignee_last_name
+     from workflow_case_assigned_actions aa,
+          workflow_case_role_user_map cru,
+          workflow_actions wa,
+          acs_users_all assignee
+    where aa.case_id = cru.case_id
+      and aa.role_id = cru.role_id
+      and cru.user_id = assignee.user_id
+      and wa.action_id = aa.action_id
+  ) assign_info
+on (q.case_id = assign_info.case_id)
 
   </querytext>
 </fullquery>
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 -r1.10.2.1
--- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl	7 Nov 2003 15:02:59 -0000	1.10
+++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl	16 Mar 2004 14:40:24 -0000	1.10.2.1
@@ -713,6 +713,13 @@
             display_template {<a href="@bugs.submitter_url@">@bugs.submitter_first_names@ @bugs.submitter_last_name@</a>}
             hide_p 1
         }
+        assigned_to {
+            label "Assigned To"
+            display_template {<a href="@bugs.assignee_url@">@bugs.assignee_first_names@
+                               @bugs.assignee_last_name@</a>
+                               <if @bugs.action_pretty_name@ not nil> to </if>
+                               @bugs.action_pretty_name@}
+        }
         fix_for_version {
             label "Fix for"
             display_col fix_for_version_name
@@ -884,6 +891,7 @@
     set extend_list { 
         comment_short
         submitter_url 
+        assignee_url 
         status_pretty
         resolution_pretty
         component_name
@@ -917,6 +925,7 @@
             set fixed_in_version_name [bug_tracker::version_get_name -version_id $fixed_in_version]
             set comment_short [string_truncate -len $truncate_len -format $comment_format -- $comment_content]
             set submitter_url [acs_community_member_url -user_id $submitter_user_id]
+            set assignee_url [acs_community_member_url -user_id $assigned_user_id]
             set resolution_pretty [bug_tracker::resolution_pretty $resolution]
             
             # Hide fields in this state