\n"; } $INC = array('js/popups.php'); print_header($INC,$HeadX); /* Pre-Load the repeated events for quckier access */ $repeated_events = read_repeated_events ( strlen ( $user ) ? $user : $login, $cat_id, $startdate ); /* Pre-load the non-repeating events for quicker access */ $events = read_events ( strlen ( $user ) ? $user : $login, $startdate, $enddate, $cat_id ); for ( $i = 0; $i < 7; $i++ ) { $days[$i] = $wkstart + ( 24 * 3600 ) * $i; $weekdays[$i] = weekday_short_name ( ( $i + $WEEK_START ) % 7 ); $header[$i] = $weekdays[$i] . "
\n" . date_to_str ( date ( "Ymd", $days[$i] ), $DATE_FORMAT_MD, false ); } ?>
\n(" . translate("Week") . " " . week_number ( $wkstart ) . ")"; } ?> " class="prev" href="week.php?date="><?php etranslate(" /> " class="next" href="week.php?date="><?php etranslate(" /> $user_fullname"; } if ( $is_nonuser_admin ) { echo "
-- " . translate("Admin mode") . " --"; } if ( $is_assistant ) { echo "
-- " . translate("Assistant mode") . " --"; } ?>

\n"; print_category_menu('week', sprintf ( "%04d%02d%02d",$thisyear, $thismonth, $thisday ), $cat_id ); } ?>

"; if ( $can_add ) { echo html_for_add_icon ( date ( "Ymd", $days[$d] ), "", "", $user ); } echo "" . $header[$d] . "\n"; } ?> 1 ) { if ( ! empty ( $hour_arr[$i] ) ) { $diff_start_time = $i - $last_row; if ( $rowspan_arr[$i] > 1 ) { if ( $rowspan_arr[$i] + ( $diff_start_time ) > $rowspan_arr[$last_row] ) { $rowspan_arr[$last_row] = ( $rowspan_arr[$i] + ( $diff_start_time ) ); } $rowspan += ( $rowspan_arr[$i] - 1 ); } else { $rowspan_arr[$last_row] += $rowspan_arr[$i]; } // this will move entries apart that appear in one field, // yet start on different hours for ( $u = $diff_start_time ; $u > 0 ; $u-- ) { $hour_arr[$last_row] .= "
\n"; } $hour_arr[$last_row] .= $hour_arr[$i]; $hour_arr[$i] = ""; $rowspan_arr[$i] = 0; } $rowspan--; } else if ( ! empty ( $rowspan_arr[$i] ) && $rowspan_arr[$i] > 1 ) { $rowspan = $rowspan_arr[$i]; $last_row = $i; } } // now save the output... if ( ! empty ( $hour_arr[9999] ) && strlen ( $hour_arr[9999] ) ) { $untimed[$d] = $hour_arr[9999]; $untimed_found = true; } $save_hour_arr[$d] = $hour_arr; $save_rowspan_arr[$d] = $rowspan_arr; } // untimed events first if ( $untimed_found ) { echo "\n\n"; for ( $d = $start_ind; $d < $end_ind; $d++ ) { $thiswday = date ( "w", $days[$d] ); $is_weekend = ( $thiswday == 0 || $thiswday == 6 ); $class = ( $is_weekend ? "weekend" : "" ); if ( date ( 'Ymd', $days[$d] ) == date ( 'Ymd', $today ) ) { if ($class != "") { $class .= " "; } $class .= "today"; } echo ""; if ( ! empty ( $untimed[$d] ) && strlen ( $untimed[$d] ) ) { echo $untimed[$d]; } else { echo " "; } echo "\n"; } echo "\n"; } for ( $d = $start_ind; $d < $end_ind; $d++ ) { $rowspan_day[$d] = 0; } for ( $i = $first_slot; $i <= $last_slot; $i++ ) { $time_h = (int) ( ( $i * $interval ) / 60 ); $time_m = ( $i * $interval ) % 60; $time = display_time ( ( $time_h * 100 + $time_m ) * 100 ); echo "\n\n"; for ( $d = $start_ind; $d < $end_ind; $d++ ) { $thiswday = date ( "w", $days[$d] ); $is_weekend = ( $thiswday == 0 || $thiswday == 6 ); $class = ( $is_weekend ? "weekend" : "" ); if ( date ( 'Ymd', $days[$d] ) == date ( 'Ymd', $today ) ) { if ( $class != "" ) { $class .= " "; } $class .= "today"; } // Use the class 'hasevents' for any hour block that has events // in it. if ( ! empty ( $save_hour_arr[$d][$i] ) && strlen ( $save_hour_arr[$d][$i] ) ) { $class = 'hasevents'; } if ( $rowspan_day[$d] > 1 ) { // this might mean there's an overlap, or it could mean one event // ends at 11:15 and another starts at 11:30. if ( ! empty ( $save_hour_arr[$d][$i] ) ) { echo "" . $save_hour_arr[$d][$i] . "\n"; } $rowspan_day[$d]--; } else if ( empty ( $save_hour_arr[$d][$i] ) ) { echo ""; if ( $can_add ) { //if user can add events... echo html_for_add_icon ( date ( "Ymd", $days[$d] ), $time_h, $time_m, $user ); //..then echo the add event icon } echo " \n"; } else { $rowspan_day[$d] = $save_rowspan_arr[$d][$i]; if ( $rowspan_day[$d] > 1 ) { echo ""; if ( $can_add ) { echo html_for_add_icon ( date ( "Ymd", $days[$d] ), $time_h, $time_m, $user ); } echo $save_hour_arr[$d][$i] . "\n"; } else { echo ""; if ( $can_add ) { echo html_for_add_icon ( date ( "Ymd", $days[$d] ), $time_h, $time_m, $user ); } echo $save_hour_arr[$d][$i] . "\n"; } } } echo "\n"; } ?>
 
 
" . $time . "


" class="printer" href="week.php?<?php echo $u_url; if ( $thisyear ) { echo "year=$thisyear&month=$thismonth&day=$thisday"; } echo $caturl . "&"; ?>friendly=1" target="cal_printer_friendly" onmouseover="window.status = ''" ?>friendly=1" target="cal_printer_friendly" onmouseover="window.status = ''">[]