Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-functions-create.sql,v diff -u -r1.13.2.1 -r1.13.2.2 --- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 20 May 2004 17:30:02 -0000 1.13.2.1 +++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql 20 May 2004 17:35:19 -0000 1.13.2.2 @@ -19,11 +19,7 @@ returns varchar as ' declare p_pm_project_id alias for $1; -<<<<<<< project-manager-functions-create.sql - v_pm_project_name pm_projects.project_name%TYPE; -======= v_pm_project_name pm_projectsx.name%TYPE; ->>>>>>> 1.16 begin select name || ''_'' || p_pm_project_id into v_pm_project_name from pm_projectsx Index: openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/project-manager-procs.tcl,v diff -u -r1.2.2.1 -r1.2.2.2 --- openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 20 May 2004 17:30:04 -0000 1.2.2.1 +++ openacs-4/contrib/packages/project-manager/tcl/project-manager-procs.tcl 20 May 2004 17:35:19 -0000 1.2.2.2 @@ -27,7 +27,6 @@ return $value_if_not_null } } -<<<<<<< project-manager-procs.tcl ad_proc -public pm::util::string_truncate_and_pad { @@ -60,41 +59,8 @@ return $new_string } -======= -ad_proc -public pm::util::string_truncate_and_pad { - -length - {-ellipsis "..."} - -string -} { - Truncates a string to a given length, or pads it to match a given length - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-14 - - @param length - - @param ellipsis - - @param string - - @return - - @error -} { - - set new_string [string_truncate -len $length -ellipsis $ellipsis -- $string] - set new_string_length [string length $new_string] - - if {$new_string_length < $length} { - set new_string "$new_string[string repeat " " [expr $length - $new_string_length]]" - } - - return $new_string -} - - ad_proc -private pm::util::word_diff { {-old:required} {-new:required} 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.4.2.1 -r1.4.2.2 --- openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 20 May 2004 17:30:04 -0000 1.4.2.1 +++ openacs-4/contrib/packages/project-manager/tcl/task-procs.tcl 20 May 2004 17:35:19 -0000 1.4.2.2 @@ -702,7 +702,6 @@ return $total_logged_hours } -<<<<<<< task-procs.tcl ad_proc -public pm::task::link { @@ -1140,659 +1139,6 @@ return } - acs_mail_lite::send \ - -to_addr jader@bread.com \ - -from_addr jader@bread.com \ - -subject "Reminder: pm::task::email_status is starting..." \ - -body "It is starting" - - set parties [list] - - # what if the person assigned is no longer a part of the subsite? - # right now, we still email them. - - db_foreach get_all_open_tasks " - SELECT - ts.task_id, - ts.task_id as item_id, - ts.task_number, - t.task_revision_id, - t.title, - to_char(t.earliest_start,'J') as earliest_start_j, - to_char(current_timestamp,'J') as today_j, - to_char(t.latest_start,'J') as latest_start_j, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - t.percent_complete, - t.estimated_hours_work, - t.estimated_hours_work_min, - t.estimated_hours_work_max, - case when t.actual_hours_worked is null then 0 - else t.actual_hours_worked end as actual_hours_worked, - to_char(t.earliest_start,'YYYY-MM-DD HH24:MI') as earliest_start, - to_char(t.earliest_finish,'YYYY-MM-DD HH24:MI') as earliest_finish, - to_char(t.latest_start,'YYYY-MM-DD HH24:MI') as latest_start, - to_char(t.latest_finish,'YYYY-MM-DD HH24:MI') as latest_finish, - p.first_names || ' ' || p.last_name as full_name, - p.party_id, - (select one_line from pm_roles r where ta.role_id = r.role_id) as role - FROM - pm_tasks ts, - pm_tasks_revisionsx t, - pm_task_assignment ta, - acs_users_all p, - cr_items i, - pm_task_status s - WHERE - ts.task_id = t.item_id and - i.item_id = t.item_id and - t.task_revision_id = i.live_revision and - ts.status = s.status_id and - s.status_type = 'o' and - t.item_id = ta.task_id and - ta.party_id = p.party_id - ORDER BY - t.latest_start asc" { - set earliest_start_pretty [lc_time_fmt $earliest_start "%x"] - set earliest_finish_pretty [lc_time_fmt $earliest_finish "%x"] - set latest_start_pretty [lc_time_fmt $latest_start "%x"] - set latest_finish_pretty [lc_time_fmt $latest_finish "%x"] - - if {[exists_and_not_null earliest_start_j]} { - set slack_time [pm::task::slack_time \ - -earliest_start_j $earliest_start_j \ - -today_j $today_j \ - -latest_start_j $latest_start_j] - - } - - if {[lsearch $parties $party_id] == -1} { - lappend parties $party_id - } - - lappend task_list($party_id) $task_id - set titles_arr($task_id) $title - set ls_arr($task_id) $latest_start_pretty - set lf_arr($task_id) $latest_finish_pretty - set slack_arr($task_id) $slack_time - - # how many tasks does this person have? - if {[info exists task_count($party_id)]} { - incr task_count($party_id) - } else { - set task_count($party_id) 1 - } - } - - # transitions are < this value - set OVERDUE_THRESHOLD 0 - set PRESSING_THRESHOLD 7 - set LONGTERM_THRESHOLD 90 - - set TASK_LENGTH 70 - set TASK_ID_LENGTH 9 - - foreach party $parties { - - set subject "Daily Task status report" - set address [db_string get_email "select email from parties where party_id = :party" -default "jade-errors@bread.com"] - - set overdue [list] - set pressing [list] - set longterm [list] - - foreach task $task_list($party) { - - if {$slack_arr($task) < $OVERDUE_THRESHOLD} { - set which_pile overdue - } elseif {$slack_arr($task) < $PRESSING_THRESHOLD} { - set which_pile pressing - } elseif {$slack_arr($task) < $PRESSING_THRESHOLD} { - set which_pile longterm - } else { - set which_pile "" - } - - if {![empty_string_p $which_pile]} { - - set trimmed_task [pm::util::string_truncate_and_pad -length $TASK_ID_LENGTH -string $task] - set trimmed_title [pm::util::string_truncate_and_pad -length $TASK_LENGTH -string $titles_arr($task)] - - lappend $which_pile "$trimmed_task $trimmed_title" - lappend $which_pile "[string repeat " " $TASK_ID_LENGTH] LS: $ls_arr($task) LF: $lf_arr($task) Slack: $slack_arr($task)" - lappend $which_pile "" - } - - } - - set description [list] - - set overdue_title "OVERDUE TASKS" - set overdue_title [pm::util::string_truncate_and_pad -length $TASK_LENGTH -string $overdue_title] - - set overdue_description "consult with people affected, and let them know deadlines are affected" - - set pressing_title "PRESSING TASKS" - set pressing_title [pm::util::string_truncate_and_pad -length $TASK_LENGTH -string $pressing_title] - - set pressing_description "you need to start working on these soon to avoid affecting deadlines" - - set longterm_title "LONG TERM TASKS" - set longterm_title [pm::util::string_truncate_and_pad -length $TASK_LENGTH -string $longterm_title] - set longterm_description "look over these to plan ahead" - - # okay, let's now set up the email body - - lappend description "This is a daily reminder of tasks that are assigned to you" - lappend description "You current have $task_count($party) tasks assigned to you" - - lappend description "" - lappend description "\# $overdue_title" - - set length [string length $overdue_description] - lappend description [string repeat "_" $length] - - lappend description $overdue_description - - lappend description "" - foreach overdue_item $overdue { - lappend description $overdue_item - } - - lappend description "" - lappend description "\# $pressing_title" - - set length [string length $pressing_description] - lappend description [string repeat "_" $length] - - lappend description $pressing_description - - - lappend description "" - foreach pressing_item $pressing { - lappend description $pressing_item - } - - lappend description "" - lappend description "\# $longterm_title" - - set length [string length $longterm_description] - lappend description [string repeat "_" $length] - - lappend description $longterm_description - - lappend description "" - foreach longterm_item $longterm { - lappend description $longterm_item - } - - acs_mail_lite::send \ - -to_addr $address \ - -from_addr $address \ - -subject $subject \ - -body [join $description "\n"] - - } - - # consider also sending out emails to people who have assigned - # tickets to nobody - -} - - - -ad_proc -private pm::task::email_status_init { -} { - Schedules the daily emailings - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-14 - - @return - - @error -} { - ns_log Notice "Scheduling daily email notifications for project manager to 5:00 am" - ad_schedule_proc -thread t -debug t -schedule_proc ns_schedule_daily "5 0" pm::task::email_status -} -======= - - -ad_proc -public pm::task::link { - -task_item_id_1:required - -task_item_id_2:required -} { - Links two tasks together - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-03-10 - - @param task_item_id_1 - - @param task_item_id_2 - - @return - - @error -} { - - if {[string equal $task_item_id_1 $task_item_id_2]} { - # do nothing - ns_log Notice "Project-manager: Cannot link a task to itself!" - } elseif {$task_item_id_1 < $task_item_id_2} { - db_dml link_tasks " - INSERT INTO - pm_task_xref - (task_id_1, task_id_2) - VALUES - (:task_item_id_1, :task_item_id_2)" - } else { - db_dml link_tasks " - INSERT INTO - pm_task_xref - (task_id_1, task_id_2) - VALUES - (:task_item_id_2, :task_item_id_1)" - } - -} - - -ad_proc -public pm::task::assign_remove_everyone { - -task_item_id:required -} { - Removes all assignments for a task - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-09 - - @param task_item_id - - @return - - @error -} { - db_dml remove_assignment " - delete from pm_task_assignment where task_id = :task_item_id" -} - - -ad_proc -public pm::task::assign { - -task_item_id:required - -party_id:required - {-role_id ""} -} { - Assigns party_id to task_item_id - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-05 - - @param task_item_id - - @param party_id - - @param role_id the role under which the person is assigned - - @return - - @error -} { - if {![exists_and_not_null role_id]} { - set role_id [pm::role::default] - } - - db_dml add_assignment " - insert into pm_task_assignment - (task_id, - role_id, - party_id) - values - (:task_item_id, - :role_id, - :party_id) - " -} - - -ad_proc -public pm::task::open { - -task_item_id:required -} { - Opens a task, and sends notifications, unless it was already - open. If it was already open, does nothing. - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-22 - - @param task_item_id - - @return - - @error -} { - # find out what the status of the task was, and while we're at it, - # get other interesting information about the task, in case we - # want to close it. Then we can put this info in the email. - - db_1row get_status " - SELECT - t.status, - s.status_type, - s.description as status_description, - r.title as task_title, - r.estimated_hours_work, - r.estimated_hours_work_min, - r.estimated_hours_work_max, - to_char(r.earliest_start, 'YYYY-MM-DD HH24:MI:SS') as earliest_start_ansi, - to_char(r.earliest_finish, 'YYYY-MM-DD HH24:MI:SS') as earliest_finish_ansi, - 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, - project_revision.title as project_name - FROM - pm_tasks t, - cr_items task_item, - pm_task_status s, - pm_tasks_revisionsx r, - cr_items project_item, - cr_revisions project_revision - WHERE - r.parent_id = project_item.item_id and - t.task_id = task_item.item_id and - task_item.live_revision = r.revision_id and - project_item.live_revision = project_revision.revision_id and - r.item_id = t.task_id and - t.status = s.status_id and - t.task_id = :task_item_id" - - if {[string equal $status_type "o"]} { - - # this is already open - return - - } - - # set the new status - - set status_code [pm::task::default_status_open] - - db_dml update_status " - UPDATE - pm_tasks - SET - status = :status_code - WHERE - task_id = :task_item_id" - - # send out an email notification - - set earliest_start [lc_time_fmt $earliest_start_ansi "%x"] - set earliest_finish [lc_time_fmt $earliest_finish_ansi "%x"] - 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 - "] - - if {[llength $assignees] > 0} { - - set to_address [join $assignees ", "] - - set user_id [ad_conn user_id] - - set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] - - set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$task_item_id" - - set subject "Task reopened (was $status_description): $task_title" - - if {[parameter::get_from_package_key -package_key project-manager -parameter UseUncertainCompletionTimesP]} { - set estimated_work "\nHrs work (min): $estimated_hours_work_min\nHrs work (max): $estimated_hours_work_max" - } else { - set estimated_work "\nHrs work: $estimated_hours_work" - - } - - set notification_text "Task reopened, was $status_description\n\n" - - append notification_text " -------------- -Task ID: \#$task_item_id -Description: $task_title -Project: $project_name - -Link: $task_url - ---------------- -Estimated work: ----------------$estimated_work - ------- -Dates: ------- -Earliest start: $earliest_start -Earliest finish: $earliest_finish -Latest start: $latest_start -Latest finish $latest_finish - ------------ -Description ------------ -$task_description" - - - append notification_text "\n" - - acs_mail_lite::send \ - -to_addr $to_address \ - -from_addr $from_address \ - -subject $subject \ - -body $notification_text - } - - return -} - -ad_proc -public pm::task::close { - -task_item_id:required -} { - Closes a task, and sends notifications, unless it was already - closed. If it was already closed, does nothing. - - @author Jade Rubick (jader@bread.com) - @creation-date 2004-04-22 - - @param task_item_id - - @return - - @error -} { - # find out what the status of the task was - - db_1row get_status " - SELECT - t.status, - s.status_type, - s.description as status_description, - r.title as task_title, - r.estimated_hours_work, - r.estimated_hours_work_min, - r.estimated_hours_work_max, - to_char(r.earliest_start, 'YYYY-MM-DD HH24:MI:SS') as earliest_start_ansi, - to_char(r.earliest_finish, 'YYYY-MM-DD HH24:MI:SS') as earliest_finish_ansi, - 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, - project_revision.title as project_name - FROM - pm_tasks t, - cr_items task_item, - pm_task_status s, - pm_tasks_revisionsx r, - cr_items project_item, - cr_revisions project_revision - WHERE - r.parent_id = project_item.item_id and - t.task_id = task_item.item_id and - task_item.live_revision = r.revision_id and - project_item.live_revision = project_revision.revision_id and - r.item_id = t.task_id and - t.status = s.status_id and - t.task_id = :task_item_id" - - if {[string equal $status_type "c"]} { - - # this is already closed - return - - } - - # set the new status - - set status_code [pm::task::default_status_closed] - - db_dml update_status " - UPDATE - pm_tasks - SET - status = :status_code - WHERE - task_id = :task_item_id" - - # send out an email notification - - set earliest_start [lc_time_fmt $earliest_start_ansi "%x"] - set earliest_finish [lc_time_fmt $earliest_finish_ansi "%x"] - 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 - "] - - if {[llength $assignees] > 0} { - - set to_address [join $assignees ", "] - - set user_id [ad_conn user_id] - - set from_address [db_string get_from_email "select email from parties where party_id = :user_id" -default "nobody@nowhere.com"] - - set last_time_stamp "" - set work_log "----------------------\nWork done on this task\n----------------------\n\n" - - db_foreach get_logged_time " - SELECT - to_char(le.time_stamp, 'fmDyfm fmMMfm-fmDDfm-YYYY') as time_stamp_pretty, - le.value, - le.description, - r.title as task_name, - submitter.first_names || ' ' || submitter.last_name as user_name - FROM - logger_entries le, - cr_items i, - cr_revisions r, - pm_task_logger_proj_map m, - logger_projects lp, - acs_objects ao, - acs_users_all submitter - WHERE - r.item_id = m.task_item_id and - i.live_revision = r.revision_id and - r.item_id = :task_item_id and - le.project_id = lp.project_id and - ao.object_id = le.entry_id and - le.entry_id = m.logger_entry and - ao.creation_user = submitter.user_id - ORDER BY - le.time_stamp desc" { - 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" - - set last_time_stamp $time_stamp_pretty - } - - set task_url "[parameter::get_from_package_key -package_key acs-kernel -parameter SystemURL][ad_conn package_url]task-one?task_id=$task_item_id" - - set subject "Task closed (was $status_description) $task_title" - - if {[parameter::get_from_package_key -package_key project-manager -parameter UseUncertainCompletionTimesP]} { - set estimated_work "\nHrs work (min): $estimated_hours_work_min\nHrs work (max): $estimated_hours_work_max" - } else { - set estimated_work "\nHrs work: $estimated_hours_work" - - } - - set notification_text "Task closed, was $status_description\n\n" - - append notification_text " -------------- -Task ID: \#$task_item_id -Description: $task_title -Project: $project_name - -Link: $task_url -" - append notification_text "\n\n$work_log" - - append notification_text " ---------------- -Estimated work: ----------------$estimated_work - ------- -Dates: ------- -Earliest start: $earliest_start -Earliest finish: $earliest_finish -Latest start: $latest_start -Latest finish $latest_finish - ------------ -Description ------------ -$task_description" - - - acs_mail_lite::send \ - -to_addr $to_address \ - -from_addr $from_address \ - -subject $subject \ - -body $notification_text - } - - return -} - - - -ad_proc -public pm::task::email_status {} { - - set send_email_p [parameter::get_from_package_key -package_key "project-manager" -parameter SendDailyEmail -default "0"] - - if {[string equal $send_email_p "0"]} { - ns_log Notice "Parameter SendDailyEmail for project manager says skip email today" - return - } - # also don't send reminders on weekends. set today_j [db_string get_today "select to_char(current_timestamp,'J')"] @@ -2225,4 +1571,3 @@ } ->>>>>>> 1.8 Index: openacs-4/contrib/packages/project-manager/www/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/one.tcl,v diff -u -r1.30.2.1 -r1.30.2.2 --- openacs-4/contrib/packages/project-manager/www/one.tcl 20 May 2004 17:30:05 -0000 1.30.2.1 +++ openacs-4/contrib/packages/project-manager/www/one.tcl 20 May 2004 17:35:19 -0000 1.30.2.2 @@ -75,15 +75,9 @@ set original_project_id $project_id -<<<<<<< one.tcl # for edits of tasks. We want to come back to here. -set return_url "[ad_conn url]?[ad_conn query]" - -======= -# for edits of tasks. We want to come back to here. set return_url [ad_return_url -qualified] ->>>>>>> 1.35 # --------------------------------------------------------------- # # the unique identifier for this package @@ -249,26 +243,13 @@ } } \ -orderby { -<<<<<<< one.tcl default_value latest_start,asc title { label "Subject" orderby_asc "title asc" orderby_desc "title desc" default_direction asc } - earliest_start {orderby earliest_start} - earliest_finish {orderby earliest_finish} - latest_start {orderby latest_start} - latest_finish {orderby latest_finish} -======= - default_value latest_start,asc - title { - label "Subject" - orderby_asc "title asc" - orderby_desc "title desc" - default_direction asc - } earliest_start { label "Earliest start" orderby_asc "earliest_start, u.first_names, u.last_name" @@ -290,7 +271,6 @@ orderby_desc "latest_finish desc, u.first_names, u.last_name" default_direction asc } ->>>>>>> 1.35 } \ -orderby_name orderby_tasks \ -html { 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 -r1.27.2.2 -r1.27.2.3 --- openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 20 May 2004 17:30:05 -0000 1.27.2.2 +++ openacs-4/contrib/packages/project-manager/www/task-add-edit.tcl 20 May 2004 17:35:19 -0000 1.27.2.3 @@ -60,13 +60,9 @@ task_item_id:array,optional task_title:array,optional {process_id:integer ""} -<<<<<<< task-add-edit.tcl description:html,array,optional -======= - description:html,array,optional {old_description ""} comment:html,array,optional ->>>>>>> 1.33 name:array,optional end_date:array,optional percent_complete:array,optional @@ -126,20 +122,6 @@ # --------------------------------------------------------------- # -<<<<<<< task-add-edit.tcl -if {![exists_and_not_null project_id]} { - set project_id [db_string get_project_id { }] -} - - - -# ns_log Notice "return_url: $return_url" - - - - -======= ->>>>>>> 1.33 # -------------------------------------------------------------------- # If we are using a process, then we need to get the information on # the process now. This is necessary because we need to do things like @@ -274,7 +256,6 @@ for {set i 1} {$i <= $number} {incr i} { # set up date variable names set end_date_$i [list $end_date_year($i) $end_date_month($i) $end_date_day($i) {} {} {}] -<<<<<<< task-add-edit.tcl # ns_log Notice "end_date_$i: [set end_date_$i]" } } @@ -321,55 +302,8 @@ # ns_log notice "set description_[set element_type] to $keyvalu" -======= - # ns_log Notice "end_date_$i: [set end_date_$i]" } -} -# ------------------------------------------------------- # -# The second evilest hack of all time. -# ------------------------------------------------------- -# This is a workaround the fact that using multiple richtext items -# with ad_form is extremely difficult. The description field -# will come in like an array, with values like -# description.1 = 1234 bold -# description.1.format = text/enhanced -# description.1.spellcheck = :nospell: -# The problem is we want -# to have multiple descriptions. -# -# What this loop does is go through the array, and rename the -# values into other variables. We then feed these variables into -# the SQL function that creates the new tasks. This works. I'm -# sure there must be a better way to do it. -# ------------------------------------------------------- # - -if {[info exists description] && ![exists_and_not_null process_id]} { - - set searchToken [array startsearch description] - - while {[array anymore description $searchToken]} { - - # these next two lines are important - set element_num "" - set element_type "" - - set keyname [array nextelement description $searchToken] - set keyvalu $description($keyname) - - # ns_log Notice "keyname: $keyname keyvalu: $keyvalu" - - # element_num is 1...n, element_type is format, spellcheck - regexp {(.*)\.(.*)} $keyname match element_num element_type - - # ns_log Notice "element_num: $element_num element_type: $element_type" - - set description_[set element_type]($element_num) $keyvalu - - # ns_log notice "set description_[set element_type] to $keyvalu" - - } - } # ------------------------------------------------------- # @@ -420,12 +354,8 @@ # ns_log notice "set comment_[set element_type] to $keyvalu" ->>>>>>> 1.33 } -<<<<<<< task-add-edit.tcl -======= - } else { for {set i 1} {$i <= $number} {incr i} { @@ -441,19 +371,14 @@ set format $comment_format($i) set richtext_list [list [set comment_$i] $format] lappend comment_list [ad_html_to_text [template::util::richtext::get_property html_value $richtext_list]] ->>>>>>> 1.33 } -<<<<<<< task-add-edit.tcl -======= - # ns_log Notice "comment_list $comment_list" ->>>>>>> 1.33 # --------------------------------------------------------------- # # permissions and title setup, etc # we should update the permissions to not just use package_id, so @@ -504,19 +429,10 @@ {value $edit_p} } -<<<<<<< task-add-edit.tcl {return_url:text(hidden) {value $return_url} } - {project_id:text(hidden) - {value $project_id} -======= - {return_url:text(hidden) - {value $return_url} ->>>>>>> 1.33 - } - {number:text(hidden) {value $number} } @@ -547,14 +463,9 @@ set task_title_arr($i) $my_task_title set description_arr($i) $my_description -<<<<<<< task-add-edit.tcl - set mime_type_arr($i) $my_mime_type - set template_arr($i) [list $my_description $my_mime_type] -======= lappend old_description $my_description set mime_type_arr($i) $my_mime_type set template_arr($i) [list $my_description $my_mime_type] ->>>>>>> 1.33 set estimated_hours_arr($i) $my_estimated_work set estimated_hours_min_arr($i) $my_estimated_work_min set estimated_hours_max_arr($i) $my_estimated_work_max @@ -854,32 +765,13 @@ } -<<<<<<< task-add-edit.tcl - # make sure we're not dependent on ourselves - - if {![string equal $task_item_id_arr($i) $dependency_options($key)]} { - # check for case when there is a quote in the name of - # a task. We have to filter this out, or we get an error. - append dependency_options_full "{{$key} $dependency_options($key)} " - } - } - } else { - foreach key $dependency_keys { - - # check for case when there is a quote in the name of - # a task. We have to filter this out, or we get an error. - append dependency_options_full "{{$key} $dependency_options($key)} " - } - } -======= set dependency_options_full [pm::task::dependency_options \ -edit_p $edit_p \ -task_item_id $task_item_id_arr($i) \ -project_item_id $project_item_id_arr($i) \ -dependency_task_ids "$my_dependencies" \ -number $number \ -current_number $i] ->>>>>>> 1.33 # ns_log Notice "end_date.$i : $end_date_arr($i)" @@ -1020,14 +912,10 @@ set p_parent_task_id $dependency_task_id($i) set p_skip_p $skip_task_p($i) -<<<<<<< task-add-edit.tcl - # ns_log Notice "end date: $p_end_date" -======= # we don't do anything for the comments field, because they # are not added in for new tasks. # ns_log Notice "end date: $p_end_date" ->>>>>>> 1.33 # add in the new task @@ -1142,16 +1030,11 @@ set p_task_item_id $task_item_id($i) set p_task_title $task_title($i) set p_description $description($i) -<<<<<<< task-add-edit.tcl set p_mime_type $description_format($i) -======= - set p_mime_type $description_format($i) - set p_comment $comment($i) set p_comment_type $comment_format($i) ->>>>>>> 1.33 set p_percent $percent_complete($i) set p_work $estimated_hours_work($i) set p_work_min $estimated_hours_work_min($i) @@ -1290,21 +1173,10 @@ } -<<<<<<< task-add-edit.tcl } -after_submit { - # ns_log Notice "tae: return_url: $return_url" - - ad_returnredirect "task-assign-add-edit?[export_vars -url {project_item_id return_url process_task_id:multiple revisions:multiple task_id:multiple}]" - pm::project::compute_parent_status $project_item_id -======= -} -after_submit { - ad_returnredirect "task-assign-add-edit?[export_vars -url {comment_list edit_p return_url process_task_id:multiple revisions:multiple task_id:multiple old_description}]" ->>>>>>> 1.33 -<<<<<<< task-add-edit.tcl -======= # 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 # task is edited and changed to another project. @@ -1324,7 +1196,6 @@ } ->>>>>>> 1.33 ad_script_abort } 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.8.2.2 -r1.8.2.3 --- openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 20 May 2004 17:30:05 -0000 1.8.2.2 +++ openacs-4/contrib/packages/project-manager/www/task-assign-add-edit.tcl 20 May 2004 17:35:19 -0000 1.8.2.3 @@ -22,14 +22,10 @@ revisions:multiple role_id:array,optional party_id:array,optional -<<<<<<< task-assign-add-edit.tcl {return_url ""} -======= - {return_url ""} {edit_p "t"} {comment_list ""} {old_description:html ""} ->>>>>>> 1.15 } -properties { @@ -44,18 +40,6 @@ # --------------------------------------------------------------- # -<<<<<<< task-assign-add-edit.tcl - -if {[string equal [llength task_id] 1] && [exists_and_not_null return_url]} { - - # if the task is closed, then we don't need to reassign things - if {[string equal 0 [pm::task::open_p -task_item_id $task_id]]} { - ad_returnredirect $return_url - } -} - -======= ->>>>>>> 1.15 # hack to get around lack of multiple hidden support with ad_form set old_description [string map {"-" " "} $old_description] @@ -64,21 +48,7 @@ set revisions [string map {"-" " "} $revisions] set task_id [string map {"-" " "} $task_id] -<<<<<<< task-assign-add-edit.tcl -# The number of assignments is set to 9, or the number of assignees + -# 2 if there are more than 5 assignees -set NUMBER_OF_ASSIGNMENTS 9 - -# find out the maximum number of assignees -db_foreach get_count "select count(task_id) as my_count from pm_task_assignment where task_id in ([join $task_id ", "]) group by task_id" { - if {$my_count > $NUMBER_OF_ASSIGNMENTS} { - set NUMBER_OF_ASSIGNMENTS [expr $my_count + 2] - } -} - -======= - # We have passed in a list of comments and old_description. We will # key them by task number @@ -122,7 +92,6 @@ } } ->>>>>>> 1.15 db_multirow tasks get_task_info { } # create a multirow we can use to iterate @@ -151,10 +120,6 @@ # permissions -<<<<<<< task-assign-add-edit.tcl -set title "Add $task_term_lower assignments" -set context [list [list "one?project_item_id=$project_item_id" "One $project_term"] "New $task_term dependency"] -======= if {[string equal $edit_p "t"]} { set title "Edit $task_term_lower assignments" set context [list "Edit $task_term assignments"] @@ -163,7 +128,6 @@ set context [list "Add $task_term assignments"] } ->>>>>>> 1.15 permission::require_permission -party_id $user_id -object_id $package_id -privilege create @@ -294,17 +258,9 @@ set role_oneline($val) $des } -<<<<<<< task-assign-add-edit.tcl # ideally, we want to replace this with notifications, but I never # got it working correctly, so I use acs_mail_lite - set from_address [db_string get_email "select email from parties where party_id = :user_id"] - -======= - # ideally, we want to replace this with notifications, but I never - # got it working correctly, so I use acs_mail_lite - ->>>>>>> 1.15 foreach pl $party_list { regexp {(.*),(.*)} $pl match task_id_v num_value @@ -313,71 +269,6 @@ set r_id $assignment_role($pl) set p_id $assignment_party($pl) -<<<<<<< task-assign-add-edit.tcl - set to_address [db_string get_email "select email from parties where party_id = :p_id"] - - set subject "Task \#$t_id: $one_lines($t_id)" - - 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 $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 "------------- -Task overview -------------- -Task ID: \#$t_id -Description: $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 ------------ -$descriptions($t_id)" - - - 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]" \ - # -object_id $t_id \ - # -user_id $p_id \ - # -interval_id [notification::interval::get_id_from_name -name instant] \ - # -delivery_method_id [notification::delivery::get_id -short_name email] - - # send out notifications - # notification::new \ - # -type_id [notification::type::get_type_id -short_name pm_task_notif] \ - # -object_id $t_id \ - # -response_id $t_id \ - # -notif_subject $subject \ - # -notif_text $notification_text -======= # If there is a comment for this task, then display it # prominently in the email set my_comment $comment_value($t_id) @@ -418,7 +309,6 @@ # -response_id $t_id \ # -notif_subject $subject \ # -notif_text $notification_text ->>>>>>> 1.15 db_dml add_assignment { } @@ -500,24 +390,16 @@ } -after_submit { -<<<<<<< task-assign-add-edit.tcl if {[exists_and_not_null return_url]} { ad_returnredirect $return_url } else { - ad_returnredirect "one?project_item_id=$project_item_id" - } -======= - if {[exists_and_not_null return_url]} { - ad_returnredirect $return_url - } else { if {[llength $task_id] > 1} { ad_returnredirect "tasks" } else { ad_returnredirect "task-one?task_id=$task_id" } } ->>>>>>> 1.15 ad_script_abort }