Index: openacs-4/packages/tasks/tasks.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/tasks.info,v diff -u -r1.8 -r1.9 --- openacs-4/packages/tasks/tasks.info 21 Oct 2005 20:31:32 -0000 1.8 +++ openacs-4/packages/tasks/tasks.info 26 Oct 2005 18:54:28 -0000 1.9 @@ -7,14 +7,14 @@ f f - + Matthew Geddert Keep track of tasks to do. - 2005-10-21 + 2005-10-26 This package uses project manager tcl and sql as the base for a simple task program without project manager's complexity. 0 - + 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.7 -r1.8 --- openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml 21 Oct 2005 20:30:47 -0000 1.7 +++ openacs-4/packages/tasks/catalog/tasks.en_US.ISO-8859-1.xml 26 Oct 2005 18:54:29 -0000 1.8 @@ -1,5 +1,5 @@ - + a Task Add a task to the selected contacts @@ -9,6 +9,7 @@ Assign Process Cancel Cancel, do not delete + Change Assignee Comment Are you sure you want to mark %pretty_entries% as done? Completed Task @@ -60,6 +61,8 @@ Reassign Reassign Selected Tasks Reassign Tasks + Search Assignee + Search for a name to set as the assignee of the tasks. Select process: Select the user to assign the tasks. Select the user to assign the task. If "blank" then the task will be assigned to yourself. Index: openacs-4/packages/tasks/lib/tasks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/lib/tasks.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/tasks/lib/tasks.tcl 24 Oct 2005 22:35:10 -0000 1.17 +++ openacs-4/packages/tasks/lib/tasks.tcl 26 Oct 2005 18:54:29 -0000 1.18 @@ -126,7 +126,8 @@ 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]"] template::list::create \ -name tasks \ Index: openacs-4/packages/tasks/sql/postgresql/tasks-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/sql/postgresql/tasks-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/tasks/sql/postgresql/tasks-create.sql 16 Oct 2005 11:11:12 -0000 1.5 +++ openacs-4/packages/tasks/sql/postgresql/tasks-create.sql 26 Oct 2005 18:54:29 -0000 1.6 @@ -93,7 +93,8 @@ -- start date relative to current date start numeric, -- due date relative to current date - due numeric + due numeric, + assignee_id integer ); @@ -133,7 +134,8 @@ priority integer, start_date timestamptz, due_date timestamptz, - completed_date timestamptz + completed_date timestamptz, + assignee_id integer ); @@ -313,9 +315,9 @@ ----------------------------- -select define_function_args('tasks_task__new','task_id,process_instance_id,process_task_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start_date,due_date,package_id,creation_user,creation_ip,context_id'); +select define_function_args('tasks_task__new','task_id,process_instance_id,process_task_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start_date,due_date,package_id,creation_user,creation_ip,context_id,assignee_id'); -create or replace function tasks_task__new (integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,timestamptz,timestamptz,integer,integer,varchar,integer) +create or replace function tasks_task__new (integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,timestamptz,timestamptz,integer,integer,varchar,integer,integer) returns integer as ' declare p_task_id alias for $1; @@ -335,6 +337,7 @@ p_creation_user alias for $15; p_creation_ip alias for $16; p_context_id alias for $17; + p_assignee_id alias for $18; v_task_id integer; v_start_date timestamptz; begin @@ -359,20 +362,20 @@ insert into t_tasks (task_id, process_instance_id, process_task_id, party_id, object_id, title, description, mime_type, comment, status_id, priority, - start_date, due_date) + start_date, due_date, assignee_id) values (v_task_id, p_process_instance_id, p_process_task_id, p_party_id, p_object_id, p_title, p_description, p_mime_type, p_comment, - p_status_id, p_priority, v_start_date, p_due_date); + p_status_id, p_priority, v_start_date, p_due_date, p_assignee_id); return v_task_id; end; ' language 'plpgsql'; -select define_function_args('tasks_process_task__new','task_id,process_id,open_action_id,closing_action_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start,due,package_id,creation_user,creation_ip,context_id'); +select define_function_args('tasks_process_task__new','task_id,process_id,open_action_id,closing_action_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start,due,package_id,creation_user,creation_ip,context_id,assignee_id'); -create or replace function tasks_process_task__new (integer,integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,numeric,numeric,integer,integer,varchar,integer) +create or replace function tasks_process_task__new (integer,integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,numeric,numeric,integer,integer,varchar,integer,integer) returns integer as ' declare p_task_id alias for $1; @@ -393,6 +396,7 @@ p_creation_user alias for $16; p_creation_ip alias for $17; p_context_id alias for $18; + p_assignee_id alias for $19; v_task_id integer; begin v_task_id:= acs_object__new( @@ -410,11 +414,11 @@ insert into t_process_tasks (task_id, process_id, open_action_id, closing_action_id, party_id, object_id, title, description, mime_type, comment, status_id, - priority, start, due) + priority, start, due, assignee_id) values (v_task_id, p_process_id, p_open_action_id, p_closing_action_id, p_party_id, p_object_id, p_title, p_description, p_mime_type, - p_comment, p_status_id, p_priority, p_start, p_due); + p_comment, p_status_id, p_priority, p_start, p_due, p_assignee_id); return v_task_id; end; Index: openacs-4/packages/tasks/sql/postgresql/upgrade/upgrade-0.1d5-0.1d6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/sql/postgresql/upgrade/upgrade-0.1d5-0.1d6.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/tasks/sql/postgresql/upgrade/upgrade-0.1d5-0.1d6.sql 26 Oct 2005 18:54:29 -0000 1.1 @@ -0,0 +1,114 @@ +-- We add the extra fields +alter table t_tasks add column assignee_id integer; +alter table t_process_tasks add column assignee_id integer; + +-- We create the functions + +select define_function_args('tasks_task__new','task_id,process_instance_id,process_task_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start_date,due_date,package_id,creation_user,creation_ip,context_id,assignee_id'); + +create or replace function tasks_task__new (integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,timestamptz,timestamptz,integer,integer,varchar,integer,integer) +returns integer as ' +declare + p_task_id alias for $1; + p_process_instance_id alias for $2; + p_process_task_id alias for $3; + p_party_id alias for $4; + p_object_id alias for $5; + p_title alias for $6; + p_description alias for $7; + p_mime_type alias for $8; + p_comment alias for $9; + p_status_id alias for $10; + p_priority alias for $11; + p_start_date alias for $12; + p_due_date alias for $13; + p_package_id alias for $14; + p_creation_user alias for $15; + p_creation_ip alias for $16; + p_context_id alias for $17; + p_assignee_id alias for $18; + v_task_id integer; + v_start_date timestamptz; +begin + v_task_id:= acs_object__new( + p_task_id, + ''tasks_task'', + now(), + p_creation_user, + p_creation_ip, + coalesce(p_context_id, p_package_id), + ''t'', + p_title, + p_package_id + ); + + if p_start_date is null then + v_start_date := now(); + else + v_start_date := p_start_date; + end if; + + insert into t_tasks + (task_id, process_instance_id, process_task_id, party_id, object_id, + title, description, mime_type, comment, status_id, priority, + start_date, due_date, assignee_id) + values + (v_task_id, p_process_instance_id, p_process_task_id, p_party_id, + p_object_id, p_title, p_description, p_mime_type, p_comment, + p_status_id, p_priority, v_start_date, p_due_date, p_assignee_id); + + return v_task_id; +end; +' language 'plpgsql'; + + +select define_function_args('tasks_process_task__new','task_id,process_id,open_action_id,closing_action_id,party_id,object_id,title,description,mime_type,comment,status_id,priority,start,due,package_id,creation_user,creation_ip,context_id,assignee_id'); + +create or replace function tasks_process_task__new (integer,integer,integer,integer,integer,integer,varchar,text,varchar,text,integer,integer,numeric,numeric,integer,integer,varchar,integer,integer) +returns integer as ' +declare + p_task_id alias for $1; + p_process_id alias for $2; + p_open_action_id alias for $3; + p_closing_action_id alias for $4; + p_party_id alias for $5; + p_object_id alias for $6; + p_title alias for $7; + p_description alias for $8; + p_mime_type alias for $9; + p_comment alias for $10; + p_status_id alias for $11; + p_priority alias for $12; + p_start alias for $13; + p_due alias for $14; + p_package_id alias for $15; + p_creation_user alias for $16; + p_creation_ip alias for $17; + p_context_id alias for $18; + p_assignee_id alias for $19; + v_task_id integer; +begin + v_task_id:= acs_object__new( + p_task_id, + ''tasks_process_task'', + now(), + p_creation_user, + p_creation_ip, + coalesce(p_context_id, p_package_id), + ''t'', + p_title, + p_package_id + ); + + insert into t_process_tasks + (task_id, process_id, open_action_id, closing_action_id, party_id, + object_id, title, description, mime_type, comment, status_id, + priority, start, due, assignee_id) + values + (v_task_id, p_process_id, p_open_action_id, p_closing_action_id, + p_party_id, p_object_id, p_title, p_description, p_mime_type, + p_comment, p_status_id, p_priority, p_start, p_due, p_assignee_id); + + return v_task_id; +end; +' language 'plpgsql'; \ No newline at end of file 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.5 -r1.6 --- openacs-4/packages/tasks/tcl/tasks-procs.tcl 17 Oct 2005 15:09:41 -0000 1.5 +++ openacs-4/packages/tasks/tcl/tasks-procs.tcl 26 Oct 2005 18:54:29 -0000 1.6 @@ -131,6 +131,7 @@ {-due_date ""} {-package_id ""} {-context_id ""} + {-assignee_id ""} } { if { [empty_string_p $package_id] } { set package_id [apm_package_id_from_key "tasks"] @@ -141,7 +142,7 @@ set context_id $package_id } - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {task_id process_instance_id process_task_id party_id object_id title description mime_type comment status_id priority start_date due_date package_id context_id} + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {task_id process_instance_id process_task_id party_id object_id title description mime_type comment status_id priority start_date due_date package_id context_id assignee_id} set task_id [package_instantiate_object -extra_vars $extra_vars tasks_task] @@ -157,6 +158,7 @@ {-status_id 1} {-priority 0} {-due_date ""} + {-assignee_id ""} } { set modifying_user [ad_conn user_id] set modifying_ip [ad_conn peeraddr] @@ -194,14 +196,15 @@ {-start 0} {-due 0} {-package_id ""} + {-assignee_id ""} } { if { [empty_string_p $package_id] } { set package_id [ad_conn package_id] } set extra_vars [ns_set create] set context_id $package_id - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {task_id process_id open_action_id closing_action_id party_id object_id title description mime_type comment status_id priority start due package_id context_id} + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {task_id process_id open_action_id closing_action_id party_id object_id title description mime_type comment status_id priority start due package_id context_id assignee_id} set task_id [package_instantiate_object -extra_vars $extra_vars tasks_process_task] @@ -221,6 +224,7 @@ {-priority 0} {-start 0} {-due 0} + {-assignee_id ""} } { set modifying_user [ad_conn user_id] set modifying_ip [ad_conn peeraddr] Index: openacs-4/packages/tasks/tcl/tasks-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/tcl/tasks-procs.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/tasks/tcl/tasks-procs.xql 25 Sep 2005 23:49:23 -0000 1.1 +++ openacs-4/packages/tasks/tcl/tasks-procs.xql 26 Oct 2005 18:54:29 -0000 1.2 @@ -34,7 +34,8 @@ comment = :comment, status_id = :status_id, priority = :priority, - due_date = :due_date + due_date = :due_date, + assignee_id = :assignee_id where task_id = :task_id @@ -66,7 +67,8 @@ status_id = :status_id, priority = :priority, start = :start, - due = :due + due = :due, + assignee_id = :assignee_id where task_id = :task_id Index: openacs-4/packages/tasks/www/change-assignee.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/change-assignee.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/tasks/www/change-assignee.adp 26 Oct 2005 18:54:29 -0000 1.1 @@ -0,0 +1,5 @@ + +@page_title;noquote@ +@context;noquote@ + + \ No newline at end of file Index: openacs-4/packages/tasks/www/change-assignee.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/change-assignee.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/tasks/www/change-assignee.tcl 26 Oct 2005 18:54:29 -0000 1.1 @@ -0,0 +1,70 @@ +ad_page_contract { + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation_date 2005-10-23 +} { + {task_id:multiple,optional ""} + {process_task_id:multiple,optional ""} + {party_id ""} + {return_url ""} +} + +set required_p 0 + +if { ![exists_and_not_null task_id] } { + if { ![exists_and_not_null process_task_id] } { + set required_p 1 + } +} elseif { ![exists_and_not_null process_task_id] } { + if { ![exists_and_not_null task_id] } { + set required_p 1 + } +} + +if { $required_p } { + ad_return_complaint 1 "You need to provided either task_id or process_task_id" + ad_script_abort +} + +set page_title "[_ tasks.Change_Assignee]" +set context [list "$page_title"] + +if { ![exists_and_not_null return_url] } { + set return_url [get_referrer] +} + +if { [exists_and_not_null task_id] } { + set tasks_list [join $task_id ", \#"] +} + +if { [exists_and_not_null process_task_id] } { + set tasks_list [join $process_task_id ", \#"] +} + +ad_form -name change_assignee -form { + {tasks_show:text(inform) + {label "[_ tasks.Tasks]:"} + {value "\#$tasks_list"} + } + {task_id:text(hidden) {value $task_id}} + {process_task_id:text(hidden) {value $process_task_id}} + {party_id:party_search(party_search) + {label "[_ tasks.Search_Assignee]:"} + {help_text "[_ tasks.Search_Assignee_help]"} + } + {return_url:text(hidden) {value $return_url}} +} -on_submit { + if { [exists_and_not_null task_id] } { + foreach task $task_id { + db_dml update_tasks { } + } + } + if { [exists_and_not_null process_task_id] } { + foreach process_task $process_task_id { + db_dml update_process_tasks { } + } + } +} -after_submit { + ad_returnredirect $return_url +} \ No newline at end of file Index: openacs-4/packages/tasks/www/change-assignee.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/change-assignee.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/tasks/www/change-assignee.xql 26 Oct 2005 18:54:29 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + update t_tasks + set assignee_id = :party_id + where task_id = :task + + + + + + update t_process_tasks + set assignee_id = :party_id + where task_id = :process_task + + + + \ No newline at end of file Index: openacs-4/packages/tasks/www/process-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/process-add-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/tasks/www/process-add-edit.tcl 25 Sep 2005 23:49:23 -0000 1.2 +++ openacs-4/packages/tasks/www/process-add-edit.tcl 26 Oct 2005 18:54:29 -0000 1.3 @@ -10,7 +10,7 @@ @return title Page title. } { process_id:integer,optional - assignee_id:integer,optional + {assignee_id:integer,optional ""} } -properties { context_bar:onevalue title:onevalue @@ -85,7 +85,9 @@ -process_id $process_id \ -title $title \ -description $description \ - -mime_type "text/plain" + -mime_type "text/plain" \ + -assignee_id $assignee_id\ + } -after_submit { Index: openacs-4/packages/tasks/www/process-task.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/process-task.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/tasks/www/process-task.tcl 25 Sep 2005 23:49:23 -0000 1.2 +++ openacs-4/packages/tasks/www/process-task.tcl 26 Oct 2005 18:54:29 -0000 1.3 @@ -179,7 +179,8 @@ -status_id $status \ -priority $priority \ -start $start \ - -due $due] + -due $due \ + -assignee_id $assignee_id] util_user_message -html -message "The process task $task was added" } @@ -197,7 +198,8 @@ -status_id $status \ -priority $priority \ -start $start \ - -due $due + -due $due \ + -assignee_id $assignee_id util_user_message -html -message "The process task $task was updated" Index: openacs-4/packages/tasks/www/process.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/process.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/tasks/www/process.adp 26 Sep 2005 08:20:06 -0000 1.2 +++ openacs-4/packages/tasks/www/process.adp 26 Oct 2005 18:54:29 -0000 1.3 @@ -1,4 +1,5 @@ - + + @assignee_id@ @title@ @context@ Index: openacs-4/packages/tasks/www/process.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/process.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/tasks/www/process.tcl 25 Sep 2005 23:49:23 -0000 1.2 +++ openacs-4/packages/tasks/www/process.tcl 26 Oct 2005 18:54:29 -0000 1.3 @@ -95,7 +95,7 @@ } } \ -bulk_actions { - "Delete" "process-task-delete" "Delete tasks" + "Delete" "process-task-delete" "Delete tasks" "#tasks.Change_Assignee#" change-assignee "#tasks.Change_Assignee#" } \ -bulk_action_export_vars { process_id Index: openacs-4/packages/tasks/www/processes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/processes.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/tasks/www/processes.adp 25 Sep 2005 23:49:23 -0000 1.2 +++ openacs-4/packages/tasks/www/processes.adp 26 Oct 2005 18:54:29 -0000 1.3 @@ -1,9 +1,11 @@ - + + @assignee_id@ - + + Index: openacs-4/packages/tasks/www/task.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/tasks/www/Attic/task.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/tasks/www/task.adp 27 Jul 2005 13:45:00 -0000 1.1 +++ openacs-4/packages/tasks/www/task.adp 26 Oct 2005 18:54:29 -0000 1.2 @@ -1,8 +1,10 @@ - + + - + + @party_id@