Kalender
Update: * Suche wurde angepasst
This commit is contained in:
@@ -43,6 +43,23 @@ class CalendarModel
|
||||
|
||||
public static $specialCalendarColors = array(997 => '#bd0000', 998 => '#8000A3', 999 => '#08769b');
|
||||
|
||||
public static function convertToSummertime($timestamp)
|
||||
{
|
||||
// Create a DateTime object from the Unix timestamp
|
||||
$date = new DateTime();
|
||||
$date->setTimestamp($timestamp);
|
||||
|
||||
// Set the timezone to Europe/Berlin
|
||||
$date->setTimezone(new DateTimeZone('Europe/Berlin'));
|
||||
if ($date->format('I') == 1) {
|
||||
$cest = 7200;
|
||||
} else {
|
||||
$cest = 3600;
|
||||
}
|
||||
$unixtimestamp = $date->getTimestamp() + $cest;
|
||||
// Format the date and time
|
||||
return date('Y-m-d H:i:s', $unixtimestamp);
|
||||
}
|
||||
|
||||
public static function replace_unicode_sequences($string)
|
||||
{
|
||||
@@ -96,16 +113,18 @@ class CalendarModel
|
||||
|
||||
$rows = array();
|
||||
while ($data = $dbcal->fetch_array($res)) {
|
||||
if ($data['location']) {
|
||||
$searchName = $data['name'] . " @" . $data['location'];
|
||||
} else {
|
||||
$searchName = $data['name'];
|
||||
if ($data['private'] != 1 || $data['calendar_id'] == $r->cal_id) {
|
||||
if ($data['location']) {
|
||||
$searchName = $data['name'] . " @" . $data['location'];
|
||||
} else {
|
||||
$searchName = $data['name'];
|
||||
}
|
||||
$id = $data['id'] . ";" . date("Y-m-d", $data['start_time']);
|
||||
$rows[] = array(
|
||||
'id' => $id,
|
||||
'text' => $searchName . " (" . date("Y-m-d", $data['start_time']) . ")"
|
||||
);
|
||||
}
|
||||
$id = $data['id'] . ";" . date("Y-m-d", $data['start_time']);
|
||||
$rows[] = array(
|
||||
'id' => $id,
|
||||
'text' => $searchName . " (" . date("Y-m-d", $data['start_time']) . ")"
|
||||
);
|
||||
}
|
||||
$json['incomplete_results'] = false;
|
||||
$json['total_count'] = count($rows);
|
||||
@@ -195,7 +214,11 @@ class CalendarModel
|
||||
|
||||
if ($data['recurrence']) {
|
||||
$recurrence = json_decode($data['recurrence'], true);
|
||||
$rrule_events= json_decode($data['rrule_events'], true);
|
||||
$rrule_events = json_decode($data['rrule_events'], true);
|
||||
foreach ($rrule_events as $key => $value) {
|
||||
$rrule_events[$key]['start'] = self::convertToSummertime(strtotime($value['start']));
|
||||
$rrule_events[$key]['end'] = self::convertToSummertime(strtotime($value['end']));
|
||||
}
|
||||
if ($rrulefreq[$recurrence['pattern']['type']]) {
|
||||
unset ($byweekday);
|
||||
$freq = $rrulefreq[$recurrence['pattern']['type']];
|
||||
@@ -237,19 +260,19 @@ class CalendarModel
|
||||
$txtcolor = "#000";
|
||||
$colorCounter++;
|
||||
}
|
||||
$location=$data['location'];
|
||||
$eventtype=$data['event_type'];
|
||||
$description=$data['description'];
|
||||
$location = $data['location'];
|
||||
$eventtype = $data['event_type'];
|
||||
$description = $data['description'];
|
||||
if ($calenderRights[$data['calendar_id']]) {
|
||||
$rights = $calenderRights[$data['calendar_id']];
|
||||
$CalendarUsers[$data['calendar_id']] = $data['calendar_name'];
|
||||
if ($data['private']==1 && $calendar[0]->go_calendar_id != $data['calendar_id']) {
|
||||
if ($data['private'] == 1 && $calendar[0]->go_calendar_id != $data['calendar_id']) {
|
||||
$name = "Privat";
|
||||
$attachment = 0;
|
||||
$attachmentLinks = "";
|
||||
$location="";
|
||||
$eventtype="1";
|
||||
$description="";
|
||||
$location = "";
|
||||
$eventtype = "1";
|
||||
$description = "";
|
||||
}
|
||||
$rows[] = array(
|
||||
'id' => array('id' => $data['id']),
|
||||
@@ -552,7 +575,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$busy = ($r->busy);
|
||||
$users = ($r->users);
|
||||
$attendees = ($r->attendees);
|
||||
$privateflag=($r->privateflag);
|
||||
$privateflag = ($r->privateflag);
|
||||
foreach ($users as $key => $value) {
|
||||
$user_id = $value;
|
||||
}
|
||||
@@ -750,7 +773,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$users = ($r->users);
|
||||
$customer_info_reminder_check = 0;
|
||||
$attendees = ($r->attendees);
|
||||
$privateflag=($r->privateflag);
|
||||
$privateflag = ($r->privateflag);
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
header('Content-Type: application/json');
|
||||
foreach ($users as $key => $value) {
|
||||
|
||||
Reference in New Issue
Block a user