update with latest changes and DE translations

This commit is contained in:
2022-01-16 20:10:06 +01:00
parent e583fc62dd
commit ee351b44b1
10 changed files with 928 additions and 150 deletions

View File

@@ -3,6 +3,7 @@
class EventEntity { class EventEntity {
var $calendar_name; var $calendar_name;
var $calendar_description;
var $event_name; var $event_name;
var $location; var $location;
var $description; var $description;
@@ -24,6 +25,20 @@ class EventEntity {
$this->calendar_name = $calendar_name; $this->calendar_name = $calendar_name;
} }
/**
* @return mixed
*/
public function getCalendarDescription() {
return $this->calendar_description;
}
/**
* @param mixed $calendar_description
*/
public function setCalendarDescription($calendar_description) {
$this->calendar_description = $calendar_description;
}
/** /**
* @return mixed * @return mixed
*/ */

View File

@@ -35,7 +35,7 @@ class GoogleCalendarService {
); );
try { try {
Log::debug('G-Calendar: Call google with #getCalendar.'); Log::debug('G-Calendar: Call google with #getCalendar for calendar with id: ' . $calendarId);
$response = $this->service->events->listEvents($calendarId, $params); $response = $this->service->events->listEvents($calendarId, $params);
Cache::put($this->cacheKeyCalendarGet.$calendarId, $response, $cacheTime); Cache::put($this->cacheKeyCalendarGet.$calendarId, $response, $cacheTime);

View File

@@ -71,6 +71,7 @@ class Upcoming extends ComponentBase {
$eventObject = new EventEntity(); $eventObject = new EventEntity();
$eventObject->setCalendarName($calendarEvent->summary); $eventObject->setCalendarName($calendarEvent->summary);
$eventObject->setEventName($event->summary); $eventObject->setEventName($event->summary);
$eventObject->setCalendarDescription($calendarEvent->description);
$eventObject->setLocation($event->location); $eventObject->setLocation($event->location);
$eventObject->setDescription($event->description); $eventObject->setDescription($event->description);
$eventObject->setStartTime($event->start->dateTime); $eventObject->setStartTime($event->start->dateTime);

779
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
<?php namespace NicoSt\GCalendar\FormWidgets;
use Backend\Classes\FormWidgetBase;
use Cache;
use Log;
use Flash;
use Lang;
use NicoSt\GCalendar\Models\Settings;
class ClearCacheButton extends FormWidgetBase {
protected $defaultAlias = 'clearCacheButton';
private $cacheKeyCalendarList = 'GCalendar-CalendarList';
private $cacheKeyCalendarGet = 'GCalendar-CalendarGet#';
public function render() {
return $this->makePartial('clearCacheButton');
}
// Clear cache for all saved calendars
public function onClearCache() {
$calendarSelectors = Settings::get('calendar_selector', []);
foreach ($calendarSelectors as &$selector) {
Cache::forget($this->cacheKeyCalendarGet.$selector['id']);
}
Cache::forget($this->cacheKeyCalendarList);
Log::info('G-Calendar: Cache cleared!');
Flash::success(Lang::get('nicost.gcalendar::lang.widget.clearCacheButton.success'));
}
}

View File

@@ -0,0 +1,5 @@
<button type="button"
data-request="onClearCache"
class="btn btn-default">
<?= e(trans('nicost.gcalendar::lang.widget.clearCacheButton.buttonText')) ?>
</button>

View File

@@ -3,8 +3,159 @@
'name' => 'G-Calendar', 'name' => 'G-Calendar',
'description' => 'Kalender Plugin basierend auf der Google API.', 'description' => 'Kalender Plugin basierend auf der Google API.',
], ],
'component' => [
'upcoming' => [
'name' => 'Bevorstehende Termine',
'description' => 'Listet alle bevorstehenden Termine.'
],
'embeddedCalendar' => [
'name' => 'Eingebetteter Kalender',
'description' => 'Eingebetteter Google Kalender.',
'groups' => [
'calendars' => 'Kalender',
'toggleElements' => 'Toggle Elements'
],
'properties' => [
'calendarTitle' => [
'title' => 'Kalender Title'
],
'width' => [
'title' => 'Breite',
'validationMessage' => 'Die Breite muss Numerisch sein und darf nicht mehr als vier Ziffern umfassen.'
],
'height' => [
'title' => 'Höhe',
'validationMessage' => 'Die Höhe muss Numerisch sein und darf nicht mehr als vier Ziffern umfassen.'
],
'timezone' => [
'title' => 'Zeitzone'
],
'language' => [
'title' => 'Sprache'
],
'viewMode' => [
'title' => 'Anzeigemodus',
'placeholder' => 'Wähle einen Anzeigemodus',
'description' => 'Wähle "Dynamisch" um die "Agenda Ansicht" für Mobile Geräte und die "Monatsansicht" für Desktop zu nutzen.',
'month' => 'Monatsansicht',
'week' => 'Wochenansicht',
'agenda' => 'Agenda Ansicht',
'dynamic' => 'Dynamisch'
],
'weekStart' => [
'title' => 'Woche starte am:',
'sat' => 'Samstag',
'sun' => 'Sonntag',
'mon' => 'Montag'
],
'bgcolor' => [
'title' => 'Hintergrundfarbe',
'description' => 'Definiert die Hintergrundfarbe des Kopfbereichs.',
'validationMessage' => 'Hintergrundfarbe muss als Hexadecimal Code angegeben werden.'
],
'showTitle' => [
'title' => 'Titel Anzeigen'
],
'showPrint' => [
'title' => 'Drucker Optionen Anzeigen'
],
'showTimezone' => [
'title' => 'Zeitzone Anzeigen'
],
'showNav' => [
'title' => 'Navigation Anzeigen'
],
'showDate' => [
'title' => 'Datum Anzeigen'
],
'showTabs' => [
'title' => 'Tabs Anzeigen'
],
'showCalendarList' => [
'title' => 'Kalender Liste Anzeigen'
],
]
]
],
'widget' => [
'clearCacheButton' => [
'buttonText' => 'Cache löschen',
'success' => 'Cache wurde gelöscht!'
]
],
'settings' => [ 'settings' => [
'label' => 'G-Calendar', 'label' => 'G-Calendar',
'description' => 'Einstellungen für das G-Kalender Plugin' 'description' => 'Einstellungen für das G-Calendar Plugin.',
'tab' => [
'client' => 'Client Konfiguration',
'calendars' => 'Kalender',
'settings' => 'Einstellungen'
], ],
'fields' => [
'applicationName' => [
'label' => 'Anzeigename',
'comment' => 'Optional.'
],
'clientId' => [
'label' => 'Client ID',
'comment' => 'Die "Client ID" steht in den "OAuth Credentials". (https://console.cloud.google.com/apis/credentials)'
],
'clientSecret' => [
'label' => 'Client Secret',
'comment' => 'Der "Client Secret" code steht in den "OAuth Credentials". (https://console.cloud.google.com/apis/credentials)'
],
'accessToken' => [
'label' => 'Access Token',
'comment' => 'Wird automatisch beim Speichern der "Client ID" und "Client Secret" generiert.'
],
'cacheTime' => [
'label' => 'Google Calendar API Cache.',
'comment' => 'Anfragen an die Google Calendar API werden zwischengespeichert um die Anzahl der Anfragen zu reduzieren. (\'0\') um den Cache zu deaktivieren. (Angabe in Minuten)'
],
'section' => [
'accessToken' => 'Access Token',
'cacheControl' => 'Cache Einstellungen',
'notification' => 'Benachrichtigung'
],
'notification' => [
'switch' => [
'label' => 'Benachrichtigung Einblenden',
'on' => 'An',
'off' => 'Aus'
],
'text' => [
'label' => 'Nachricht'
]
]
],
'button' => [
'requestToken' => 'Access Token Anfragen',
'clearToken' => 'Access Token Löschen'
],
'calendarList' => [
'emptyList' => 'Kein Kalender gefunden. Verbinde G-Calendar mit deinem Google Account um deine Kalender hier anzuzeigen.',
'columnName' => 'Name',
'columnRole' => 'Rolle',
'columnId' => 'ID'
],
'gaccess' => [
'text' => 'Klicke auf den unten stehenden Link um G-Calendar zugriff auch deine Kalender zu gewähren.',
'button' => 'Zugriff Gewähren.'
],
'oauth' => [
'tokenNotValid' => 'Access Token <b>ungültig</b>.',
'tokenValid' => 'Access Token gültig.'
]
],
'message' => [
'accessTokenNotExpired' => 'Access Token nicht abgelaufen.',
'accessTokenRemoved' => 'Access Token erfolgreich entfernt.'
]
]; ];

View File

@@ -1,7 +1,7 @@
<?php return [ <?php return [
'plugin' => [ 'plugin' => [
'name' => 'G-Calendar', 'name' => 'G-Calendar',
'description' => 'Calendar plugin which uses the google API.', 'description' => 'Calendar plugin which uses the google API.'
], ],
'component' => [ 'component' => [
@@ -18,21 +18,21 @@
], ],
'properties' => [ 'properties' => [
'calendarTitle' => [ 'calendarTitle' => [
'title' => 'Calendar Title', 'title' => 'Calendar Title'
], ],
'width' => [ 'width' => [
'title' => 'Width', 'title' => 'Width',
'validationMessage' => 'The width must be numeric and not longer than 4 characters.', 'validationMessage' => 'The width must be numeric and not longer than 4 characters.'
], ],
'height' => [ 'height' => [
'title' => 'Height', 'title' => 'Height',
'validationMessage' => 'The height must be numeric and not longer than 4 characters.', 'validationMessage' => 'The height must be numeric and not longer than 4 characters.'
], ],
'timezone' => [ 'timezone' => [
'title' => 'Timezone', 'title' => 'Timezone'
], ],
'language' => [ 'language' => [
'title' => 'Language Code', 'title' => 'Language Code'
], ],
'viewMode' => [ 'viewMode' => [
'title' => 'View Mode', 'title' => 'View Mode',
@@ -55,31 +55,38 @@
'validationMessage' => 'Background color must be a hexadecimal color code.' 'validationMessage' => 'Background color must be a hexadecimal color code.'
], ],
'showTitle' => [ 'showTitle' => [
'title' => 'Show Title', 'title' => 'Show Title'
], ],
'showPrint' => [ 'showPrint' => [
'title' => 'Show Print Option', 'title' => 'Show Print Option'
], ],
'showTimezone' => [ 'showTimezone' => [
'title' => 'Show Timezone', 'title' => 'Show Timezone'
], ],
'showNav' => [ 'showNav' => [
'title' => 'Show Navigation', 'title' => 'Show Navigation'
], ],
'showDate' => [ 'showDate' => [
'title' => 'Show Date', 'title' => 'Show Date'
], ],
'showTabs' => [ 'showTabs' => [
'title' => 'Show Tabs', 'title' => 'Show Tabs'
], ],
'showCalendarList' => [ 'showCalendarList' => [
'title' => 'Show Calendar List', 'title' => 'Show Calendar List'
], ],
] ]
] ]
], ],
'widget' => [
'clearCacheButton' => [
'buttonText' => 'Clear Cache',
'success' => 'Cache cleared!'
]
],
'settings' => [ 'settings' => [
'label' => 'G-Calendar', 'label' => 'G-Calendar',
'description' => 'Settings for G-Calendar plugin', 'description' => 'Settings for G-Calendar plugin',
@@ -96,11 +103,11 @@
], ],
'clientId' => [ 'clientId' => [
'label' => 'Client ID', 'label' => 'Client ID',
'comment' => 'The Client ID can be found in the OAuth Credentials under Service Account.' 'comment' => 'The Client ID can be found in the OAuth Credentials under Service Account. (https://console.cloud.google.com/apis/credentials)'
], ],
'clientSecret' => [ 'clientSecret' => [
'label' => 'Client Secret', 'label' => 'Client Secret',
'comment' => 'The Client Secret key can be found in the OAuth Credentials.' 'comment' => 'The Client Secret can be found in the OAuth Credentials. (https://console.cloud.google.com/apis/credentials)'
], ],
'accessToken' => [ 'accessToken' => [
'label' => 'Access Token', 'label' => 'Access Token',
@@ -111,8 +118,20 @@
'comment' => 'Cache Google Calendar API requests in minutes. Enter \'0\' to disable caching.' 'comment' => 'Cache Google Calendar API requests in minutes. Enter \'0\' to disable caching.'
], ],
'section' => [ 'section' => [
'accessToken' => 'Access Token' 'accessToken' => 'Access Token',
'cacheControl' => 'Cache control',
'notification' => 'Notification'
], ],
'notification' => [
'switch' => [
'label' => 'Display Notification',
'on' => 'On',
'off' => 'Off'
],
'text' => [
'label' => 'Notification Content'
]
]
], ],
'button' => [ 'button' => [

View File

@@ -1,7 +1,7 @@
tabs: tabs:
fields: fields:
# Tab: Google Client # Tab: Client Configuration
application_name: application_name:
label: 'nicost.gcalendar::lang.settings.fields.applicationName.label' label: 'nicost.gcalendar::lang.settings.fields.applicationName.label'
tab: 'nicost.gcalendar::lang.settings.tab.client' tab: 'nicost.gcalendar::lang.settings.tab.client'
@@ -14,12 +14,14 @@ tabs:
type: text type: text
comment: 'nicost.gcalendar::lang.settings.fields.clientId.comment' comment: 'nicost.gcalendar::lang.settings.fields.clientId.comment'
span: left span: left
required: true
client_secret: client_secret:
label: 'nicost.gcalendar::lang.settings.fields.clientSecret.label' label: 'nicost.gcalendar::lang.settings.fields.clientSecret.label'
tab: 'nicost.gcalendar::lang.settings.tab.client' tab: 'nicost.gcalendar::lang.settings.tab.client'
type: text type: text
comment: 'nicost.gcalendar::lang.settings.fields.clientSecret.comment' comment: 'nicost.gcalendar::lang.settings.fields.clientSecret.comment'
span: left span: left
required: true
google_oauth: google_oauth:
label: 'nicost.gcalendar::lang.settings.fields.section.accessToken' label: 'nicost.gcalendar::lang.settings.fields.section.accessToken'
tab: 'nicost.gcalendar::lang.settings.tab.client' tab: 'nicost.gcalendar::lang.settings.tab.client'
@@ -28,10 +30,16 @@ tabs:
tab: 'nicost.gcalendar::lang.settings.tab.client' tab: 'nicost.gcalendar::lang.settings.tab.client'
type: NicoSt\GCalendar\FormWidgets\OAuth type: NicoSt\GCalendar\FormWidgets\OAuth
# Tab: Calendars
calendar_selector: calendar_selector:
tab: 'nicost.gcalendar::lang.settings.tab.calendars' tab: 'nicost.gcalendar::lang.settings.tab.calendars'
type: NicoSt\GCalendar\FormWidgets\CalendarSelector type: NicoSt\GCalendar\FormWidgets\CalendarSelector
# Tab: Settings
cache_control:
label: 'nicost.gcalendar::lang.settings.fields.section.cacheControl'
tab: 'nicost.gcalendar::lang.settings.tab.settings'
type: section
cache_time: cache_time:
label: 'nicost.gcalendar::lang.settings.fields.cacheTime.label' label: 'nicost.gcalendar::lang.settings.fields.cacheTime.label'
tab: 'nicost.gcalendar::lang.settings.tab.settings' tab: 'nicost.gcalendar::lang.settings.tab.settings'
@@ -39,3 +47,26 @@ tabs:
type: number type: number
span: left span: left
default: 15 default: 15
clear_cache:
tab: 'nicost.gcalendar::lang.settings.tab.settings'
type: NicoSt\GCalendar\FormWidgets\ClearCacheButton
notification:
label: 'nicost.gcalendar::lang.settings.fields.section.notification'
tab: 'nicost.gcalendar::lang.settings.tab.settings'
type: section
notification_show:
label: 'nicost.gcalendar::lang.settings.fields.notification.switch.label'
tab: 'nicost.gcalendar::lang.settings.tab.settings'
type: switch
on: nicost.gcalendar::lang.settings.fields.notification.switch.on
off: nicost.gcalendar::lang.settings.fields.notification.switch.off
notification_text:
label: 'nicost.gcalendar::lang.settings.fields.notification.text.label'
tab: 'nicost.gcalendar::lang.settings.tab.settings'
type: richeditor
size: huge
toolbarButtons: bold|italic|underline||insertLink||undo|redo||html
trigger:
action: show
field: notification_show
condition: checked