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

View file

@ -1,8 +1,11 @@
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:events/Resources/Private/Language/locallang_csh_date.xlf:tx_events_domain_model_date',
'label' => 'start',
'label_alt' => 'end, canceled',
'label_alt_force' => true,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
@ -20,7 +23,7 @@ return [
'iconfile' => 'EXT:events/Resources/Public/Icons/tx_events_domain_model_date.gif'
],
'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' => [
'sys_language_uid' => [
@ -136,6 +139,18 @@ return [
'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(
'exclude' => 1,

View file

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

View file

@ -15,6 +15,14 @@
<source>End</source>
<target>Ende</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled">
<source>Canceled?</source>
<target>Abgesagt?</target>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.yes">
<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>

View file

@ -12,6 +12,12 @@
<trans-unit id="tx_events_domain_model_date.end">
<source>End</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled">
<source>Canceled?</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.canceled.yes">
<source>Canceled</source>
</trans-unit>
<trans-unit id="tx_events_domain_model_date.event">
<source>Associated event</source>
</trans-unit>

View file

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