Kalender
Update: * Neues Feature Private Termine Implementierung
This commit is contained in:
@@ -152,6 +152,7 @@ class CalendarApicontroller extends mfBaseApicontroller
|
||||
$now = floor(microtime(true) * 1000);
|
||||
$timenow = time();
|
||||
while (true) {
|
||||
|
||||
$colors = $redis->get('thetool_calendar_usercolors_' . $decstring);
|
||||
if ($colors) {
|
||||
$calendarColors = json_decode($colors, true);
|
||||
@@ -172,11 +173,15 @@ class CalendarApicontroller extends mfBaseApicontroller
|
||||
$message[0]['start_time'] = date('Y-m-d H:i', $json['start_time']);
|
||||
$message[0]['end_time'] = date('Y-m-d H:i', $json['end_time']);
|
||||
}
|
||||
$message[0]['name']= $Calendarevent['data'][0]['category']['category'];
|
||||
$message[0]['description'] = $Calendarevent['data'][0]['description']['description'];
|
||||
$message[0]['location'] = $Calendarevent['data'][0]['location']['location'];
|
||||
$message[0]['event_type'] = $Calendarevent['data'][0]['event_type']['event_type'];
|
||||
$message[0]['attachment'] = $Calendarevent['data'][0]['attachment']['attachment'];
|
||||
$message[0]['attachments'] = $Calendarevent['data'][0]['attachments']['attachments'];
|
||||
$message[0]['calendar_name'] = $Calendarevent['data'][0]['calendar_name']['calendar_name'];
|
||||
$message[0]['isorganizer'] = $Calendarevent['data'][0]['isorganizer']['isorganizer'];
|
||||
$message[0]['privateflag'] = $Calendarevent['data'][0]['privateflag']['privateflag'];
|
||||
$message[0]['rrule'] = $Calendarevent['data'][0]['rrule']['rrule'];
|
||||
$message[0]['duration'] = $Calendarevent['data'][0]['duration']['duration'];
|
||||
$message[0]['mtime'] = $Calendarevent['data'][0]['mtime']['mtime'];
|
||||
@@ -189,6 +194,7 @@ class CalendarApicontroller extends mfBaseApicontroller
|
||||
$message[0]['bgColor'] = $calendarColors[$json['calendar_id']]['bgcolor'];
|
||||
$message[0]['txtColor'] = $calendarColors[$json['calendar_id']]['txtcolor'];
|
||||
$message[0]['rights'] = $rights[$json['calendar_id']];
|
||||
$message[0]['me'] = $decstring;
|
||||
|
||||
$result = json_encode($message);
|
||||
if (in_array($message[0]['calendar_id'], $allowedCalendar)) {
|
||||
|
||||
@@ -237,9 +237,20 @@ class CalendarModel
|
||||
$txtcolor = "#000";
|
||||
$colorCounter++;
|
||||
}
|
||||
$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']) {
|
||||
$name = "Privat";
|
||||
$attachment = 0;
|
||||
$attachmentLinks = "";
|
||||
$location="";
|
||||
$eventtype="1";
|
||||
$description="";
|
||||
}
|
||||
$rows[] = array(
|
||||
'id' => array('id' => $data['id']),
|
||||
'cstart' => array('cstart' => $starttime),
|
||||
@@ -250,14 +261,15 @@ class CalendarModel
|
||||
'bgColor' => array('bgColor' => $bgcolor),
|
||||
'txtColor' => array('txtColor' => $txtcolor),
|
||||
'rights' => array('rights' => $rights, 'order' => $rights),
|
||||
'location' => array('location' => $data['location']),
|
||||
'location' => array('location' => $location),
|
||||
'busy' => array('busy' => $data['busy']),
|
||||
'privateflag' => array('privateflag' => $data['private']),
|
||||
'allDay' => array('allDay' => $data['all_day_event']),
|
||||
'rrule' => array('rrule' => $rrule),
|
||||
'rrule_events' => array('rrule_events' => $rrule_events),
|
||||
'duration' => array('duration' => $duration),
|
||||
'event_type' => array('event_type' => $data['event_type']),
|
||||
'description' => array('description' => ($data['description'])),
|
||||
'event_type' => array('event_type' => $eventtype),
|
||||
'description' => array('description' => ($description)),
|
||||
'attachment' => array('attachment' => $attachment),
|
||||
'attachments' => array('attachments' => $attachmentLinks),
|
||||
'calendar_name' => array('calendar_name' => $data['calendar_name']),
|
||||
@@ -466,6 +478,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
'customer_info' => array('customer_info' => $data['customer_info']),
|
||||
'customer_info_send' => array('customer_info_send' => $data['customer_info_send']),
|
||||
'customer_info_reminder' => array('customer_info_reminder' => $data['customer_info_reminder']),
|
||||
'privateflag' => array('privateflag' => $data['private'], 'order' => $data['private']),
|
||||
'isorganizer' => array('isorganizer' => $data['is_organizer']),
|
||||
'attendees' => array('attendees' => json_encode($AttendeeArray)),
|
||||
'organizer' => array('organizer' => $data['organizer']),
|
||||
@@ -539,6 +552,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$busy = ($r->busy);
|
||||
$users = ($r->users);
|
||||
$attendees = ($r->attendees);
|
||||
$privateflag=($r->privateflag);
|
||||
foreach ($users as $key => $value) {
|
||||
$user_id = $value;
|
||||
}
|
||||
@@ -573,6 +587,9 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
if (isset($allday))
|
||||
$updateArray['all_day_event'] = $allday;
|
||||
|
||||
if (isset($privateflag))
|
||||
$updateArray['private'] = $privateflag;
|
||||
|
||||
if (isset($reminder)) {
|
||||
if ($reminder == 'NULL')
|
||||
$updateArray['reminder'] = NULL;
|
||||
@@ -733,6 +750,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$users = ($r->users);
|
||||
$customer_info_reminder_check = 0;
|
||||
$attendees = ($r->attendees);
|
||||
$privateflag=($r->privateflag);
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
header('Content-Type: application/json');
|
||||
foreach ($users as $key => $value) {
|
||||
@@ -771,7 +789,7 @@ WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourda
|
||||
$customer_info_send = NULL;
|
||||
}
|
||||
|
||||
$dataarray = array("start_time" => $start, 'end_time' => $end, 'name' => $title, 'description' => $description, 'location' => $location, 'calendar_id' => $user_id, 'uuid' => "a5eb79b3-fca7-5378-a09e-" . rand(100000000000, 999999999999), 'user_id' => 1, 'timezone' => 'Europe/Amsterdam', 'all_day_event' => 0, 'repeat_end_time' => 0, 'reminder' => $reminder, 'ctime' => time(), 'cname' => $me->name, 'mtime' => time(), 'mname' => $me->name, 'user_id' => 1, 'busy' => $busy, 'status' => 'CONFIRMED', 'resource_event_id' => 0, 'private' => 0, 'rrule' => '', 'background' => 'EBF1E2', 'files_folder_id' => 0, 'read_only' => 0, 'exception_for_event_id' => 0, 'recurrence_id' => 0, 'is_organizer' => 1, 'event_type' => $type, 'customer' => $customer, 'customer_info' => $customer_info, 'customer_info_send' => $customer_info_send, 'customer_info_reminder' => $customer_info_reminder_check);
|
||||
$dataarray = array("start_time" => $start, 'end_time' => $end, 'name' => $title, 'description' => $description, 'location' => $location, 'calendar_id' => $user_id, 'uuid' => "a5eb79b3-fca7-5378-a09e-" . rand(100000000000, 999999999999), 'user_id' => 1, 'timezone' => 'Europe/Amsterdam', 'all_day_event' => 0, 'repeat_end_time' => 0, 'reminder' => $reminder, 'ctime' => time(), 'cname' => $me->name, 'mtime' => time(), 'mname' => $me->name, 'user_id' => 1, 'busy' => $busy, 'status' => 'CONFIRMED', 'resource_event_id' => 0, 'private' => $privateflag, 'rrule' => '', 'background' => 'EBF1E2', 'files_folder_id' => 0, 'read_only' => 0, 'exception_for_event_id' => 0, 'recurrence_id' => 0, 'is_organizer' => 1, 'event_type' => $type, 'customer' => $customer, 'customer_info' => $customer_info, 'customer_info_send' => $customer_info_send, 'customer_info_reminder' => $customer_info_reminder_check);
|
||||
|
||||
$db->insert("cal_events", $dataarray);
|
||||
$event_id = $dataarray['uuid'];
|
||||
|
||||
Reference in New Issue
Block a user