mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
fixes for improper calculations of weekdaystarts
This commit is contained in:
parent
1d0e2c5998
commit
c6e22e175f
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True, "enable_template_class" => True);
|
$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"]["noheader"] = True;
|
||||||
$phpgw_info["flags"]["nonavbar"] = True;
|
$phpgw_info["flags"]["nonavbar"] = True;
|
||||||
$phpgw_info["flags"]["nocalendarheader"] = True;
|
$phpgw_info["flags"]["nocalendarheader"] = True;
|
||||||
@ -28,25 +28,6 @@
|
|||||||
|
|
||||||
$view = "day";
|
$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));
|
$now = $phpgw->calendar->splitdate(mktime (2, 0, 0, $thismonth, $thisday, $thisyear));
|
||||||
|
|
||||||
$phpgw->template->set_file(array("day" => "day.tpl"));
|
$phpgw->template->set_file(array("day" => "day.tpl"));
|
||||||
|
@ -1,7 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($phpgw_info["flags"]["nocalendarheader"]) ||
|
if (!isset($phpgw_info["flags"]["nocalendarheader"]) ||
|
||||||
!$phpgw_info["flags"]["nocalendarheader"]) {
|
!$phpgw_info["flags"]["nocalendarheader"]) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<table border="0" width="100%" cellpadding="0" cellspacing="0">
|
<table border="0" width="100%" cellpadding="0" cellspacing="0">
|
||||||
@ -10,17 +34,17 @@
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td width="2%">
|
<td width="2%">
|
||||||
<a href="<?php echo $phpgw->link("day.php","year=".$phpgw->common->show_date(time(),"Y")."&month=".$phpgw->common->show_date(time(),"m")."&day=".$phpgw->common->show_date(time(),"d")); ?>">
|
<a href="<?php echo $phpgw->link("day.php","day=".$phpgw->calendar->today["day"]."&month=".$phpgw->calendar->today["month"]."&year=".$phpgw->calendar->today["year"]); ?>">
|
||||||
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/today.gif" alt="<?php echo lang("Today"); ?>" border="0">
|
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/today.gif" alt="<?php echo lang("Today"); ?>" border="0">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td width="2%" align="left">
|
<td width="2%" align="left">
|
||||||
<a href="<?php echo $phpgw->link("week.php","date=".$phpgw->common->show_date(time(),"Ymd")); ?>">
|
<a href="<?php echo $phpgw->link("week.php","day=".$phpgw->calendar->today["day"]."&month=".$phpgw->calendar->today["month"]."&year=".$phpgw->calendar->today["year"]); ?>">
|
||||||
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/week.gif" alt="<?php echo lang("This week"); ?>" border="0">
|
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/week.gif" alt="<?php echo lang("This week"); ?>" border="0">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td width="2%" align="left">
|
<td width="2%" align="left">
|
||||||
<a href="<?php echo $phpgw->link("index.php","date=".$phpgw->common->show_date(time(),"Ymd")); ?>">
|
<a href="<?php echo $phpgw->link("index.php","day=".$phpgw->calendar->today["day"]."&month=".$phpgw->calendar->today["month"]."&year=".$phpgw->calendar->today["year"]); ?>">
|
||||||
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/month.gif" alt="<?php echo lang("This month"); ?>" border="0">
|
<img src="<?php echo $phpgw_info["server"]["app_images"]; ?>/month.gif" alt="<?php echo lang("This month"); ?>" border="0">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -17,31 +17,14 @@
|
|||||||
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
||||||
if (isset($friendly) && $friendly){
|
if (isset($friendly) && $friendly){
|
||||||
$phpgw_info["flags"]["noheader"] = True;
|
$phpgw_info["flags"]["noheader"] = True;
|
||||||
|
$phpgw_info["flags"]["nonavbar"] = True;
|
||||||
|
$phpgw_info["flags"]["nocalendarheader"] = True;
|
||||||
} else {
|
} else {
|
||||||
$friendly = 0;
|
$friendly = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
include("../header.inc.php");
|
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));
|
$next = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$thisyear));
|
||||||
|
|
||||||
$prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear));
|
$prev = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth - 1,1,$thisyear));
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<table border="0" width="100%">
|
<table border="0" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
@ -17,7 +16,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td align="middle">
|
<td align="middle">
|
||||||
<font size="+2" color="#000000"><b>{month_identifier}</b></font>
|
<font size="+2" color="#000000"><b>{month_identifier}</b></font>
|
||||||
<font color="#000000" size="+1" color="{bg_text}"><br>{username}</font>
|
<font size="+1" color="#000000"><br>{username}</font>
|
||||||
</td>
|
</td>
|
||||||
<td align="right" valign="top">
|
<td align="right" valign="top">
|
||||||
{small_calendar_next}
|
{small_calendar_next}
|
||||||
|
@ -19,12 +19,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td align="center" valign="top">
|
<td align="center" valign="top">
|
||||||
{small_calendar_this}
|
{small_calendar_this}
|
||||||
<font size="+2" color="{bg_text"}">
|
<font size="+2" color="#000000"><b>{week_identifier}</b></font>
|
||||||
<b>{week_identifier}</b>
|
<font size="+2" color="#000000"><br>{username}</font>
|
||||||
</font>
|
|
||||||
<font size="+1" color="{bg_text}"><br>
|
|
||||||
{username}
|
|
||||||
</font>
|
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
{next_week_link}
|
{next_week_link}
|
||||||
|
@ -13,44 +13,25 @@
|
|||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
$phpgw_info["flags"] = array("currentapp" => "calendar", "enable_calendar_class" => True, "enable_nextmatchs_class" => True);
|
||||||
|
|
||||||
if (isset($friendly) && $friendly){
|
if (isset($friendly) && $friendly){
|
||||||
$phpgw_info["flags"]["noheader"] = True;
|
$phpgw_info["flags"]["noheader"] = True;
|
||||||
$phpgw_info["flags"]["nonavbar"] = True;
|
$phpgw_info["flags"]["nonavbar"] = True;
|
||||||
|
$phpgw_info["flags"]["nocalendarheader"] = True;
|
||||||
} else {
|
} else {
|
||||||
$friendly = 0;
|
$friendly = 0;
|
||||||
}
|
}
|
||||||
include("../header.inc.php");
|
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));
|
$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 = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth,$thisday - 7,$thisyear));
|
||||||
|
|
||||||
$nextmonth = $phpgw->calendar->splitdate(mktime(2,0,0,$thismonth + 1,1,$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));
|
$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;
|
$start = 7200;
|
||||||
} else {
|
} else {
|
||||||
$start = 93600;
|
$start = 93600;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user