Index: openacs-4/packages/project-manager/project-manager.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/project-manager.info,v diff -u -r1.13 -r1.14 --- openacs-4/packages/project-manager/project-manager.info 10 Aug 2005 22:22:25 -0000 1.13 +++ openacs-4/packages/project-manager/project-manager.info 12 Aug 2005 21:14:03 -0000 1.14 @@ -7,48 +7,50 @@ f f - + Jade Rubick Project management tool for OpenACS - 2005-01-13 + 2005-08-12 Integrated Bakery Resources Track tasks, estimates and actual progress for a project. See the <a href="http://openacs.org/projects/dotwrk/project_management/">project page</a> for more information. + 0 - + + - - - - - + + + + + + + + + - - - - - + Index: openacs-4/packages/project-manager/catalog/project-manager.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/catalog/project-manager.en_US.ISO-8859-1.xml,v diff -u -r1.18 -r1.19 --- openacs-4/packages/project-manager/catalog/project-manager.en_US.ISO-8859-1.xml 11 Aug 2005 07:29:39 -0000 1.18 +++ openacs-4/packages/project-manager/catalog/project-manager.en_US.ISO-8859-1.xml 12 Aug 2005 21:14:33 -0000 1.19 @@ -390,6 +390,9 @@ you need to start working on these soon to avoid affecting deadlines Max: Min: + Choose one project to move the task to. + Move Task + Move task to project: n/a Name Name: @@ -412,8 +415,10 @@ One line description One process One %project_term% + One Task Ongoing Open + Or search for another project: Order Overdue Tasks Overview of process: @@ -477,12 +482,14 @@ Remove myself Removed Removed: %old% + Results: Role Role ID Roles Search: Search: Search + Enter a keyword to search for projects. Section Select Assigne in this project to send a message Select process: Index: openacs-4/packages/project-manager/tcl/task-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/task-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/project-manager/tcl/task-procs.tcl 30 Jul 2005 00:26:33 -0000 1.12 +++ openacs-4/packages/project-manager/tcl/task-procs.tcl 12 Aug 2005 21:15:03 -0000 1.13 @@ -2686,3 +2686,90 @@ return $return_val } + +ad_proc -public pm::task::move { + -task_item_id:required + -project_item_id:required +} { + Moves one task from one project to another project. + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation-date 2005-08-12 + + @param task_item_id The task_item_id of the task to move + @param project_item_id The project_item_id of the project to move the task into. +} { + # Get the package_id of the project where the task will be created + set project_package_id [db_string get_project_package_id { }] + set user_id [ad_conn user_id] + permission::require_permission -party_id $user_id -object_id $project_item_id -privilege create + + pm::task::get -tasks_item_id $task_item_id \ + -one_line_array one_line \ + -description_array description \ + -description_mime_type_array mime_type_array \ + -estimated_hours_work_array estimated_hours_work \ + -estimated_hours_work_min_array estimated_hours_work_min \ + -estimated_hours_work_max_array estimated_hours_work_max \ + -dependency_array dependency_array \ + -percent_complete_array percent_complete \ + -end_date_day_array end_date_day \ + -end_date_month_array end_date_month \ + -end_date_year_array end_date_year \ + -project_item_id_array project_item_id_array \ + -priority_array priority + + set end_date "$end_date_year($task_item_id)-$end_date_month($task_item_id)-$end_date_day($task_item_id)" + + set new_task_id [pm::task::new \ + -project_id $project_item_id \ + -title "$one_line($task_item_id)" \ + -description "$description($task_item_id)" \ + -mime_type $mime_type_array($task_item_id) \ + -end_date $end_date \ + -percent_complete "$percent_complete($task_item_id)" \ + -estimated_hours_work "$estimated_hours_work($task_item_id)" \ + -estimated_hours_work_min "$estimated_hours_work_min($task_item_id)" \ + -estimated_hours_work_max "$estimated_hours_work_max($task_item_id)" \ + -creation_date [dt_sysdate] \ + -creation_user $user_id \ + -creation_ip [ad_conn peeraddr] \ + -package_id $project_package_id \ + -priority $priority($task_item_id)] + + db_dml update_extra_info { } + + set task_revision_id [pm::task::get_revision_id -task_item_id $task_item_id] + set new_task_revision_id [pm::task::get_revision_id -task_item_id $new_task_id] + + db_1row get_original_times { } + + db_dml update_task_times { } + + # Add all assignees + set assignee_list [pm::task::assignee_role_list -task_item_id $task_item_id] + foreach assignee $assignee_list { + pm::task::assign \ + -task_item_id $new_task_id \ + -party_id [lindex $assignee 0] \ + -role_id [lindex $assignee 1] + } + + # Add in dependencies + set dependency $dependency_array($task_item_id) + if {[exists_and_not_null dependency]} { + pm::task::dependency_add \ + -task_item_id $new_task_id \ + -parent_id $dependency \ + -dependency_type finish_before_start \ + -project_item_id $project_item_id + } + + callback pm::task_new -package_id $project_package_id -task_id $new_task_id + + # Delete the task + pm::task::delete -task_item_id $task_item_id + + return $new_task_id +} \ No newline at end of file Index: openacs-4/packages/project-manager/tcl/task-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/tcl/task-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/project-manager/tcl/task-procs.xql 26 May 2005 09:34:29 -0000 1.3 +++ openacs-4/packages/project-manager/tcl/task-procs.xql 12 Aug 2005 21:15:03 -0000 1.4 @@ -39,4 +39,57 @@ + + + select + package_id + from + acs_objects + where + object_id =:project_item_id + + + + + + update + pm_tasks + set + task_number = 1, + status = 1 + where + task_id = :new_task_id + + + + + + select + earliest_start, + earliest_finish, + latest_start, + latest_finish + from + pm_tasks_revisions + where + task_revision_id = :task_revision_id + + + + + + + update + pm_tasks_revisions + set + earliest_start = :earliest_start, + earliest_finish = :earliest_finish, + latest_start = :latest_start, + latest_finish = :latest_finish + where + task_revision_id = :new_task_revision_id + + + + Index: openacs-4/packages/project-manager/www/move-task.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/move-task.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/project-manager/www/move-task.adp 12 Aug 2005 21:16:21 -0000 1.1 @@ -0,0 +1,16 @@ + +@page_title;noquote@ +@context;noquote@ + +#project-manager.Move_task_to# + + + + #project-manager.Results# + + + + #project-manager.or_search_for# + + + Index: openacs-4/packages/project-manager/www/move-task.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/move-task.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/project-manager/www/move-task.tcl 12 Aug 2005 21:16:21 -0000 1.1 @@ -0,0 +1,107 @@ +ad_page_contract { + Move one task to another project + + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @cration-date 2005-08-10 +} { + task_id:integer,notnull + search_key:optional + {search_p "0"} + {return_url ""} +} + +set page_title "[_ project-manager.Move_task]" +set context [list [list "task-one?task_id=$task_id" [_ project-manager.one_task]] $page_title] + +set package_id [ad_conn package_id] +set project_item_id [pm::task::project_item_id -task_item_id $task_id] +set user_id [ad_conn user_id] + +if { [empty_string_p $return_url] } { + set return_url one?project_item_id=$project_item_id +} + +# We are going to get all projects of the same instance that we are located +set options [list] +db_foreach get_projects { } { + set project [pm::project::get_project_item_id -project_id $object_id] + lappend options [list "$object_title" $project] +} + +ad_form -name move_task -form { + {task_id:text(hidden) + {value $task_id} + } + {return_url:text(hidden) + {value $return_url} + } + {new_project_id:text(select) + {label "[_ project-manager.Projects]:"} + {options { $options }} + {help_text "[_ project-manager.move_help]"} + } +} -on_submit { + + # Creating a new task on the selected project_id + set new_task_item_id [pm::task::move -task_item_id $task_id -project_item_id $new_project_id] + +} -after_submit { + ad_returnredirect -message "Task Item $task_id Move to Project $new_project_id" $return_url +} + + +# To get projects of other instances in the system using to forms, one for search +# and the other one for select +if { $search_p } { + set search_options [list] + db_foreach get_search_projects { } { + set project [pm::project::get_project_item_id -project_id $object_id] + lappend search_options [list "$object_title" $project] + } + + ad_form -name move_task_search -form { + {task_id:text(hidden) + {value $task_id} + } + {return_url:text(hidden) + {value $return_url} + } + {search_p:text(hidden) + {value 1} + } + {search_key:text(hidden) + {value $search_key} + } + {new_project_id:text(select) + {label "[_ project-manager.Projects]:"} + {options { $search_options }} + {help_text "[_ project-manager.move_help]"} + } + } -on_submit { + + # Creating a new task on the selected project_id + set new_task_item_id [pm::task::move -task_item_id $task_id -project_item_id $new_project_id] + + } -after_submit { + ad_returnredirect -message "Task Item $task_id Move to Project $new_project_id" $return_url + } +} else { + + # Form to search for projects + ad_form -name search_projects -form { + {task_id:text(hidden) + {value $task_id} + } + {return_url:text(hidden) + {value $return_url} + } + {search_p:text(hidden) + {value 1} + } + {search_key:text(text),optional + {label "[_ project-manager.Project_Search]"} + {help_text "[_ project-manager.search_help]"} + } + } +} \ No newline at end of file Index: openacs-4/packages/project-manager/www/move-task.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/move-task.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/project-manager/www/move-task.xql 12 Aug 2005 21:16:21 -0000 1.1 @@ -0,0 +1,42 @@ + + + + + + select + distinct + i.item_id, + p.object_id, + p.object_title + from + pm_projectsx p, + cr_items i, + acs_objects o + where + p.object_id = i.live_revision + and i.item_id <> :project_item_id + and p.object_id = o.object_id + and o.package_id = :package_id + + + + + + select + distinct + i.item_id, + p.object_id, + p.object_title + from + pm_projectsx p, + cr_items i, + acs_objects o + where + p.object_id = i.live_revision + and p.object_id = o.object_id + and o.package_id <> :package_id + and p.title like '%'||:search_key||'%' + + + + \ No newline at end of file