Nur mal zur Info: Ich habe immer noch keine Lösung, um den EGroupware-Kalender mobil richtig anzeigen zu lassen, habe mich damit aber auch nicht mehr weiter beschäftigt. Ein eigener VPS oder so lohnt sich nicht. Änderungen am Kalender werden bei mir nur am Desktop gemacht. Für den mobilen Zugriff, verwende ich folgendes Script, das natürlich gerne kopiert und weiterverwendet werden kann:
<?php
try {
$pdo = new PDO(
'mysql:host=myhost;
dbname=mydatabase;port=3306',
'myuser',
'mypassword',
array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
} catch (PDOException $e) {
echo 'Fehler!';
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Terminübersicht</title>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="expires" content="5">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<style>
html, body {
font-size:16px;
line-height:25px;
font-family:Helvetica,Arial;
-webkit-text-size-adjust:100%;
}
.date {
font-weight:bold;
color:red;
font-size:18px;
}
.title {
font-weight:bold;
}
.modified {
font-style:italic;
margin-bottom:10px;
}
hr {
border-style:solid;
}
select {
padding-left:5px;
font-size:16px;
margin-top:10px;
margin-bottom:15px;
width:260px;
height:35px;
border-width:1px;
border-color:black;
border-radius:5px;
border-style:solid;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
background-color:white;
}
a {
color:black;
text-decoration:underline;
}
div {
page-break-inside:avoid;
}
input {
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
border-width:1px;
border-color:black;
border-radius:5px;
border-style:solid;
margin-bottom:15px;
font-size:16px;
height:35px;
}
input.calender {
padding-left:5px;
margin-left:10px;
width:75px;
background-color:white;
display:none;
}
form.calender {
text-align:center;
}
</style>
<noscript><style>input.calender{display:inline;}</style></noscript>
</head>
<body>
<?php
setlocale(LC_ALL, "de_DE.UTF-8");
date_default_timezone_set('Europe/Berlin');
if(isset($_GET['date']) && !empty($_GET['date'])) {
$date = str_replace(array('today','tomorrow','overmorrow'), array(date("Y-m-d"), date("Y-m-d", strtotime("tomorrow")), date("Y-m-d", strtotime("tomorrow + 1 day"))), $_GET['date']);
} else {
$date = date("Y-m-d");
}
?>
<form method="get" action="" class="calender">
<select name="date" onchange='if(this.value != 0) { this.form.submit(); }'>
<?php
echo "
<option ".($_GET['date'] == "today" ? "selected=\"\" ":"")."value=\"today\">".strftime("%e. %B %Y",time())." (heute)</option>
<option ".($_GET['date'] == "tomorrow" ? "selected=\"\" ":"")."value=\"tomorrow\">".strftime("%e. %B %Y",strtotime("tomorrow"))." (morgen)</option>
<option ".($_GET['date'] == "overmorrow" ? "selected=\"\" ":"")."value=\"overmorrow\">".strftime("%e. %B %Y",strtotime("tomorrow + 1 day"))." (übermorgen)</option>
<option ".($_GET['date'] == strftime("%Y-%m-%d",strtotime("tomorrow + 2 day")) ? "selected=\"\" ":"")."value=\"".strftime("%Y-%m-%d",strtotime("tomorrow + 2 day"))."\">".strftime("%e. %B %Y (%A)",strtotime("tomorrow + 2 day"))."</option>
<option ".($_GET['date'] == strftime("%Y-%m-%d",strtotime("tomorrow + 3 day")) ? "selected=\"\" ":"")."value=\"".strftime("%Y-%m-%d",strtotime("tomorrow + 3 day"))."\">".strftime("%e. %B %Y (%A)",strtotime("tomorrow + 3 day"))."</option>
<option ".($_GET['date'] == strftime("%Y-%m-%d",strtotime("tomorrow + 4 day")) ? "selected=\"\" ":"")."value=\"".strftime("%Y-%m-%d",strtotime("tomorrow + 4 day"))."\">".strftime("%e. %B %Y (%A)",strtotime("tomorrow + 4 day"))."</option>
<option ".($_GET['date'] == strftime("%Y-%m-%d",strtotime("tomorrow + 5 day")) ? "selected=\"\" ":"")."value=\"".strftime("%Y-%m-%d",strtotime("tomorrow + 5 day"))."\">".strftime("%e. %B %Y (%A)",strtotime("tomorrow + 5 day"))."</option>
"?>
<input type="submit" value="Öffnen…" class="calender">
</select>
</form>
<?php
function link_website($string) {
$string = preg_replace('/((http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?)/', '<a href="\1" target="_blank">\1</a>', $string);
return $string;
}
$stmt = $pdo->prepare('SELECT * FROM egw_cal WHERE cal_owner = 7 AND FROM_UNIXTIME(range_start,"%Y-%m-%d") = :date AND cal_deleted IS NULL ORDER BY range_start');
$stmt->execute(array(':date' => $date));
$results = $stmt->fetchAll();
if(empty($results)) {
echo "<span class=\"date\">Für diesen Tag sind keine Termine eingetragen!</span><br>";
} else {
foreach( $results as $row ) {
echo "<div>";
echo "<span class=\"date\">".date('G:i',$row['range_start'])." Uhr - ".date('G:i',$row['range_end'])." Uhr (".(($row['range_end']-$row['range_start'])/3600)." Stunde/n)</span><br>";
echo "<span class=\"title\">".link_website($row['cal_title'])."</span><br>";
if(!empty($row['cal_location'])){echo link_website($row['cal_location'])."<br>";}
if(!empty($row['cal_description'])){echo nl2br(link_website($row['cal_description']))."<br>";}
echo "</div>";
echo "<hr>";
}
}
?>
<?php
$stmt = $pdo->prepare('SELECT * FROM egw_cal WHERE cal_owner = 7 AND FROM_UNIXTIME(range_start,"%Y-%m-%d") = :date ORDER BY cal_modified DESC LIMIT 1');
$stmt->execute(array(':date' => $date));
$results = $stmt->fetchAll();
foreach( $results as $row ) {echo "<span class=\"modified\">Zuletzt bearbeitet: ".strftime("%e. %B %Y, %k:%M:%S Uhr",$row['cal_modified'])."</span><br>";}
echo "<span class=\"modified\">Stand: ".strftime("%e. %B %Y, %k:%M:%S Uhr",time())."</span>";
?>
</body>
</html>
Das Script ist für hier etwas gekürzt. Außerdem ist die Config natürlich nicht wirklich direkt im Script.