Skip to content

Commit

Permalink
Merge pull request #478 from jweiland-net/addPrimerFeature
Browse files Browse the repository at this point in the history
Add primer option to exceptions
  • Loading branch information
sfroemkenjw authored Aug 21, 2024
2 parents c25209f + fb112a2 commit dc3c794
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 442 deletions.
12 changes: 12 additions & 0 deletions Classes/Domain/Model/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Exception extends AbstractEntity

protected bool $showAnyway = false;

protected bool $primer = false;

public function getExceptionType(): string
{
return $this->exceptionType;
Expand Down Expand Up @@ -80,4 +82,14 @@ public function setShowAnyway(bool $showAnyway): void
{
$this->showAnyway = $showAnyway;
}

public function isPrimer(): bool
{
return $this->primer;
}

public function setPrimer(bool $primer): void
{
$this->primer = $primer;
}
}
7 changes: 7 additions & 0 deletions Configuration/Extbase/Persistence/Classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@
\JWeiland\Events2\Domain\Model\Category::class => [
'tableName' => 'sys_category',
],
\JWeiland\Events2\Domain\Model\Exception::class => [
'properties' => [
'primer' => [
'fieldName' => 'is_primer',
],
],
],
];
25 changes: 20 additions & 5 deletions Configuration/TCA/tx_events2_domain_model_exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
],
'types' => [
'Add' => [
'showitem' => '--palette--;;exception, sys_language_uid, l10n_parent, l10n_diffsource, exception_time, exception_details,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
'showitem' => '--palette--;;exception, sys_language_uid, l10n_parent, l10n_diffsource, exception_time, is_primer, exception_details,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access'
],
'Remove' => [
'showitem' => '--palette--;;exception, sys_language_uid, l10n_parent, l10n_diffsource, show_anyway, exception_details,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access'
],
'Time' => [
'showitem' => '--palette--;;exception, sys_language_uid, l10n_parent, l10n_diffsource, exception_time, exception_details,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access'
],
'Info' => [
'showitem' => '--palette--;;exception, sys_language_uid, l10n_parent, l10n_diffsource, exception_details,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.access;access'
],
],
Expand Down Expand Up @@ -226,6 +226,21 @@
'show_anyway' => [
'exclude' => true,
'label' => 'LLL:EXT:events2/Resources/Private/Language/locallang_db.xlf:tx_events2_domain_model_exception.show_anyway',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
'items' => [
[
'label' => '',
'value' => '',
],
],
'default' => 0,
],
],
'is_primer' => [
'exclude' => true,
'label' => 'LLL:EXT:events2/Resources/Private/Language/locallang_db.xlf:tx_events2_domain_model_exception.is_primer',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
Expand Down
4 changes: 4 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
<source>Datails</source>
<target>Details</target>
</trans-unit>
<trans-unit id="tx_events2_domain_model_exception.primer">
<source>Primer</source>
<target>Premiere</target>
</trans-unit>

<trans-unit id="tx_events2_domain_model_location">
<source>Location</source>
Expand Down
4 changes: 4 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@
<source>Show removed date in list and detail view anyway</source>
<target>Entferntes Datum in Listen- und Detailansicht trotzdem anzeigen</target>
</trans-unit>
<trans-unit id="tx_events2_domain_model_exception.is_primer">
<source>Show as Primer</source>
<target>Zeige als Premiere</target>
</trans-unit>

<trans-unit id="tx_events2_domain_model_location">
<source>Location</source>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
<trans-unit id="tx_events2_domain_model_exception.exception_details">
<source>Details</source>
</trans-unit>
<trans-unit id="tx_events2_domain_model_exception.primer">
<source>Primer</source>
</trans-unit>

<trans-unit id="tx_events2_domain_model_location">
<source>Location</source>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@
<trans-unit id="tx_events2_domain_model_exception.show_anyway">
<source>Show removed date in list and detail view anyway</source>
</trans-unit>
<trans-unit id="tx_events2_domain_model_exception.is_primer">
<source>Show as Primer</source>
</trans-unit>

<trans-unit id="tx_events2_domain_model_location">
<source>Location</source>
Expand Down
5 changes: 5 additions & 0 deletions Resources/Private/Partials/Day/Properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ <h1>{day.event.title}</h1>

<f:section name="showDateAndTime">
<dl>
<f:for each="{e2:getExceptionsFromEventForSpecificDate(event: day.event, date: date)}" as="exception">
<f:if condition="{exception.primer}">
<dt>{f:translate(key: 'tx_events2_domain_model_exception.primer')}</dt>
</f:if>
</f:for>
<dt>
<strong>
{f:if(condition: '{e2:isDateMarkedAsCanceled(event: day.event, date: date)}', then: '<s>')}
Expand Down
Loading

0 comments on commit dc3c794

Please sign in to comment.