Kalender Anpassungen

- Kalender Termin Kopierfeature
This commit is contained in:
Daniel Spitzer
2025-06-09 12:10:16 +02:00
parent 630af363f9
commit 488457ccd8
3 changed files with 113 additions and 11 deletions

View File

@@ -959,8 +959,11 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
$data['create'] = time();
$data['edit_by'] = 89;
$data['create_by'] = 89;
$db->insert("TheTool_CalendarQueue", $data);
if ($r->delete_old_entry) {
CalendarModel::deleteCalendarOldEvent($r->delete_old_entry);
die();
}
}
public static function insertCalendarEventAttachmentTemp($name, $contantType, $content, $size, $newkey)
@@ -1021,6 +1024,36 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
die();
}
public static function deleteCalendarOldEvent($id)
{
date_default_timezone_set('Europe/Berlin');
header('Content-Type: application/json');
$db = self::dbKalender();
$res = $db->select("cal_events", 'id,microsoft_id,user_id,calendar_id', "id = '" . $id . "' LIMIT 1");
if ($db->num_rows($res)) {
$result = $db->fetch_object($res);
$rescal = $db->select("cal_calendars", "id,ms_user_id", "id = '" . $result->calendar_id . "' LIMIT 1");
if ($db->num_rows($res)) {
$resultcal = $db->fetch_object($rescal);
$microsoft_user_id = $resultcal->ms_user_id;
var_dump($resultcal);
}
$data = [];
$data['ms_user_id'] = $microsoft_user_id;
$data['ms_event_id'] = $result->microsoft_id;
$data['type'] = 'd';
$data['status'] = 'p';
$data['edit'] = time();
$data['create'] = time();
$data['edit_by'] = 89;
$data['create_by'] = 89;
$db->insert("TheTool_CalendarQueue", $data);
}
$db->delete("cal_events", "id = '" . $id . "'");
die();
}
public static function cancelCalendarEvent($r, $me)
{
$id = $r->id;