Skip to content
Merged
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: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
All notable changes to this project will be documented in this file.
## [Unreleased]
- Support Nextcloud 34 (Hub 26 Spring)
- Make modal for sending out confirmations closeable
- Apply time zone to confirmation mail

## [9.1.1] - 2026-05-06
### Fixed
- Fix repairstep which deleted the display names from shares
- Make modal for sending out confirmations closeable

### Changed
- Set default sort to last activity (renamed from last interaction) for poll list, navigation and dashboard
Expand Down
10 changes: 7 additions & 3 deletions lib/Model/Mail/ConfirmationMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace OCA\Polls\Model\Mail;

use DateTimeZone;
use OCA\Polls\AppInfo\Application;
use OCA\Polls\Db\Option;
use OCA\Polls\Db\Poll;
Expand Down Expand Up @@ -47,18 +48,21 @@ protected function buildBody(): void {
$this->l10n->n('Confirmed option:', 'Confirmed options:', count($this->confirmedOptions))
);

$useTimeZoneName = $this->poll->getTimezoneName() ?? $this->recipient->getTimeZoneName();
$useTimeZone = new DateTimeZone($useTimeZoneName);

$localizedDateSpan = new DateTimeIntervalText($this->l10n);

foreach ($this->confirmedOptions as $option) {
if ($this->poll->getType() === Poll::TYPE_DATE) {
$dateTime = $option->getDateTime();
$dateTime = $option->getDateTime()->setTimeZone($useTimeZone);

if ($dateTime->getISO() === null) {
continue;
}

$localizedDateSpan
->setStartDateTime($option->getDateTime())
->setStartDateTime($dateTime)
->setInterval($option->getInterval());

$this->emailTemplate->addBodyListItem(
Expand All @@ -72,7 +76,7 @@ protected function buildBody(): void {

if ($this->poll->getType() === Poll::TYPE_DATE) {
$this->emailTemplate->addBodyText(
$this->l10n->t('The used time zone is "%s", based on the detected time zone at your registration time. To view the times in your current time zone, enter the poll by clicking the button below.', $this->recipient->getTimeZoneName())
$this->l10n->t('The used time zone is "%s". To view the times in your current time zone, enter the poll by clicking the button below.', $useTimeZoneName)
);
}

Expand Down
13 changes: 5 additions & 8 deletions lib/Model/UserBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
use OCA\Polls\Model\User\User;
use OCA\Polls\UserSession;
use OCP\Collaboration\Collaborators\ISearch;
use OCP\IDateTimeZone;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\Share\IShare;
Expand Down Expand Up @@ -69,7 +68,6 @@ class UserBase implements JsonSerializable {
protected string $description = '';
protected string $richObjectType = self::TYPE_USER;
protected string $organisation = '';
protected IDateTimeZone $timeZone;
protected IGroupManager $groupManager;
protected IL10N $l10n;
protected UserSession $userSession;
Expand All @@ -86,7 +84,6 @@ public function __construct(
) {
$this->l10n = Container::getL10N();
$this->groupManager = Container::queryClass(IGroupManager::class);
$this->timeZone = Container::queryClass(IDateTimeZone::class);
$this->userSession = Container::queryClass(UserSession::class);
$this->appSettings = Container::queryClass(AppSettings::class);
}
Expand Down Expand Up @@ -172,14 +169,14 @@ public function getLocaleCodeIntl(): string {
}

public function getTimeZone(): DateTimeZone {
if ($this->timeZoneName) {
return new DateTimeZone($this->timeZoneName);
}
return new DateTimeZone($this->timeZone->getTimeZone()->getName());
return new DateTimeZone($this->timeZoneName);
}

public function getTimeZoneName(): string {
return $this->timeZoneName;
if ($this->timeZoneName) {
return $this->timeZoneName;
}
return date_default_timezone_get();
}

public function getDisplayName(): string {
Expand Down
Loading