Allow an date to be marked as canceled

That has no effect, the info is just available from model.
This can be used to display a canceled date in a different way, or
render a notice.

Relates: #8092
This commit is contained in:
Daniel Siepmann 2021-01-12 16:42:58 +01:00
parent f111884299
commit ca7340782b
6 changed files with 81 additions and 39 deletions

View file

@ -20,6 +20,11 @@ class Date extends AbstractEntity
*/ */
protected $end = null; protected $end = null;
/**
* @var bool
*/
protected $canceled = false;
/** /**
* @var \Wrm\Events\Domain\Model\Event * @var \Wrm\Events\Domain\Model\Event
*/ */
@ -64,6 +69,11 @@ class Date extends AbstractEntity
$this->end = $end; $this->end = $end;
} }
public function isCanceled(): bool
{
return $this->canceled;
}
/** /**
* @return Event * @return Event
*/ */

View file

@ -1,8 +1,11 @@
<?php <?php
return [ return [
'ctrl' => [ 'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date', 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date',
'label' => 'start', 'label' => 'start',
'label_alt' => 'end, canceled',
'label_alt_force' => true,
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id', 'cruser_id' => 'cruser_id',
@ -20,7 +23,7 @@ return [
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.gif' 'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.gif'
], ],
'types' => [ 'types' => [
'1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end, event, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, start, end, canceled, event, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
@ -136,6 +139,18 @@ return [
'default' => null, 'default' => null,
], ],
], ],
'canceled' => [
'exclude' => true,
'label' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'default' => 0,
'items' => [
['LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date.canceled.yes'],
],
],
],
'event' => array( 'event' => array(
'exclude' => 1, 'exclude' => 1,

View file

@ -1,8 +1,10 @@
<?php <?php
return [ return [
'ctrl' => [ 'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event', 'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_event.xlf:tx_events_domain_model_event',
'label' => 'title', 'label' => 'title',
'thumbnail' => 'images',
'tstamp' => 'tstamp', 'tstamp' => 'tstamp',
'crdate' => 'crdate', 'crdate' => 'crdate',
'cruser_id' => 'cruser_id', 'cruser_id' => 'cruser_id',

View file

@ -1,24 +1,32 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events_domain_model_date"> <trans-unit id="tx_events_domain_model_date">
<source>Date</source> <source>Date</source>
<target>Termin</target> <target>Termin</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.start"> <trans-unit id="tx_events_domain_model_date.start">
<source>Start</source> <source>Start</source>
<target>Beginn</target> <target>Beginn</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.end"> <trans-unit id="tx_events_domain_model_date.end">
<source>End</source> <source>End</source>
<target>Ende</target> <target>Ende</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.event"> <trans-unit id="tx_events_domain_model_date.canceled">
<source>Associated event</source> <source>Canceled?</source>
<target>Verknüpfte Veranstaltungen</target> <target>Abgesagt?</target>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_date.canceled.yes">
</file> <source>Canceled</source>
<target>Abgesagt</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
<target>Verknüpfte Veranstaltungen</target>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -1,20 +1,26 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0"> <xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events"> <file source-language="en" datatype="plaintext" original="messages" date="2019-04-03T12:11:11Z" product-name="tx_events">
<header/> <header/>
<body> <body>
<trans-unit id="tx_events_domain_model_date"> <trans-unit id="tx_events_domain_model_date">
<source>Date</source> <source>Date</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.start"> <trans-unit id="tx_events_domain_model_date.start">
<source>Start</source> <source>Start</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.end"> <trans-unit id="tx_events_domain_model_date.end">
<source>End</source> <source>End</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_events_domain_model_date.event"> <trans-unit id="tx_events_domain_model_date.canceled">
<source>Associated event</source> <source>Canceled?</source>
</trans-unit> </trans-unit>
</body> <trans-unit id="tx_events_domain_model_date.canceled.yes">
</file> <source>Canceled</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
</trans-unit>
</body>
</file>
</xliff> </xliff>

View file

@ -70,6 +70,7 @@ CREATE TABLE tx_events_domain_model_date (
event int(11) unsigned DEFAULT '0' NOT NULL, event int(11) unsigned DEFAULT '0' NOT NULL,
start int(11) DEFAULT NULL, start int(11) DEFAULT NULL,
end int(11) DEFAULT NULL, end int(11) DEFAULT NULL,
canceled int(11) NOT NULL DEFAULT 0,
KEY event (event), KEY event (event),
KEY dataHandler (event, t3ver_wsid, pid) KEY dataHandler (event, t3ver_wsid, pid)
); );