Index: openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/tcl/Attic/calendar-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl 13 Jan 2005 13:54:35 -0000 1.2 +++ openacs-4/contrib/packages/project-manager/tcl/calendar-procs.tcl 21 Jul 2005 16:28:08 -0000 1.3 @@ -51,10 +51,19 @@ } { Creates a month widget for tasks } { + set day_template "\$day_number" set prev_nav_template "<" set next_nav_template ">" + set package_id [ad_conn package_id] + + if { ![string eq $package_id [dotlrn::get_package_id]]} { + set instance_clause "and (select context_id from acs_objects where object_id=(select context_id from acs_objects where object_id=(select context_id from acs_objects where object_id=t.parent_id))) = :package_id" + } else { + set instance_clause "" + } + #ad_return_complaint 1 "$package_id $instance_clause" if {[empty_string_p $date]} { set date [dt_systime] } @@ -82,83 +91,86 @@ set last_latest_start_j "" set assignee_list [list] - db_foreach select_monthly_tasks {} { - - # highlight what you're assigned to. - if {[string equal $person_id $user_id]} { - set font_begin "" - set font_end "" - } else { - set font_begin "" - set font_end "" - } - - if { \ - ![empty_string_p $is_lead_p] && \ - [string is true $is_lead_p]} { - - set font_begin "$font_begin" - set font_end "$font_end" - } - - # if this is another row of the same item, just add the name. - if {[string equal $last_task_id $task_id]} { - append day_details "
  • , ${font_begin}${full_name}${font_end}
  • " - } else { - - # this is the beginning of an item. - - # save the last item for output - if {![empty_string_p $last_task_id]} { - ns_set put $items $last_latest_start_j "${day_details}

    " - } - - # set up the next item for output - - if {[string equal $status "c"]} { - set detail_begin "" - set detail_end "" - } else { - set detail_begin "" - set detail_end "" - } - - # begin setting up this calendar item - set day_details "

    ${detail_begin}$task_id
    $title${detail_end}

    $project_name
    " - - # only add to the list if we want to see closed tasks - append day_details "

    " - } - - - # Display stuff - set day_number_template "$day_template" - - return [dt_widget_month -calendar_details $items -date $date \ - -master_bgcolor black \ - -header_bgcolor lavender \ - -header_text_color black \ - -header_text_size "+1" \ - -day_header_bgcolor lavender \ - -day_bgcolor white \ - -today_bgcolor #FFF8DC \ - -empty_bgcolor lightgrey \ - -day_text_color black \ - -prev_next_links_in_title 1 \ - -prev_month_template $prev_nav_template \ - -next_month_template $next_nav_template \ - -day_number_template $day_number_template] + + db_foreach select_monthly_tasks {} { + + # highlight what you're assigned to. + if {[string equal $person_id $user_id]} { + set font_begin "" + set font_end "" + } else { + set font_begin "" + set font_end "" + } + + if { \ + ![empty_string_p $is_lead_p] && \ + [string is true $is_lead_p]} { + + set font_begin "$font_begin" + set font_end "$font_end" + } + + # if this is another row of the same item, just add the name. + if {[string equal $last_task_id $task_id]} { + append day_details "
  • , ${font_begin}${full_name}${font_end}
  • " + } else { + + # this is the beginning of an item. + + # save the last item for output + if {![empty_string_p $last_task_id]} { + ns_set put $items $last_latest_start_j "${day_details}

    " + } + + # set up the next item for output + + if {[string equal $status "c"]} { + set detail_begin "" + set detail_end "" + } else { + set detail_begin "" + set detail_end "" + } + + # begin setting up this calendar item + set day_details "

    ${detail_begin}$task_id
    $title${detail_end}

    $project_name
    " + + # only add to the list if we want to see closed tasks + append day_details "

    " + } + + + # Display stuff + set day_number_template "$day_template" + + return [dt_widget_month -calendar_details $items -date $date \ + -master_bgcolor black \ + -header_bgcolor lavender \ + -header_text_color black \ + -header_text_size "+1" \ + -day_header_bgcolor lavender \ + -day_bgcolor white \ + -today_bgcolor #FFF8DC \ + -empty_bgcolor lightgrey \ + -day_text_color black \ + -prev_next_links_in_title 1 \ + -prev_month_template $prev_nav_template \ + -next_month_template $next_nav_template \ + -day_number_template $day_number_template] + } - -} + + +} \ No newline at end of file