diff --git a/calendar/day.php b/calendar/day.php
index 5740bafd29..363263d284 100644
--- a/calendar/day.php
+++ b/calendar/day.php
@@ -14,8 +14,10 @@
/* $Id$ */
- if ($friendly) {
+ if (isset($friendly) && $friendly){
$phpgw_info["flags"]["noheader"] = True;
+ } else {
+ $friendly = 0;
}
$phpgw_info["flags"]["currentapp"] = "calendar";
@@ -23,85 +25,76 @@
$view = "day";
- if (strlen($date) > 0) {
- $thisyear = substr($date,0,4);
- $thismonth = substr($date,4,2);
- $thisday = substr($date,6,2);
+ if (isset($date) && strlen($date) > 0) {
+ $thisyear = substr($date, 0, 4);
+ $thismonth = substr($date, 4, 2);
+ $thisday = substr($date, 6, 2);
} else {
- if ($month == 0) {
- $thismonth = date("m");
- } else {
- $thismonth = $month;
- }
-
- if ($year == 0) {
- $thisyear = date("Y");
- } else {
- $thisyear = $year;
- }
-
- if ($day == 0) {
- $thisday = date("d");
- } else {
+ if (!isset($day) || !$day)
+ $thisday = $phpgw->calendar->today["day"];
+ else
$thisday = $day;
- }
+ if (!isset($month) || !$month)
+ $thismonth = $phpgw->calendar->today["month"];
+ else
+ $thismonth = $month;
+ if (!isset($year) || !$year)
+ $thisyear = $phpgw->calendar->today["year"];
+ else
+ $thisyear = $year;
}
- $now = mktime (2, 0, 0, $thismonth, $thisday, $thisyear);
+ $now = $phpgw->calendar->splitdate(mktime (2, 0, 0, $thismonth, $thisday, $thisyear));
- $next = mktime(2, 0, 0, $thismonth, $thisday + 1, $thisyear);
- $nextyear = date("Y", $next);
- $nextmonth = date("m", $next);
- $nextday = date("d", $next);
- $month_ago = date("Ymd", mktime(2, 0, 0,$thismonth - 1,$thisday,$thisyear));
+ $next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday + 1,$thisyear));
- $prev = mktime(2, 0, 0, $thismonth, $day - 1, $thisyear);
- $prevyear = date("Y", $prev);
- $prevmonth = date("m", $prev);
- $prevday = date("d", $prev);
- $month_ahead = date("Ymd", mktime(2,0,0,$thismonth + 1,$thisday,$thisyear));
+ $month_ago = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,$thisday,$thisyear));
- /* Pre-Load the repeated events for quckier access */
- $repeated_events = read_repeated_events();
+ $prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear));
+
+ $month_ahead = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,$thisday,$thisyear));
if ($friendly) {
- echo "
";
+ echo "";
}
?>
-
- |
-
-
-
+
+ |
+
+
+">
-
+
-
-
+
+">
common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]);
?>
-
- |
-
-
+
+ |
+
+
-
-
-
-
-
+
+
+ ">
+
+ calendar->print_day_at_a_glance($now); ?>
-
+
-
- |
-
-
+ |
+ |
+ |
+
diff --git a/calendar/index.php b/calendar/index.php
index a59a693aaa..427479fb5e 100755
--- a/calendar/index.php
+++ b/calendar/index.php
@@ -24,9 +24,9 @@
include("../header.inc.php");
if (isset($date) && strlen($date) > 0) {
- $thisyear = substr($date, 0, 4);
+ $thisyear = substr($date, 0, 4);
$thismonth = substr($date, 4, 2);
- $thisday = substr($date, 6, 2);
+ $thisday = substr($date, 6, 2);
} else {
if (!isset($day) || !$day)
$thisday = $phpgw->calendar->today["day"];
@@ -43,20 +43,18 @@
}
$next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear));
-// $nextdate = date("Ymd");
$prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear));
-// $prevdate = date("Ymd");
if ($friendly) {
- echo "";
+ echo "";
$view = "month";
}
?>
| |