Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions application/config/google.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
$config['google_client_id'] = Config::GOOGLE_CLIENT_ID;

$config['google_client_secret'] = Config::GOOGLE_CLIENT_SECRET;

$config['google_hide_notes'] = Config::GOOGLE_HIDE_NOTES;

4 changes: 3 additions & 1 deletion application/controllers/Caldav.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public static function sync(string $provider_id): void
}
}

$hide_notes = config('google_hide_notes');

foreach ($caldav_events as $caldav_event) {
if ($caldav_event['status'] === 'CANCELLED') {
continue;
Expand Down Expand Up @@ -258,7 +260,7 @@ public static function sync(string $provider_id): void
'start_datetime' => $caldav_event['start_datetime'],
'end_datetime' => $caldav_event['end_datetime'],
'location' => $caldav_event['location'],
'notes' => $caldav_event['summary'] . ' ' . $caldav_event['description'],
'notes' => $hide_notes ? "External" : $caldav_event['summary'] . ' ' . $caldav_event['description'],
'id_users_provider' => $provider_id,
'id_caldav_calendar' => $caldav_event['id'],
];
Expand Down
4 changes: 3 additions & 1 deletion application/controllers/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public static function sync(string $provider_id = null): void
}
}

$hide_notes = config('google_hide_notes');

foreach ($google_events->getItems() as $google_event) {
if ($google_event->getStatus() === 'cancelled') {
continue;
Expand Down Expand Up @@ -240,7 +242,7 @@ public static function sync(string $provider_id = null): void
'end_datetime' => $google_event_end->format('Y-m-d H:i:s'),
'is_unavailability' => true,
'location' => $google_event->getLocation(),
'notes' => $google_event->getSummary() . ' ' . $google_event->getDescription(),
'notes' => $hide_notes ? "External" : $google_event->getSummary() . ' ' . $google_event->getDescription(),
'id_users_provider' => $provider_id,
'id_google_calendar' => $google_event->getId(),
'id_users_customer' => null,
Expand Down
1 change: 1 addition & 0 deletions config-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ class Config
const GOOGLE_SYNC_FEATURE = false; // Enter TRUE or FALSE
const GOOGLE_CLIENT_ID = '';
const GOOGLE_CLIENT_SECRET = '';
const GOOGLE_HIDE_NOTES = false;
}