Merge branch 'spidev' into 'master'
Kalender See merge request fronk/thetool!713
This commit is contained in:
@@ -43,6 +43,26 @@ class CalendarModel
|
|||||||
|
|
||||||
public static $specialCalendarColors = array(997 => '#bd0000', 998 => '#8000A3', 999 => '#08769b');
|
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()
|
public static function dbKalender()
|
||||||
{
|
{
|
||||||
if (!TT_CALENDAR_ENABLE) {
|
if (!TT_CALENDAR_ENABLE) {
|
||||||
@@ -69,12 +89,12 @@ class CalendarModel
|
|||||||
foreach ($termExplode as $term) {
|
foreach ($termExplode as $term) {
|
||||||
$where .= " AND (name LIKE '%" . $term . "%' OR location LIKE '%" . $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");
|
$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)) {
|
while ($data = $dbcal->fetch_array($res)) {
|
||||||
if ($data['location']) {
|
if ($data['location']) {
|
||||||
$searchName = $data['name'] . " @" . $data['location'];
|
$searchName = $data['name'] . " @" . $data['location'];
|
||||||
@@ -310,20 +330,26 @@ class CalendarModel
|
|||||||
$attendees = json_decode($data['attendees'], true);
|
$attendees = json_decode($data['attendees'], true);
|
||||||
$organizer = json_decode($data['organizer'], true);
|
$organizer = json_decode($data['organizer'], true);
|
||||||
foreach ($attendees as $key => $value) {
|
foreach ($attendees as $key => $value) {
|
||||||
|
if ($key == "required" || $key == "optional") {
|
||||||
|
|
||||||
foreach ($value as $attendeekey => $attendee) {
|
foreach ($value as $attendeekey => $attendee) {
|
||||||
// echo $attendee['name'];
|
$attendee['name'] = self::replace_unicode_sequences($attendee['name']);
|
||||||
if ($attendee['email'] == $organizer['email']) {
|
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']]) {
|
} else if ($Allcalendar[$attendee['name']]) {
|
||||||
$AttendeeArray[] = $Allcalendar[$attendee['name']];
|
$AttendeeArray[] = $Allcalendar[$attendee['name']];
|
||||||
} else {
|
} else {
|
||||||
$AttendeeArray[] = $attendee['email'];
|
$AttendeeArray[] = $attendee['email'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!$data['accepted'] && $data['busy'] == 1) {
|
||||||
|
$data['accepted']['ok']=1;
|
||||||
|
$data['accepted']=json_encode($data['accepted']);
|
||||||
|
}
|
||||||
|
|
||||||
$rows = array(
|
$rows = array(
|
||||||
'id' => array('id' => $data['id'], 'order' => $data['id']),
|
'id' => array('id' => $data['id'], 'order' => $data['id']),
|
||||||
|
|||||||
@@ -372,10 +372,12 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
let accepted = data.data.accepted.accepted;
|
let accepted = data.data.accepted.accepted;
|
||||||
if (accepted) {
|
if (accepted) {
|
||||||
const accept = JSON.parse(accepted);
|
const accept = JSON.parse(accepted);
|
||||||
const datetime = new Date(accept.time * 1000);
|
if (accept.time) {
|
||||||
const germanDateTime = datetime.toLocaleString('de-DE');
|
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').addClass('fa-circle-check');
|
||||||
$('.accepted-status').prop('title', accept.user + ' (' + germanDateTime + ')');
|
|
||||||
$('.event-accepted').text('Akzeptiert');
|
$('.event-accepted').text('Akzeptiert');
|
||||||
} else {
|
} else {
|
||||||
$('.accepted-status').addClass('fa-circle-info');
|
$('.accepted-status').addClass('fa-circle-info');
|
||||||
|
|||||||
Reference in New Issue
Block a user