implemented @crti's suggestion to use the calendar/event owners' timezone by default in the link-shared calendar/event display
This commit is contained in:
parent
f3cb94ddae
commit
a97f5fc113
2 changed files with 11 additions and 2 deletions
12
lib/app.php
12
lib/app.php
|
@ -343,10 +343,18 @@ class OC_Calendar_App{
|
|||
if (\OC::$session->exists('public_link_timezone')) {
|
||||
// aye, using that
|
||||
return \OC::$session->get('public_link_timezone');
|
||||
|
||||
|
||||
// is it a shared calendar or event??
|
||||
} elseif (\OC::$session->exists('public_link_owner')) {
|
||||
// let's try to get the shared calendar
|
||||
return OCP\Config::getUserValue(\OC::$session->get('public_link_owner'),
|
||||
'calendar',
|
||||
'timezone',
|
||||
date_default_timezone_get());
|
||||
|
||||
// nope!
|
||||
} else {
|
||||
// use the default
|
||||
// use the default already!
|
||||
return date_default_timezone_get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ if (isset($rootLinkItem)) {
|
|||
$url = OCP\Util::linkToPublic('calendar') . '&t=' . $token;
|
||||
// let's set the token in the session for further reference
|
||||
\OC::$session->set('public_link_token', $token);
|
||||
\OC::$session->set('public_link_owner', $linkItem['uid_owner']);
|
||||
|
||||
// do we have a password on this share?
|
||||
if (isset($linkItem['share_with'])) {
|
||||
|
|
Loading…
Reference in a new issue