";
if ( $WEEK_START == "1" )
$wkstart = get_monday_before ( $thisyear, $thismonth, 1 );
else
$wkstart = get_sunday_before ( $thisyear, $thismonth, 1 );
$monthstart = mktime(2,0,0,$thismonth,1,$thisyear);
$monthend = mktime(2,0,0,$thismonth + 1,0,$thisyear);
echo "
| "
. "";
echo month_name ( $thismonth - 1 ) .
" |
";
echo "";
if ( $WEEK_START == 0 ) echo "| " .
weekday_short_name ( 0 ) . " | ";
for ( $i = 1; $i < 7; $i++ ) {
echo "" .
weekday_short_name ( $i ) . " | ";
}
if ( $WEEK_START == 1 ) echo "" .
weekday_short_name ( 0 ) . " | ";
for ($i = $wkstart; date("Ymd",$i) <= date ("Ymd",$monthend);
$i += (24 * 3600 * 7) ) {
echo "
";
for ($j = 0; $j < 7; $j++) {
$date = $i + ($j * 24 * 3600);
$dateYmd = date ( "Ymd", $date );
$hasEvents = false;
if ( $boldDays ) {
$ev = get_entries ( $user, $dateYmd, $get_unapproved );
if ( count ( $ev ) > 0 ) {
$hasEvents = true;
} else {
$rep = get_repeating_entries ( $user, $dateYmd, $get_unapproved );
if ( count ( $rep ) > 0 )
$hasEvents = true;
}
}
if ( $dateYmd >= date ("Ymd",$monthstart) &&
$dateYmd <= date ("Ymd",$monthend) ) {
echo "| ";
echo "" .
( $hasEvents ? "" : "" ) .
date ( "j", $date ) .
( $hasEvents ? "" : "" ) .
" | ";
} else
echo " | ";
} // end for $j
echo "
";
} // end for $i
echo "";
}
if ( empty ( $year ) )
$year = date("Y");
$thisyear = $year;
if ( $year != date ( "Y") )
$thismonth = 1;
if ( $year > "1903" )
$prevYear = $year - 1;
else
$prevYear=$year;
$nextYear= $year + 1;
if ( $allow_view_other != "Y" && ! $is_admin )
$user = "";
$boldDays = false;
if ( ! empty ( $bold_days_in_year ) && $bold_days_in_year == 'Y' ) {
/* Pre-Load the repeated events for quckier access */
$repeated_events = read_repeated_events (
( ! empty ( $user ) && strlen ( $user ) ) ? $user : $login, $cat_id );
/* Pre-load the non-repeating events for quicker access */
$events = read_events ( ( ! empty ( $user ) && strlen ( $user ) )
? $user : $login, $year . "0101", $year . "1231", $cat_id );
$boldDays = true;
}
// Include unapproved events?
$get_unapproved = ( $DISPLAY_UNAPPROVED == 'Y' );
if ( $user == "__public__" )
$get_unapproved = false;
print_header();
?>
" CLASS="monthlink"> ">
|
\n";
if ( ! empty ( $user ) ) {
user_load_variables ( $user, "user_" );
echo $user_fullname;
} else
echo $fullname;
if ( $is_assistant )
echo " -- " . translate("Assistant mode") . " --";
}
?>
|
" CLASS="monthlink"> ">
|
friendly=1" TARGET="cal_printer_friendly"
onMouseOver="window.status = ''">[]