$user = $viewusers[$i]; user_load_variables($user, "temp"); echo "<th class=\"row\" style=\"width:{$tdw}%;\">{$tempfullname}</th>"; for ($date = $wkstart, $h = 0; date("Ymd", $date) <= date("Ymd", $wkend); $date += 24 * 3600, $h++) { $wday = strftime("%w", $date); if ($wday == 0 || $wday == 6) { echo "<td class=\"weekend\" style=\"width:{$tdw}%;\">"; } else { echo "<td style=\"width:{$tdw}%;\">"; } $events = $e_save[$i]; $repeated_events = $re_save[$i]; if (empty($add_link_in_views) || $add_link_in_views != "N") { echo html_for_add_icon(date("Ymd", $date), "", "", $user); } print_date_entries(date("Ymd", $date), $user, true); echo "</td>"; } echo "</tr>\n"; } echo "</table>\n<br /><br />\n"; } $user = ""; // reset if (!empty($eventinfo)) { echo $eventinfo; } echo "<a title=\"" . translate("Generate printer-friendly version") . "\" class=\"printer\" href=\"view_v.php?id={$id}&date=" . "{$thisdate}&friendly=1\" " . "target=\"cal_printer_friendly\" onmouseover=\"window.status='" . translate("Generate printer-friendly version") . "'\">[" . translate("Printer Friendly") . "]</a>\n"; print_trailer(); ?> </body>
$todayYmd = date('Ymd', $today); for ($i = 0; $i < $viewusercnt; $i++) { $events = $e_save[$i]; $repeated_events = $re_save[$i]; $user = $viewusers[$i]; user_load_variables($user, 'temp'); $body .= ' <tr> <th class="row" style="width:' . $tdw . '%;">' . $tempfullname . '</th>'; for ($date = $wkstart; $date < $wkend; $date += 86400) { $is_weekend = is_weekend($date); if ($is_weekend && $DISPLAY_WEEKENDS == 'N') { continue; } $dateYmd = date('Ymd', $date); $entryStr = print_date_entries($dateYmd, $user, true); $class = ($dateYmd == $todayYmd ? ' class="today"' : (!empty($entryStr) && $entryStr != ' ' ? ' class="hasevents"' : ($is_weekend ? ' class="weekend"' : ''))) . ' style="width:' . $tdw . '%;">'; // . // Build header row. if ($i == 0) { $header .= ' <th' . $class . weekday_name(date('w', $date), $DISPLAY_LONG_DAYS) . ' ' . date('d', $date) . '</th>'; } $body .= ' <td' . $class . (empty($ADD_LINK_IN_VIEWS) || $ADD_LINK_IN_VIEWS != 'N' ? html_for_add_icon($dateYmd, '', '', $user) . "\n" : '') . $entryStr . ' </td>'; } $body .= ' </tr>'; } // .
if (date("Ymd", $date) >= date("Ymd", $monthstart) && date("Ymd", $date) <= date("Ymd", $monthend)) { $thiswday = date("w", $date); $is_weekend = $thiswday == 0 || $thiswday == 6; if (empty($WEEKENDBG)) { $is_weekend = false; } print "<td"; if ($date == date("Ymd", $today)) { echo " class=\"today\">"; } elseif ($is_weekend) { echo " class=\"weekend\">"; } else { echo ">"; } //echo date ( "D, m-d-Y H:i:s", $date ) . "<br />"; print_date_entries(date("Ymd", $date), !empty($user) ? $user : $login, false, implode(',', $viewusers)); print "</td>\n"; } else { print "<td> </td>\n"; } } print "</tr>\n"; } ?> </table><br /> <?php echo $eventinfo; display_unapproved_events($is_assistant || $is_nonuser_admin ? $user : $login); ?>
$class = ""; if (date("Ymd", $date) == date("Ymd", $today)) { $class = "today"; } if ($is_weekend) { if (strlen($class)) { $class .= " "; } $class .= "weekend"; } if (strlen($class)) { echo " class=\"{$class}\""; } echo ">"; //echo date ( "D, m-d-Y H:i:s", $date ) . "<br />"; print_date_entries(date("Ymd", $date), !empty($user) ? $user : $login, false); print "</td>\n"; } else { print "<td> </td>\n"; } } print "</tr>\n"; } ?> </table> <br /> <?php if (!empty($eventinfo)) { echo $eventinfo; } display_unapproved_events($is_assistant || $is_nonuser_admin ? $user : $login);
$startdate = date('Ymd', $wkstart); $enddate = date('Ymd', $wkend); /* Pre-Load the repeated events for quckier access */ $repeated_events = read_repeated_events($login, $startdate, $enddate, ''); /* Pre-load the non-repeating events for quicker access */ $events = read_events($login, $startdate, $enddate); $first_hour = $WORK_DAY_START_HOUR; $last_hour = $WORK_DAY_END_HOUR; $untimed_found = false; $tmpOut1 = $tmpOut2 = ''; for ($i = 0; $i < 7; $i++) { $days[$i] = $wkstart + 86400 * $i; $date = date('Ymd', $days[$i]); $tmpOut1 .= ' <th style="width: 13%; background: ' . (date('Ymd', $days[$i]) == date('Ymd', $today) ? $TODAYCELLBG : $THBG) . ';">' . weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS) . '<br />' . month_name(date('m', $days[$i]) - 1, 'M') . ' ' . date('d', $days[$i]) . '</th>'; $tmpOut2 .= ' <td style="vertical-align: top; width: 75px; height: 75px; ' . 'background: ' . ($date == date('Ymd') ? $TODAYCELLBG : $CELLBG) . print_date_entries($date, $login, true, true) . ' </td>'; } echo ' <table width="100%"> <tr> <td style="background: ' . $TABLEBG . ';"> <table style="border: 0; width: 100%;" cellspacing="1" cellpadding="2"> <tr>' . $tmpOut1 . ' </tr> <tr>' . $tmpOut2 . ' </tr> </table> </td> </tr> </table>';
} else { $color = $CELLBG; } $class = "tableheader"; } echo "<TR><TH CLASS=\"{$class}\" WIDTH=\"10%\" BGCOLOR=\"{$color}\" VALIGN=\"top\">" . "<FONT SIZE=\"-1\" CLASS=\"{$class}\">" . $weekday . " " . round(date("d", $date)) . "</FONT></TH>\n"; for ($i = $j, $k = 0; $i < count($viewusers) && $k < $USERS_PER_TABLE; $i++, $k++) { $user = $viewusers[$i]; $events = $e_save[$i]; $repeated_events = $re_save[$i]; echo "<TD WIDTH=\"{$tdw}%\" BGCOLOR=\"{$color}\">"; //echo date ( "D, m-d-Y H:i:s", $date ) . "<BR>"; if (empty($add_link_in_views) || $add_link_in_views != "N") { echo html_for_add_icon(date("Ymd", $date), "", "", $user); } print_date_entries(date("Ymd", $date), $user, $friendly, true); echo "</TD>"; } echo "</TR>\n"; } if (empty($friendly) || !$friendly) { echo "</TD></TR></TABLE>\n</TABLE>\n<P>\n"; } else { echo "</TABLE>\n<P>\n"; } } $user = ""; // reset if (empty($friendly)) { echo $eventinfo; }
function display_month($thismonth, $thisyear, $demo = false) { global $DISPLAY_ALL_DAYS_IN_MONTH, $DISPLAY_LONG_DAYS, $DISPLAY_WEEKNUMBER, $login, $today, $user, $WEEK_START, $WEEKENDBG; $ret = ' <table class="main" cellspacing="0" cellpadding="0" id="month_main"> <tr>' . ($DISPLAY_WEEKNUMBER == 'Y' ? ' <th class="empty"></th>' : ''); for ($i = 0; $i < 7; $i++) { $thday = ($i + $WEEK_START) % 7; $ret .= ' <th' . (is_weekend($thday) ? ' class="weekend"' : '') . '>' . weekday_name($thday, $DISPLAY_LONG_DAYS) . '</th>'; } $ret .= ' </tr>'; $charset = translate('charset'); $weekStr = translate('Week'); $WKStr = translate('WK'); $wkstart = get_weekday_before($thisyear, $thismonth); // Generate values for first day and last day of month. $monthstart = date('Ymd', mktime(0, 0, 0, $thismonth, 1, $thisyear)); $monthend = date('Ymd', mktime(0, 0, 0, $thismonth + 1, 0, $thisyear)); $monthend2 = date('Ymd His', mktime(0, 0, 0, $thismonth + 1, 0, $thisyear)); $todayYmd = date('Ymd', $today); for ($i = $wkstart; date('Ymd', $i + 43200) <= $monthend; $i += 604800) { $ret .= ' <tr>'; if ($DISPLAY_WEEKNUMBER == 'Y') { $tmp = date('W', $i + 86400); $ret .= ' <td class="weekcell"><a title="' . $weekStr . ' ' . $tmp . '" href="' . ($demo ? '' : 'week.php?date=' . date('Ymd', $i + 86400)) . (!empty($user) && $user != $login ? '&user='******'') . (empty($cat_id) ? '' : '&cat_id=' . $cat_id) . '"' . '>'; $wkStr = $WKStr . $tmp; $wkStr2 = ''; if ($charset == 'UTF-8') { $wkStr2 = $wkStr; } else { for ($w = 0, $cnt = strlen($wkStr); $w < $cnt; $w++) { $wkStr2 .= substr($wkStr, $w, 1) . '<br />'; } } $ret .= $wkStr2 . '</a></td>'; } for ($j = 0; $j < 7; $j++) { $date = $i + ($j * 86400 + 43200); $dateYmd = date('Ymd', $date); $dateD = date('d', $date); $thiswday = date('w', $date); $is_weekend = is_weekend($date) && !empty($WEEKENDBG); $ret .= ' <td'; $currMonth = $dateYmd >= $monthstart && $dateYmd <= $monthend; if ($currMonth || !empty($DISPLAY_ALL_DAYS_IN_MONTH) && $DISPLAY_ALL_DAYS_IN_MONTH == 'Y') { $class = $currMonth ? !$demo && $dateYmd == $todayYmd ? 'today' : ($is_weekend ? 'weekend' : '') : 'othermonth'; // Get events for this day. $ret_events = ''; if (!$demo) { $ret_events = print_date_entries($dateYmd, empty($user) ? $login : $user, false); } else { // Since we base this calendar on the current month, // the placement of the days always change so // set 3rd Thursday as "today" for the demo... if ($dateD > 15 && $dateD < 23 && $thiswday == 4) { $class = 'today'; $ret_events = translate('Today'); } // ... and set 2nd Saturday and 2nd Tuesday as the demo event days. if ($dateD > 7 && $dateD < 16 && ($thiswday == 2 || $thiswday == 6)) { $class .= ' entry hasevents'; $ret_events = translate('My event text'); } } $class = trim($class); $class .= !empty($ret_events) && strstr($ret_events, 'class="entry"') ? ' hasevents' : ''; $ret .= (strlen($class) ? ' class="' . $class . '"' : '') . '>' . $ret_events . '</td>'; } else { $ret .= ($is_weekend ? ' class="weekend"' : '') . '> </td>'; } } $ret .= ' </tr>'; } return $ret . ' </table>'; }
$color = $TODAYCELLBG; } else { $color = $THBG; } echo "<th style=\"width:13%; background-color:{$color};\">{$header[$d]}</th>"; } ?> </tr> <tr> <?php $first_hour = $WORK_DAY_START_HOUR - $TZ_OFFSET; $last_hour = $WORK_DAY_END_HOUR + $TZ_OFFSET; $untimed_found = false; for ($d = 0; $d < 7; $d++) { $date = date("Ymd", $days[$d]); print "<td style=\"vertical-align:top; width:75px; height:75px;"; if ($date == date("Ymd")) { echo " background-color:{$TODAYCELLBG};\">"; } else { echo " background-color:{$CELLBG};\">"; } print_date_entries($date, $login, true, true); echo " "; echo "</td>\n"; } ?> </tr> </table> </td></tr></table>