Index: openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/task-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 3 Jun 2004 21:32:02 -0000 1.9 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 10 Jun 2004 20:23:11 -0000 1.10 @@ -106,7 +106,10 @@ set dependency_options_full "{\"--None--\" \"\"} " - if {!$edit_p} { + if {[string equal $edit_p t] || [string equal $edit_p 1]} { + # Do nothing + } else { + # now set up dependency options for {set j 1} {$j <= $number} {incr j} { @@ -119,7 +122,7 @@ # for editing tasks, we skip ourselves (because depending on # ourselves just sometimes isn't an option) - if {[string equal $edit_p t]} { + if {[string equal $edit_p t] || [string equal $edit_p 1]} { foreach key $keys { # make sure we're not dependent on ourselves @@ -834,6 +837,7 @@ to_char(r.latest_start, 'YYYY-MM-DD HH24:MI:SS') as latest_start_ansi, to_char(r.latest_finish, 'YYYY-MM-DD HH24:MI:SS') as latest_finish_ansi, r.description as task_description, + r.mime_type, project_revision.title as project_name FROM pm_tasks t, @@ -877,16 +881,7 @@ set latest_start [lc_time_fmt $latest_start_ansi "%x"] set latest_finish [lc_time_fmt $latest_finish_ansi "%x"] - set assignees [db_list get_assignees " - select - email - FROM - pm_task_assignment a, - parties p - WHERE - task_id = :task_item_id and - a.party_id = p.party_id - "] + set assignees [pm::task::assignee_email_list -task_item_id $task_item_id] if {[llength $assignees] > 0} { @@ -909,10 +904,12 @@ set notification_text "Task reopened, was $status_description\n\n" + set task_description [ad_html_text_convert -from $mime_type -to "text/plain" $task_description] + append notification_text " ------------- Task ID: \#$task_item_id -Description: $task_title +Subject: $task_title Project: $project_name Link: $task_url @@ -937,11 +934,11 @@ append notification_text "\n" - acs_mail_lite::send \ + pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ - -body $notification_text + -body $notification_text } return @@ -978,6 +975,7 @@ to_char(r.latest_start, 'YYYY-MM-DD HH24:MI:SS') as latest_start_ansi, to_char(r.latest_finish, 'YYYY-MM-DD HH24:MI:SS') as latest_finish_ansi, r.description as task_description, + r.mime_type, project_revision.title as project_name FROM pm_tasks t, @@ -1022,16 +1020,7 @@ set latest_finish [lc_time_fmt $latest_finish_ansi "%x"] - set assignees [db_list get_assignees " - select - email - FROM - pm_task_assignment a, - parties p - WHERE - task_id = :task_item_id and - a.party_id = p.party_id - "] + set assignees [pm::task::assignee_email_list -task_item_id $task_item_id] if {[llength $assignees] > 0} { @@ -1072,7 +1061,7 @@ if {![string equal $time_stamp_pretty $last_time_stamp]} { append work_log "* $time_stamp_pretty\n\n" } - append work_log "[pm::util::string_truncate_and_pad -length 25 -string "$user_name:"] $description ($value hrs)\n" + append work_log "[pm::util::string_truncate_and_pad -length 15 -string "$user_name:"] $description ($value hrs)\n" set last_time_stamp $time_stamp_pretty } @@ -1090,6 +1079,8 @@ set notification_text "Task closed, was $status_description\n\n" + set task_description [ad_html_text_convert -from $mime_type -to "text/plain" $task_description] + append notification_text " ------------- Task ID: \#$task_item_id @@ -1119,7 +1110,7 @@ $task_description" - acs_mail_lite::send \ + pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject \ @@ -1248,7 +1239,7 @@ set which_pile overdue } elseif {$slack_arr($task) < $PRESSING_THRESHOLD} { set which_pile pressing - } elseif {$slack_arr($task) < $PRESSING_THRESHOLD} { + } elseif {$slack_arr($task) < $LONGTERM_THRESHOLD} { set which_pile longterm } else { set which_pile "" @@ -1327,7 +1318,7 @@ lappend description $longterm_item } - acs_mail_lite::send \ + pm::util::send \ -to_addr $address \ -from_addr $address \ -subject $subject \ @@ -1367,7 +1358,9 @@ {-edit_p "t"} {-comment ""} {-description ""} + {-description_mime_type "text/plain"} {-old_description ""} + {-old_description_mime_type "text/plain"} {-subject ""} {-work ""} {-work_min ""} @@ -1528,14 +1521,16 @@ } + set description [ad_html_text_convert -from $description_mime_type -to "text/plain" $description] + set old_description [ad_html_text_convert -from $old_description_mime_type -to "text/plain" $old_description] if {![string equal $description $old_description] && [string equal $edit_p t]} { - set description_out "$description \n\n-------\nOld description:\n-------\n\n[ad_html_to_text $old_description]" + set description_out "$description \n\n-------\nOld description:\n-------\n\n$old_description" append intro_text "\nSee below to see the changes in the description" } else { - set description_out [ad_html_to_text $description] + set description_out $description } if {[string equal $use_uncertain_completion_times_p 1]} { @@ -1562,7 +1557,7 @@ append notification_text "\n\n-----------\nDescription\n-----------" append notification_text "\n$description_out" - acs_mail_lite::send \ + pm::util::email \ -to_addr $to_address \ -from_addr $from_address \ -subject $subject_out \ @@ -1647,3 +1642,32 @@ return $display_value } + + +ad_proc -public pm::task::assignee_email_list { + -task_item_id:required +} { + Returns a list of assignee email addresses + + @author Jade Rubick (jader@bread.com) + @creation-date 2004-06-10 + + @param task_item_id + + @return + + @error +} { + + return [db_list get_addresses { + SELECT + p.email + FROM + parties p, + pm_task_assignment a + WHERE + a.task_id = :task_item_id and + a.party_id = p.party_id + }] + +}