';
}
}
diff --git a/src/application/language/english/translations_lang.php b/src/application/language/english/translations_lang.php
index f735c1d9..d0913178 100644
--- a/src/application/language/english/translations_lang.php
+++ b/src/application/language/english/translations_lang.php
@@ -264,3 +264,6 @@ $lang['hour'] = 'Hour';
$lang['minute'] = 'Minute';
$lang['google_sync_completed'] = 'Google synchronization completed successfully!';
$lang['google_sync_failed'] = 'Google synchronization failed: Could not establish server connection.';
+$lang['select_google_calendar'] = 'Select Google Calendar';
+$lang['select_google_calendar_prompt'] = 'Select the calendar that you want to sync your appointments. If you do not want to select a specific calendar the default one will be used.';
+$lang['google_calendar_selected'] = 'Google calendar has been successfully selected!';
\ No newline at end of file
diff --git a/src/application/language/german/translations_lang.php b/src/application/language/german/translations_lang.php
index a45d5344..378332cb 100644
--- a/src/application/language/german/translations_lang.php
+++ b/src/application/language/german/translations_lang.php
@@ -263,4 +263,7 @@ $lang['time'] = 'Zeit';
$lang['hour'] = 'Uhr';
$lang['minute'] = 'Minute';
$lang['google_sync_completed'] = 'Google Synchronisation erfolgreich beendet!';
-$lang['google_sync_failed'] = 'Google Synchronisation fehlgeschlagen: Serververbindung konnte nicht hergestellt werden.';
\ No newline at end of file
+$lang['google_sync_failed'] = 'Google Synchronisation fehlgeschlagen: Serververbindung konnte nicht hergestellt werden.';
+$lang['select_google_calendar'] = 'Wählen Sie Google Kalender';
+$lang['select_google_calendar_prompt'] = 'Wählen Sie den Kalender, den Sie Ihre Termine synchronisieren möchten. Wenn Sie nicht wollen, um einen bestimmten Kalender wählen den Standard, verwendet.';
+$lang['google_calendar_selected'] = 'Google-Kalender ausgewählt wurde erfolgreich!';
\ No newline at end of file
diff --git a/src/application/language/greek/translations_lang.php b/src/application/language/greek/translations_lang.php
index 1cb838e1..4dfa8ff4 100644
--- a/src/application/language/greek/translations_lang.php
+++ b/src/application/language/greek/translations_lang.php
@@ -263,4 +263,7 @@ $lang['time'] = 'Χρόνος';
$lang['hour'] = 'Ώρα';
$lang['minute'] = 'Λεπτά';
$lang['google_sync_completed'] = 'Ο συγχρονισμός με την Google ολοκληρώθηκε επιτυχώς!';
-$lang['google_sync_failed'] = 'Ο συγχρονισμός με την Google απέτυχε: Δεν μπόρεσε να πραγματοποιηθεί σύνδεση με τον server.';
\ No newline at end of file
+$lang['google_sync_failed'] = 'Ο συγχρονισμός με την Google απέτυχε: Δεν μπόρεσε να πραγματοποιηθεί σύνδεση με τον server.';
+$lang['select_google_calendar'] = 'Επιλογή Ημερολογίου της Google';
+$lang['select_google_calendar_prompt'] = 'Επιλέξτε το ημερολόγιο στο οποίο θέλετε να συγχρονίζεται τα ραντεβού σας. Εάν δεν θελήσετε να επιλέξετε ένα συγκεκριμένο ημερολόγιο θα χρησιμοποιηθεί το προεπιλεγμένο.';
+$lang['google_calendar_selected'] = 'Το ημερολόγιο της Google επιλέχθηκε επιτυχώς!';
\ No newline at end of file
diff --git a/src/application/libraries/google_sync.php b/src/application/libraries/google_sync.php
index fce96097..7325aee1 100644
--- a/src/application/libraries/google_sync.php
+++ b/src/application/libraries/google_sync.php
@@ -13,7 +13,7 @@ require_once dirname(dirname(dirname(__FILE__))) . '/configuration.php';
* library.
*/
class Google_Sync {
- private $CI;
+ private $CI;
private $client;
private $service;
@@ -301,11 +301,19 @@ class Google_Sync {
* The given user's token must already exist in db in order to get access to his
* Google Calendar account.
*
- * @param numeric $provider_id The provider's record id.
+ * @param string $google_token The user's token will be used to grant access to google calendar.
* @return array Returns an array with the available calendars.
*/
- public function get_google_calendars($provider_id) {
-
+ public function get_google_calendars() {
+ $calendarList = $this->service->calendarList->listCalendarList();
+ $calendars = array();
+ foreach ($calendarList->items as $google_calendar) {
+ $calendars[] = array(
+ 'id' => $google_calendar->id,
+ 'summary' => $google_calendar->summary
+ );
+ }
+ return $calendars;
}
}
diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php
index 4102b081..084c80c8 100644
--- a/src/application/views/backend/calendar.php
+++ b/src/application/views/backend/calendar.php
@@ -315,7 +315,6 @@