Commit graph

152 commits

Author SHA1 Message Date
bc6aa4d359 Apply stdWrap to date demand settings
Move to a dedicated factory for easier re use.
Add dependencies and apply stdWrap to properties.
That allows to dynamically set values like dates by using stdWrap
features.

E.g.:

    settings {
        end {
            strtotime = midnight +1 day
        }
    }

Relates: #9505
2021-12-06 12:34:32 +01:00
809ef032f4 Allow editing and creation of dates within event
Relates: #9471
2021-11-23 08:28:22 +01:00
c38241f351 Fix broken upcoming feature
Using a FlexForm results in stored Unixtimestamps.
Adding 00:00 and using strtotime will result in false, resulting in
null.

We now just keep the provided value as integer.
That way underlying code works as expected and delivers events from
given start date.

Relates: #9352, #8581
2021-10-11 11:33:52 +02:00
f0ee19cfae Fix CGL ordering of import statements
Update of dev dependency results in better sorting of UpperCamelCase.
2021-10-11 11:33:11 +02:00
de6c317602 Do not break PHPStan due to new PHPDoc in TYPO3 source
Update of TYPO3 results in the following error:

     ------ -----------------------------------------------------------------------
     Line   Classes/Service/DestinationDataImportService.php
    ------ -----------------------------------------------------------------------
     135    Property
            Wrm\Events\Service\DestinationDataImportService::$objectManager with
            generic class TYPO3\CMS\Extbase\Object\ObjectManager does not specify
            its types: T
            💡 You can turn this off by setting
            checkGenericClassInNonGenericObjectType: false in your
            phpstan.neon.
     160    Method Wrm\Events\Service\DestinationDataImportService::__construct()
            has parameter $objectManager with generic class
            TYPO3\CMS\Extbase\Object\ObjectManager but does not specify its
            types: T
            💡 You can turn this off by setting
            checkGenericClassInNonGenericObjectType: false in your
            phpstan.neon.
    ------ -----------------------------------------------------------------------

We disable the check for now.
2021-10-11 11:32:27 +02:00
Dirk Koritnik
d5ad0a66a8 Fix probems with catgories
* make sure no empty category is listed in search filter
* fix type error in dd import
2021-09-08 11:03:30 +00:00
22e75d4729 Do not load all dates of each event
Most of the time dates are fetched and shown.
They need the event to show info like title.
But they nearly never need further dates, except in detail view.

Turning this property lazy will save a lot of data fetching and mapping
and provides a huge performance impact.
2021-09-08 10:13:01 +02:00
Dirk Koritnik
515351823b Show cancel notice 2021-09-07 19:23:57 +02:00
Dirk Koritnik
2d3db75070 Add categories to search template 2021-09-07 19:23:35 +02:00
Dirk Koritnik
a0cf9f30a6 Edit version and constraints 2021-09-07 19:02:15 +02:00
Dirk Koritnik
ce6d50a7d7 Remove regions from cleanup 2021-09-07 19:01:47 +02:00
b906c50a09 Mark extension compatible with php 7.2 2021-09-07 16:19:29 +02:00
da87dc7644 Improve determination of "end" in db constraints
Some dates might not have an end date, but only start.
Those should be respected.
2021-09-07 16:03:54 +02:00
26cc0d3f8c Fix wrong converted condition
The condition was changed when types where properly added.
The actual meaning was changed by accident and is now fixed again.
2021-09-07 15:58:00 +02:00
6226fb32d4 Do not break import if region could not be found 2021-09-07 12:19:49 +02:00
1f769939b4 Extend cleanup
Properly cleanup system.

Delete further records when deleting everything.
Also respect further records when purging old entries.

Respect:

* sys_category_record_mm
* sys_file_reference
* sys_file_metadata
2021-09-07 12:19:09 +02:00
10237d6f91 Add PHPStan to CI 2021-09-07 11:42:53 +02:00
f618536ff9 Add PHPStan
In order to static analyze code and prevent bugs when changing code.
Fix issues in most of the files.
2021-09-07 11:07:55 +02:00
ebb668221e Support canceled attribute during import of destination data
Destination data provides an attribute "DETAILS_ABGESAGT" to mark an
event as canceled.
We now fetch that info and mark all dates of that event as canceled.

This also contains refactoring of creation of dates within import.
All dates had the same info, and are now created at a single place.

Relates: #9280
2021-09-07 09:29:38 +02:00
b8b11f3e19 Merge branch 'feature/add-ci' into 'master'
Support canceled attribute during import of destination data

See merge request typo3/events!11
2021-09-07 07:28:39 +00:00
cbe4eda380 Add CI
* Add first basic CI with defaults.
* Add ecs for coding guideline.
* Fix invalid xliff files.
2021-09-07 09:26:59 +02:00
27e5bb129a Merge branch 'bugfix/inherit-from-extbase-repository' into 'master'
Fix Category type miss match during import

See merge request typo3/events!9
2021-09-07 06:51:51 +00:00
8ded245785 Fix Category type miss match during import
Extbase Category repository was used, while custom Category instances
were expected.
The repository didn't inherit from Extbase Repository and therefore
didn't provide expected findByUid method.
2021-09-07 08:40:09 +02:00
Dirk Koritnik
919db32131 Merge branch 'feature/typo3-v10' into 'master'
State compatibility with v10

See merge request typo3/events!8
2021-09-07 06:12:57 +00:00
410a73052e Fix type miss match of object storages
The properties should always be ObjectStorage instances.
We streamline the annotation and initialization to ensure exactly that.

Also import needs small adjustment as it still expected null as possible
return type.
2021-09-07 07:54:43 +02:00
018fdc697e Fix RemoveAllCommand return type
The command should always return an integer as exit code.
The called method does not return anything, resulting in null to be
returned.
2021-09-07 07:54:43 +02:00
d0cb951550 Do not break performance when no postponed date exists
Some sites do not use postponed_date at all.
It would be a massive performance issue to still search for them for
each and every date instance that is created.

This small addition will solve the issue for those pages.
It will still once at least one internal reference is added.

We could then try to add proxies which are build and added, but don't
use the DB. That way the performance would still be okay, and data will
only be fetched when used.
2021-09-07 07:54:43 +02:00
8816eca99e Migrate Pagination configuration
POST is no longer supported, only GET.
Whole pagination is deprecated and will be removed in v12.
2021-09-07 07:54:42 +02:00
8201782b6f Properly check for images
Do not check for models, but actual file.
They might be missing, e.g. cause not downloaded from production into
dev environment.

The new checks ensure the page will not break with an exception, but
show default images.
2021-09-07 07:54:42 +02:00
3822b86df6 Fix Category type miss match during import
Extbase Category repository was used, while custom Category instances
were expected.
2021-09-07 07:54:41 +02:00
8ddbc2fb88 Handle missing target folder on import 2021-09-07 07:54:02 +02:00
beca8c2e07 Keep old legacy command identifier
The old identifier had a trailing comma.
Old installations would break if we do not keep the command under this
identifier.
Updating scheduler tasks is a bad thing, so we keep compatibility.
2021-09-07 07:54:01 +02:00
39d4f628e3 Prevent broken event state when build from db result
The process will not call __construct, the object storages might not be
initialized. Therefore initializeObject is now implemented which is
calling the existing method to initialize object storages.
2021-09-07 07:52:30 +02:00
326378e2fc Allow to reference events from event
This might be useful to allow editors and integrators to create
something like "you might also be interested in" or "related events".
2021-09-07 07:52:29 +02:00
97bcbe2065 Add original date to dates if available
This is not possible via native API.
We therefore use the event to fetch and add the relation.

Relates: #8857
2021-09-07 07:52:29 +02:00
36ecc9bbe8 Add cObject data to fluid when available
Relates: #9012
2021-09-07 07:52:29 +02:00
ed23c783cd Adjust formatting 2021-09-07 07:52:28 +02:00
5440ef4f72 Fix not available cache for events_category
Adjust cache name to match TYPO3 v10 convention without "cache_" prefix.
Add default configuration to prevent issue if integrator does not
configure cache.
2021-09-07 07:52:28 +02:00
1929a4a566 Use sorting of categories
Extbase will properly use mm sorting.
But categories can't be sorted within the TCA tree component.
Therefore it makes more sense to use actual sys_category sorting.
In order to do so, we add our own model and pass the sorting.
That way PHP can do the sorting.

That's the easiest approach.
Also events shouldn't contain to many categories.  A performance impact
should not be high.

Relates: #8459
2021-09-07 07:52:28 +02:00
Dirk Koritnik
9a8ee30580 Increase image limit 2021-09-07 07:52:27 +02:00
Dirk Koritnik
2450f5c6b7 Switch to Storage Object for images 2021-09-07 07:52:27 +02:00
cbbe56775e Allow to add link for canceled dates
E.g. allow users to get info about refunds.

Relates: #8574
2021-09-07 07:52:26 +02:00
bfaa25c707 Do not allow self reference for postponed date 2021-09-07 07:52:26 +02:00
3012816123 Allow to delete events
Relates: #8570
2021-09-07 07:52:26 +02:00
10b4c34fe6 Allow to define a new date if current is postponed
Relates: #8092
2021-09-07 07:52:25 +02:00
c65ae5023f Allow integrator to set start or end for date via settings
Respect start and end when creating demand from settings.
That way integrator can configure it via TypoScript, or provide an
FlexForm.

Also the query was adjusted. It now respects a single value and doesn't
need start and end.
That way upcoming events can be created.

Relates: #8581
2021-09-07 07:52:25 +02:00
cf2b571fda Support manual sorting in foreign language
Given: Website uses copy / free mode of localization.
       and Editor selects specific events to display.
Then:  Those events should be displayed as selected.

Before this change the sorting was applied on uid of objects,
which is the uid of default lanugage record. But editors might select
localized uids. Therefore a fallback is added in case no object was
found.

Relates: #8557
2021-09-07 07:52:25 +02:00
Dirk Koritnik
4a8abbe344 Add getter and setter for caceled 2021-09-07 07:52:24 +02:00
Dirk Koritnik
ce723b01bc Extend date canceld form 2021-09-07 07:52:24 +02:00
Dirk Koritnik
55530ee062 Allow multiline in title and subtitle 2021-09-07 07:52:23 +02:00