Index: openacs-4/contrib/packages/project-manager/www/project-assign-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/project-assign-edit.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/packages/project-manager/www/project-assign-edit.adp 11 Jun 2004 20:58:19 -0000 1.1 +++ openacs-4/contrib/packages/project-manager/www/project-assign-edit.adp 28 Jun 2004 21:12:22 -0000 1.2 @@ -1,5 +1,7 @@ @title@ @context@ + +
  • set according to task assignments
  • @html;noquote@ Index: openacs-4/contrib/packages/project-manager/www/project-assign-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/project-assign-edit.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/packages/project-manager/www/project-assign-edit.tcl 11 Jun 2004 20:58:19 -0000 1.1 +++ openacs-4/contrib/packages/project-manager/www/project-assign-edit.tcl 28 Jun 2004 21:12:22 -0000 1.2 @@ -31,6 +31,8 @@ set title "Edit project assignees" set context [list "Edit assignees"] +set project_task_assignee_url [export_vars -base project-assign-task-assignees {project_item_id return_url}] + set roles_list_of_lists [pm::role::select_list_filter] db_foreach assignee_query { Index: openacs-4/contrib/packages/project-manager/www/project-assign-task-assignees.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/project-assign-task-assignees.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/project-manager/www/project-assign-task-assignees.tcl 28 Jun 2004 21:12:22 -0000 1.1 @@ -0,0 +1,71 @@ +# + +ad_page_contract { + + Assigns people to a project based on the assignments for tasks in + the project + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-06-28 + @arch-tag: 0ef1b86a-6653-4734-81b9-280c6f71f408 + @cvs-id $Id: project-assign-task-assignees.tcl,v 1.1 2004/06/28 21:12:22 jader Exp $ +} { + project_item_id:integer,notnull + return_url +} -properties { +} -validate { +} -errors { +} + +# remove all assignments + +pm::project::assign_remove_everyone \ + -project_item_id $project_item_id + +# get all task assignments for this project + +set assignments_lol [db_list_of_lists get_people { + SELECT + a.party_id, + a.role_id + FROM + pm_task_assignment a, + cr_items i + WHERE + i.parent_id = :project_item_id and + i.item_id = a.task_id +}] + +set parties [list] + +foreach pair $assignments_lol { + + foreach {party role} $pair { + + + # set the lowest role someone is assigned as + if {[string is false [info exists lowest_role($party)]]} { + set lowest_role($party) $role + } + + if {$lowest_role($party) < $role} { + set lowest_role($party) $role + } + + # make a list of parties assigned + if {[lsearch $parties $party] < 0} { + lappend parties $party + } + } +} + +# make project assignments + +foreach party $parties { + pm::project::assign \ + -project_item_id $project_item_id \ + -role_id $lowest_role($party) \ + -party_id $party +} + +ad_returnredirect -message "Set project assignments based on task assignments" [export_vars -base project-assign-edit {project_item_id return_url}] Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.adp,v diff -u -N -r1.18 -r1.19 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 22 Jun 2004 00:25:55 -0000 1.18 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.adp 28 Jun 2004 21:12:22 -0000 1.19 @@ -8,40 +8,54 @@ + + + + + + + + + + - -
    + Send email to assignees? + + +
    + Error +
    +
    +
    + +  #@num.rownum@   + + + #@num.task_id@ + + + + Skip this task? + + + + +
    + Error +
    +
    +
    - -  #@num.rownum@   - - - #@num.task_id@ - - - - Skip this task? - - - -
    - Error -
    -
    - -

    - - Subject:*
    Index: openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-add-edit.tcl,v diff -u -N -r1.39 -r1.40 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 25 Jun 2004 00:04:43 -0000 1.39 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 28 Jun 2004 21:12:22 -0000 1.40 @@ -9,6 +9,11 @@ I'm waiting to do that until after my company updates our projects with the customer in each field. +

    + + I'd also like to move the assignments to this page, in the same manner + as the processes. + @author jader@bread.com @creation-date 2003-07-28 @cvs-id $Id$ @@ -47,7 +52,7 @@ @param dependency_task_id @param skip_task_p Whether or not to skip this particular task. Used by processes, if t, then the task is not created @param using_process_p Lets the UI know if there is a process being used (t if so) - + @param send_email_p Send out emails to assignees of new task(s) } { my_key:integer,optional @@ -77,7 +82,7 @@ skip_task_p:array,optional {using_process_p "f"} {return_url ""} - + {send_mail_p "t"} } -properties { context:onevalue @@ -424,6 +429,11 @@ {value $task_id_pass} } + {send_email_p:text(select) + {options {{"Yes" t} {"No" f}}} + {value t} + } + {edit_p:text(hidden) {value $edit_p} } @@ -1141,7 +1151,7 @@ } -after_submit { - ad_returnredirect -message "Task(s) saved. Now choose assignees" "task-assign-add-edit?[export_vars -url {comment_list edit_p return_url process_task_id:multiple revisions:multiple task_id:multiple old_description}]" + ad_returnredirect -message "Task(s) saved. Now choose assignees" "task-assign-add-edit?[export_vars -url {comment_list edit_p return_url process_task_id:multiple revisions:multiple task_id:multiple old_description send_email_p}]" # compile a list of which projects the tasks are assigned to # there is a bug here, because we don't update a project when a Index: openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/task-assign-add-edit.tcl,v diff -u -N -r1.18 -r1.19 --- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 22 Jun 2004 00:25:55 -0000 1.18 +++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 28 Jun 2004 21:12:22 -0000 1.19 @@ -26,6 +26,7 @@ {edit_p "t"} {comment_list ""} {old_description:html ""} + {send_email_p "t"} } -properties { @@ -155,6 +156,10 @@ {value $return_url} } + {send_email_p:text(hidden) + {value $send_email_p} + } + {revisions:text(hidden) {value $revisions_pass}} @@ -281,25 +286,29 @@ set my_comment $comment_value($t_id) set my_old_description $old_description_value($t_id) - pm::task::email_alert \ - -task_item_id $t_id \ - -user_id $user_id \ - -assignee_id $p_id \ - -assignee_role_name $role_oneline($r_id) \ - -edit_p $edit_p \ - -comment $my_comment \ - -description $descriptions($t_id) \ - -old_description $my_old_description \ - -subject $one_lines($t_id) \ - -work_min $est_hours_work_min($t_id) \ - -work_max $est_hours_work_max($t_id) \ - -work $est_hours_work($t_id) \ - -project_name $project_names($t_id) \ - -earliest_start $earliest_starts($item_id) \ - -earliest_finish $earliest_finishes($item_id) \ - -latest_start $latest_starts($item_id) \ - -latest_finish $latest_finishes($item_id) \ - -url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$t_id" + if {[string is true $send_email_p]} { + pm::task::email_alert \ + -task_item_id $t_id \ + -user_id $user_id \ + -assignee_id $p_id \ + -assignee_role_name $role_oneline($r_id) \ + -edit_p $edit_p \ + -comment $my_comment \ + -description $descriptions($t_id) \ + -old_description $my_old_description \ + -subject $one_lines($t_id) \ + -work_min $est_hours_work_min($t_id) \ + -work_max $est_hours_work_max($t_id) \ + -work $est_hours_work($t_id) \ + -project_name $project_names($t_id) \ + -earliest_start $earliest_starts($item_id) \ + -earliest_finish $earliest_finishes($item_id) \ + -latest_start $latest_starts($item_id) \ + -latest_finish $latest_finishes($item_id) \ + -url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$t_id" + } else { + ns_log Debug "User $user_id elected to not send out email while editing task_item_id $t_id" + } # we only want to do this for new people # notification::request::new \ @@ -481,4 +490,3 @@ incr index } -