// . // Generate header row. $class = $dateYmd == date('Ymd', $today) ? ' class="today"' : (is_weekend($days[$i]) ? ' class="weekend"' : ''); $headerStr .= ' <th ' . $class . '>' . ($can_add ? html_for_add_icon($dateYmd, '', '', $user) : '') . '<p style="margin:.75em 0 0 0"><a href="day.php?' . $u_url . 'date=' . $dateYmd . $caturl . '">' . $header[$i] . '</a></p></th>'; $date = date('Ymd', $days[$i]); $hour_arr = $rowspan_arr = $tk = array(); // . // Get, combine and sort, static and repeating events for this date. $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date)); // . // Then sort in any tasks due for this day and before. $ev = combine_and_sort_events($ev, $date >= date('Ymd') ? get_tasks($date, $get_unapproved) : $tk); for ($j = 0, $cnt = count($ev); $j < $cnt; $j++) { if ($get_unapproved || $ev[$j]->getStatus() == 'A') { html_for_event_week_at_a_glance($ev[$j], $date); } } // . // Squish events that use the same cell into the same cell. // For example, an event from 8:00-9:15 and another from 9:30-9:45 // both want to show up in the 8:00-9:59 cell. $last_row = -1; $rowspan = 0; for ($j = 0; $j < $TIME_SLOTS; $j++) { if ($rowspan > 1) { if (!empty($hour_arr[$j])) { $diff_start_time = $j - $last_row; if ($rowspan_arr[$j] > 1) { if ($rowspan_arr[$j] + $diff_start_time > $rowspan_arr[$last_row]) { $rowspan_arr[$last_row] = $rowspan_arr[$j] + $diff_start_time;
} } // print out any remaining repeating events while ($cur_rep < count($rep)) { if ($get_unapproved || $rep[$cur_rep]['cal_status'] == 'A') { if (!empty($rep[$cur_rep]['cal_ext_for_id'])) { $viewid = $rep[$cur_rep]['cal_ext_for_id']; $viewname = $rep[$cur_rep]['cal_name'] . " (" . translate("cont.") . ")"; } else { $viewid = $rep[$cur_rep]['cal_id']; $viewname = $rep[$cur_rep]['cal_name']; } if ($rep['cal_duration'] == 24 * 60) { $all_day[$d] = 1; } html_for_event_week_at_a_glance($viewid, $date, $rep[$cur_rep]['cal_time'], $viewname, $rep[$cur_rep]['cal_description'], $rep[$cur_rep]['cal_status'], $rep[$cur_rep]['cal_priority'], $rep[$cur_rep]['cal_access'], $rep[$cur_rep]['cal_duration'], $rep[$cur_rep]['cal_login'], $hide_icons); } $cur_rep++; } // squish events that use the same cell into the same cell. // For example, an event from 8:00-9:15 and another from 9:30-9:45 both // want to show up in the 8:00-9:59 cell. $rowspan = 0; $last_row = -1; for ($i = 0; $i < $TIME_SLOTS; $i++) { if ($rowspan > 1) { if (!empty($hour_arr[$i])) { if ($rowspan_arr[$i] > 1) { $rowspan_arr[$last_row] += $rowspan_arr[$i] - 1; $rowspan += $rowspan_arr[$i] - 1; } else {
if ($get_unapproved || $ev[$i]->getStatus() == 'A') { if ($ev[$i]->getDuration() == 1440) { $all_day[$d] = 1; } html_for_event_week_at_a_glance($ev[$i], $dateYmd, 'small', $show_time); //echo "Found event date=$dateYmd name='$viewname'<br />\n"; //print_r ( $rowspan_arr ); } } // print out any remaining repeating events while ($cur_rep < $repcnt) { if ($get_unapproved || $rep[$cur_rep]->getStatus() == 'A') { if ($rep[$cur_rep]->getDuration() == 1440) { $all_day[$d] = 1; } html_for_event_week_at_a_glance($rep[$cur_rep], $dateYmd, 'small', $show_time); } $cur_rep++; } // squish events that use the same cell into the same cell. // For example, an event from 8:00-9:15 and another from 9:30-9:45 both // want to show up in the 8:00-9:59 cell. $rowspan = 0; $last_row = -1; for ($i = 0; $i < $TIME_SLOTS; $i++) { if ($rowspan > 1) { if (!empty($hour_arr[$i])) { if ($rowspan_arr[$i] > 1) { $rowspan_arr[$last_row] += $rowspan_arr[$i] - 1; $rowspan += $rowspan_arr[$i] - 1; } else {