diff --git a/Classes/Controller/DutyRosterController.php b/Classes/Controller/DutyRosterController.php index 626638f..771bc46 100755 --- a/Classes/Controller/DutyRosterController.php +++ b/Classes/Controller/DutyRosterController.php @@ -28,7 +28,7 @@ class DutyRosterController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionContr /** * - * @var EventRepository eventRepository + * @var EventRepository */ private $eventRepository; @@ -55,7 +55,7 @@ private function prepareEvents(array $events) /** @var Event $firstEvent */ $lastEvent = $events[count($events) - 1]; - if ($lastEvent->getBeginTimeStamp() < $now) { + if ($lastEvent->getDateTime()->getTimestamp() < $now) { $afterNow = count($events) * (-1); } else { $afterNow = -1; @@ -66,7 +66,7 @@ private function prepareEvents(array $events) * @var Event $e */ foreach ($events as $e) { - if ($afterNow == -1 && $e->getBeginTimeStamp() > $now) { + if ($afterNow == -1 && $e->getDateTime()->getTimestamp() > $now) { $afterNow = $c; } $c++; @@ -175,7 +175,7 @@ public function reasonsForPreventionAction(string $id): string $visibility = $this->getEventVisiblity($parsedBody); if ($from != null && $until != null) { - return json_encode($this->eventRepository->findEventsAt($this->getStorageUid($id), $from, $until + (24 * 3600), $visibility)); + return json_encode($this->eventRepository->findEventsAt($this->getStorageUid($id), $from, $until, $visibility)); } } @@ -208,16 +208,15 @@ private function getEventVisiblity($parsedBody): int } - private function getValidDate(string $rawDate): string + private function getValidDate(string $rawDate): ?\DateTime { if (preg_match(DutyRosterController::DATE_PATTERN, $rawDate)) { $date = date_parse_from_format('Y-m-d', $rawDate); if (!isset($date['errors']) || count($date['errors']) == 0) { $dt = new \DateTime(); - $dt->setTimezone(new \DateTimeZone('Europe/Berlin')); $dt->setTime(0, 0, 0, 0); $dt->setDate($date['year'], $date['month'], $date['day']); - return $dt->getTimestamp(); + return $dt; } } return null; diff --git a/Classes/Domain/Model/Commitment.php b/Classes/Domain/Model/Commitment.php index ea9e5ed..529ac15 100755 --- a/Classes/Domain/Model/Commitment.php +++ b/Classes/Domain/Model/Commitment.php @@ -58,8 +58,7 @@ public function __construct() * @return void */ protected function initStorageObjects() - { - } + {} /** * Returns the user @@ -170,6 +169,8 @@ public function setEvent($event): void */ public function getIsNotChangable(): bool { - return $this->getEvent()->getBeginTimeStamp() < time(); + return $this->getEvent() + ->getDateTime() + ->getTimestamp() < time(); } -} \ No newline at end of file +} diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index a8510df..d04c6f6 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -10,12 +10,11 @@ * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * - * (c) 2023 C. Gogolin + * (c) 2022 C. Gogolin */ class Event extends AbstractEntity { - - + /** * * @var ObjectStorage @@ -74,15 +73,15 @@ class Event extends AbstractEntity /** * - * @var int + * @var string */ - protected $beginDate = 0 ; + protected $date = '0000-00-00'; /** * - * @var int + * @var string */ - protected $beginTime = 68400; // 19:00 + protected $time = '00:00'; /** * @@ -146,7 +145,6 @@ public function __construct() // Do not remove the next line: It would break the functionality $this->initStorageObjects(); - } /** @@ -327,70 +325,42 @@ public function setFullDay($fullDay): void $this->fullDay = $fullDay; } - - - /** * - * @return int + * @return \DateTime */ - public function getBeginDate(): int + public function getDate(): \DateTime { - return $this->beginDate; + return \DateTime::createFromFormat('Y-m-d', $this->date); } /** * - * @param int $beginDate + * @param \DateTime $date * @return void */ - public function setBeginDate(\DateTime $beginDate): void + public function setDate(\DateTime $date): void { - $this->beginDate = $beginDate; - } - - /** - * - * @return \DateTime - */ - public function getBeginDateUTC(): \DateTime - { - $return = new \DateTime(); - $return->setTimestamp($this->beginDate); - $return->setTimezone(new \DateTimeZone ('UTC')); - return $return; - } - - - /** - * - * @return int - */ - public function getBeginTime(): int - { - return $this->beginTime; + $this->date = $date->format('Y-m-d'); } /** * * @return \DateTime */ - public function getBeginTimeUTC(): \DateTime - { - $return = new \DateTime(); - $return->setTimestamp($this->beginTime); - $return->setTimezone(new \DateTimeZone ('UTC')); - return $return; + public function getTime(): \DateTime + { + return \DateTime::createFromFormat('H:i:s', $this->time); } /** * - * @param int $time + * @param \DateTime $time * @return void */ - public function setTime(int $beginTime): void + public function setTime(\DateTime $time): void { - $this->beginTime = $beginTime; + $this->time = $time->format('H:i:s'); } /** @@ -414,14 +384,13 @@ public function setDuration($duration): void /** * - * @return int + * @return \DateTime */ - public function getBeginTimestamp(): int + public function getDateTime(): \DateTime { - return $this->getFullDay() ? $this->getBeginDate() : $this->getBeginDate() + $this->getBeginTime(); + return $this->getFullDay() ? \DateTime::createFromFormat('Y-m-d', $this->date)->setTime(0, 0) : \DateTime::createFromFormat('Y-m-d H:i:s', $this->date . ' ' . $this->time); } - /** * * @return void diff --git a/Classes/Domain/Model/FrontendUserGroup.php b/Classes/Domain/Model/FrontendUserGroup.php index ee9960e..a258a41 100644 --- a/Classes/Domain/Model/FrontendUserGroup.php +++ b/Classes/Domain/Model/FrontendUserGroup.php @@ -30,13 +30,6 @@ class FrontendUserGroup extends AbstractEntity */ protected $subgroup; - - /** - * - * @var string - */ - protected $accronym = ''; - /** * Constructs a new Frontend User Group */ @@ -45,6 +38,13 @@ public function __construct() $this->subgroup = new ObjectStorage(); } + /** + * + * @var string + */ + protected $accronym = ''; + + /** * Sets the title value * @@ -110,11 +110,12 @@ public function getSubgroup() return $this->subgroup; } - /** - * - * @return string - */ - public function getAccronym() { - return $this->accronym; - } -} + /** + * + * @return string + */ + public function getAccronym() + { + return $this->accronym; + } +} \ No newline at end of file diff --git a/Classes/Domain/Repository/CommitmentRepository.php b/Classes/Domain/Repository/CommitmentRepository.php index e0ecfe1..b8e3c04 100755 --- a/Classes/Domain/Repository/CommitmentRepository.php +++ b/Classes/Domain/Repository/CommitmentRepository.php @@ -67,11 +67,11 @@ public function findCurrentEventCommitments(FrontendUser $user, array $dutyRoste ->in('tx_participants_domain_model_event.pid', $dutyRosterStrorageUids))) ->where($qb->expr() ->andX($qb->expr() - ->gte('tx_participants_domain_model_event.begin_date', $qb->createNamedParameter($startMoment->getTimestamp())), $qb->expr() + ->gte('tx_participants_domain_model_event.date', $qb->createNamedParameter($startMoment->format('Y-m-d'))), $qb->expr() ->eq('tx_participants_domain_model_commitment.user', $qb->createNamedParameter($user->getUid())), $qb->expr() ->eq('tx_participants_domain_model_commitment.pid', $planningStorageUid))) - ->orderby('tx_participants_domain_model_event.begin_date', 'ASC') - ->addOrderby('tx_participants_domain_model_event.begin_time', 'ASC') + ->orderby('tx_participants_domain_model_event.date', 'ASC') + ->addOrderby('tx_participants_domain_model_event.time', 'ASC') ->groupBy('tx_participants_domain_model_commitment.uid'); if (! $withCanceledEvents) { @@ -141,7 +141,6 @@ public function findMissingCommitmentsOf(int $userUid, int $commitmentStorageUid { $yesterday = new \DateTime(); $yesterday->sub(new \DateInterval('P1D')); - $yesterday->setTimezone(new \DateTimeZone('UTC')); $qb = $this->getQueryBuilder('tx_participants_domain_model_event'); $qb->select('tx_participants_domain_model_event.uid', 'tx_participants_domain_model_commitment.pid') @@ -156,7 +155,7 @@ public function findMissingCommitmentsOf(int $userUid, int $commitmentStorageUid ->andWhere($qb->expr() ->in('tx_participants_domain_model_event.pid', $eventStorageUids)) ->andWhere($qb->expr() - ->gt('tx_participants_domain_model_event.begin_date', $yesterday->getTimestamp())); + ->gt('tx_participants_domain_model_event.date', $yesterday->format('y-m-d'))); // debug($qb->getSQL()); $s = $qb->execute(); diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php index 5d8b62e..6f8b05a 100644 --- a/Classes/Domain/Repository/EventRepository.php +++ b/Classes/Domain/Repository/EventRepository.php @@ -64,7 +64,7 @@ public function findTomorrowsEvents(): array $s = $qb->execute(); $return = array(); - while ($row = $s->fetchAssociative()) { + while ($row = $s->fetch()) { $return[] = $this->findByUid($row['uid']); } // debug($return); @@ -84,8 +84,8 @@ public function findPublicEvents(int $limit = EventRepository::UNLIMITED, array ->andX($qb->expr() ->eq('tx_participants_domain_model_event.public', PublicOption::INHERITED), $qb->expr() ->eq('tx_participants_domain_model_eventtype.public', PublicOption::PUBLIC )))) - ->orderBy('begin_date', QueryInterface::ORDER_ASCENDING) - ->addOrderBy('begin_time', QueryInterface::ORDER_ASCENDING); + ->orderBy('date', QueryInterface::ORDER_ASCENDING) + ->addOrderBy('time', QueryInterface::ORDER_ASCENDING); if ($storageUids == null) { $qb->andWhere($qb->expr() @@ -107,20 +107,21 @@ public function findPublicEvents(int $limit = EventRepository::UNLIMITED, array } if ($startWithToday) { $qb->andWhere($qb->expr() - ->gte('tx_participants_domain_model_event.begin_date', time())); + ->gte('tx_participants_domain_model_event.date', $qb->createNamedParameter(date('Y-m-d')))); } // debug($qb->getSql()); $s = $qb->execute(); $return = array(); - while ($row = $s->fetchAssociative()) { + while ($row = $s->fetch()) { $return[] = $this->findByUid($row['uid']); } return $return; } - public function findEventsAt(array $storageUids, int $from, int $until, int $visibility, int $limit = EventRepository::UNLIMITED, bool $inclusiveCanceledEvents = false): array + + public function findEventsAt(array $storageUids, \DateTime $from, \DateTime $until, int $visibility, int $limit = EventRepository::UNLIMITED, bool $inclusiveCanceledEvents = false): array { $qb = $this->getQueryBuilder('tx_participants_domain_model_event'); @@ -146,8 +147,8 @@ public function findEventsAt(array $storageUids, int $from, int $until, int $vis ->eq('tx_participants_domain_model_event.event_type', $qb->quoteIdentifier('tx_participants_domain_model_eventtype.uid'))) ->where( $qb->expr()->andX( - $qb->expr()->gte('begin_date', $qb->createNamedParameter($from)), - $qb->expr()->lt('begin_date', $qb->createNamedParameter($until)) + $qb->expr()->gte('date', $qb->createNamedParameter($from->format('Y-m-d'))), + $qb->expr()->lte('date', $qb->createNamedParameter($until->format('Y-m-d'))) ) ) ->orderBy('date', QueryInterface::ORDER_ASCENDING) @@ -178,10 +179,10 @@ public function findEventsAt(array $storageUids, int $from, int $until, int $vis $s = $qb->execute(); $return = []; if (1 == 0) { // add debug infos - $debug = []; + $debug = []; $debug['sql'] = $qb->getSql(); - $debug['from'] = $from; - $debug['until'] = $until; + $debug['from'] = $from->format('Y-m-d'); + $debug['until'] = $until->format('Y-m-d'); $return['debug'] = $debug; } $data = []; @@ -189,9 +190,9 @@ public function findEventsAt(array $storageUids, int $from, int $until, int $vis /** @var Event $e */ $e = $this->findByUid($row['uid']); $tmp = []; - $tmp['description'] = htmlspecialchars($e->getEventType()->getTitle() .' ('.date('d.m.Y', $e->getBeginDate()).')'); - $tmp['title'] = htmlspecialchars($e->getEventType()->getTitle()); - $tmp['date'] = htmlspecialchars(date('d.m.Y', $e->getBeginDate())); + $tmp['description'] = htmlspecialchars($e->getEventType()->getTitle() . ' (' . $e->getDate()->format('d.m.Y') . ')'); + $tmp['title'] = htmlspecialchars($e->getEventType()->getTitle()); + $tmp['begin_date'] = htmlspecialchars($e->getDate()->format('d.m.Y')); $data[] = $tmp; } $return['data'] = $data; diff --git a/Classes/Domain/TCA/EventTca.php b/Classes/Domain/TCA/EventTca.php index 21045e6..2f8a214 100644 --- a/Classes/Domain/TCA/EventTca.php +++ b/Classes/Domain/TCA/EventTca.php @@ -11,7 +11,7 @@ * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * - * (c) 2023 C. Gogolin + * (c) 2022 C. Gogolin * * This class contains a tca configuration function. * @@ -43,14 +43,20 @@ public function computeTitle(&$parameters) } $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']); if ($record != null) { - if($record['full_day']) { - $parameters['title'] = $typeTitle . ' (' . date('d.m.Y', $record['begin_date']) . ')'; + if ($record['full_day']) { + $parameters['title'] = $typeTitle . ' (' . self::formatDate($record['date']) . ')'; } else { - $parameters['title'] = $typeTitle . ' (' . date('d.m.Y H:i', $record['begin_date'] + $record['begin_time'] ) . ')'; + $parameters['title'] = $typeTitle . ' (' . self::formatDate($record['date']) . ' ' . $record['time'] . ')'; } - } else { $parameters['title'] = $typeTitle; } } + + private static function formatDate(string $sqlDate): string + { + $e = explode('-', $sqlDate); + return $e[2] . '.' . $e[1] . '.' . $e[0]; + } + } \ No newline at end of file diff --git a/Classes/Task/PersonalDutyRosterPlanningTask.php b/Classes/Task/PersonalDutyRosterPlanningTask.php index 7e22e65..23d89db 100644 --- a/Classes/Task/PersonalDutyRosterPlanningTask.php +++ b/Classes/Task/PersonalDutyRosterPlanningTask.php @@ -267,7 +267,7 @@ public function execute() $this->initialize(); if ($this->validate()) { - $now = time(); + $now = new \DateTime(); // -------------------------- // statistic values @@ -311,7 +311,7 @@ public function execute() $c = $this->commitmentRepository->findByUid($uids['commitment']); $e = $this->eventRepository->findByUid(intval($uids['event'])); - if ($e != null && $e->getBeginTimeStamp() > $now) { + if ($e != null && $e->getDatetime() > $now) { $d = $u->getCurrentlyOffDuty() ? false : $this->calculatePlanningPresent($u, $e); // debug($ds); @@ -353,7 +353,7 @@ public function execute() * @var Commitment $c */ $c = GeneralUtility::makeInstance(Commitment::class); - if ($e->getBeginTimeStamp() > $now) { + if ($e->getDateTime() > $now) { $c->setEvent($e); $c->setUser($u); @@ -428,7 +428,7 @@ private function sendInfoMail(FrontendUser $user, array $inserts, array $updates */ public function getAdditionalInformation() { - return 'Duty roster storage uids:' . $this->dutyRosterStorageUids . // + return 'Duty roster stroarge uids:' . $this->dutyRosterStorageUids . // ' / planning storage uid: ' . $this->planningStorageUid . // ' / frontend user storage uids: ' . $this->feUserStorageUids . // ' / frontend user group storage uids: ' . $this->feUsergroupStorageUids . // diff --git a/Classes/Upgrades/BeginTimeConverterWizard.php b/Classes/Upgrades/BeginTimeConverterWizard.php deleted file mode 100644 index 355ed86..0000000 --- a/Classes/Upgrades/BeginTimeConverterWizard.php +++ /dev/null @@ -1,110 +0,0 @@ -getQueryBuilderForTable('tx_participants_domain_model_event '); - $source->select('uid', 'time', 'date')->from('tx_participants_domain_model_event'); - - $sourceStatement = $source->execute(); - - /** @var QueryBuilder $target */ - $target = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_participants_domain_model_event'); - $target->update('tx_participants_domain_model_event'); - - while ($row = $sourceStatement->fetchAssociative()) { - $target->where($target->expr()->eq('uid', $row['uid'])); - $tmp = explode(':',$row['time']); - $ut = intval($tmp[0]) * 3600 + intval($tmp[1]) * 60 + intval($tmp[2]); - $target->set('begin_time', $ut); - - - $target->set('begin_date', strtotime($row['date'])); - $target->set('begin_time', $ut); - - $target->execute(); - } - return true; - } - - /** - * Is an update necessary? - * - * Is used to determine whether a wizard needs to be run. - * Check if data for migration exists. - * - * @return bool Whether an update is required (TRUE) or not (FALSE) - */ - public function updateNecessary(): bool - { - - try { - /** @var QueryBuilder $source */ - $source = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_participants_domain_model_event'); - $source->select('uid') - ->from('tx_participants_domain_model_event') - ->setMaxResults(1) - ->where( - $source->expr()->eq('begin_date', 0) - ); - - $sourceStatement = $source->execute(); - if ($sourceStatement->fetchAssociative() !== false) { - return true; - } - } catch (\Exception $e) { - return false; - } - return false; - } - - /** - * Returns an array of class names of prerequisite classes - * - * This way a wizard can define dependencies like "database up-to-date" or - * "reference index updated" - * - * @return string[] - */ - public function getPrerequisites(): array - { - // Add your logic here - return []; - } - - public function getIdentifier(): string - { - return 'participants_beginTimeConverterWizard'; - } -} \ No newline at end of file diff --git a/Configuration/TCA/tx_participants_domain_model_commitment.php b/Configuration/TCA/tx_participants_domain_model_commitment.php index 4f105f4..d3ca6d9 100755 --- a/Configuration/TCA/tx_participants_domain_model_commitment.php +++ b/Configuration/TCA/tx_participants_domain_model_commitment.php @@ -16,10 +16,10 @@ 'iconfile' => 'EXT:participants/Resources/Public/Icons/tx_participants_domain_model_commitment.gif' ], 'interface' => [ - 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, present, present_default, event, user', + 'showRecordFieldList' => ' l10n_parent, l10n_diffsource, present, present_default, event, user', ], 'types' => [ - '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, present, present_default, event, user'], + '1' => ['showitem' => ' l10n_parent, l10n_diffsource, present, present_default, event, user'], ], 'columns' => [ 'sys_language_uid' => [ @@ -72,11 +72,9 @@ 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_commitment.present', 'config' => [ 'type' => 'check', - 'renderType' => 'checkboxToggle', 'items' => [ - [ - 0 => '', - 1 => '', + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' ] ], 'default' => 0, @@ -86,12 +84,10 @@ 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_commitment.present_default', 'config' => [ 'type' => 'check', - 'readOnly' => true, - 'renderType' => 'checkboxToggle', + 'readOnly' => true, 'items' => [ - [ - 0 => '', - 1 => '', + '1' => [ + '0' => 'LLL:EXT:lang/locallang_core.xlf:labels.enabled' ] ], 'default' => 0, @@ -100,7 +96,7 @@ 'event' => [ 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_commitment.event', 'config' => [ - 'readOnly' => true, + 'readOnly' => true, 'type' => 'select', 'dbType' => 'event', 'renderType' => 'selectSingle', @@ -119,6 +115,6 @@ 'maxitems' => 1, ], ], - + ], -]; \ No newline at end of file +]; diff --git a/Configuration/TCA/tx_participants_domain_model_event.php b/Configuration/TCA/tx_participants_domain_model_event.php index cb631c7..8c94679 100644 --- a/Configuration/TCA/tx_participants_domain_model_event.php +++ b/Configuration/TCA/tx_participants_domain_model_event.php @@ -6,7 +6,7 @@ 'title' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.title', 'label' => 'title', 'label_userFunc' => \Cylancer\Participants\Domain\TCA\EventTca::class . '->computeTitle', - 'sortby' => 'begin_date', + 'default_sortby' => 'date ASC, time ASC', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser_id', @@ -20,9 +20,9 @@ 'starttime' => 'starttime', 'endtime' => 'endtime', 'type' => 'type', - 'begin_date' => 'begin_date', + 'date' => 'date', 'full_day' => 'full_day', - 'begin_time' => 'begin_time', + 'time' => 'time', 'duration' => 'duration', 'usergroups' => 'usergroups', 'public' => 'public', @@ -37,12 +37,13 @@ 'iconfile' => 'EXT:participants/Resources/Public/Icons/tx_participants_domain_model_event_type.gif' ], 'interface' => [ - 'showRecordFieldList' => ' l10n_parent, l10n_diffsource, hidden, canceled, event_type, begin_date, full_day, begin_time, ' . // - 'duration, usergroups, show_public_usergroups, public_usergroups, description, public, public_description, show_public_description ' + 'showRecordFieldList' => 'l10n_parent, l10n_diffsource, hidden, canceled, event_type, date, full_day, time, ' + . 'duration, usergroups, show_public_usergroups, public_usergroups, description, public, public_description, ' + . 'show_public_description ' ], 'types' => [ '1' => [ - 'showitem' => ' l10n_parent, l10n_diffsource, hidden, canceled, event_type, public, begin_date, full_day, begin_time, duration,' + 'showitem' => ' l10n_parent, l10n_diffsource, hidden, canceled, event_type, public, date, full_day, time, duration,' . '--div--;LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.tabGroupSettings, usergroups, show_public_usergroups, public_usergroups, ' . '--div--;LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.tabDescription, description, show_public_description, public_description ' ] @@ -187,14 +188,15 @@ ] ], - 'begin_date' => [ - 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.beginDate', + 'date' => [ + 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.date', 'config' => [ 'type' => 'input', 'renderType' => 'inputDateTime', -// 'format' => 'date', + 'format' => 'date', + 'dbType' => 'date', 'eval' => 'date', - 'default' => intdiv(time() , (86400)) * 86400 + 'default' => time() ] ], @@ -207,13 +209,16 @@ ] ], - 'begin_time' => [ - 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.beginTime', + 'time' => [ + 'label' => 'LLL:EXT:participants/Resources/Private/Language/locallang_db.xlf:tx_participants_domain_model_event.time', 'config' => [ 'type' => 'input', 'renderType' => 'inputDateTime', + 'dbType' => 'time', 'eval' => 'time', - 'default' => 68400 // <=> 19:00h + 'default' => '19:00:00', + // 68400 // <=> 19:00h + // 'mode' => 'useOrOverridePlaceholder' ] ], diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index ef1c7ab..35ba395 100755 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -134,4 +134,4 @@ tx_participants_dutyRosterICal { pluginName = DutyRoster vendorName = Cylancer } -} +} \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf index 3afcd18..2e8c135 100755 --- a/Resources/Private/Language/de.locallang_db.xlf +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -167,7 +167,7 @@ Website - Benutzergruppen (Alternative für die öffentliche Anzeige) - + Date Datum @@ -175,9 +175,9 @@ Full day Ganztägig - - Begin time - Start-Zeit + + Time + Uhrzeit Duration in hours diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index e082184..e450796 100755 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -133,14 +133,14 @@ Website user groups (alternative for the public view) - + Date Full day - - Begin time + + Time Duration in hours diff --git a/Resources/Private/Partials/DutyRoster/DefaultICalendarEntries.html b/Resources/Private/Partials/DutyRoster/DefaultICalendarEntries.html index 5ea3a8d..0a4427d 100755 --- a/Resources/Private/Partials/DutyRoster/DefaultICalendarEntries.html +++ b/Resources/Private/Partials/DutyRoster/DefaultICalendarEntries.html @@ -27,8 +27,8 @@ CREATED:{event.crdate}T{event.crdate}Z DTSTAMP:{event.tstamp}T{event.tstamp}Z UID:dutyRoster-{event.uid}@{domain} -DTSTART;VALUE=DATETZID=Europe/Berlin:{event.beginTimestamp}{event.beginTimestamp} -DTEND;VALUE=DATETZID=Europe/Berlin: +1 day+{event.duration} hour +DTSTART;VALUE=DATETZID=Europe/Berlin:{event.date}{event.time} +DTEND;VALUE=DATETZID=Europe/Berlin: +1 day +{event.duration} hours SUMMARY:🚒 {event.eventType.title -> f:format.htmlspecialchars()} DESCRIPTION:{ug.title}, ( {event.description -> f:format.stripTags()} ) END:VEVENT diff --git a/Resources/Private/Partials/PersonalDutyRoster/DefaultICalendarEntries.html b/Resources/Private/Partials/PersonalDutyRoster/DefaultICalendarEntries.html index 22570d3..fd7fdd9 100755 --- a/Resources/Private/Partials/PersonalDutyRoster/DefaultICalendarEntries.html +++ b/Resources/Private/Partials/PersonalDutyRoster/DefaultICalendarEntries.html @@ -27,8 +27,8 @@ CREATED:{commitment.event.crdate}T{commitment.event.crdate}Z DTSTAMP:{commitment.event.tstamp}T{commitment.event.tstamp}Z UID:dutyRoster-{commitment.event.uid}@{domain} -DTSTART;VALUE=DATETZID=Europe/Berlin:{commitment.event.beginTimestamp}{commitment.event.beginTimestamp} -DTEND;VALUE=DATETZID=Europe/Berlin: +1 day+{commitment.event.duration} hour +DTSTART;VALUE=DATETZID=Europe/Berlin:{commitment.event.date}{commitment.event.time} +DTEND;VALUE=DATETZID=Europe/Berlin: +1 day +{commitment.event.duration} hours SUMMARY:🚒 {commitment.event.eventType.title -> f:format.htmlspecialchars()} DESCRIPTION:{ug.title}, ( {commitment.event.description -> f:format.stripTags()} ) END:VEVENT diff --git a/Resources/Private/Templates/DutyRoster/Show.html b/Resources/Private/Templates/DutyRoster/Show.html index b3e27ab..7428bde 100755 --- a/Resources/Private/Templates/DutyRoster/Show.html +++ b/Resources/Private/Templates/DutyRoster/Show.html @@ -51,10 +51,10 @@

{f:if(condition='{event.current} == 1', then:'upcomingDateNext')} {f:if(condition='{event.current} == 2', then:'upcomingDateNextNext')}" > -