Index: openacs-4/packages/tasks/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/tasks/lib/tasks.tcl 7 Nov 2005 17:44:03 -0000 1.19 +++ openacs-4/packages/tasks/lib/tasks.tcl 17 Nov 2005 16:04:38 -0000 1.20 @@ -126,8 +126,9 @@ set not_done_url [export_vars -url -base "${tasks_url}contact" {orderby {status_id 1} {party_id $contact_id}}] set return_url "[ad_conn url]?[ad_conn query]" set add_url [export_vars -base "${tasks_url}task" {return_url orderby status_id {party_id $contact_id}}] -set bulk_actions [list "[_ tasks.Reassign]" "${tasks_url}reassign-task" "[_ tasks.Reassign_selected]"\ +# set bulk_actions [list "[_ tasks.Reassign]" "${tasks_url}reassign-task" "[_ tasks.Reassign_selected]"\ "[_ tasks.Change_Assignee]" "${tasks_url}change-assignee" "[_ tasks.Change_Assignee]"] +set bulk_actions [list "[_ tasks.Change_Assignee]" "${tasks_url}change-assignee" "[_ tasks.Change_Assignee]"] template::list::create \ -name tasks \ Index: openacs-4/packages/tasks/tcl/tasks-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/tcl/tasks-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/tasks/tcl/tasks-procs.tcl 7 Nov 2005 17:44:04 -0000 1.7 +++ openacs-4/packages/tasks/tcl/tasks-procs.tcl 17 Nov 2005 16:04:39 -0000 1.8 @@ -14,107 +14,6 @@ namespace eval tasks::process::task {} namespace eval tasks::process::instance {} - -ad_proc -public tasks::new { - -party_id:required - {-object_id ""} - {-process_id ""} - -title:required - {-description ""} - {-mime_type "text/plain"} - {-comment ""} - -due_date:required - {-priority 0} - {-status "o"} - {-user_id ""} - {-ip_addr ""} - {-package_id ""} -} { - insert new task -} { - if {[empty_string_p $package_id]} { - set package_id [ad_conn package_id] - } - if {[empty_string_p $user_id]} { - set user_id [ad_conn user_id] - } - if {[empty_string_p $ip_addr]} { - set ip_addr [ad_conn peeraddr] - } - - set task_id [db_exec_plsql create_task {}] - - return $task_id -} - -ad_proc -public tasks::edit { - -task_id:required - -title:required - {-description ""} - {-mime_type "text/plain"} - {-comment ""} - -due_date:required - {-priority 0} - {-status "o"} - {-user_id ""} - {-ip_addr ""} -} { - update task -} { - if {[empty_string_p $user_id]} { - set user_id [ad_conn user_id] - } - if {[empty_string_p $ip_addr]} { - set ip_addr [ad_conn peeraddr] - } - - db_dml update_task {} - db_dml update_object {} -} - - -ad_proc -public tasks::project_id { - {-package_id ""} -} { - Returns this tasks instance project_id -} { - if { [string is false [exists_and_not_null package_id]] } { - set package_id [ad_conn package_id] - } - set project_id [db_string get_project_id { - select pm_projectsx.item_id - from pm_projectsx, - cr_folders cf - where pm_projectsx.parent_id = cf.folder_id - and cf.package_id = :package_id - } -default {}] - if { [string is false [exists_and_not_null project_id]] } { - tasks::initialize -package_id $package_id - set project_id [tasks::project_id -package_id $package_id] - } - return $project_id -} - -ad_proc -public tasks::initialize { - {-package_id ""} -} { - Returns this tasks instance project_id -} { - if { [string is false [exists_and_not_null package_id]] } { - set package_id [ad_conn package_id] - } - if { [string is false [db_0or1row project_exists_p { select 1 from cr_folders where package_id = :package_id and label = 'Projects' }]] } { - pm::project::new -project_name "[_ tasks.Tasks_Instance]" \ - -status_id "1" \ - -organization_id "" \ - -creation_user [ad_conn user_id] \ - -creation_ip [ad_conn peeraddr] \ - -ongoing_p "t" \ - -package_id $package_id - } -} - - ad_proc -public tasks::task::new { {-task_id ""} {-process_instance_id ""} @@ -298,3 +197,105 @@ return $task_id } + + + +ad_proc -public tasks::new { + -party_id:required + {-object_id ""} + {-process_id ""} + -title:required + {-description ""} + {-mime_type "text/plain"} + {-comment ""} + -due_date:required + {-priority 0} + {-status "o"} + {-user_id ""} + {-ip_addr ""} + {-package_id ""} +} { + insert new task +} { + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + if {[empty_string_p $ip_addr]} { + set ip_addr [ad_conn peeraddr] + } + + set task_id [db_exec_plsql create_task {}] + + return $task_id +} + +ad_proc -public tasks::edit { + -task_id:required + -title:required + {-description ""} + {-mime_type "text/plain"} + {-comment ""} + -due_date:required + {-priority 0} + {-status "o"} + {-user_id ""} + {-ip_addr ""} +} { + update task +} { + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + if {[empty_string_p $ip_addr]} { + set ip_addr [ad_conn peeraddr] + } + + db_dml update_task {} + db_dml update_object {} +} + + +ad_proc -public tasks::project_id { + {-package_id ""} +} { + Returns this tasks instance project_id +} { + if { [string is false [exists_and_not_null package_id]] } { + set package_id [ad_conn package_id] + } + set project_id [db_string get_project_id { + select pm_projectsx.item_id + from pm_projectsx, + cr_folders cf + where pm_projectsx.parent_id = cf.folder_id + and cf.package_id = :package_id + } -default {}] + if { [string is false [exists_and_not_null project_id]] } { + tasks::initialize -package_id $package_id + set project_id [tasks::project_id -package_id $package_id] + } + return $project_id +} + +ad_proc -public tasks::initialize { + {-package_id ""} +} { + Returns this tasks instance project_id +} { + if { [string is false [exists_and_not_null package_id]] } { + set package_id [ad_conn package_id] + } + if { [string is false [db_0or1row project_exists_p { select 1 from cr_folders where package_id = :package_id and label = 'Projects' }]] } { + pm::project::new -project_name "[_ tasks.Tasks_Instance]" \ + -status_id "1" \ + -organization_id "" \ + -creation_user [ad_conn user_id] \ + -creation_ip [ad_conn peeraddr] \ + -ongoing_p "t" \ + -package_id $package_id + } +} + Index: openacs-4/packages/tasks/www/contact.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/contact.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/tasks/www/contact.tcl 24 Oct 2005 21:39:24 -0000 1.9 +++ openacs-4/packages/tasks/www/contact.tcl 17 Nov 2005 16:04:39 -0000 1.10 @@ -38,7 +38,7 @@ set package_id [ad_conn package_id] set admin_p [permission::permission_p -object_id $package_id -privilege admin] set context [list] -set elements "checkbox deleted_p priority title process_title date creation_user" +set elements "checkbox deleted_p priority title process_title date assignee" if { [string equal $emp_f "2"]} { lappend elements contact_name Index: openacs-4/packages/tasks/www/task-interval.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/Attic/task-interval.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/tasks/www/task-interval.tcl 26 Sep 2005 08:20:06 -0000 1.3 +++ openacs-4/packages/tasks/www/task-interval.tcl 17 Nov 2005 16:04:39 -0000 1.4 @@ -41,7 +41,7 @@ db_1row get_task_info " select t.title as task, t.description, t.mime_type, t.priority, to_char((t.due_date $operand '$days days'::interval),'YYYY-MM-DD') as due_date, - t.status_id as status, t.comment + t.status_id as status, t.comment, t.assignee_id from t_tasks t where t.task_id = :task_id " @@ -54,6 +54,7 @@ -comment ${comment} \ -due_date ${due_date} \ -status_id ${status} \ + -assignee_id ${assignee_id} \ -priority ${priority}] set task_url [export_vars -base "/tasks/task" -url {task_id party_id status_id orderby}]