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 -r1.11 -r1.12 --- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 30 Apr 2004 01:42:58 -0000 1.11 +++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 5 May 2004 19:04:55 -0000 1.12 @@ -268,18 +268,6 @@ # ideally, we want to replace this with notifications, but I never # got it working correctly, so I use acs_mail_lite - db_1row get_from_address_and_more { - SELECT - p.email as from_address, - p2.first_names || ' ' || p2.last_name as mod_username - FROM - parties p, - persons p2 - WHERE - p.party_id = :user_id and - p.party_id = p2.person_id - } - foreach pl $party_list { regexp {(.*),(.*)} $pl match task_id_v num_value @@ -288,84 +276,31 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) - set to_address [db_string get_email "select email from parties where party_id = :p_id"] - - if {[string equal $edit_p "t"]} { - set subject "Edited $task_term \#$t_id: $one_lines($t_id)" - set intro_text "$mod_username edited this $task_term_lower" - } else { - set subject "New $task_term \#$t_id: $one_lines($t_id)" - set intro_text "$mod_username assigned you to a new $task_term_lower" - } - # If there is a comment for this task, then display it # prominently in the email set my_comment $comment_value($t_id) set my_old_description $old_description_value($t_id) - if {[empty_string_p $my_comment]} { - set comment_text "" - } else { - set comment_text "--------\nCOMMENT:\n--------\n$my_comment\n\n" - } + 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_name \ + -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 $return_url - set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$t_id" - - if {![string equal $descriptions($t_id) $my_old_description] && [string equal $edit_p t]} { - set description_out "$descriptions($t_id) \n\n-------\nCHANGES:\n-------\n\n[ad_html_to_text [pm::util::word_diff -old [ad_html_to_text $my_old_description] -new [ad_html_to_text $descriptions($t_id)] -split_by " " -start_new "" -end_new ""]]" - - append intro_text "\nSee below to see the changes in the description" - append description_out "\n\n\nkey: _deleted_ *new* text\n" - } else { - set description_out [ad_html_to_text $descriptions($t_id)] - } - - if {[string equal $use_uncertain_completion_times_p 1]} { - set estimated_work " -Hrs work (min): $est_hours_work_min($t_id) -Hrs work (max): $est_hours_work_max($t_id)" - } else { - set estimated_work " -Hrs work: $est_hours_work($t_id)" - -} - - - set notification_text "$intro_text\n\n$comment_text------------- -Task overview -------------- -Task ID: \#$t_id -Subject: $one_lines($t_id) -Project: $project_name -Your role: $role_oneline($r_id) -Link: $task_url - - - ---------------- -Estimated work: ----------------$estimated_work - ------- -Dates: ------- -Earliest start: $earliest_starts($item_id) -Earliest finish: $earliest_finishes($item_id) -Latest start: $latest_starts($item_id) -Latest finish $latest_finishes($item_id) - ------------ -Description ------------ -$description_out" - - - acs_mail_lite::send \ - -to_addr $to_address \ - -from_addr $from_address \ - -subject $subject \ - -body $notification_text - # we only want to do this for new people # notification::request::new \ # -type_id "[notification::type::get_type_id -short_name pm_task_notif]" \