diff --git a/calendar/day.php b/calendar/day.php index bc359c5610..24f0c527b9 100644 --- a/calendar/day.php +++ b/calendar/day.php @@ -16,7 +16,7 @@ $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True, "enable_template_class" => True); - if (isset($friendly) && (int)$friendly==1){ + if (isset($friendly) && $friendly){ $phpgw_info["flags"]["noheader"] = True; $phpgw_info["flags"]["nonavbar"] = True; $phpgw_info["flags"]["nocalendarheader"] = True; @@ -28,25 +28,6 @@ $view = "day"; - if (isset($date) && strlen($date) > 0) { - $thisyear = substr($date, 0, 4); - $thismonth = substr($date, 4, 2); - $thisday = substr($date, 6, 2); - } 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 = $phpgw->calendar->splitdate(mktime (2, 0, 0, $thismonth, $thisday, $thisyear)); $phpgw->template->set_file(array("day" => "day.tpl")); diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php index b27c93056e..34567b917d 100644 --- a/calendar/inc/header.inc.php +++ b/calendar/inc/header.inc.php @@ -1,8 +1,32 @@ 0) { + $thisyear = substr($date, 0, 4); + $thismonth = substr($date, 4, 2); + $thisday = substr($date, 6, 2); + } 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; + } + if (!isset($phpgw_info["flags"]["nocalendarheader"]) || !$phpgw_info["flags"]["nocalendarheader"]) { - ?> + +?> @@ -10,17 +34,17 @@   @@ -39,6 +63,6 @@
- "> + "> /today.gif" alt="" border="0"> - "> + "> /week.gif" alt="" border="0"> - "> + "> /month.gif" alt="" border="0">
- +?> diff --git a/calendar/index.php b/calendar/index.php index b054e6225c..163ab91fa3 100755 --- a/calendar/index.php +++ b/calendar/index.php @@ -17,31 +17,14 @@ $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True); if (isset($friendly) && $friendly){ $phpgw_info["flags"]["noheader"] = True; + $phpgw_info["flags"]["nonavbar"] = True; + $phpgw_info["flags"]["nocalendarheader"] = True; } else { $friendly = 0; } include("../header.inc.php"); - if (isset($date) && strlen($date) > 0) { - $thisyear = substr($date, 0, 4); - $thismonth = substr($date, 4, 2); - $thisday = substr($date, 6, 2); - } 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; - } - $next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear)); $prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear)); diff --git a/calendar/templates/default/index.tpl b/calendar/templates/default/index.tpl index a0e83b047f..59cbf7d12c 100755 --- a/calendar/templates/default/index.tpl +++ b/calendar/templates/default/index.tpl @@ -9,7 +9,6 @@ } -
@@ -17,7 +16,7 @@ {month_identifier} -
{username}
+
{username}
{small_calendar_next} diff --git a/calendar/templates/default/week.tpl b/calendar/templates/default/week.tpl index 610552164f..7bae792c9f 100755 --- a/calendar/templates/default/week.tpl +++ b/calendar/templates/default/week.tpl @@ -19,12 +19,8 @@ {small_calendar_this} - - {week_identifier} - -
- {username} -
+ {week_identifier} +
{username}
{next_week_link} diff --git a/calendar/week.php b/calendar/week.php index 75d6ed20ee..b4c53d39fc 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -13,44 +13,25 @@ \**************************************************************************/ /* $Id$ */ + $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True); + if (isset($friendly) && $friendly){ $phpgw_info["flags"]["noheader"] = True; $phpgw_info["flags"]["nonavbar"] = True; + $phpgw_info["flags"]["nocalendarheader"] = True; } else { $friendly = 0; } include("../header.inc.php"); - if(!isset($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"])) - $phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] = "Sunday"; - - if (isset($date) && strlen($date) > 0) { - $thisyear = substr($date, 0, 4); - $thismonth = substr($date, 4, 2); - $thisday = substr($date, 6, 2); - } 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; - } - $next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday + 7,$thisyear)); $prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday - 7,$thisyear)); $nextmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear)); $prevmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear)); - if($phpgw_info["user"]["preferences"]["calednar"]["workweekstarts"] == "Sunday") { + if($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] == "Sunday") { $start = 7200; } else { $start = 93600;