diff --git a/calendar/index.php b/calendar/index.php index 700695a2c1..a165c57ceb 100755 --- a/calendar/index.php +++ b/calendar/index.php @@ -66,8 +66,8 @@ "; - echo $phpgw->calendar->pretty_small_calendar($thisday,$prev["month"],$prev["year"],"edit_entry.php"); + echo ""; ?> @@ -77,15 +77,15 @@ echo lang(strftime("%B",$m)) . " " . $thisyear; ?> - +">
common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]); ?>
"; - echo $phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"edit_entry.php"); + echo "
"; ?> diff --git a/calendar/week.php b/calendar/week.php index f47d8862f5..cc2b7183a8 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -13,172 +13,111 @@ \**************************************************************************/ /* $Id$ */ - if (!$friendly){ - $phpgw_info["flags"]["noheader"]="True"; + if (isset($friendly) && $friendly){ + $phpgw_info["flags"]["noheader"] = True; + } else { + $friendly = 0; } $phpgw_info["flags"]["currentapp"] = "calendar"; include("../header.inc.php"); - - if (! $friendly) { - $phpgw->common->phpgw_header(); - } else - echo ""; - $view = "week"; -?> - - - - - 0) { + 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"); + 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 = mktime(2, 0, 0, $thismonth, $thisday + 7, $thisyear); - $nextyear = date("Y", $next); - $nextmonth = date("m", $next); - $nextday = date("d", $next); + $next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday + 7,$thisyear)); + $prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday - 7,$thisyear)); - $prev = mktime(2, 0, 0, $thismonth, $thisday - 7, $thisyear); - $prevyear = date("Y", $prev); - $prevmonth = date("m", $prev); - $prevday = date("d", $prev); + $nextmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear)); + $prevmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear)); - // We add 2 hours on to the time so that the switch to DST doesn't - // throw us off. So, all our dates are 2AM for that day. - $sun = get_sunday_before($thisyear, $thismonth, $thisday) + 7200; - $sat = $sun + (3600 * 24 * 7); + $sun = $phpgw->calendar->splitdate($phpgw->calendar->get_sunday_before($thisyear, $thismonth, $thisday) + 7200); + $sat = $phpgw->calendar->splitdate($sun["raw"] + 604800); + + if ($friendly) { + echo ""; + $view = "week"; + } ?> -
"; + echo $phpgw->calendar->pretty_small_calendar($thisday,$prev["month"],$prev["year"],"day.php"); echo ""; + echo $phpgw->calendar->pretty_small_calendar($thisday,$next["month"],$next["year"],"day.php"); echo "
- + + + +
+ +"; + echo $phpgw->calendar->pretty_small_calendar($thisday,$prevmonth["month"],$prevmonth["year"],"day.php"); + echo ""; + echo ""; + echo " +"; + if (!$friendly) + echo "link("week.php","year=".$next["year"]."&month=".$next["month"]."&day=".$next["day"])."\">"; + echo ">>"; + if(!friendly) echo ""; + echo ""; + echo ""; +?> + +
"; + if (!$friendly) + echo "link("week.php","year=".$prev["year"]."&month=".$prev["month"]."&day=".$prev["day"])."\">"; + echo "<<"; + if(!friendly) echo ""; + echo ""; + echo $phpgw->calendar->pretty_small_calendar($thisday,$thismonth,$thisyear,"day.php"); +?> +"> + $sat["month"] && $sun["year"] <> $sat["year"]) echo ", ".$sun["year"]; + echo " - "; + if($sun["month"] <> $sat["month"]) echo lang(strftime("%B",$sat["raw"]))." "; + echo $sat["day"].", ".$sat["year"]; +?> + +"> +
+common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]); +?> +
"; + echo $phpgw->calendar->pretty_small_calendar($thisday,$nextmonth["month"],$nextmonth["year"],"day.php"); + echo "
link("week.php","year=$prevyear&month=$prevmonth&day=$prevday")."\"><<"; + echo $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true); + + if (!$friendly) { + $param = ""; + if ($thisyear) + $param .= "year=$thisyear&month=$thismonth&"; + + $param .= "friendly=1"; + echo "link($PHP_SELF,$param)."\" target=\"cal_printer_friendly\" onMouseOver=\"window.status='" + .lang("Generate printer-friendly version")."'\">[" . lang("Printer Friendly") . "]"; + $phpgw->common->phpgw_footer(); } ?> - - - - -db->query("SELECT account_lastname, account_firstname FROM accounts WHERE account_lid='" - . $phpgw_info["user"]["account_lid"]. "'"); - echo "
\n"; - if ($phpgw->db->next_record()) { - if (strlen($phpgw->db->f(0)) || strlen($phpgw->db->f(1))) { - if (strlen($phpgw->db->f(1))) - echo $phpgw->db->f(1) . " "; - if (strlen($phpgw->db->f(0))) - echo $phpgw->db->f(0) . " "; - } else - echo $user; - } -?> -
- -link("week.php","&year=$nextyear&month=$nextmonth&day=$nextday") - . "\">>>"; - } -?> - - - - - - - - - - - - - - - - -nextmatchs->alternate_row_color($CELLBG); - - echo "\n"; - } - -?> - - -
">">">">">">">
"; - else - echo "BGCOLOR=\"$CELLBG\">"; - - print_date_entries($date,$hide_icons,$phpgw_info["user"]["sessionid"]); - - //$date = $i + ($j * 24 * 3600); -/* $thirsday=$j+24*3600*4; - if ($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] == "Sunday" && $j == 0) { - echo 'week ' .(int)((date("z",$thirsday)+7)/7) . ''; - } - if ($phpgw_info["user"]["preferences"]["calendar"]["weekdaystarts"] == "Monday" && $j == 1) { - echo 'week ' . (int)((date("z",$thirsday)+7)/7) . ''; - }*/ - - echo "
- - link("week.php","$yeartext&friendly=1"); - ?>" TARGET="cal_printer_friendly" onMouseOver="window.status = ''">[] - common->phpgw_footer(); -?> diff --git a/calendar/year.php b/calendar/year.php index ed64cc8044..0707c457cb 100755 --- a/calendar/year.php +++ b/calendar/year.php @@ -12,8 +12,10 @@ /* $Id$ */ - if ($friendly) { + if (isset($friendly) && $friendly){ $phpgw_info["flags"]["noheader"] = True; + } else { + $friendly = 0; } $phpgw_info["flags"]["currentapp"] = "calendar"; @@ -28,7 +30,7 @@ link("year.php","year=" . ($year - 1)) . "\"><<"; ?> @@ -42,21 +44,21 @@ ?> - - - - - - - - - - - - - - - + +"; + if(!$friendly) + echo $phpgw->calendar->pretty_small_calendar($i,$i,$year,"day.php"); +// echo $phpgw->calendar->display_small_month($i,$year,False,"day.php"); + else + echo $phpgw->calendar->pretty_small_calendar($i,$i,$year); +// echo $phpgw->calendar->display_small_month($i,$year,False); + echo ""; + if($i==6) echo ""; + } +?>