Index: openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml 13 Mar 2006 07:44:52 -0000 1.14
+++ openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml 23 Nov 2006 11:51:33 -0000 1.15
@@ -49,6 +49,7 @@
Standard tasks are cannot be used in conjunction with custom tasks
The task <a href="/tasks/%task_url%">%task%</a> was added
The task <a href="/tasks/%task_url%">%title%</a> was updated
+ (The task lindex task)
The task "%task%" was added to %names%
The task "%task_title%" was deleted
The tasks %task_list% were deleted
Index: openacs-4/packages/tasks/lib/task-form.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/task-form.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/tasks/lib/task-form.adp 1 Mar 2006 12:29:27 -0000 1.1
+++ openacs-4/packages/tasks/lib/task-form.adp 23 Nov 2006 11:51:33 -0000 1.2
@@ -1 +1 @@
-
+
Index: openacs-4/packages/tasks/lib/task-form.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/task-form.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/tasks/lib/task-form.tcl 29 Mar 2006 19:29:27 -0000 1.3
+++ openacs-4/packages/tasks/lib/task-form.tcl 23 Nov 2006 11:51:33 -0000 1.4
@@ -14,7 +14,6 @@
}
}
-
# export_vars_list is a tcl list of key value that need
# to be submitted with the form so that the page that
# includes the tasks is displayed correctly when we
@@ -56,6 +55,8 @@
# to find out if this is an edit request or not
# by checking if the task_id object exists
+set show_form 1
+
if { ![info exists task_id] } {
set task_action "add"
} else {
@@ -194,10 +195,9 @@
}
}
-#ad_return_error "ASD" [lsort -unique [concat [list return_url object_id task_action task_action_id task_form_vars] $export_vars_list]]
ad_form \
- -name add_edit \
+ -name add_edit_task \
-cancel_url $return_url \
-cancel_label "[_ tasks.Cancel]" \
-edit_buttons $edit_buttons \
@@ -216,7 +216,7 @@
set title $task
set context [list $title]
set task_prescribed_p 0
- foreach task_prescribed_option [template::element::get_property add_edit task_prescribed options] {
+ foreach task_prescribed_option [template::element::get_property add_edit_task task_prescribed options] {
if { [lindex $task_prescribed_option 0] == $task } {
set task_prescribed_p 1
}
@@ -232,13 +232,21 @@
# {end_date {[calendar::date_valid_p -date $end_date]} {This is not a valid date. Either the date doesn't exist or it is not formatted correctly. Correct formatting is: YYYY-MM-DD or YYYYMMDD}}
{task { [string equal [string trim $task] {}] != [string equal [string trim $task_prescribed] {}] } {[_ tasks.lt_Either_a_custom_task_]}}
} -on_submit {
+
+ if {$task eq ""} {
+ set task $task_prescribed
+ }
# we don't use new_data and edit_data blocks because otherwise the save_add_another
# gets messed up if we are adding a second task
if { ![db_0or1row get_it { select 1 from acs_objects where object_id = :task_id }] } {
foreach object $object_id {
+
+ if {$assignee_id eq $object_id} {
+ set assignee_id [ad_conn user_id]
+ }
set task_id [tasks::task::new \
-title ${task} \
-description ${description} \
@@ -248,6 +256,7 @@
-due_date ${due_date} \
-status_id ${status} \
-package_id ${package_id} \
+ -assignee_id ${assignee_id} \
-priority ${priority}]
}
@@ -271,42 +280,27 @@
-priority ${priority} \
-assignee_id ${assignee_id}]
- set task_url [export_vars -base task -url {task_id return_url}]
+ set task_url [export_vars -base [ad_conn url] -url {task_id return_url}]
set title $task
util_user_message -html -message "[_ tasks.lt_The_task_a_hreftaskst_1]"
}
} -after_submit {
if { [ns_queryget "formbutton:save_add_another"] != "" } {
- template::element::set_value add_edit task_prescribed ""
- template::element::set_value add_edit task ""
- template::element::set_value add_edit comment ""
- template::element::set_value add_edit due_date ""
- template::element::set_value add_edit status "1"
- template::element::set_value add_edit priority "1"
- template::element::set_value add_edit description ""
- template::element::set_value add_edit comment ""
+ template::element::set_value add_edit_task task_prescribed ""
+ template::element::set_value add_edit_task task ""
+ template::element::set_value add_edit_task comment ""
+ template::element::set_value add_edit_task due_date ""
+ template::element::set_value add_edit_task status "1"
+ template::element::set_value add_edit_task priority "1"
+ template::element::set_value add_edit_task description ""
+ template::element::set_value add_edit_task comment ""
+ set show_form 1
} else {
- ad_returnredirect $return_url
- ad_script_abort
+ set show_form 0
}
}
-if { $task_action eq "edit" } {
- set creation_id [db_string get_it { }]
- set creator_url [contact::url -party_id $creation_id]
- set creator_name [contact::name -party_id $creation_id]
- template::element::create add_edit creator \
- -datatype "text" \
- -widget "inform" \
- -label "" \
- -value "[_ tasks.lt_Originally_created_by]" \
- -optional
-} else {
- if { $object_count > 1 } {
- template::element::set_properties add_edit names widget inform
- }
-}
ad_return_template
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.8 -r1.9
--- openacs-4/packages/tasks/lib/tasks-portlet.adp 4 May 2006 06:03:42 -0000 1.8
+++ openacs-4/packages/tasks/lib/tasks-portlet.adp 23 Nov 2006 11:51:33 -0000 1.9
@@ -15,7 +15,8 @@
hide_elements=""
start_date=@start_date@
end_date=@end_date@
- assignee_query=@assignee_query@ />
+ assignee_id=@assignee_id@
+ />
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.8 -r1.9
--- openacs-4/packages/tasks/lib/tasks-portlet.tcl 4 May 2006 06:03:42 -0000 1.8
+++ openacs-4/packages/tasks/lib/tasks-portlet.tcl 23 Nov 2006 11:51:33 -0000 1.9
@@ -4,3 +4,4 @@
if { ![info exists end_date] } { set end_date {} }
if { ![info exists assignee_query] } { set assignee_query {} }
if { ![info exists object_query] } { set object_query {} }
+if { ![info exists assignee_id] } { set assignee_id {} }
Index: openacs-4/packages/tasks/lib/tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/tasks/lib/tasks.adp 4 Mar 2006 22:57:25 -0000 1.6
+++ openacs-4/packages/tasks/lib/tasks.adp 23 Nov 2006 11:51:33 -0000 1.7
@@ -29,11 +29,16 @@
#tasks.Assign_Process#
-
-
-
-
-
+
+
Index: openacs-4/packages/tasks/lib/tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v
diff -u -r1.30 -r1.31
--- openacs-4/packages/tasks/lib/tasks.tcl 19 Oct 2006 17:05:01 -0000 1.30
+++ openacs-4/packages/tasks/lib/tasks.tcl 23 Nov 2006 11:51:33 -0000 1.31
@@ -27,6 +27,8 @@
if { ![exists_and_not_null package_id] } {
set package_id [ad_conn package_id]
}
+if { ![info exists assignee_id] } { set assignee_id {} }
+
set package_url [apm_package_url_from_id $package_id]
set optional_params {start_date end_date page_size hide_elements default_assignee_id}
set required_params {object_query object_ids object_id assignee_query assignee_ids assignee_id}
@@ -311,9 +313,9 @@
if { [exists_and_not_null selected_assignee_id] } {
set assignee_query '${selected_assignee_id}'
} else {
- if { [info exists assignee_ids] } {
+ if { [exists_and_not_null assignee_ids] } {
set assignee_query [template::util::tcl_to_sql_list $assignee_ids]
- } elseif { [info exists assignee_id] } {
+ } elseif { [exists_and_not_null assignee_id] } {
set assignee_query '$assignee_id'
}
}
Index: openacs-4/packages/tasks/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/index.adp,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/tasks/www/index.adp 28 Apr 2006 05:59:17 -0000 1.15
+++ openacs-4/packages/tasks/www/index.adp 23 Nov 2006 11:51:33 -0000 1.16
@@ -10,7 +10,7 @@
object_query=@object_query;noquote@
start_date=@start_date@
end_date=@end_date@
- assignee_query=@assignee_query@ />
+ assignee_id=@user_id@ />
Index: openacs-4/packages/tasks/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/index.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/tasks/www/index.tcl 5 May 2006 18:37:20 -0000 1.13
+++ openacs-4/packages/tasks/www/index.tcl 23 Nov 2006 11:51:33 -0000 1.14
@@ -25,19 +25,39 @@
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
}
set search_options [concat [list [list [_ contacts.All_Contacts] ""]] [db_list_of_lists dbqd.contacts.www.index.public_searches {}]]
set searchcount 1
-db_foreach dbqd.contacts.www.index.my_recent_searches {} {
- lappend search_options [list "${searchcount}) ${recent_title}" ${recent_search_id}]
+db_foreach dbqd.contacts.www.index.my_searches {} {
+ lappend search_options [list "${my_searches_title}" ${my_searches_search_id} [_ contacts.My_Searches]]
incr searchcount
}
+db_foreach dbqd.contacts.www.index.my_lists {} {
+ lappend search_options [list "${my_lists_title}" ${my_lists_list_id} [_ contacts.Lists]]
+ incr searchcount
+}
+if { [exists_and_not_null search_id] } {
+ set search_in_list_p 0
+ foreach search_option $search_options {
+ if { [lindex $search_option 1] eq $search_id } {
+ set search_in_list_p 1
+ }
+ }
+ if { [string is false $search_in_list_p] } {
+ set search_options [concat [list [list "<< [_ contacts.Search] \#${search_id} >>" $search_id]] $search_options]
+ }
+}
+
+
+lang::util::localize_list_of_lists -list $search_options
+
+
set form_elements {
{search_id:integer(select),optional {label ""} {options $search_options} {html {onChange "javascript:acs_FormRefresh('search')"}}}
{query:text(text),optional {label ""} {html {size 20 maxlength 255}}}