From a97f5fc1131c3106b2e3ab11dace025cb91060a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27rysiek=27=20Wo=C5=BAniak?= Date: Thu, 13 Feb 2014 01:16:25 +0100 Subject: [PATCH] implemented @crti's suggestion to use the calendar/event owners' timezone by default in the link-shared calendar/event display --- lib/app.php | 12 ++++++++++-- share.php | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/app.php b/lib/app.php index ce151b79..b4e5e6f3 100644 --- a/lib/app.php +++ b/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(); } } diff --git a/share.php b/share.php index ba657772..16c0aaa8 100644 --- a/share.php +++ b/share.php @@ -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'])) {