Index: openacs-4/packages/tasks/lib/tasks-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks-portlet.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/tasks/lib/tasks-portlet.adp	4 Mar 2006 22:57:24 -0000	1.6
+++ openacs-4/packages/tasks/lib/tasks-portlet.adp	12 Apr 2006 08:26:27 -0000	1.7
@@ -14,7 +14,8 @@
 		show_filters_p="1"
                 hide_elements=""
                 start_date=@start_date@
-                end_date=@end_date@ />	
+                end_date=@end_date@
+                assignee_query=@assignee_query@ />	
         </td>
       </tr>
     </table>
Index: openacs-4/packages/tasks/lib/tasks-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks-portlet.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/tasks/lib/tasks-portlet.tcl	4 Mar 2006 22:57:24 -0000	1.6
+++ openacs-4/packages/tasks/lib/tasks-portlet.tcl	12 Apr 2006 08:26:27 -0000	1.7
@@ -2,3 +2,4 @@
 
 if { ![info exists start_date] } { set start_date {} }
 if { ![info exists end_date] } { set end_date {} }
+if { ![info exists assignee_query] } { set assignee_query {} }
Index: openacs-4/packages/tasks/lib/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v
diff -u -r1.26 -r1.27
--- openacs-4/packages/tasks/lib/tasks.tcl	13 Mar 2006 07:38:41 -0000	1.26
+++ openacs-4/packages/tasks/lib/tasks.tcl	12 Apr 2006 08:26:27 -0000	1.27
@@ -128,31 +128,7 @@
 
 append limitations_clause "\n and t.object_id in ( $object_query )"
 
-# you may specify a list of assignees as well if you like, they are similar to the object
-# queries and ids this is not required. You may only specify one of the following, assignee_query, assignee_ids, assignee_id
 
-if { [info exists assignee_query] || [info exists assignee_ids] || [info exists assignee_id] } {
-    if {
-	( [info exists assignee_query] && ![info exists assignee_ids] && ![info exists assignee_id] ) ||
-	( ![info exists assignee_query] && [info exists assignee_ids] && ![info exists assignee_id] ) ||
-	( ![info exists assignee_query] && [info exists assignee_ids] && ![info exists assignee_id] ) 
-    } {
-	# we only have one provided object_id list, this is correct set up
-    } else {
-	error "packages/tasks/lib/tasks - invalid include you must specify one (and only one) of the following: assignee_query, assignee_ids, assignee_id"
-    }
-
-    if { [info exists assignee_ids] } {
-	set assignee_query [template::util::tcl_to_sql_list $object_ids]
-    } elseif { [info exists object_id] } {
-	set assignee_query '$object_id'
-    }
-
-    if { [exists_and_not_null assignee_query] } {
-	append limitations_clause "\n and t.assignee_id in ( $assignee_query )"
-    }
-}
-
 append limitations_clause "\n and ao.package_id = [ad_conn package_id]"
 
 if { $start_date ne "" } {
@@ -294,12 +270,56 @@
 
 
 
+# you may specify a list of assignees as well if you like, they are similar to the object
+# queries and ids this is not required. You may only specify one of the following, assignee_query, assignee_ids, assignee_id
+if { [info exists assignee_query] || [info exists assignee_ids] || [info exists assignee_id] } {
+    if {
+	( [info exists assignee_query] && ![info exists assignee_ids] && ![info exists assignee_id] ) ||
+	( ![info exists assignee_query] && [info exists assignee_ids] && ![info exists assignee_id] ) ||
+	( ![info exists assignee_query] && [info exists assignee_ids] && ![info exists assignee_id] ) 
+    } {
+	# we only have one provided object_id list, this is correct set up
+    } else {
+	error "packages/tasks/lib/tasks - invalid include you must specify one (and only one) of the following: assignee_query, assignee_ids, assignee_id"
+    }
 
+    if { [info exists assignee_query] || [info exists assignee_ids] } {
+	# the users should be able to select from a list of assignees
+	if { ![info exists assignee_query] } {
+	    set assignee_query [template::util::tcl_to_sql_list $assignee_ids]
+	}
+	set package_id [ad_conn package_id]
+	set selected_assignee_id [ns_queryget selected_assignee_id]
+	set assignees [db_list_of_lists get_them " select contact__name( party_id ),
+                                                          party_id
+                                                     from parties
+                                                    where party_id in ( $assignee_query )
+                                                      and party_id in (
+            select t_tasks.assignee_id
+              from t_tasks
+             where t_tasks.object_id in ( $object_query ))"]
+	set filters_list [list selected_assignee_id [list label [_ tasks.Assignee] values [concat [list [list "- - - -" ""]] $assignees]]]
+    }
+    if { [exists_and_not_null selected_assignee_id] } {
+	set assignee_query '${selected_assignee_id}'
+    } else {
+	if { [info exists assignee_ids] } {
+	    set assignee_query [template::util::tcl_to_sql_list $assignee_ids]
+	} elseif { [info exists assignee_id] } {
+	    set assignee_query '$assignee_id'
+	}
+    }
 
+    if { [exists_and_not_null assignee_query] } {
+	append limitations_clause "\n and t.assignee_id in ( $assignee_query )"
+    }
+}
 
 
 
 
+
+
 set row_list [list]
 foreach element [list checkbox deleted_p priority title process_title object_name date assignee] {
     if { $single_object_p && $element == "object_name" } {	
@@ -314,7 +334,7 @@
 # by default we only show pending tasks
 lappend filters_list status_id [list label [_ tasks.Status] values $status_options where_clause { t.status_id = :status_id } default_value "1"]
 
-
+#lappend filters_list 
 if { [lsearch $hide_elements checkbox] >= 0 } {
     set bulk_actions [list]
 } else {
Index: openacs-4/packages/tasks/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/index.adp,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/tasks/www/index.adp	4 Mar 2006 23:56:09 -0000	1.13
+++ openacs-4/packages/tasks/www/index.adp	12 Apr 2006 08:26:27 -0000	1.14
@@ -9,7 +9,8 @@
 	<include src="/packages/tasks/lib/tasks-portlet"
                  object_query=@object_query;noquote@ 
                  start_date=@start_date@
-                 end_date=@end_date@ />
+                 end_date=@end_date@
+                 assignee_query=@assignee_query@ />xo
 
     </td>
 </tr>
Index: openacs-4/packages/tasks/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/index.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/tasks/www/index.tcl	4 Mar 2006 23:56:09 -0000	1.11
+++ openacs-4/packages/tasks/www/index.tcl	12 Apr 2006 08:26:27 -0000	1.12
@@ -13,6 +13,7 @@
     {query ""}
     {tasks_future:integer "7"}
     {tasks_previous:integer ""}
+    {selected_assignee_id ""}
 }
 
 
@@ -24,7 +25,7 @@
 set url [ad_conn url]
 
 set return_url [export_vars -base $url -url {orderby format search_id query page page_size tasks_future tasks_previous {page_flush_p t}}]
-
+set assignee_query " select user_id from users "
 set package_id [site_node::get_element -url "/contacts" -element object_id]
 if { [exists_and_not_null search_id] } {
     contact::search::log -search_id $search_id
@@ -54,7 +55,7 @@
     }
 }
 
-ad_form -name "search" -method "GET" -export {status_id tasks_orderby page format} -form $form_elements \
+ad_form -name "search" -method "GET" -export {selected_assignee_id status_id tasks_orderby page format} -form $form_elements \
     -on_request {
     } -edit_request {
     } -on_refresh {