Update:
* resource wurde bei Teilnehmern entfernt
* wenn es keinen Status für die Terminteilnahme gibt wird der busy Status hergenommen ohne Rahmeninformationen
This commit is contained in:
Daniel Spitzer
2024-11-12 11:12:07 +01:00
parent f4766549e7
commit 413b730397
2 changed files with 41 additions and 13 deletions

View File

@@ -43,6 +43,26 @@ class CalendarModel
public static $specialCalendarColors = array(997 => '#bd0000', 998 => '#8000A3', 999 => '#08769b');
public static function replace_unicode_sequences($string)
{
$unicode_map = [
'\u00f6' => 'ö',
'\u00fc' => 'ü',
'\u00e4' => 'ä',
'\u00df' => 'ß',
'\u00e9' => 'é',
'\u00e0' => 'à',
'\u00f3' => 'ó',
// Weitere Unicode-Zuordnungen können hier hinzugefügt werden
];
foreach ($unicode_map as $unicode => $char) {
$string = str_replace($unicode, $char, $string);
}
return $string;
}
public static function dbKalender()
{
if (!TT_CALENDAR_ENABLE) {
@@ -69,12 +89,12 @@ class CalendarModel
foreach ($termExplode as $term) {
$where .= " AND (name LIKE '%" . $term . "%' OR location LIKE '%" . $term . "%') ";
}
$where .= " AND calendar_id IN (" . implode(",",$calendars) . ")";
$where .= " AND calendar_id IN (" . implode(",", $calendars) . ")";
$res = $dbcal->select("cal_events", "id, uuid, calendar_id, user_id, start_time, end_time, timezone, all_day_event, name, description, location, repeat_end_time, reminder, ctime, mtime, muser_id, busy, status, resource_event_id, private, rrule, background, files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type", "1=1 $where ORDER BY name");
$rows=array();
$rows = array();
while ($data = $dbcal->fetch_array($res)) {
if ($data['location']) {
$searchName = $data['name'] . " @" . $data['location'];
@@ -310,20 +330,26 @@ class CalendarModel
$attendees = json_decode($data['attendees'], true);
$organizer = json_decode($data['organizer'], true);
foreach ($attendees as $key => $value) {
if ($key == "required" || $key == "optional") {
foreach ($value as $attendeekey => $attendee) {
// echo $attendee['name'];
if ($attendee['email'] == $organizer['email']) {
foreach ($value as $attendeekey => $attendee) {
$attendee['name'] = self::replace_unicode_sequences($attendee['name']);
if ($attendee['email'] == $organizer['email']) {
} elseif ($Allcalendar[$attendee['name']] && $Allcalendar[$attendee['name']] == $data['calendar_id']) {
} elseif ($Allcalendar[$attendee['name']] && $Allcalendar[$attendee['name']] == $data['calendar_id']) {
} else if ($Allcalendar[$attendee['name']]) {
$AttendeeArray[] = $Allcalendar[$attendee['name']];
} else {
$AttendeeArray[] = $attendee['email'];
} else if ($Allcalendar[$attendee['name']]) {
$AttendeeArray[] = $Allcalendar[$attendee['name']];
} else {
$AttendeeArray[] = $attendee['email'];
}
}
}
}
if (!$data['accepted'] && $data['busy'] == 1) {
$data['accepted']['ok']=1;
$data['accepted']=json_encode($data['accepted']);
}
$rows = array(
'id' => array('id' => $data['id'], 'order' => $data['id']),

View File

@@ -372,10 +372,12 @@ document.addEventListener('DOMContentLoaded', function () {
let accepted = data.data.accepted.accepted;
if (accepted) {
const accept = JSON.parse(accepted);
const datetime = new Date(accept.time * 1000);
const germanDateTime = datetime.toLocaleString('de-DE');
if (accept.time) {
const datetime = new Date(accept.time * 1000);
const germanDateTime = datetime.toLocaleString('de-DE');
$('.accepted-status').prop('title', accept.user + ' (' + germanDateTime + ')');
}
$('.accepted-status').addClass('fa-circle-check');
$('.accepted-status').prop('title', accept.user + ' (' + germanDateTime + ')');
$('.event-accepted').text('Akzeptiert');
} else {
$('.accepted-status').addClass('fa-circle-info');