Compare commits
38
Commits
9265e0d1c1
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb84ea9563 | ||
|
|
5455973dba | ||
|
|
659e72fc8c | ||
|
|
ce935825ce | ||
|
|
6871eb7b32 | ||
|
|
57497fff45 | ||
|
|
61dc53c7ea | ||
|
|
7575f55930 | ||
|
|
54567d7d79 | ||
|
|
e6d1009b52 | ||
|
|
3e36136bfa | ||
|
|
60a99bc157 | ||
|
|
3333eed980 | ||
|
|
a7b7b7a476 | ||
|
|
4598fb8aa5 | ||
|
|
05fa99c15c | ||
|
|
48f22a7787 | ||
|
|
2a510339c3 | ||
|
|
7ae9aa266e | ||
|
|
81a8013e8a | ||
|
|
518f29b160 | ||
|
|
5b37b37a78 | ||
|
|
ab2b840dc5 | ||
|
|
4cefbce87e | ||
|
|
2bd663a9bf | ||
|
|
bf9afd143d | ||
|
|
5d41660a9a | ||
|
|
c63cbdd3a6 | ||
|
|
e9bda426f2 | ||
|
|
63e3ed4a78 | ||
|
|
9aabff6b5b | ||
|
|
863dd9de1a | ||
|
|
26a7d5f78a | ||
|
|
8f667e92ee | ||
|
|
0ac58c1033 | ||
|
|
903292d84c | ||
|
|
170e14dae5 | ||
|
|
b428ce9086 |
No files matched your search
@@ -0,0 +1,44 @@
|
||||
-- Removes personal data from a production dump. Run by `ddev anonymize-db`, which ddev also
|
||||
-- runs after every `ddev import-db`. Safe to run more than once.
|
||||
-- @devPasswordHash is set by the command before this file runs.
|
||||
|
||||
-- Tables renamed by the database analyzer in production keep their data until dropped there
|
||||
SET @zzzTables = (
|
||||
SELECT GROUP_CONCAT('`', table_name, '`')
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = DATABASE() AND table_name LIKE 'zzz\_deleted\_%'
|
||||
);
|
||||
SET @dropZzzTables = IF(@zzzTables IS NULL, 'DO 0', CONCAT('DROP TABLE ', @zzzTables));
|
||||
PREPARE dropZzzTables FROM @dropZzzTables;
|
||||
EXECUTE dropZzzTables;
|
||||
DEALLOCATE PREPARE dropZzzTables;
|
||||
|
||||
-- Usernames stay, so everybody logs in locally as their own user (with the dev password)
|
||||
UPDATE be_users SET
|
||||
realName = IF('' = realName, '', CONCAT('BE User ', uid)),
|
||||
email = IF('' = email, '', CONCAT('be-user-', uid, '@example.invalid')),
|
||||
password = @devPasswordHash,
|
||||
password_reset_token = '',
|
||||
mfa = NULL;
|
||||
|
||||
UPDATE fe_users SET
|
||||
username = CONCAT('fe-user-', uid),
|
||||
password = @devPasswordHash,
|
||||
name = IF('' = name, '', CONCAT('FE User ', uid)),
|
||||
first_name = IF('' = first_name, '', 'Vorname'),
|
||||
middle_name = '',
|
||||
last_name = IF('' = last_name, '', CONCAT('Nachname ', uid)),
|
||||
address = IF('' = address, '', 'Musterstraße 1'),
|
||||
telephone = IF('' = telephone, '', '0000 000000'),
|
||||
email = IF('' = email, '', CONCAT('fe-user-', uid, '@example.invalid')),
|
||||
zip = IF('' = zip, '', '00000'),
|
||||
city = IF('' = city, '', 'Musterstadt');
|
||||
|
||||
-- Sessions, locks, reports and logs: IP addresses, user agents, user data
|
||||
TRUNCATE be_sessions;
|
||||
TRUNCATE fe_sessions;
|
||||
TRUNCATE sys_lockedrecords;
|
||||
TRUNCATE sys_http_report;
|
||||
TRUNCATE sys_log;
|
||||
TRUNCATE tx_epproducts_log;
|
||||
TRUNCATE tx_epevents_log;
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Description: Remove personal data from the imported production database
|
||||
## Usage: anonymize-db
|
||||
## Example: "ddev anonymize-db"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
DEV_PASSWORD=password
|
||||
|
||||
# TYPO3 verifies argon2i hashes with plain password_verify()
|
||||
hash=$(php -r 'echo password_hash($argv[1], PASSWORD_ARGON2I);' "$DEV_PASSWORD")
|
||||
|
||||
{
|
||||
echo "SET @devPasswordHash = '${hash}';"
|
||||
cat /var/www/html/.ddev/anonymize-db.sql
|
||||
} | mysql --host=db --user=db --password=db db
|
||||
|
||||
echo "Database anonymized. Backend users log in with their username and the password '${DEV_PASSWORD}'."
|
||||
+14
-8
@@ -1,17 +1,17 @@
|
||||
name: ep-reisen-13
|
||||
name: ep-reisen
|
||||
type: typo3
|
||||
docroot: public
|
||||
php_version: "8.5"
|
||||
webserver_type: apache-fpm
|
||||
xdebug_enabled: false
|
||||
additional_hostnames:
|
||||
- sbw-ep13
|
||||
- snowzone-ep13
|
||||
- snowbreak-ep13
|
||||
- ser-ep13
|
||||
- alvac-ep13
|
||||
- cllt-ep13
|
||||
- skiwe-ep13
|
||||
- sbw
|
||||
- snowzone
|
||||
- snowbreak
|
||||
- ser
|
||||
- alvac
|
||||
- cllt
|
||||
- skiwe
|
||||
additional_fqdns: []
|
||||
database:
|
||||
type: mariadb
|
||||
@@ -23,6 +23,8 @@ web_environment:
|
||||
nodejs_version: "24"
|
||||
timezone: Europe/Berlin
|
||||
corepack_enable: false
|
||||
omit_containers:
|
||||
- ddev-ssh-agent
|
||||
|
||||
# Key features of DDEV's config.yaml:
|
||||
|
||||
@@ -313,3 +315,7 @@ corepack_enable: false
|
||||
#hooks:
|
||||
# post-start:
|
||||
# - exec: composer install -d /var/www/html
|
||||
|
||||
hooks:
|
||||
post-import-db:
|
||||
- exec: .ddev/commands/web/anonymize-db
|
||||
@@ -1,65 +1,26 @@
|
||||
# TYPO3 CMS Base Distribution
|
||||
# E&P Reisen websites (TYPO3 13)
|
||||
|
||||
Get going quickly with TYPO3 CMS.
|
||||
TYPO3 13 LTS for www.ep-reisen.de and its subsites (ski-boarderweek, snowzone, semesterende-skireisen,
|
||||
ski-wochenenden, …). Products, hotels, regions and dates live in `packages/ep_products`, templates
|
||||
and assets in `packages/ep_theme`. Dates, prices and availability come from **MyE&P** (`EP/myep`),
|
||||
which in turn reads bpn-connect.
|
||||
|
||||
## Prerequisites
|
||||
## Local setup
|
||||
|
||||
* PHP 8.2
|
||||
* [Composer](https://getcomposer.org/download/)
|
||||
DDEV project: `ddev start`, then `ddev composer install` and `ddev npm install && ddev npm run build`.
|
||||
Rebuild the assets after template changes: Tailwind purges classes it does not find in the
|
||||
templates.
|
||||
|
||||
## Quickstart
|
||||
## Documentation
|
||||
|
||||
* `composer create-project typo3/cms-base-distribution project-name ^13`
|
||||
* `cd project-name`
|
||||
- [docs/cms-api.md](docs/cms-api.md): the API TYPO3 serves to MyE&P and the chatbot
|
||||
(`/api/hotel`, `/api/product`, `/api/calendar-hotels`, `/api/content/*`).
|
||||
- [docs/calendars.md](docs/calendars.md): price calendar, Belegungskalender and iCal feed: where
|
||||
the data comes from, caching, and what to check when a calendar does not load.
|
||||
|
||||
Note that this distribution installs most, but not all of the TYPO3 CMS core extensions.
|
||||
Depending on your need you might also want to install other TYPO3 extensions from
|
||||
[packagist.org](https://packagist.org/?type=typo3-cms-framework).
|
||||
## Deployment
|
||||
|
||||
### Setup
|
||||
|
||||
To start an interactive installation, you can do so by executing the following
|
||||
command and then follow the wizard:
|
||||
|
||||
```bash
|
||||
composer exec typo3 setup
|
||||
```
|
||||
|
||||
### Setup unattended (optional)
|
||||
|
||||
If you're a more advanced user, you might want to leverage the unattended installation.
|
||||
To do this, you need to execute the following command and substitute the arguments
|
||||
with your own environment configuration.
|
||||
|
||||
```bash
|
||||
export TYPO3_SETUP_ADMIN_PASSWORD=$(tr -dc "_A-Za-z0-9#=$()/" < /dev/urandom | head -c24)
|
||||
composer exec -- typo3 setup \
|
||||
--no-interaction \
|
||||
--server-type=other \
|
||||
--driver=sqlite \
|
||||
--admin-username=admin \
|
||||
--admin-email="[email protected]" \
|
||||
--project-name="My TYPO3 Project" \
|
||||
--create-site="http://localhost:8000/"
|
||||
echo "Admin password: ${TYPO3_SETUP_ADMIN_PASSWORD}"
|
||||
```
|
||||
|
||||
### Development server
|
||||
|
||||
While it's advised to use a more sophisticated web server such as
|
||||
Apache 2 or Nginx, you can instantly run the project by using PHPs` built-in
|
||||
[web server](https://secure.php.net/manual/en/features.commandline.webserver.php).
|
||||
|
||||
* `TYPO3_CONTEXT=Development php -S localhost:8000 -t public`
|
||||
* open your browser at "http://localhost:8000"
|
||||
|
||||
Please be aware that the built-in web server is single threaded and only meant
|
||||
to be used for development.
|
||||
|
||||
## Next steps
|
||||
|
||||
* [Getting Started with TYPO3](https://docs.typo3.org/permalink/t3start:start)
|
||||
* [Create a Site Package](https://docs.typo3.org/permalink/t3sitepackage:start)
|
||||
`deploy.php` (Deployer). A deploy runs `extension:setup`, resets OPcache and flushes all caches.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
+1
-1
@@ -20,6 +20,7 @@
|
||||
"ep/ep-theme": "@dev",
|
||||
"fluidtypo3/vhs": "^8.0",
|
||||
"georgringer/news": "^14.1",
|
||||
"helhum/typo3-console": "^8.2",
|
||||
"lochmueller/staticfilecache": "^15.2",
|
||||
"ssch/typo3-encore": "^7.0",
|
||||
"typo3/cms-backend": "^13.4",
|
||||
@@ -29,7 +30,6 @@
|
||||
"typo3/cms-dashboard": "^13.4",
|
||||
"typo3/cms-extbase": "^13.4",
|
||||
"typo3/cms-extensionmanager": "^13.4",
|
||||
"typo3/cms-felogin": "^13.4",
|
||||
"typo3/cms-filelist": "^13.4",
|
||||
"typo3/cms-fluid": "^13.4",
|
||||
"typo3/cms-fluid-styled-content": "^13.4",
|
||||
|
||||
Generated
+1164
-645
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
/*/settings.yaml
|
||||
@@ -20,3 +20,5 @@ languages:
|
||||
languageId: 0
|
||||
rootPageId: 2458
|
||||
websiteTitle: ''
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -20,3 +20,5 @@ languages:
|
||||
languageId: 0
|
||||
rootPageId: 2457
|
||||
websiteTitle: ''
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -294,3 +294,5 @@ routes:
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nDisallow: /ajax/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
websiteTitle: ''
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -92,3 +92,5 @@ routes:
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
websiteTitle: 'Semsterende Skireisen'
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -75,3 +75,5 @@ routes:
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
websiteTitle: ''
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -59,3 +59,5 @@ routes:
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
websiteTitle: 'Ski-Wochenenden mit E&P Reisen und Events'
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -58,3 +58,5 @@ routes:
|
||||
route: robots.txt
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -58,3 +58,5 @@ routes:
|
||||
route: robots.txt
|
||||
type: staticText
|
||||
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\n"
|
||||
dependencies:
|
||||
- ep/theme
|
||||
@@ -22,6 +22,8 @@ return [
|
||||
'ep_products' => [
|
||||
// /api/hotel, /api/product, /api/content/* (X-Api-Key or ?key=)
|
||||
'cmsApiKey' => '',
|
||||
// n8n: PUT /api/json-ld/{uid} (X-Api-Key only), writes as backend user _n8n
|
||||
'jsonLdApiKey' => '',
|
||||
// MyE&P OAuth2 client credentials (import, price calendar); locally e.g. https://myep.ddev.site/api/
|
||||
'myEpApiBaseUrl' => '',
|
||||
'myEpApiClientId' => '',
|
||||
|
||||
+28
-1
@@ -21,10 +21,16 @@ set('shared_dirs', [
|
||||
// Baseline of the MyE&P import: without it every deploy would trigger a full re-import
|
||||
'var/transient/ep_products_import',
|
||||
]);
|
||||
// Not in git, production is leading (encryptionKey, install tool, backend changes)
|
||||
// Not in git, production is leading (encryptionKey, install tool, backend changes; the site
|
||||
// settings are edited in the backend's Settings module, one settings.yaml per site)
|
||||
set('site_settings_files', array_map(
|
||||
static fn(string $config): string => 'config/sites/' . basename(dirname($config)) . '/settings.yaml',
|
||||
glob(__DIR__ . '/config/sites/*/config.yaml')
|
||||
));
|
||||
set('shared_files', [
|
||||
'config/system/secrets.php',
|
||||
'config/system/settings.php',
|
||||
...get('site_settings_files'),
|
||||
]);
|
||||
set('writable_dirs', [
|
||||
'{{typo3/public_dir}}/typo3temp/assets',
|
||||
@@ -96,6 +102,25 @@ task('deploy:check:fileadmin', function () {
|
||||
}
|
||||
});
|
||||
|
||||
// The same for a site's settings.yaml: an empty one silently resets the site to the default settings
|
||||
// (navigation, storage folders, ...). A new site's file is put in place by hand first.
|
||||
task('deploy:check:site-settings', function () {
|
||||
foreach (get('site_settings_files') as $file) {
|
||||
if (!test("[ -s {{deploy_path}}/shared/$file ]")) {
|
||||
throw new \RuntimeException(parse("{{deploy_path}}/shared/$file is missing or empty"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Data migrations that the new release needs, named one by one: a wizard already done is skipped,
|
||||
// and pending core or third-party wizards are not run unattended
|
||||
set('upgrade_wizards', ['epProductsCalendarCode']);
|
||||
task('typo3:upgrade:run', function () {
|
||||
foreach (get('upgrade_wizards') as $wizard) {
|
||||
run("{{bin/php}} {{release_path}}/{{bin/typo3}} upgrade:run $wizard --no-interaction");
|
||||
}
|
||||
});
|
||||
|
||||
// current_path instead of the recipe's release_path, so it also works after a rollback
|
||||
task('typo3:cache:flush', function () {
|
||||
run('{{bin/php}} {{current_path}}/{{bin/typo3}} cache:flush');
|
||||
@@ -104,6 +129,7 @@ task('typo3:cache:flush', function () {
|
||||
task('deploy', [
|
||||
'deploy:info',
|
||||
'deploy:check:fileadmin',
|
||||
'deploy:check:site-settings',
|
||||
// Build locally first, so a failing build aborts before the server is touched at all.
|
||||
'deploy:build',
|
||||
'deploy:setup',
|
||||
@@ -114,6 +140,7 @@ task('deploy', [
|
||||
'deploy:writable',
|
||||
// The schema has to exist before the new code starts serving traffic.
|
||||
'typo3:extension:setup',
|
||||
'typo3:upgrade:run',
|
||||
// deploy:publish == deploy:symlink, deploy:unlock, deploy:cleanup, deploy:success
|
||||
'deploy:publish',
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
# Availability and prices on product pages
|
||||
|
||||
TYPO3 shows three things built from contingent data. None of them talks to bpn-connect directly:
|
||||
all go through **MyE&P**, which keeps a local snapshot of bpn-connect's availability and holds the
|
||||
group house prices.
|
||||
|
||||
| What | Where | Shown for | MyE&P endpoint |
|
||||
|---|---|---|---|
|
||||
| **Price calendar** + price tables | product detail, tab "Termine/Preise" | products with a calendar and season **summer** (`s`) | `contingents/calendar`, `contingents/prices` |
|
||||
| **Belegungskalender** (availability calendar) | product detail, sidebar | products with a calendar and season **not summer** | `contingents/availability` (+ `contingents/calendar` for the months to leave out) |
|
||||
| **iCal feed** for booking portals | `https://www.ep-reisen.de/contingents/<hotel>.ical` | every hotel with a Kalender-Code | `contingents/availability` |
|
||||
|
||||
So every product with a calendar shows exactly one. The MyE&P side is documented in
|
||||
its `docs/api-consumer-guide.md` (`EP/myep`).
|
||||
|
||||
## Hotel codes
|
||||
|
||||
Every field has one job:
|
||||
|
||||
| Field | Job |
|
||||
|---|---|
|
||||
| Hotel › **Import-Code** (`code`) and **Weitere Import-Codes** (matchcode aliases) | The BusPro codes whose imported dates land on this record, and by which `/api/hotel`, `/api/product?hotel=` and the Travelinfo page find it (`HotelCodeResolver`). A code belongs to one visible record; saving it on a second one is refused. Nothing to do with the calendars. |
|
||||
| Hotel › **Kalender-Code** (`calendar_code`) | The BusPro code whose contingent this record shows: calendars, price tables, iCal feed. Empty = no calendar, the feed answers `404`. Records may share it: a house's summer record (`…GRP`) and its winter record both carry the house's code. |
|
||||
| Product › **Kalender anzeigen** (`show_calendar`) | Whether the product page shows a calendar at all. |
|
||||
| Product › **Saison** (`season`) | Which one: `s` the price calendar, anything else the Belegungskalender. |
|
||||
|
||||
**The calendar on a product page is the Kalender-Code of the hotel that page shows**: the hotel
|
||||
pinned in the Produktdetail element, else the product's only Unterkunft, else the one picked in
|
||||
its hotel list (`Product::getCalendarHotelFor()`).
|
||||
|
||||
MyE&P only understands **BusPro codes** that it syncs (e.g. `DGS`, `LPJ`, `DKS`). When BusPro has
|
||||
several entries for a house (Mitterlengau: nine), only one carries the house's contingent; the
|
||||
office says which one, and that is the Kalender-Code.
|
||||
|
||||
The product's old "Unterkunft für Belegungskalender" (`calendar_hotel`) is no longer read. The
|
||||
upgrade wizard `epProductsCalendarCode` filled the new fields from it; `vendor/bin/typo3
|
||||
ep:calendar-codes` lists the product pages whose calendar differs from it, until it is removed.
|
||||
|
||||
## Price calendar (summer)
|
||||
|
||||
- `Product/Detail.html`, section `Dates`, partial `Product/PriceCalendar`;
|
||||
`AjaxCalendarController::priceCalendarAction` → `contingents/calendar` (status and price per
|
||||
day), `priceTableAction` → `contingents/prices` for the current and the next year (loaded when
|
||||
scrolled into view).
|
||||
- Only works for hotels that are an **accommodation with prices** in MyE&P (summer group houses).
|
||||
|
||||
## Belegungskalender (winter)
|
||||
|
||||
- `Product/Detail.html`, section `AvailabilityCalendar`, loaded by htmx when it scrolls into view
|
||||
(`intersect once`, so the hidden copy of the sidebar on the other breakpoint does not load);
|
||||
`AjaxCalendarController::availabilityAction`, template `AjaxCalendar/Availability.html`,
|
||||
month select `calendar_controller.js`.
|
||||
- All months in one response; the select only switches between them. 12 months from the current
|
||||
one, extended to the last month MyE&P has data for.
|
||||
- **Months with prices are left out**: they are summer, covered by the price calendar. Only summer
|
||||
months have prices today; that is the whole distinction. If `contingents/calendar` fails, all
|
||||
months are shown (not cached).
|
||||
- Colours as on TYPO3 10: green available (`OK`, and days without data), yellow on request
|
||||
(`ON_REQUEST`), red not available (`BLOCKED`), past days grey; a status change from the previous
|
||||
day is drawn as a diagonal. The `availability-*` classes are built in PHP, so they are safelisted
|
||||
in `tailwind.config.js`; without that Tailwind purges them.
|
||||
- Works for every hotel MyE&P syncs, with or without an accommodation (see below).
|
||||
|
||||
## iCal feed
|
||||
|
||||
- `IcalController::contingentsAction`, `IcalService`; route `/contingents/{hotel}.ical` on the
|
||||
`ep-reisen` site (`config/sites/ep-reisen/config.yaml`, page 9, type 1710), `{hotel}` is the
|
||||
hotel's path segment. The feed shows the record's Kalender-Code; without one it answers `404`.
|
||||
- One `Unavailable` event per run of `BLOCKED` or `ON_REQUEST` days with the same status, as on
|
||||
TYPO3 10.
|
||||
- Never cached. When MyE&P has no availability it answers `503` with `Retry-After: 900` instead of
|
||||
an empty calendar, which the portals would read as "every day free"; they keep their last import.
|
||||
|
||||
## Which hotels MyE&P has availability for
|
||||
|
||||
MyE&P syncs its snapshot from bpn-connect every 15 minutes during the day and hourly at night, for
|
||||
the calendar codes of its accommodations **plus** every code in TYPO3's `/api/calendar-hotels`
|
||||
(see [cms-api.md](cms-api.md)), which lists the Kalender-Code of every visible hotel record. So a
|
||||
hotel offered only in winter needs nothing in MyE&P: giving the record a Kalender-Code is enough;
|
||||
it is synced with the next run.
|
||||
|
||||
`contingents/availability` answers:
|
||||
- `400` for a code that is not synced (not an accommodation, not in TYPO3's list),
|
||||
- `502` when the hotel's snapshot is missing or older than 6 hours (sync failing),
|
||||
- `200` with one entry per known day otherwise.
|
||||
|
||||
`contingents/calendar` and `contingents/prices` additionally need an accommodation with prices.
|
||||
|
||||
MyE&P's `GET /api/contingents/status` lists every synced code with its source, prices, last sync
|
||||
and last error: the first place to look when a calendar does not load.
|
||||
|
||||
## Caching
|
||||
|
||||
- The AJAX responses (price calendar, price tables, Belegungskalender) are page-cached on the AJAX
|
||||
page for at most **1 hour** (`cache_period = 3600`) and never past midnight
|
||||
(`cache_clearAtMidnight`, past days must turn grey). Browsers do not cache them
|
||||
(`sendCacheHeaders = 0`).
|
||||
- **Errors are not cached** (`disablePageCache()`): the next visitor triggers a new attempt.
|
||||
- Every AJAX URL carries a cHash (required for `tx_epproducts_ajax`), so each hotel and year has its
|
||||
own cache entry.
|
||||
- Entries are tagged `ep_hotel_<code>`. Nothing flushes them automatically; a deploy flushes all
|
||||
caches. To refresh by hand: `vendor/bin/typo3 cache:flush --group pages`, or flush the tag via
|
||||
the `CacheManager` for a single hotel.
|
||||
- On top of that comes MyE&P's sync interval, so a calendar is at most about 1¼ hours behind
|
||||
bpn-connect.
|
||||
|
||||
## When a calendar does not load
|
||||
|
||||
The message is "Der Kalender konnte aktuell nicht geladen werden."; the iCal feed answers `503`.
|
||||
|
||||
| Cause | How to tell | Fix |
|
||||
|---|---|---|
|
||||
| No calendar at all | product's "Kalender anzeigen" off, or the shown hotel has no Kalender-Code | tick it / set the Kalender-Code of the hotel the page shows |
|
||||
| Kalender-Code is not a BusPro code (`…GRP`, `…SO`) | MyE&P `400`, bpn-connect `404` | set the house's BusPro code as Kalender-Code |
|
||||
| Code not synced by MyE&P | not in `contingents/status`; MyE&P `400` | check that the hotel record is visible (then its code is in `/api/calendar-hotels`) |
|
||||
| Sync failing for the hotel | `contingents/status`: `available: false`, `lastError` | MyE&P / bpn-connect |
|
||||
| MyE&P unreachable or its OAuth failing | all hotels fail; TYPO3 log `EP.EpProducts.MyEP.ApiClient` | MyE&P |
|
||||
| Price calendar only: no accommodation or no prices | MyE&P `400` / empty | prices are maintained in MyE&P's Groups admin |
|
||||
|
||||
TYPO3 logs every failed MyE&P call in `var/log/typo3_*.log` (component
|
||||
`EP.EpProducts.MyEP.ApiClient`, for the iCal feed also `EP.EpProducts.Service.IcalService`).
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
# CMS API
|
||||
|
||||
Endpoints TYPO3 serves to other systems: **MyE&P** (hotel and product content, calendar hotels),
|
||||
the **chatbot** (content feed) and **n8n** (JSON-LD of content elements). They are answered by `EP\EpProducts\Middleware\ApiMiddleware`
|
||||
before the page resolver, so they do not depend on a page and are never page-cached.
|
||||
|
||||
The other side of these contracts is documented in MyE&P's `docs/api-consumer-guide.md`
|
||||
(`EP/myep`).
|
||||
|
||||
## Authentication
|
||||
|
||||
All endpoints except `/api/json-ld/` (see there) need the shared key `cmsApiKey` from the `ep_products` extension configuration
|
||||
(Settings → Extension Configuration → ep_products, tab ContentFeed):
|
||||
|
||||
- header `X-Api-Key: <key>` (preferred, query strings end up in access logs), or
|
||||
- query parameter `?key=<key>`.
|
||||
|
||||
A missing or wrong key answers `403 {"message": "Invalid or missing api key"}`. An empty
|
||||
`cmsApiKey` denies every request. MyE&P sends the key as `APP_CMS_API_KEY`; both sides must be
|
||||
changed together.
|
||||
|
||||
## `GET /api/hotel?hotel=<code>`
|
||||
|
||||
Content of one hotel, for MyE&P's group house pages and booking flow.
|
||||
|
||||
- `hotel`: an import code of the record: its "Import-Code" or one of its "Weitere Import-Codes"
|
||||
(matchcode aliases), resolved by `HotelCodeResolver`. In MyE&P this is the accommodation's
|
||||
**CMS code** (e.g. `DGSGRP`), which can differ from its calendar code.
|
||||
- `400` without `hotel`, `404 {"message": "Hotel not found"}` for an unknown code.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "…", "code": "…",
|
||||
"description": "…", "features": "…", "room_types": "…",
|
||||
"additional_information": "…", "address": "…",
|
||||
"images": {"original": [{"url": "…", "alt": "…", "title": "…"}], "resized": […]},
|
||||
"icons": […],
|
||||
"region": {"name": "…", "latitude": …, "longitude": …, "webcam": "…", "ski_area": "…",
|
||||
"ski_area_extended": "…", "description": "…", "news": "…", "length": …,
|
||||
"altitude": …, "lifts": …, "images": {…}, "region_maps": [{"url": "…", "alt": "…", "title": "…"}]}
|
||||
}
|
||||
```
|
||||
|
||||
## `GET /api/product?product=<code>[&hotel=<code>]`
|
||||
|
||||
Content of one product with a hotel.
|
||||
|
||||
- `product`: the product code (default language). `400` without it, `404 {"message": "Product
|
||||
not found"}` for an unknown code.
|
||||
- Without `hotel` (MyE&P's group houses, linked by product code): the product's only visible
|
||||
Unterkunft. Any other number of visible Unterkünfte answers `422 {"message": "Product <code>
|
||||
links <n> hotels, expected exactly 1", "hotel_count": <n>}`.
|
||||
- With `hotel` (MyE&P's booking flow): the record of that import code, as in `/api/hotel`; an
|
||||
unknown code gives `"hotel": []`.
|
||||
- `board_description`, `additional_services`: raw RTE values, `""` when empty.
|
||||
- `calendar_hotel_code`: the Kalender-Code of the hotel when "Kalender anzeigen" is on, else
|
||||
`null`. MyE&P compares it with its accommodation's calendar code.
|
||||
|
||||
```json
|
||||
{
|
||||
"product": {"name": "…", "code": "…", "images": {…}, "board_description": "…",
|
||||
"additional_services": "…", "calendar_hotel_code": "SST"},
|
||||
"country": {"name": "…"},
|
||||
"region": {…},
|
||||
"city": {"name": "…"},
|
||||
"hotel": {…}
|
||||
}
|
||||
```
|
||||
|
||||
## `GET /api/calendar-hotels`
|
||||
|
||||
The Kalender-Codes of all visible hotel records: the codes whose availability TYPO3 shows (iCal
|
||||
feeds, availability calendar, price calendar). MyE&P syncs its contingent snapshot for these codes
|
||||
in addition to its accommodations, so hotels offered only in winter, which have no accommodation in
|
||||
MyE&P, have availability too. See [calendars.md](calendars.md).
|
||||
|
||||
- One entry per code; `name` of the record whose import code it is, else of the first record.
|
||||
- `products`: visible products with "Kalender anzeigen" that link a record with the code under
|
||||
Unterkünfte.
|
||||
- Sorted by code; products by uid. Names have line breaks collapsed.
|
||||
- `season`: `"s"` (summer), `"w"` (winter) or `null`.
|
||||
|
||||
```json
|
||||
[
|
||||
{"code": "DKI", "name": "Sportclub Schwendi", "products": [
|
||||
{"uid": 155, "name": "Sportclub Schwendi", "season": "w"},
|
||||
{"uid": 362, "name": "Gruppenhaus Schwendi", "season": "s"}
|
||||
]}
|
||||
]
|
||||
```
|
||||
|
||||
Every code in this list should be a **BusPro code** with a contingent (see
|
||||
[calendars.md](calendars.md#hotel-codes)).
|
||||
|
||||
## `GET /api/content/manifest` and `GET /api/content/records?type=<type>&uids=<uids>`
|
||||
|
||||
The content feed for the chatbot (`EP\EpProducts\ContentFeed\ContentFeedApi`).
|
||||
|
||||
- `manifest`: everything the feed publishes (pages of the configured sites and records), with a
|
||||
modification timestamp per item. Cached for 10 minutes.
|
||||
- `records`: up to 100 records of one type per request. `type` is one of `product`, `hotel`,
|
||||
`region`, `country`, `city`, `concept`, `news`; `uids` comma-separated. Uids that are no longer
|
||||
eligible are left out, not answered with an error (the consumer reads them as deleted).
|
||||
- `400` for an unknown type, no uids or more than 100 uids; `404` for other paths.
|
||||
- `503` with `Retry-After: 3600` when the feed is switched off (`contentFeedEnabled = 0`, the kill
|
||||
switch for when the host is struggling), `503` when `contentFeedSites` is empty. The consumer
|
||||
keeps what it has on a 503; nothing is deleted on the chatbot side.
|
||||
|
||||
Configuration (extension configuration `ep_products`, tab ContentFeed): `contentFeedEnabled`,
|
||||
`contentFeedSites`, `contentFeedLanguages`, `contentFeedExcludedPages`,
|
||||
`contentFeedNewsDetailPages`.
|
||||
|
||||
## `PUT /api/json-ld/<uid>`
|
||||
|
||||
n8n writes the JSON-LD (SEO markup) of a content element (`EP\EpProducts\JsonLd\JsonLdApi`).
|
||||
n8n is the source of truth: the element's `bodytext` is replaced with the posted object wrapped in
|
||||
`<script type="application/ld+json">`, whatever the element held before. Only plain html elements
|
||||
(`CType` `html`) are written, any other type is refused, so a wrong uid cannot replace visible page
|
||||
content. Other fields (hidden, …) are left alone; each translation is its own uid.
|
||||
|
||||
- Key: `jsonLdApiKey` (extension configuration `ep_products`, tab JsonLd), only as header
|
||||
`X-Api-Key`; `?key=` is not accepted.
|
||||
- `POST` does the same as `PUT` (n8n's default method).
|
||||
- Body: the JSON-LD object (or array of objects) itself, e.g.
|
||||
`{"@context": "https://schema.org", "@type": "Event", …}`. Pretty-printed when stored;
|
||||
`<` and `>` are escaped as `\u003C`/`\u003E`, so a value cannot close the script element.
|
||||
- `200 {"uid": 13169, "pid": 24, "changed": true}`; `changed: false` when the stored markup is
|
||||
already identical (nothing written).
|
||||
- `400` for invalid JSON or a scalar, `403` for a wrong or missing key, `404` for an unknown or
|
||||
deleted uid, `405` for other methods, `409` when the element is not of type `html`, `503` when
|
||||
the backend user `_n8n` is missing, `500` with `errors` when DataHandler refuses the write.
|
||||
|
||||
The write goes through DataHandler as the backend user `_n8n` (no password, so no login; group
|
||||
`n8n` with *Tables (modify)* `tt_content` and *Explicitly allow* `tt_content:CType:html`; page
|
||||
permissions are bypassed). Every change is in the element's history, where it can be undone, and
|
||||
clears the page cache.
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpProducts\Command;
|
||||
|
||||
use EP\EpProducts\Service\CalendarCodeMigration;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
/**
|
||||
* The editors' list after the switch to Kalender-Codes; goes away with calendar_hotel
|
||||
*/
|
||||
#[AsCommand(name: 'ep:calendar-codes', description: 'Lists product pages whose calendar differs from the old "Unterkunft für Belegungskalender"')]
|
||||
class CalendarCodesCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
private readonly CalendarCodeMigration $calendarCodeMigration,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$differences = $this->calendarCodeMigration->findDifferences();
|
||||
if ([] === $differences) {
|
||||
$io->success('Every product page shows the same calendar as with "Unterkunft für Belegungskalender".');
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
$io->table(
|
||||
['Produkt', 'Saison', 'Unterkunft', 'bisher', 'jetzt'],
|
||||
array_map(static fn(array $row): array => [
|
||||
sprintf('%d %s', $row['product'], $row['name']),
|
||||
$row['season'],
|
||||
0 === $row['hotel'] ? $row['hotelName'] : sprintf('%d %s', $row['hotel'], $row['hotelName']),
|
||||
'' !== $row['before'] ? $row['before'] : '–',
|
||||
'' !== $row['after'] ? $row['after'] : '–',
|
||||
], $differences)
|
||||
);
|
||||
$io->writeln('bisher: Code der "Unterkunft für Belegungskalender"; jetzt: Kalender-Code der angezeigten Unterkunft, wenn "Kalender anzeigen" an ist.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ class ManifestBuilder
|
||||
'pid',
|
||||
'sys_language_uid',
|
||||
'MAX(tstamp) AS tstamp',
|
||||
"SUM(CASE WHEN deleted = 0 AND hidden = 0 AND CType <> 'list' THEN 1 ELSE 0 END) AS text_elements"
|
||||
"SUM(CASE WHEN deleted = 0 AND hidden = 0 AND CType <> 'list' AND CType NOT LIKE 'epproducts\\_%' THEN 1 ELSE 0 END) AS text_elements"
|
||||
)
|
||||
->from('tt_content')->groupBy('pid', 'sys_language_uid')->executeQuery()
|
||||
->fetchAllAssociative()
|
||||
|
||||
@@ -386,7 +386,13 @@ class RecordSerializer
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_webcam');
|
||||
$url = $queryBuilder
|
||||
->select('url')
|
||||
->from('tx_epproducts_domain_model_webcam')->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($webcamUid, Connection::PARAM_INT)))->executeQuery()
|
||||
->from('tx_epproducts_domain_model_webcam')->where(
|
||||
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($webcamUid, Connection::PARAM_INT)),
|
||||
$queryBuilder->expr()->or(
|
||||
$queryBuilder->expr()->eq('available', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)),
|
||||
$queryBuilder->expr()->eq('manual', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)),
|
||||
),
|
||||
)->executeQuery()
|
||||
->fetchOne()
|
||||
;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class AjaxCalendarController extends ActionController
|
||||
|
||||
public function priceCalendarAction(Hotel $hotel, int $months = 12): ResponseInterface
|
||||
{
|
||||
$hotelCode = trim($hotel->getCode() ?? '');
|
||||
$hotelCode = trim($hotel->getCalendarCode());
|
||||
$this->tagPageCacheForHotel($hotelCode);
|
||||
|
||||
$dateRange = DateUtility::getDateRange(null, null, $months);
|
||||
@@ -112,10 +112,101 @@ class AjaxCalendarController extends ActionController
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Availability calendar (Belegungskalender) of the product detail sidebar, for products
|
||||
* without the price calendar, limited to the months without prices (winter). TYPO3 10
|
||||
* fetched it month by month from bpn-connect; MyE&P returns the whole snapshot at once,
|
||||
* so every month is rendered and the month select only switches between them.
|
||||
*/
|
||||
public function availabilityAction(Hotel $hotel, int $months = 12): ResponseInterface
|
||||
{
|
||||
$hotelCode = trim($hotel->getCalendarCode());
|
||||
$this->tagPageCacheForHotel($hotelCode);
|
||||
|
||||
$period = DateUtility::getDateRange(null, null, $months)['period'];
|
||||
$today = new \DateTimeImmutable('today');
|
||||
|
||||
$statusByDate = [];
|
||||
$error = false;
|
||||
|
||||
if ('' === $hotelCode) {
|
||||
$error = true;
|
||||
$this->disablePageCache();
|
||||
} else {
|
||||
try {
|
||||
foreach ($this->myEpClient->getContingentAvailability($hotelCode) as $item) {
|
||||
if (!is_array($item) || !isset($item['date'])) {
|
||||
continue;
|
||||
}
|
||||
$statusByDate[$item['date']] = $this->normalizeAvailabilityStatus((string)($item['status'] ?? 'OK'));
|
||||
}
|
||||
} catch (ApiException $e) {
|
||||
$error = true;
|
||||
$this->disablePageCache();
|
||||
}
|
||||
}
|
||||
|
||||
if ([] !== $statusByDate) {
|
||||
$lastDataDate = new \DateTimeImmutable(max(array_keys($statusByDate)));
|
||||
$dataEnd = $lastDataDate->modify('first day of next month')->setTime(0, 0, 0);
|
||||
if ($dataEnd > $period->getEndDate()) {
|
||||
$period = new Period($period->getStartDate(), $dataEnd);
|
||||
}
|
||||
}
|
||||
|
||||
// Days without a row are available, as on TYPO3 10. A change of the occupancy level
|
||||
// from the previous day is drawn as a diagonal transition (arrival/departure day).
|
||||
$classByDate = [];
|
||||
$previousStatus = $statusByDate[$period->getStartDate()->modify('-1 day')->format('Y-m-d')] ?? 'OK';
|
||||
for ($day = \DateTimeImmutable::createFromInterface($period->getStartDate()); $day < $period->getEndDate(); $day = $day->modify('+1 day')) {
|
||||
$dateKey = $day->format('Y-m-d');
|
||||
$status = $statusByDate[$dateKey] ?? 'OK';
|
||||
if ($day < $today) {
|
||||
$classByDate[$dateKey] = 'text-zinc-400';
|
||||
} elseif ($previousStatus !== $status) {
|
||||
$classByDate[$dateKey] = 'text-white availability-' . $this->getAvailabilitySuffix($previousStatus) . '-to-' . $this->getAvailabilitySuffix($status);
|
||||
} else {
|
||||
$classByDate[$dateKey] = 'text-white availability-' . $this->getAvailabilitySuffix($status);
|
||||
}
|
||||
$previousStatus = $status;
|
||||
}
|
||||
|
||||
// Only summer months have prices in the price config, and those are covered by the
|
||||
// price calendar, so they are left out here. If the price config is unavailable, all
|
||||
// months are shown, but not cached.
|
||||
$priceMonths = [];
|
||||
if (!$error) {
|
||||
try {
|
||||
foreach ($this->myEpClient->getPriceConfigData($hotelCode) as $item) {
|
||||
if (!is_array($item) || !isset($item['date'])) {
|
||||
continue;
|
||||
}
|
||||
if (null !== ($item['pricePerNight'] ?? null) || null !== ($item['defaultPricePerNight'] ?? null)) {
|
||||
$priceMonths[substr((string)$item['date'], 0, 7)] = true;
|
||||
}
|
||||
}
|
||||
} catch (ApiException $e) {
|
||||
$this->disablePageCache();
|
||||
}
|
||||
}
|
||||
|
||||
$calendarMonths = array_values(array_filter(
|
||||
$this->buildCalendarMonths($period),
|
||||
fn (array $month): bool => !isset($priceMonths[$month['date']->format('Y-m')])
|
||||
));
|
||||
|
||||
$this->view->assignMultiple([
|
||||
'classByDate' => $classByDate,
|
||||
'calendarMonths' => $calendarMonths,
|
||||
'error' => $error,
|
||||
]);
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
public function priceTableAction(Hotel $hotel, ?string $year = null): ResponseInterface
|
||||
{
|
||||
$year ??= new \DateTimeImmutable()->format('Y');
|
||||
$hotelCode = trim($hotel->getCode() ?? '');
|
||||
$hotelCode = trim($hotel->getCalendarCode());
|
||||
$this->tagPageCacheForHotel($hotelCode);
|
||||
|
||||
$priceTable = [
|
||||
@@ -167,6 +258,25 @@ class AjaxCalendarController extends ActionController
|
||||
$this->request->getAttribute('frontend.cache.instruction')?->disableCache('Price calendar data could not be retrieved');
|
||||
}
|
||||
|
||||
private function normalizeAvailabilityStatus(string $status): string
|
||||
{
|
||||
$status = strtoupper(trim($status));
|
||||
if ('ONREQUEST' === $status) {
|
||||
return 'ON_REQUEST';
|
||||
}
|
||||
|
||||
return in_array($status, ['OK', 'ON_REQUEST', 'BLOCKED'], true) ? $status : 'OK';
|
||||
}
|
||||
|
||||
private function getAvailabilitySuffix(string $status): string
|
||||
{
|
||||
return match ($status) {
|
||||
'BLOCKED' => 'none',
|
||||
'ON_REQUEST' => 'partial',
|
||||
default => 'full',
|
||||
};
|
||||
}
|
||||
|
||||
private function buildTooltip(string $status, array $item): string
|
||||
{
|
||||
if ($status === 'blocked') {
|
||||
|
||||
@@ -4,14 +4,21 @@ namespace EP\EpProducts\Controller;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use EP\EpProducts\Domain\Model\Concept;
|
||||
use EP\EpProducts\Domain\Model\Product;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class AjaxTeaserPopupController extends ActionController
|
||||
{
|
||||
public function conceptAction(Concept $concept, string $targetUrl): ResponseInterface
|
||||
public function conceptAction(Concept $concept, string $targetUrl, ?Product $product = null): ResponseInterface
|
||||
{
|
||||
// A product can have its own text; title, image and button stay those of the concept
|
||||
$popupText = (string)$product?->getPopupText();
|
||||
if ('' === trim(strip_tags($popupText))) {
|
||||
$popupText = $concept->getPopupText();
|
||||
}
|
||||
$this->view->assignMultiple([
|
||||
'concept' => $concept,
|
||||
'popupText' => $popupText,
|
||||
'targetUrl' => $targetUrl,
|
||||
]);
|
||||
return $this->htmlResponse();
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpProducts\Controller;
|
||||
|
||||
use EP\EpProducts\Domain\Model\Hotel;
|
||||
use EP\EpProducts\Service\IcalService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TYPO3\CMS\Core\Http\PropagateResponseException;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
class IcalController extends ActionController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly IcalService $icalService,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The feed is sent as a response of its own, past the page cache: a cached page would lose the
|
||||
* Content-Disposition header, and availability must not be older than the MyE&P snapshot
|
||||
*/
|
||||
public function contingentsAction(Hotel $hotel): ResponseInterface
|
||||
{
|
||||
// Without a Kalender-Code the hotel has no availability; an empty calendar would read as free
|
||||
if ('' === trim($hotel->getCalendarCode())) {
|
||||
throw new PropagateResponseException(
|
||||
$this->responseFactory->createResponse(404)
|
||||
->withHeader('Content-Type', 'text/plain; charset=utf-8')
|
||||
->withHeader('Cache-Control', 'private, no-store')
|
||||
->withBody($this->streamFactory->createStream('No availability for this hotel')),
|
||||
1763309100
|
||||
);
|
||||
}
|
||||
|
||||
$calendar = $this->icalService->createContingentsFeed($hotel);
|
||||
|
||||
// An empty calendar would show the portals every day as free; an error keeps their last import
|
||||
if (null === $calendar) {
|
||||
throw new PropagateResponseException(
|
||||
$this->responseFactory->createResponse(503)
|
||||
->withHeader('Content-Type', 'text/plain; charset=utf-8')
|
||||
->withHeader('Cache-Control', 'private, no-store')
|
||||
->withHeader('Retry-After', '900')
|
||||
->withBody($this->streamFactory->createStream('Availability temporarily unavailable')),
|
||||
1761730800
|
||||
);
|
||||
}
|
||||
|
||||
throw new PropagateResponseException(
|
||||
$this->responseFactory->createResponse()
|
||||
->withHeader('Content-Type', 'text/calendar;charset=UTF-8')
|
||||
->withHeader('Content-Disposition', sprintf('attachment; filename=%s.ical', $hotel->getPathSegment()))
|
||||
->withHeader('Cache-Control', 'private, no-store')
|
||||
->withBody($this->streamFactory->createStream($calendar)),
|
||||
1761730801
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -91,13 +91,10 @@ class ProductController extends ActionController
|
||||
$isProductWithGroupInquiryForm = ($concept !== null) && \in_array($concept->getUid(), $groupInquiryFormConceptUids);
|
||||
$nonBookableInfo = $product->getNonBookableInfo();
|
||||
|
||||
// Assemble backlink
|
||||
$backlinkUrl = $this->request->getQueryParams()['ref'] ?? null;
|
||||
$backLinkLabel = strpos((string)$backlinkUrl, 'suche') !== -1 ? 'zurück zum Suchergebnis' : 'zurück';
|
||||
|
||||
$this->view->assignMultiple([
|
||||
'hotel' => $hotel,
|
||||
'product' => $product,
|
||||
'calendarHotel' => $product->getCalendarHotelFor($hotel),
|
||||
// Daytrip availability came from the contingent import, which is not ported
|
||||
'enabledDates' => [],
|
||||
'isProductWithExcludedConcept' => $isProductWithExcludedConcept,
|
||||
@@ -106,8 +103,6 @@ class ProductController extends ActionController
|
||||
'currentPageUid' => $this->request->getAttribute('frontend.page.information')->getId(),
|
||||
'dateFrom' => $dateFrom,
|
||||
'dateTo' => $dateTo,
|
||||
'referringUrl' => $backlinkUrl,
|
||||
'backlinkLabel' => $backLinkLabel,
|
||||
'nonBookableInfo' => $nonBookableInfo,
|
||||
'pickupsOverview' => $this->pickupOverviewService->getOverview($product, $hotel),
|
||||
]);
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
namespace EP\EpProducts\Controller;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use EP\EpProducts\Domain\Model\Hotel;
|
||||
use EP\EpProducts\Domain\Model\Travelinfo;
|
||||
use EP\EpProducts\Domain\Repository\HotelRepository;
|
||||
use EP\EpProducts\Service\HotelCodeResolver;
|
||||
use EP\EpProducts\Domain\Repository\TravelinfoRepository;
|
||||
use EP\EpProducts\MyEP\ApiClient;
|
||||
use EP\EpProducts\MyEP\ApiException;
|
||||
@@ -19,6 +22,8 @@ class TravelinfoController extends ActionController
|
||||
public function __construct(
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly TravelinfoRepository $travelinfoRepository,
|
||||
private readonly HotelRepository $hotelRepository,
|
||||
private readonly HotelCodeResolver $hotelCodeResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -94,11 +99,21 @@ class TravelinfoController extends ActionController
|
||||
$departureDayTime = $serviceDetail['dayTime'];
|
||||
}
|
||||
|
||||
// MyEP's hotel address is meant for the bus driver, so the editorial one is preferred
|
||||
$hotel = null;
|
||||
$hotelCode = $travelData['hotel']['code'] ?? null;
|
||||
if (null !== $hotelCode && '' !== $hotelCode) {
|
||||
$hotelUid = $this->hotelCodeResolver->findUid($hotelCode);
|
||||
$hotel = null !== $hotelUid ? $this->hotelRepository->findByUid($hotelUid) : null;
|
||||
}
|
||||
$hotelAddress = $hotel instanceof Hotel ? trim((string)$hotel->getAddress()) : '';
|
||||
|
||||
$this->view->assign('travelInfo', $travelInfo);
|
||||
$this->view->assign('travelData', $travelData);
|
||||
$this->view->assign('pickupsPlanning', $pickupsPlanning);
|
||||
$this->view->assign('courses', $courses);
|
||||
$this->view->assign('board', $board);
|
||||
$this->view->assign('departureDayTime', $departureDayTime);
|
||||
$this->view->assign('hotelAddress', $hotelAddress);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Dashboard;
|
||||
|
||||
use EP\EpProducts\MyEP\ApiClient;
|
||||
use EP\EpProducts\Service\ApiImportSource;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\View\BackendViewFactory;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Dashboard\Widgets\RequestAwareWidgetInterface;
|
||||
use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface;
|
||||
use TYPO3\CMS\Dashboard\Widgets\WidgetInterface;
|
||||
|
||||
/**
|
||||
* When the imports last ran and what data they brought, replacing the TYPO3 10 system information entry
|
||||
* "Letzer Produktdaten-Import"
|
||||
*/
|
||||
final class ImportStatusWidget implements WidgetInterface, RequestAwareWidgetInterface
|
||||
{
|
||||
/**
|
||||
* Command => label; the scheduler tasks are found by the command they run, not by uid
|
||||
*/
|
||||
private const array COMMANDS = [
|
||||
'ep:import-dates' => 'Reisedaten (MyE&P)',
|
||||
'ep:import-snowreport' => 'Schneehöhen',
|
||||
'ep:groups-swiss' => 'groups.swiss',
|
||||
];
|
||||
|
||||
/**
|
||||
* A task whose next run is this far in the past means scheduler:run is not called any more
|
||||
*/
|
||||
private const int OVERDUE_SECONDS = 3600;
|
||||
|
||||
private ServerRequestInterface $request;
|
||||
|
||||
public function __construct(
|
||||
private readonly WidgetConfigurationInterface $configuration,
|
||||
private readonly BackendViewFactory $backendViewFactory,
|
||||
private readonly ConnectionPool $connectionPool,
|
||||
private readonly ApiImportSource $importSource,
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly array $options = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function setRequest(ServerRequestInterface $request): void
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function renderWidgetContent(): string
|
||||
{
|
||||
$tasks = $this->findTasks();
|
||||
$rows = [];
|
||||
foreach (self::COMMANDS as $command => $label) {
|
||||
$rows[$command] = ['label' => $label, 'dataAt' => null, 'task' => $tasks[$command] ?? null];
|
||||
}
|
||||
$rows['ep:import-dates']['dataAt'] = $this->importSource->getImportedTimestamp()?->getTimestamp();
|
||||
$rows['ep:import-snowreport']['dataAt'] = $this->findLastSnowreportUpdate();
|
||||
|
||||
$myEpLastUpdate = null;
|
||||
$myEpUnreachable = false;
|
||||
try {
|
||||
$myEpLastUpdate = $this->apiClient->getLastUpdateAt()?->getTimestamp();
|
||||
} catch (\Throwable) {
|
||||
$myEpUnreachable = true;
|
||||
}
|
||||
|
||||
$view = $this->backendViewFactory->create($this->request, ['typo3/cms-dashboard', 'ep/ep-products']);
|
||||
$view->assignMultiple([
|
||||
'rows' => $rows,
|
||||
'myEpLastUpdate' => $myEpLastUpdate,
|
||||
'myEpUnreachable' => $myEpUnreachable,
|
||||
'importPending' => null !== $myEpLastUpdate && $myEpLastUpdate > (int)$rows['ep:import-dates']['dataAt'],
|
||||
'configuration' => $this->configuration,
|
||||
]);
|
||||
|
||||
return $view->render('Widget/ImportStatusWidget');
|
||||
}
|
||||
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array{uid: int, disabled: bool, lastRun: int, nextRun: int, overdue: bool, failure: ?string}>
|
||||
*/
|
||||
private function findTasks(): array
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_scheduler_task');
|
||||
$result = $queryBuilder
|
||||
->select('uid', 'disable', 'lastexecution_time', 'lastexecution_failure', 'nextexecution', 'serialized_task_object')
|
||||
->from('tx_scheduler_task')
|
||||
->where($queryBuilder->expr()->eq('deleted', 0))
|
||||
->orderBy('uid')
|
||||
->executeQuery();
|
||||
|
||||
$tasks = [];
|
||||
while ($row = $result->fetchAssociative()) {
|
||||
foreach (array_keys(self::COMMANDS) as $command) {
|
||||
// The command identifier appears in the serialized ExecuteSchedulableCommandTask exactly as
|
||||
// serialize() writes the string; matching it avoids unserializing task objects
|
||||
if (!isset($tasks[$command]) && str_contains((string)$row['serialized_task_object'], serialize($command))) {
|
||||
$tasks[$command] = [
|
||||
'uid' => (int)$row['uid'],
|
||||
'disabled' => (bool)$row['disable'],
|
||||
'lastRun' => (int)$row['lastexecution_time'],
|
||||
'nextRun' => (int)$row['nextexecution'],
|
||||
'overdue' => !$row['disable'] && 0 < (int)$row['nextexecution']
|
||||
&& (int)$row['nextexecution'] < time() - self::OVERDUE_SECONDS,
|
||||
'failure' => $this->failureMessage((string)$row['lastexecution_failure']),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
|
||||
private function failureMessage(string $failure): ?string
|
||||
{
|
||||
if ('' === $failure) {
|
||||
return null;
|
||||
}
|
||||
// Written by the scheduler as serialize(['code' => …, 'message' => …, …])
|
||||
$data = @unserialize($failure, ['allowed_classes' => false]);
|
||||
|
||||
return is_array($data) && '' !== (string)($data['message'] ?? '') ? (string)$data['message'] : 'Unbekannter Fehler';
|
||||
}
|
||||
|
||||
private function findLastSnowreportUpdate(): ?int
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_snowreport');
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
$tstamp = $queryBuilder
|
||||
->selectLiteral('MAX(tstamp)')
|
||||
->from('tx_epproducts_domain_model_snowreport')
|
||||
->executeQuery()
|
||||
->fetchOne();
|
||||
|
||||
return $tstamp ? (int)$tstamp : null;
|
||||
}
|
||||
}
|
||||
@@ -171,6 +171,12 @@ class Hotel extends AbstractEntity implements TeaserInterface
|
||||
*/
|
||||
protected $code = '';
|
||||
|
||||
/**
|
||||
* BusPro code of the house whose availability this record shows, shared by its summer and
|
||||
* winter records; empty = no calendar
|
||||
*/
|
||||
protected string $calendarCode = '';
|
||||
|
||||
/**
|
||||
* @var ObjectStorage<MatchCode>
|
||||
*/
|
||||
@@ -765,6 +771,16 @@ class Hotel extends AbstractEntity implements TeaserInterface
|
||||
$this->code = $code;
|
||||
}
|
||||
|
||||
public function getCalendarCode(): string
|
||||
{
|
||||
return $this->calendarCode;
|
||||
}
|
||||
|
||||
public function setCalendarCode(string $calendarCode): void
|
||||
{
|
||||
$this->calendarCode = $calendarCode;
|
||||
}
|
||||
|
||||
public function addAdditionalCode(MatchCode $code): void
|
||||
{
|
||||
$this->additionalCodes->attach($code);
|
||||
|
||||
@@ -239,6 +239,8 @@ class Product extends AbstractEntity implements TeaserInterface
|
||||
*/
|
||||
protected $calendarHotel;
|
||||
|
||||
protected bool $showCalendar = false;
|
||||
|
||||
/**
|
||||
* @var Product
|
||||
*/
|
||||
@@ -279,6 +281,11 @@ class Product extends AbstractEntity implements TeaserInterface
|
||||
*/
|
||||
protected $nonBookableInfo;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $popupText = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->initStorageObjects();
|
||||
@@ -1019,6 +1026,29 @@ class Product extends AbstractEntity implements TeaserInterface
|
||||
$this->calendarHotel = $calendarHotel;
|
||||
}
|
||||
|
||||
public function getShowCalendar(): bool
|
||||
{
|
||||
return $this->showCalendar;
|
||||
}
|
||||
|
||||
public function setShowCalendar(bool $showCalendar): void
|
||||
{
|
||||
$this->showCalendar = $showCalendar;
|
||||
}
|
||||
|
||||
/**
|
||||
* The hotel whose calendar this product's page shows: the hotel the page shows, when
|
||||
* "Kalender anzeigen" is on and that hotel has a Kalender-Code
|
||||
*/
|
||||
public function getCalendarHotelFor(?Hotel $hotel): ?Hotel
|
||||
{
|
||||
if (!$this->showCalendar || null === $hotel || '' === trim($hotel->getCalendarCode())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $hotel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Product
|
||||
*/
|
||||
@@ -1146,6 +1176,18 @@ class Product extends AbstractEntity implements TeaserInterface
|
||||
$this->tourThumbnail = $tourThumbnail;
|
||||
}
|
||||
|
||||
public function getPopupText()
|
||||
{
|
||||
return $this->popupText;
|
||||
}
|
||||
|
||||
public function setPopupText($popupText): static
|
||||
{
|
||||
$this->popupText = $popupText;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTourLink()
|
||||
{
|
||||
return $this->tourLink;
|
||||
|
||||
@@ -371,7 +371,7 @@ class Region extends AbstractDestination implements TeaserInterface
|
||||
public function getWebcamAvailable(): bool
|
||||
{
|
||||
$webcam = $this->getWebcam();
|
||||
return $webcam !== null && $webcam->getAvailable();
|
||||
return null !== $webcam && $webcam->isVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,11 @@ class Webcam extends AbstractEntity
|
||||
*/
|
||||
protected $available = true;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $manual = false;
|
||||
|
||||
/**
|
||||
* @return Snowreport
|
||||
*/
|
||||
@@ -113,4 +118,22 @@ class Webcam extends AbstractEntity
|
||||
{
|
||||
$this->available = $available;
|
||||
}
|
||||
|
||||
public function getManual(): bool
|
||||
{
|
||||
return (bool) $this->manual;
|
||||
}
|
||||
|
||||
public function setManual(bool $manual): void
|
||||
{
|
||||
$this->manual = $manual;
|
||||
}
|
||||
|
||||
/**
|
||||
* The feed's availability only applies to imported cams; editors show or hide their own via "hidden"
|
||||
*/
|
||||
public function isVisible(): bool
|
||||
{
|
||||
return $this->getManual() || (bool) $this->getAvailable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Hooks;
|
||||
|
||||
use EP\EpProducts\Service\HotelCodeResolver;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Core\SysLog\Action\Database as DatabaseAction;
|
||||
use TYPO3\CMS\Core\SysLog\Error as SystemLogErrorClassification;
|
||||
|
||||
/**
|
||||
* A BusPro code is an import code ("Import-Code" or "Weitere Import-Codes") of at most one visible hotel
|
||||
* record: a code already on another record is not saved, and the editor gets a message naming it.
|
||||
* Hidden records don't count. The Kalender-Code is not checked, records share it on purpose.
|
||||
*/
|
||||
class ImportCodeCheck
|
||||
{
|
||||
private const string HOTEL_TABLE = 'tx_epproducts_domain_model_hotel';
|
||||
private const string ALIAS_TABLE = 'tx_epproducts_domain_model_matchcode';
|
||||
|
||||
public function __construct(
|
||||
private readonly HotelCodeResolver $hotelCodeResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
public function processDatamap_preProcessFieldArray(array &$fieldArray, string $table, string|int $id, DataHandler $dataHandler): void
|
||||
{
|
||||
if (!isset($fieldArray['code']) || '' === trim((string)$fieldArray['code'])) {
|
||||
return;
|
||||
}
|
||||
// Old duplicates are reported by the import's log, not on every save of an unchanged code
|
||||
if (is_numeric($id) && strtoupper(trim((string)($dataHandler->recordInfo($table, (int)$id)['code'] ?? ''))) === strtoupper(trim((string)$fieldArray['code']))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self::HOTEL_TABLE === $table) {
|
||||
$ownHotelUids = [(int)$id];
|
||||
} elseif (self::ALIAS_TABLE === $table && 'hotel' === ($fieldArray['entity_type'] ?? $dataHandler->recordInfo($table, (int)$id)['entity_type'] ?? 'hotel')) {
|
||||
// A new alias gets its hotel only after this hook; every hotel saved with it may own the code
|
||||
$ownHotelUids = array_map(intval(...), array_keys($dataHandler->datamap[self::HOTEL_TABLE] ?? []));
|
||||
$entity = $fieldArray['entity'] ?? (is_numeric($id) ? ($dataHandler->recordInfo($table, (int)$id)['entity'] ?? 0) : 0);
|
||||
$ownHotelUids[] = (int)$entity;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$otherHotelUids = array_diff($this->hotelCodeResolver->findHotelUids((string)$fieldArray['code']), $ownHotelUids);
|
||||
if ([] === $otherHotelUids) {
|
||||
return;
|
||||
}
|
||||
|
||||
$otherHotelUid = (int)reset($otherHotelUids);
|
||||
$otherHotel = $dataHandler->recordInfo(self::HOTEL_TABLE, $otherHotelUid) ?? [];
|
||||
$dataHandler->log(
|
||||
$table,
|
||||
is_numeric($id) ? (int)$id : 0,
|
||||
DatabaseAction::UPDATE,
|
||||
null,
|
||||
SystemLogErrorClassification::USER_ERROR,
|
||||
sprintf(
|
||||
'Der Code "%s" wurde nicht gespeichert: er ist schon Import-Code von "%s" [%d]. Jeder BusPro-Code darf nur an einem Datensatz stehen; für den Kalender gibt es den Kalender-Code.',
|
||||
trim((string)$fieldArray['code']),
|
||||
trim((string)preg_replace('/\s+/', ' ', (string)($otherHotel['name'] ?? ''))),
|
||||
$otherHotelUid
|
||||
)
|
||||
);
|
||||
unset($fieldArray['code']);
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,10 @@ use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
||||
|
||||
/**
|
||||
* Checks the shared key of the CMS backchannel endpoints (content feed, CMS index).
|
||||
* Checks the api keys: the shared `cmsApiKey` of the CMS backchannel endpoints (content feed, CMS
|
||||
* index) and the keys of single write endpoints (`jsonLdApiKey` for n8n).
|
||||
*
|
||||
* An empty or missing `cmsApiKey` denies every request. ExtensionConfiguration::get() returns the
|
||||
* An empty or missing key denies every request. ExtensionConfiguration::get() returns the
|
||||
* stored configuration verbatim, so a newly added key is absent until someone saves the extension
|
||||
* configuration in the backend - defaulting to "allow" there would publish the whole catalogue.
|
||||
*/
|
||||
@@ -22,12 +23,6 @@ class ApiKeyAuthenticator
|
||||
|
||||
public function isAuthorized(ServerRequestInterface $request): bool
|
||||
{
|
||||
$configured = (string) ($this->extensionConfiguration->get('ep_products')['cmsApiKey'] ?? '');
|
||||
|
||||
if ('' === $configured) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Header first: query-string keys end up in access logs. `key` stays accepted for parity
|
||||
// with the existing /api/hotel and /api/product calls.
|
||||
$provided = $request->getHeaderLine('X-Api-Key');
|
||||
@@ -36,6 +31,25 @@ class ApiKeyAuthenticator
|
||||
$provided = (string) ($request->getQueryParams()['key'] ?? '');
|
||||
}
|
||||
|
||||
return $this->matches('cmsApiKey', $provided);
|
||||
}
|
||||
|
||||
/**
|
||||
* For write endpoints: the key is only accepted as header, it never shows up in access logs.
|
||||
*/
|
||||
public function isAuthorizedByHeader(ServerRequestInterface $request, string $configKey): bool
|
||||
{
|
||||
return $this->matches($configKey, $request->getHeaderLine('X-Api-Key'));
|
||||
}
|
||||
|
||||
private function matches(string $configKey, string $provided): bool
|
||||
{
|
||||
$configured = (string) ($this->extensionConfiguration->get('ep_products')[$configKey] ?? '');
|
||||
|
||||
if ('' === $configured) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return hash_equals($configured, $provided);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\JsonLd;
|
||||
|
||||
use EP\EpProducts\Http\ApiKeyAuthenticator;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Core\Http\JsonResponse;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* PUT /api/json-ld/{uid}: n8n replaces the JSON-LD of an html content element (SEO markup).
|
||||
*
|
||||
* n8n is the source of truth: the element's bodytext is overwritten with the posted object,
|
||||
* whatever it held before. Only plain html elements are written: a uid of any other type (text,
|
||||
* plugin, …) is refused, so a wrong uid in n8n cannot replace visible page content. The write
|
||||
* goes through DataHandler as the backend user `_n8n`, so every change is in the record history
|
||||
* (and can be undone there) and the page cache is cleared.
|
||||
*/
|
||||
class JsonLdApi
|
||||
{
|
||||
public const PATH_PREFIX = '/api/json-ld/';
|
||||
|
||||
private const string BACKEND_USER = '_n8n';
|
||||
|
||||
private const string CTYPE = 'html';
|
||||
|
||||
// JSON_HEX_TAG: a "</script>" inside a value must not end the script element
|
||||
private const int JSON_FLAGS = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_THROW_ON_ERROR;
|
||||
|
||||
public function __construct(private readonly ApiKeyAuthenticator $authenticator)
|
||||
{
|
||||
}
|
||||
|
||||
public function handle(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
// POST is n8n's default method; both replace the whole object
|
||||
if (!in_array($request->getMethod(), ['PUT', 'POST'], true)) {
|
||||
return new JsonResponse(['message' => 'Method not allowed'], 405, ['Allow' => 'PUT, POST']);
|
||||
}
|
||||
|
||||
if (!$this->authenticator->isAuthorizedByHeader($request, 'jsonLdApiKey')) {
|
||||
return new JsonResponse(['message' => 'Invalid or missing api key'], 403);
|
||||
}
|
||||
|
||||
$uid = substr($request->getUri()->getPath(), strlen(self::PATH_PREFIX));
|
||||
$record = 1 === preg_match('/^[1-9]\d*$/', $uid)
|
||||
? BackendUtility::getRecord('tt_content', (int) $uid, 'uid,pid,CType,bodytext')
|
||||
: null;
|
||||
|
||||
if (null === $record) {
|
||||
return new JsonResponse(['message' => 'Content element not found'], 404);
|
||||
}
|
||||
|
||||
if (self::CTYPE !== $record['CType']) {
|
||||
return new JsonResponse(['message' => 'Content element is of type "' . $record['CType'] . '", only "' . self::CTYPE . '" is written'], 409);
|
||||
}
|
||||
|
||||
try {
|
||||
// Decoded as objects, not arrays, so an empty {} stays an object
|
||||
$jsonLd = json_decode((string) $request->getBody(), false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $e) {
|
||||
return new JsonResponse(['message' => 'Invalid JSON: ' . $e->getMessage()], 400);
|
||||
}
|
||||
|
||||
if (!is_object($jsonLd) && !is_array($jsonLd)) {
|
||||
return new JsonResponse(['message' => 'Expected a JSON-LD object or array'], 400);
|
||||
}
|
||||
|
||||
$bodytext = '<script type="application/ld+json">' . "\n" . json_encode($jsonLd, self::JSON_FLAGS) . "\n" . '</script>';
|
||||
$result = ['uid' => (int) $record['uid'], 'pid' => (int) $record['pid']];
|
||||
|
||||
if ($bodytext === $record['bodytext']) {
|
||||
return new JsonResponse($result + ['changed' => false]);
|
||||
}
|
||||
|
||||
$backendUser = $this->getBackendUser();
|
||||
|
||||
if (null === $backendUser) {
|
||||
return new JsonResponse(['message' => 'Backend user ' . self::BACKEND_USER . ' is missing'], 503);
|
||||
}
|
||||
|
||||
$errors = $this->write((int) $record['uid'], $bodytext, $backendUser);
|
||||
|
||||
if ([] !== $errors) {
|
||||
return new JsonResponse(['message' => 'Content element not saved', 'errors' => $errors], 500);
|
||||
}
|
||||
|
||||
return new JsonResponse($result + ['changed' => true]);
|
||||
}
|
||||
|
||||
private function getBackendUser(): ?BackendUserAuthentication
|
||||
{
|
||||
$backendUser = GeneralUtility::makeInstance(BackendUserAuthentication::class);
|
||||
$backendUser->setBeUserByName(self::BACKEND_USER);
|
||||
|
||||
if (empty($backendUser->user['uid'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$backendUser->fetchGroupData();
|
||||
|
||||
return $backendUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string> DataHandler's error log, empty on success
|
||||
*/
|
||||
private function write(int $uid, string $bodytext, BackendUserAuthentication $backendUser): array
|
||||
{
|
||||
// Hooks and helpers called by DataHandler read the global user, not the one passed in
|
||||
$previousBackendUser = $GLOBALS['BE_USER'] ?? null;
|
||||
$GLOBALS['BE_USER'] = $backendUser;
|
||||
|
||||
try {
|
||||
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
|
||||
// The user only has modify access to tt_content, no page permissions: n8n may update
|
||||
// any content element, whichever page it is on
|
||||
$dataHandler->bypassAccessCheckForRecords = true;
|
||||
$dataHandler->start(['tt_content' => [$uid => ['bodytext' => $bodytext]]], [], $backendUser);
|
||||
$dataHandler->process_datamap();
|
||||
|
||||
return array_values($dataHandler->errorLog);
|
||||
} finally {
|
||||
$GLOBALS['BE_USER'] = $previousBackendUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ use TYPO3\CMS\Core\Resource\FileInterface;
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use EP\EpProducts\ContentFeed\ContentFeedApi;
|
||||
use EP\EpProducts\Http\ApiKeyAuthenticator;
|
||||
use EP\EpProducts\JsonLd\JsonLdApi;
|
||||
use EP\EpProducts\Service\HotelCodeResolver;
|
||||
use EP\EpProducts\Service\MyEpImageService;
|
||||
use EP\EpProducts\Utility\HotelIconUtility;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
@@ -28,6 +30,8 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
private readonly ImageService $imageService,
|
||||
private readonly ContentFeedApi $contentFeedApi,
|
||||
private readonly ApiKeyAuthenticator $authenticator,
|
||||
private readonly JsonLdApi $jsonLdApi,
|
||||
private readonly HotelCodeResolver $hotelCodeResolver,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -43,10 +47,18 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
return $this->handleProductRequest($request);
|
||||
}
|
||||
|
||||
if ('/api/calendar-hotels' === $path) {
|
||||
return $this->handleCalendarHotelsRequest($request);
|
||||
}
|
||||
|
||||
if (str_starts_with($path, ContentFeedApi::PATH_PREFIX)) {
|
||||
return $this->contentFeedApi->handle($request);
|
||||
}
|
||||
|
||||
if (str_starts_with($path, JsonLdApi::PATH_PREFIX)) {
|
||||
return $this->jsonLdApi->handle($request);
|
||||
}
|
||||
|
||||
return $handler->handle($request);
|
||||
}
|
||||
|
||||
@@ -90,13 +102,144 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
return new JsonResponse(['message' => 'Product not found'], 404);
|
||||
}
|
||||
|
||||
if (null !== $hotelCode) {
|
||||
$data['hotel'] = $this->fetchHotelData($hotelCode);
|
||||
$productUid = $data['productUid'];
|
||||
$showCalendar = $data['showCalendar'];
|
||||
unset($data['productUid'], $data['showCalendar']);
|
||||
|
||||
// Without a hotel code (MyE&P's group houses), the product's only Unterkunft is its hotel
|
||||
if (null === $hotelCode) {
|
||||
$hotelUids = $this->fetchVisibleHotelUids($productUid);
|
||||
if (1 !== count($hotelUids)) {
|
||||
return new JsonResponse([
|
||||
'message' => sprintf('Product %s links %d hotels, expected exactly 1', $productCode, count($hotelUids)),
|
||||
'hotel_count' => count($hotelUids),
|
||||
], 422);
|
||||
}
|
||||
$hotelUid = $hotelUids[0];
|
||||
} else {
|
||||
$hotelUid = $this->hotelCodeResolver->findUid($hotelCode);
|
||||
}
|
||||
|
||||
$calendarCode = $showCalendar && null !== $hotelUid ? $this->fetchCalendarCode($hotelUid) : '';
|
||||
$data['product']['calendar_hotel_code'] = '' !== $calendarCode ? $calendarCode : null;
|
||||
|
||||
if (null !== $hotelUid) {
|
||||
$data['hotel'] = $this->fetchHotelDataByUid($hotelUid);
|
||||
} elseif (null !== $hotelCode) {
|
||||
$data['hotel'] = [];
|
||||
}
|
||||
|
||||
return new JsonResponse($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uids from the MM table, then selected from the hotel table, so its restrictions apply
|
||||
*
|
||||
* @return list<int>
|
||||
*/
|
||||
private function fetchVisibleHotelUids(int $productUid): array
|
||||
{
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
|
||||
$queryBuilder = $connectionPool->getQueryBuilderForTable('tx_epproducts_product_hotel_mm');
|
||||
$linkedUids = $queryBuilder
|
||||
->select('uid_foreign')
|
||||
->from('tx_epproducts_product_hotel_mm')
|
||||
->where($queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter($productUid, Connection::PARAM_INT)))
|
||||
->executeQuery()
|
||||
->fetchFirstColumn();
|
||||
|
||||
if ([] === $linkedUids) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$queryBuilder = $connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_hotel');
|
||||
|
||||
return array_map(intval(...), $queryBuilder
|
||||
->select('uid')
|
||||
->from('tx_epproducts_domain_model_hotel')
|
||||
->where($queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter(array_map(intval(...), $linkedUids), Connection::PARAM_INT_ARRAY)))
|
||||
->executeQuery()
|
||||
->fetchFirstColumn());
|
||||
}
|
||||
|
||||
private function fetchCalendarCode(int $hotelUid): string
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_epproducts_domain_model_hotel');
|
||||
|
||||
return trim((string)$queryBuilder
|
||||
->select('calendar_code')
|
||||
->from('tx_epproducts_domain_model_hotel')
|
||||
->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($hotelUid, Connection::PARAM_INT)))
|
||||
->executeQuery()
|
||||
->fetchOne());
|
||||
}
|
||||
|
||||
/**
|
||||
* The Kalender-Codes of all visible hotels, for the contingent sync of MyE&P: their availability
|
||||
* is needed for the iCal feeds and the calendars, whether or not MyE&P has an accommodation with
|
||||
* prices for them. Per code the visible products with "Kalender anzeigen" showing a hotel with it.
|
||||
*/
|
||||
private function handleCalendarHotelsRequest(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
if (!$this->authenticator->isAuthorized($request)) {
|
||||
return new JsonResponse(['message' => 'Invalid or missing api key'], 403);
|
||||
}
|
||||
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
|
||||
$queryBuilder = $connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_hotel');
|
||||
$hotelRows = $queryBuilder
|
||||
->select('calendar_code', 'code', 'name')
|
||||
->from('tx_epproducts_domain_model_hotel')
|
||||
->where($queryBuilder->expr()->neq('calendar_code', $queryBuilder->createNamedParameter('')))
|
||||
->orderBy('uid')
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$hotels = [];
|
||||
foreach ($hotelRows as $row) {
|
||||
$code = trim((string)$row['calendar_code']);
|
||||
// Named after the record whose import code it is, else the first one
|
||||
if (isset($hotels[$code]) && $code !== trim((string)$row['code'])) {
|
||||
continue;
|
||||
}
|
||||
$hotels[$code] = [
|
||||
'code' => $code,
|
||||
'name' => trim((string)preg_replace('/\s+/', ' ', (string)$row['name'])),
|
||||
'products' => [],
|
||||
];
|
||||
}
|
||||
ksort($hotels);
|
||||
|
||||
$queryBuilder = $connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_product');
|
||||
$productRows = $queryBuilder
|
||||
->select('hotel.calendar_code', 'product.uid', 'product.name', 'product.season')
|
||||
->from('tx_epproducts_domain_model_product', 'product')
|
||||
->join('product', 'tx_epproducts_product_hotel_mm', 'mm', 'mm.uid_local = product.uid')
|
||||
->join('mm', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = mm.uid_foreign')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('product.sys_language_uid', 0),
|
||||
$queryBuilder->expr()->eq('product.show_calendar', 1),
|
||||
$queryBuilder->expr()->neq('hotel.calendar_code', $queryBuilder->createNamedParameter('')),
|
||||
)
|
||||
->groupBy('hotel.calendar_code', 'product.uid', 'product.name', 'product.season')
|
||||
->orderBy('product.uid')
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
foreach ($productRows as $row) {
|
||||
$hotels[trim((string)$row['calendar_code'])]['products'][] = [
|
||||
'uid' => (int)$row['uid'],
|
||||
'name' => trim((string)preg_replace('/\s+/', ' ', (string)$row['name'])),
|
||||
'season' => '' !== (string)$row['season'] ? (string)$row['season'] : null,
|
||||
];
|
||||
}
|
||||
|
||||
return new JsonResponse(array_values($hotels));
|
||||
}
|
||||
|
||||
private function fetchProductData(string $productCode): ?array
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
@@ -108,15 +251,21 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
'product.name as productName',
|
||||
'product.code as productCode',
|
||||
'product.region as regionUid',
|
||||
'product.board_description as boardDescription',
|
||||
'product.additional_services as additionalServices',
|
||||
'product.show_calendar as showCalendar',
|
||||
'country.name as countryName',
|
||||
'city.name as cityName',
|
||||
)
|
||||
->from('tx_epproducts_domain_model_product', 'product')
|
||||
->leftJoin('product', 'tx_epproducts_domain_model_country', 'country', 'product.country = country.uid')
|
||||
->leftJoin('product', 'tx_epproducts_domain_model_city', 'city', 'product.city = city.uid')
|
||||
->leftJoin('product', 'tx_epproducts_domain_model_matchcode', 'matchcode', 'product.uid = matchcode.entity AND matchcode.entity_type="hotel"')
|
||||
->where($queryBuilder->expr()->eq('product.code', $queryBuilder->createNamedParameter($productCode)))
|
||||
->orWhere($queryBuilder->expr()->eq('matchcode.code', $queryBuilder->createNamedParameter($productCode)))->setMaxResults(1)->executeQuery()
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('product.code', $queryBuilder->createNamedParameter($productCode)),
|
||||
$queryBuilder->expr()->in('product.sys_language_uid', [0, -1]),
|
||||
)
|
||||
->orderBy('product.uid')
|
||||
->setMaxResults(1)->executeQuery()
|
||||
->fetchAssociative()
|
||||
;
|
||||
|
||||
@@ -127,10 +276,14 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
$images = $this->serializeImages($this->productImageService->getImages((int) $data['productUid']));
|
||||
|
||||
return [
|
||||
'productUid' => (int) $data['productUid'],
|
||||
'showCalendar' => (bool) $data['showCalendar'],
|
||||
'product' => [
|
||||
'name' => $data['productName'],
|
||||
'code' => $data['productCode'],
|
||||
'images' => $images,
|
||||
'board_description' => (string) $data['boardDescription'],
|
||||
'additional_services' => (string) $data['additionalServices'],
|
||||
],
|
||||
'country' => [
|
||||
'name' => $data['countryName'],
|
||||
@@ -143,6 +296,13 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
}
|
||||
|
||||
private function fetchHotelData(string $hotelCode): array
|
||||
{
|
||||
$hotelUid = $this->hotelCodeResolver->findUid($hotelCode);
|
||||
|
||||
return null !== $hotelUid ? $this->fetchHotelDataByUid($hotelUid) : [];
|
||||
}
|
||||
|
||||
private function fetchHotelDataByUid(int $hotelUid): array
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_epproducts_domain_model_hotel');
|
||||
@@ -170,10 +330,8 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
'hotel.region',
|
||||
)
|
||||
->from('tx_epproducts_domain_model_hotel', 'hotel')
|
||||
->leftJoin('hotel', 'tx_epproducts_domain_model_matchcode', 'alias', 'hotel.uid = alias.entity AND alias.entity_type="hotel"')
|
||||
->where(
|
||||
$queryBuilder->expr()->or($queryBuilder->expr()->eq('hotel.code', $queryBuilder->createNamedParameter($hotelCode)), $queryBuilder->expr()->eq('alias.code', $queryBuilder->createNamedParameter($hotelCode)))
|
||||
)->setMaxResults(1)->executeQuery()
|
||||
->where($queryBuilder->expr()->eq('hotel.uid', $queryBuilder->createNamedParameter($hotelUid, Connection::PARAM_INT)))
|
||||
->executeQuery()
|
||||
->fetchAssociative()
|
||||
;
|
||||
|
||||
@@ -222,7 +380,7 @@ class ApiMiddleware implements MiddlewareInterface
|
||||
'webcam.url as webcamUrl',
|
||||
)
|
||||
->from('tx_epproducts_domain_model_region', 'region')
|
||||
->leftJoin('region', 'tx_epproducts_domain_model_webcam', 'webcam', 'region.webcam = webcam.uid')
|
||||
->leftJoin('region', 'tx_epproducts_domain_model_webcam', 'webcam', 'region.webcam = webcam.uid AND (webcam.available = 1 OR webcam.manual = 1)')
|
||||
->where($queryBuilder->expr()->eq('region.uid', $queryBuilder->createNamedParameter($regionUid, Connection::PARAM_INT)))->setMaxResults(1)->executeQuery()
|
||||
->fetchAssociative()
|
||||
;
|
||||
|
||||
@@ -189,20 +189,16 @@ class ApiClient implements LoggerAwareInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* One entry per day ('date', 'status': OK, BLOCKED or ON_REQUEST) for the given range
|
||||
* One entry per day the snapshot has ('date', 'status': OK, BLOCKED or ON_REQUEST), today until the
|
||||
* end of the snapshot; unlike contingents/calendar, days without a price keep their status
|
||||
*
|
||||
* @throws ApiException
|
||||
*/
|
||||
public function getContingentCalendar(
|
||||
string $hotelCode,
|
||||
\DateTimeInterface $dateFrom,
|
||||
\DateTimeInterface $dateTo,
|
||||
): array {
|
||||
return $this->requestJson('GET', 'contingents/calendar', [
|
||||
public function getContingentAvailability(string $hotelCode): array
|
||||
{
|
||||
return $this->requestJson('GET', 'contingents/availability', [
|
||||
'query' => [
|
||||
'hotelCode' => $hotelCode,
|
||||
'dateFrom' => $dateFrom->format('Y-m-d'),
|
||||
'dateTo' => $dateTo->format('Y-m-d'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Service;
|
||||
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Moves the calendars from the product's "Unterkunft für Belegungskalender" (calendar_hotel) to the
|
||||
* Kalender-Code of the hotel a product page shows (hotel calendar_code, product show_calendar), and
|
||||
* compares the two while calendar_hotel still exists.
|
||||
*
|
||||
* The hotel a page shows is the hotel pinned in a Produktdetail element's flexform, else the product's
|
||||
* single Unterkunft; a product with several Unterkünfte shows the one picked in its hotel list.
|
||||
* Remove this class together with calendar_hotel.
|
||||
*/
|
||||
class CalendarCodeMigration
|
||||
{
|
||||
private const string PRODUCT_TABLE = 'tx_epproducts_domain_model_product';
|
||||
private const string HOTEL_TABLE = 'tx_epproducts_domain_model_hotel';
|
||||
|
||||
private ?array $products = null;
|
||||
|
||||
public function __construct(
|
||||
private readonly ConnectionPool $connectionPool,
|
||||
) {
|
||||
}
|
||||
|
||||
public function isFillNecessary(): bool
|
||||
{
|
||||
foreach ($this->getLegacyCalendarCodes() as $productUid => $code) {
|
||||
if (!($this->getProducts()[$productUid]['show_calendar'] ?? false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additive: sets show_calendar and fills empty Kalender-Codes, never clears or overwrites one
|
||||
*
|
||||
* @return list<string> what the fill could not decide
|
||||
*/
|
||||
public function fill(): array
|
||||
{
|
||||
$legacyCodes = $this->getLegacyCalendarCodes();
|
||||
$hotels = $this->getVisibleHotels();
|
||||
$pinnedHotels = $this->getPinnedHotels();
|
||||
$accommodations = $this->getVisibleAccommodations();
|
||||
$notes = [];
|
||||
|
||||
// Today's behaviour: a calendar where the calendar hotel is visible and has a code
|
||||
foreach (array_keys($legacyCodes) as $productUid) {
|
||||
$this->connectionPool->getConnectionForTable(self::PRODUCT_TABLE)
|
||||
->update(self::PRODUCT_TABLE, ['show_calendar' => 1], ['uid' => $productUid]);
|
||||
}
|
||||
|
||||
// Who gets which code, by priority: 0 a calendar hotel its own code, 1 the hotel a product page
|
||||
// shows (pinned in the Produktdetail element, else the single Unterkunft), 2 the other
|
||||
// Unterkünfte, only when they have no code of their own (another house's record keeps none)
|
||||
$candidates = [];
|
||||
foreach ($legacyCodes as $productUid => $code) {
|
||||
$candidates[$this->getProducts()[$productUid]['calendar_hotel']][0][$code][] = 0;
|
||||
$productAccommodations = $accommodations[$productUid] ?? [];
|
||||
$shownHotelUids = $pinnedHotels[$productUid] ?? (1 === count($productAccommodations) ? $productAccommodations : []);
|
||||
foreach ($shownHotelUids as $hotelUid) {
|
||||
$candidates[$hotelUid][1][$code][] = $productUid;
|
||||
}
|
||||
foreach (array_diff($productAccommodations, $shownHotelUids) as $hotelUid) {
|
||||
if ('' === ($hotels[$hotelUid]['code'] ?? '')) {
|
||||
$candidates[$hotelUid][2][$code][] = $productUid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Within a priority, the most frequent code wins, then the one of the lowest product uid
|
||||
$hotelConnection = $this->connectionPool->getConnectionForTable(self::HOTEL_TABLE);
|
||||
foreach ($candidates as $hotelUid => $codesByPriority) {
|
||||
if (!isset($hotels[$hotelUid]) || '' !== $hotels[$hotelUid]['calendar_code']) {
|
||||
continue;
|
||||
}
|
||||
ksort($codesByPriority);
|
||||
$codes = reset($codesByPriority);
|
||||
uasort($codes, static fn(array $a, array $b): int => count($b) <=> count($a) ?: min($a) <=> min($b));
|
||||
$chosen = (string)array_key_first($codes);
|
||||
$others = array_diff_key($codes, [$chosen => true]);
|
||||
if ([] !== $others) {
|
||||
$notes[] = sprintf(
|
||||
'Hotel %d (%s) got %s; also wanted: %s',
|
||||
$hotelUid,
|
||||
$hotels[$hotelUid]['name'],
|
||||
$chosen,
|
||||
implode(', ', array_map(
|
||||
static fn(string $code, array $productUids): string => sprintf('%s by products %s', $code, implode(', ', $productUids)),
|
||||
array_keys($others),
|
||||
$others
|
||||
))
|
||||
);
|
||||
}
|
||||
$hotelConnection->update(self::HOTEL_TABLE, ['calendar_code' => $chosen], ['uid' => $hotelUid]);
|
||||
}
|
||||
|
||||
return $notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Product pages whose calendar differs between calendar_hotel and the Kalender-Code model, as long
|
||||
* as calendar_hotel is still filled
|
||||
*
|
||||
* @return list<array{product: int, name: string, season: string, hotel: int, hotelName: string, before: string, after: string}>
|
||||
*/
|
||||
public function findDifferences(): array
|
||||
{
|
||||
$legacyCodes = $this->getLegacyCalendarCodes();
|
||||
$hotels = $this->getVisibleHotels();
|
||||
$pinnedHotels = $this->getPinnedHotels();
|
||||
$accommodations = $this->getVisibleAccommodations();
|
||||
|
||||
$differences = [];
|
||||
foreach ($this->getProducts() as $productUid => $product) {
|
||||
if ($product['hidden']) {
|
||||
continue;
|
||||
}
|
||||
$shownHotelUids = array_unique(array_merge($pinnedHotels[$productUid] ?? [], $accommodations[$productUid] ?? []));
|
||||
$before = $legacyCodes[$productUid] ?? '';
|
||||
if ([] === $shownHotelUids && '' !== $before) {
|
||||
$differences[] = ['product' => $productUid, 'name' => $product['name'], 'season' => $product['season'], 'hotel' => 0, 'hotelName' => '(keine sichtbare Unterkunft)', 'before' => $before, 'after' => ''];
|
||||
}
|
||||
foreach ($shownHotelUids as $hotelUid) {
|
||||
$after = $product['show_calendar'] ? ($hotels[$hotelUid]['calendar_code'] ?? '') : '';
|
||||
if ($before !== $after) {
|
||||
$differences[] = ['product' => $productUid, 'name' => $product['name'], 'season' => $product['season'], 'hotel' => $hotelUid, 'hotelName' => $hotels[$hotelUid]['name'] ?? '', 'before' => $before, 'after' => $after];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $differences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string> product uid => code of its calendar hotel, where that hotel is visible and has a code
|
||||
*/
|
||||
private function getLegacyCalendarCodes(): array
|
||||
{
|
||||
$hotels = $this->getVisibleHotels();
|
||||
$codes = [];
|
||||
foreach ($this->getProducts() as $productUid => $product) {
|
||||
$code = $hotels[$product['calendar_hotel']]['code'] ?? '';
|
||||
if ('' !== $code) {
|
||||
$codes[$productUid] = $code;
|
||||
}
|
||||
}
|
||||
|
||||
return $codes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hidden products too: their calendar is there when they are shown again
|
||||
*
|
||||
* @return array<int, array{name: string, season: string, hidden: bool, calendar_hotel: int, show_calendar: bool}>
|
||||
*/
|
||||
private function getProducts(): array
|
||||
{
|
||||
if (null !== $this->products) {
|
||||
return $this->products;
|
||||
}
|
||||
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::PRODUCT_TABLE);
|
||||
$queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class);
|
||||
$rows = $queryBuilder
|
||||
->select('uid', 'name', 'season', 'hidden', 'calendar_hotel', 'show_calendar')
|
||||
->from(self::PRODUCT_TABLE)
|
||||
->where($queryBuilder->expr()->eq('sys_language_uid', 0))
|
||||
->orderBy('uid')
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$this->products = [];
|
||||
foreach ($rows as $row) {
|
||||
$this->products[(int)$row['uid']] = [
|
||||
'name' => trim((string)preg_replace('/\s+/', ' ', (string)$row['name'])),
|
||||
'season' => (string)$row['season'],
|
||||
'hidden' => (bool)$row['hidden'],
|
||||
'calendar_hotel' => (int)$row['calendar_hotel'],
|
||||
'show_calendar' => (bool)$row['show_calendar'],
|
||||
];
|
||||
}
|
||||
|
||||
return $this->products;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array{name: string, code: string, calendar_code: string}>
|
||||
*/
|
||||
private function getVisibleHotels(): array
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::HOTEL_TABLE);
|
||||
$rows = $queryBuilder
|
||||
->select('uid', 'name', 'code', 'calendar_code')
|
||||
->from(self::HOTEL_TABLE)
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$hotels = [];
|
||||
foreach ($rows as $row) {
|
||||
$hotels[(int)$row['uid']] = [
|
||||
'name' => trim((string)preg_replace('/\s+/', ' ', (string)$row['name'])),
|
||||
'code' => strtoupper(trim((string)$row['code'])),
|
||||
'calendar_code' => trim((string)$row['calendar_code']),
|
||||
];
|
||||
}
|
||||
|
||||
return $hotels;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, list<int>> product uid => its visible Unterkünfte
|
||||
*/
|
||||
private function getVisibleAccommodations(): array
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::HOTEL_TABLE);
|
||||
$rows = $queryBuilder
|
||||
->select('mm.uid_local', 'mm.uid_foreign')
|
||||
->from(self::HOTEL_TABLE, 'hotel')
|
||||
->join('hotel', 'tx_epproducts_product_hotel_mm', 'mm', 'mm.uid_foreign = hotel.uid')
|
||||
->orderBy('mm.uid_local')
|
||||
->addOrderBy('mm.sorting')
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$accommodations = [];
|
||||
foreach ($rows as $row) {
|
||||
$accommodations[(int)$row['uid_local']][] = (int)$row['uid_foreign'];
|
||||
}
|
||||
|
||||
return $accommodations;
|
||||
}
|
||||
|
||||
/**
|
||||
* A hidden pinned hotel is left out: the page falls back to the Unterkünfte
|
||||
*
|
||||
* @return array<int, list<int>> product uid => visible hotels pinned in visible Produktdetail elements
|
||||
*/
|
||||
private function getPinnedHotels(): array
|
||||
{
|
||||
$hotels = $this->getVisibleHotels();
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tt_content');
|
||||
$rows = $queryBuilder
|
||||
->select('content.pi_flexform')
|
||||
->from('tt_content', 'content')
|
||||
->join('content', 'pages', 'page', 'page.uid = content.pid')
|
||||
->where($queryBuilder->expr()->eq('content.CType', $queryBuilder->createNamedParameter('epproducts_product_detail', Connection::PARAM_STR)))
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$pinned = [];
|
||||
foreach ($rows as $row) {
|
||||
$flexform = GeneralUtility::xml2array((string)$row['pi_flexform']);
|
||||
$fields = is_array($flexform) ? ($flexform['data']['sDEF']['lDEF'] ?? []) : [];
|
||||
$productUid = (int)($fields['settings.productUid']['vDEF'] ?? 0);
|
||||
$hotelUid = (int)($fields['settings.hotelUid']['vDEF'] ?? 0);
|
||||
if (0 < $productUid && isset($hotels[$hotelUid]) && !in_array($hotelUid, $pinned[$productUid] ?? [], true)) {
|
||||
$pinned[$productUid][] = $hotelUid;
|
||||
}
|
||||
}
|
||||
|
||||
return $pinned;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
const SELECTION_GROUP_ACCOMMODATION = 85;
|
||||
const SELECTION_GROUP_PROGRAMME = 86;
|
||||
const SELECTION_GROUP_COURSES = 87;
|
||||
const SELECTION_GROUP_PERSONNEL = 88;
|
||||
const SELECTION_GROUP_EVENTS = 89;
|
||||
const SELECTION_GROUP_TRANSPORTATION = 90;
|
||||
|
||||
@@ -54,12 +55,6 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
*/
|
||||
const END_CUSTOMER_CODE_PATTERN = '/(?:MP|WE|KT|PM|MW|FA)\d{6}$/';
|
||||
|
||||
/**
|
||||
* 'Leistungen Personal' occurs in no export so far, so its id is unknown and
|
||||
* it is still matched by label. Register its id once the warning fires.
|
||||
*/
|
||||
const SELECTION_GROUP_LABEL_PERSONNEL = 'Leistungen Personal';
|
||||
|
||||
private int $pid;
|
||||
|
||||
private array $hotelMappings = [];
|
||||
@@ -77,7 +72,8 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
ExtensionConfiguration $extensionConfiguration,
|
||||
private CacheService $cacheService,
|
||||
private ProductImportSource $importSource,
|
||||
private RoomTypeResolver $roomTypeResolver
|
||||
private RoomTypeResolver $roomTypeResolver,
|
||||
private HotelCodeResolver $hotelCodeResolver
|
||||
) {
|
||||
// Extension configuration rather than TypoScript: the import runs on the CLI, where
|
||||
// TYPO3 13 has no frontend TypoScript (plugin.tx_epproducts.persistence.storagePid)
|
||||
@@ -315,7 +311,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
$includedBoard = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_BOARD);
|
||||
$includedTransportation = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_TRANSPORTATION);
|
||||
$includedProgramme = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_PROGRAMME);
|
||||
$includedPersonnel = $this->parsePersonnelSelectionGroup($row['selectionGroups']);
|
||||
$includedPersonnel = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_PERSONNEL);
|
||||
$includedEvents = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_EVENTS);
|
||||
$includedOther = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_OTHER);
|
||||
$includedCourses = $this->parseSelectionGroup($row['selectionGroups'], static::SELECTION_GROUP_COURSES);
|
||||
@@ -431,13 +427,14 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
$code = $row['hotel']['code'];
|
||||
$busProId = (int) $row['hotel']['busProId'];
|
||||
|
||||
if (!array_key_exists((string) $code, $this->hotelMappings)) {
|
||||
$hotelUid = $this->hotelCodeResolver->findUid((string) $code);
|
||||
if (null === $hotelUid || !isset($this->hotelMappings[$hotelUid])) {
|
||||
$this->logger->warning('hotel not found', ['code' => $code]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$hotel = $this->hotelMappings[$code];
|
||||
$hotel = ['code' => $code] + $this->hotelMappings[$hotelUid];
|
||||
$hotel['fact'] = $this->getTopFactForRecord('tx_epproducts_hotel_fact_mm', $hotel['uid']);
|
||||
|
||||
$services = [];
|
||||
@@ -499,6 +496,12 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
// Rooms MyE&P does not offer for booking are shown as sold out.
|
||||
// Rows exported before the flag existed keep the previous logic.
|
||||
if (array_key_exists('bookable', $roomRow) && false === $roomRow['bookable']) {
|
||||
$available = 0;
|
||||
}
|
||||
|
||||
$roomType = $this->roomTypeResolver->resolve($code, $label, $pax, $roomMinPax);
|
||||
|
||||
if ($pax < 1 && $roomMinPax < 1) {
|
||||
@@ -661,28 +664,6 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array[] $selectionGroups
|
||||
*/
|
||||
private function parsePersonnelSelectionGroup(array $selectionGroups): array
|
||||
{
|
||||
$data = [];
|
||||
foreach ($selectionGroups as $group) {
|
||||
if ($group['label'] !== static::SELECTION_GROUP_LABEL_PERSONNEL) {
|
||||
continue;
|
||||
}
|
||||
$this->logger->warning(
|
||||
'selection group matched by label, register its id',
|
||||
['label' => $group['label'], 'idbuspro' => (int) $group['busProId']]
|
||||
);
|
||||
$this->addSelections($group['selections'], $data);
|
||||
}
|
||||
|
||||
ksort($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 'Gruppenkunde' and 'Endkunde' decide. A date carrying neither is judged by
|
||||
* its travel code.
|
||||
@@ -772,31 +753,23 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
return (float) str_replace(['.', ','], ['', '.'], $price);
|
||||
}
|
||||
|
||||
/**
|
||||
* The visible hotel records by uid; which record a code belongs to says HotelCodeResolver
|
||||
*/
|
||||
private function getHotelMappings(): void
|
||||
{
|
||||
$sql = '
|
||||
SELECT u.code code, u.uid uid, h.name name, h.type type,
|
||||
SELECT h.uid uid, h.name name, h.type type,
|
||||
h.earlybird earlybird, h.new new, h.low_contingent low_contingent,
|
||||
h.keywords keywords, h.header_title header_title,
|
||||
h.category category, h.teaser teaser, h.detail_page detail_page
|
||||
FROM (
|
||||
SELECT hotel.code code, hotel.uid uid
|
||||
FROM tx_epproducts_domain_model_hotel hotel
|
||||
WHERE hotel.code != "" AND hotel.deleted = 0 AND hotel.hidden = 0
|
||||
UNION SELECT matchcode.code code, matchcode.entity uid
|
||||
FROM tx_epproducts_domain_model_matchcode matchcode
|
||||
INNER JOIN tx_epproducts_domain_model_hotel matchcode_hotel ON matchcode.entity = matchcode_hotel.uid
|
||||
WHERE matchcode.deleted = 0 AND matchcode.hidden = 0
|
||||
AND matchcode_hotel.deleted = 0 AND matchcode_hotel.hidden = 0
|
||||
ORDER BY code
|
||||
) u
|
||||
LEFT JOIN tx_epproducts_domain_model_hotel h ON u.uid = h.uid
|
||||
FROM tx_epproducts_domain_model_hotel h
|
||||
WHERE h.deleted = 0 AND h.hidden = 0
|
||||
';
|
||||
$rows = $this->db->fetchAllAssociative($sql);
|
||||
foreach ($rows as $row) {
|
||||
$this->hotelMappings[$row['code']] = [
|
||||
$this->hotelMappings[(int) $row['uid']] = [
|
||||
'uid' => $row['uid'],
|
||||
'code' => $row['code'],
|
||||
'type' => $row['type'],
|
||||
'name' => $row['name'],
|
||||
'earlybird' => $row['earlybird'],
|
||||
|
||||
@@ -14,9 +14,10 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
/**
|
||||
* Publishes the availability of a group house to its groups.swiss availability chart
|
||||
*
|
||||
* The calendar comes from MyE&P (contingents/calendar, synced from bpn-connect); TYPO3 10 read it
|
||||
* from bpn-connect directly. The chart is reset to "free" for the next year, then every run of
|
||||
* BLOCKED / ON_REQUEST days is sent as one range.
|
||||
* The availability comes from MyE&P (contingents/availability, the bpn-connect snapshot without the
|
||||
* price rule of contingents/calendar, which would block every unpriced day); TYPO3 10 read it from
|
||||
* bpn-connect directly. The chart is reset to "free" for the next year, then every run of
|
||||
* BLOCKED / ON_REQUEST days within it is sent as one range.
|
||||
*/
|
||||
class GroupsSwissService implements LoggerAwareInterface
|
||||
{
|
||||
@@ -58,10 +59,10 @@ class GroupsSwissService implements LoggerAwareInterface
|
||||
$to = $from->modify('+1 year');
|
||||
|
||||
try {
|
||||
// The last day of the range is reset below but not asked for, as in TYPO3 10
|
||||
$calendarRows = $this->apiClient->getContingentCalendar($hotelCode, $from, $to->modify('-1 day'));
|
||||
// Runs to the end of the snapshot; buildRanges() keeps the days before $to
|
||||
$calendarRows = $this->apiClient->getContingentAvailability($hotelCode);
|
||||
} catch (ApiException $e) {
|
||||
$this->logger?->error(sprintf('groups.swiss: no calendar for hotel %s', $hotelCode), ['exception' => $e]);
|
||||
$this->logger?->error(sprintf('groups.swiss: no availability for hotel %s', $hotelCode), ['exception' => $e]);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Service;
|
||||
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerAwareTrait;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
|
||||
/**
|
||||
* Finds the hotel record of a BusPro code by its import codes: the record's code ("Import-Code") or
|
||||
* one of its aliases ("Weitere Import-Codes"). Visible records only. A code belongs to one record; for
|
||||
* old data with a code on several records, the record whose own code it is wins, then the lowest uid,
|
||||
* and a warning names them. Availability does not go through here, it uses the Kalender-Code.
|
||||
*/
|
||||
class HotelCodeResolver implements SingletonInterface, LoggerAwareInterface
|
||||
{
|
||||
use LoggerAwareTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, int>|null
|
||||
*/
|
||||
private ?array $map = null;
|
||||
|
||||
public function __construct(
|
||||
private readonly ConnectionPool $connectionPool,
|
||||
) {
|
||||
}
|
||||
|
||||
public function findUid(string $code): ?int
|
||||
{
|
||||
return $this->map()[strtoupper(trim($code))] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read fresh, not from the map: for the check on save
|
||||
*
|
||||
* @return list<int> the visible hotel records that have this import code
|
||||
*/
|
||||
public function findHotelUids(string $code): array
|
||||
{
|
||||
$code = strtoupper(trim($code));
|
||||
$uids = [];
|
||||
foreach ($this->findImportCodes() as $row) {
|
||||
if ($code === strtoupper(trim((string)$row['code']))) {
|
||||
$uids[] = (int)$row['uid'];
|
||||
}
|
||||
}
|
||||
|
||||
return array_values(array_unique($uids));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, int> import code (upper case) => hotel uid
|
||||
*/
|
||||
public function map(): array
|
||||
{
|
||||
if (null !== $this->map) {
|
||||
return $this->map;
|
||||
}
|
||||
|
||||
$owners = [];
|
||||
foreach ($this->findImportCodes() as $row) {
|
||||
$owners[strtoupper(trim((string)$row['code']))][(int)$row['uid']] ??= (bool)$row['own'];
|
||||
}
|
||||
|
||||
$this->map = [];
|
||||
foreach ($owners as $code => $hotels) {
|
||||
uksort($hotels, static fn(int $a, int $b): int => $hotels[$b] <=> $hotels[$a] ?: $a <=> $b);
|
||||
$this->map[$code] = (int)array_key_first($hotels);
|
||||
if (1 < count($hotels)) {
|
||||
$this->logger?->warning(sprintf('Import code %s is on several hotel records (%s), using %d', $code, implode(', ', array_keys($hotels)), $this->map[$code]));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->map;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{code: string, uid: int, own: int}>
|
||||
*/
|
||||
private function findImportCodes(): array
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_hotel');
|
||||
$codes = $queryBuilder
|
||||
->select('code', 'uid')
|
||||
->addSelectLiteral('1 AS own')
|
||||
->from('tx_epproducts_domain_model_hotel')
|
||||
->where($queryBuilder->expr()->neq('code', $queryBuilder->createNamedParameter('')))
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_matchcode');
|
||||
$aliases = $queryBuilder
|
||||
->select('alias.code', 'hotel.uid')
|
||||
->addSelectLiteral('0 AS own')
|
||||
->from('tx_epproducts_domain_model_matchcode', 'alias')
|
||||
->join('alias', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = alias.entity')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('alias.entity_type', $queryBuilder->createNamedParameter('hotel')),
|
||||
$queryBuilder->expr()->neq('alias.code', $queryBuilder->createNamedParameter('')),
|
||||
)
|
||||
->executeQuery()
|
||||
->fetchAllAssociative();
|
||||
|
||||
return array_merge($codes, $aliases);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace EP\EpProducts\Service;
|
||||
|
||||
use EP\EpProducts\Domain\Model\Hotel;
|
||||
use EP\EpProducts\MyEP\ApiClient;
|
||||
use EP\EpProducts\MyEP\ApiException;
|
||||
use Kigkonsult\Icalcreator\Vcalendar;
|
||||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerAwareTrait;
|
||||
|
||||
/**
|
||||
* Contingent feed of a hotel for the booking portals, for its Kalender-Code
|
||||
*
|
||||
* The availability comes from MyE&P (contingents/availability, the bpn-connect snapshot without the
|
||||
* price rule of contingents/calendar). Like the sidebar calendar, it has three levels: every run of
|
||||
* BLOCKED days becomes an "Unavailable" event, every run of ON_REQUEST days (partly available) a
|
||||
* "Part-occupied:N" event, the format of TYPO3 10 until June 2026; OK days get no event. TYPO3 10
|
||||
* took N from the booked beds of the XML import, which no longer exists, so N stands in for it:
|
||||
* half of the hotel's beds, at least 1.
|
||||
*/
|
||||
class IcalService implements LoggerAwareInterface
|
||||
{
|
||||
use LoggerAwareTrait;
|
||||
|
||||
private const string SUMMARY_UNAVAILABLE = 'Unavailable';
|
||||
private const string SUMMARY_PART_OCCUPIED = 'Part-occupied:%d';
|
||||
|
||||
public function __construct(
|
||||
private readonly ApiClient $apiClient,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null the calendar, null when the availability is unknown
|
||||
*/
|
||||
public function createContingentsFeed(Hotel $hotel): ?string
|
||||
{
|
||||
$hotelCode = trim($hotel->getCalendarCode());
|
||||
|
||||
try {
|
||||
$calendarRows = $this->apiClient->getContingentAvailability($hotelCode);
|
||||
} catch (ApiException $e) {
|
||||
$this->logger?->error(sprintf('iCal: no availability for hotel %s', $hotelCode), ['exception' => $e]);
|
||||
return null;
|
||||
}
|
||||
|
||||
$vcalendar = Vcalendar::factory([Vcalendar::UNIQUE_ID => 'www.ep-reisen.de']);
|
||||
$vcalendar->setXprop(Vcalendar::X_WR_TIMEZONE, 'Europe/Berlin');
|
||||
|
||||
$partOccupiedSummary = sprintf(self::SUMMARY_PART_OCCUPIED, max(1, intdiv((int)$hotel->getBedsCount(), 2)));
|
||||
foreach ($this->buildRanges($calendarRows) as $range) {
|
||||
$vcalendar
|
||||
->newVevent()
|
||||
->setDtstart($range['from'])
|
||||
->setDtend($range['to']->modify('+1 day'))
|
||||
->setSummary('ON_REQUEST' === $range['status'] ? $partOccupiedSummary : self::SUMMARY_UNAVAILABLE);
|
||||
}
|
||||
|
||||
return $vcalendar->vtimezonePopulate()->createCalendar();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array{from: \DateTimeImmutable, to: \DateTimeImmutable, status: string}> BLOCKED / ON_REQUEST runs, both ends inclusive
|
||||
*/
|
||||
private function buildRanges(array $calendarRows): array
|
||||
{
|
||||
$rows = [];
|
||||
foreach ($calendarRows as $row) {
|
||||
if (!is_array($row) || !isset($row['date'])) {
|
||||
continue;
|
||||
}
|
||||
$date = new \DateTimeImmutable($row['date']);
|
||||
$rows[$date->format('Y-m-d')] = ['date' => $date, 'status' => $this->normalizeStatus((string)($row['status'] ?? 'OK'))];
|
||||
}
|
||||
ksort($rows);
|
||||
|
||||
$ranges = [];
|
||||
$current = null;
|
||||
$lastDate = null;
|
||||
foreach ($rows as $row) {
|
||||
$isGap = $lastDate instanceof \DateTimeImmutable && $row['date'] > $lastDate->modify('+1 day');
|
||||
if (null !== $current && ($isGap || 'OK' === $row['status'] || $current['status'] !== $row['status'])) {
|
||||
$ranges[] = $current;
|
||||
$current = null;
|
||||
}
|
||||
if ('OK' !== $row['status']) {
|
||||
if (null === $current) {
|
||||
$current = ['from' => $row['date'], 'to' => $row['date'], 'status' => $row['status']];
|
||||
} else {
|
||||
$current['to'] = $row['date'];
|
||||
}
|
||||
}
|
||||
$lastDate = $row['date'];
|
||||
}
|
||||
if (null !== $current) {
|
||||
$ranges[] = $current;
|
||||
}
|
||||
|
||||
return $ranges;
|
||||
}
|
||||
|
||||
private function normalizeStatus(string $status): string
|
||||
{
|
||||
$status = strtoupper(trim($status));
|
||||
if ('ONREQUEST' === $status) {
|
||||
return 'ON_REQUEST';
|
||||
}
|
||||
|
||||
return in_array($status, ['OK', 'ON_REQUEST', 'BLOCKED'], true) ? $status : 'OK';
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,6 @@ class SearchResultService implements SingletonInterface
|
||||
'boardUid' => ($row['boardUid'] ?? null),
|
||||
'dates' => [],
|
||||
'nights' => [],
|
||||
'teaserNights' => [],
|
||||
'rooms' => [],
|
||||
'new' => ($row['new'] ?? null),
|
||||
'skiPassIncluded' => ($row['skiPassIncluded'] ?? null),
|
||||
@@ -199,7 +198,6 @@ class SearchResultService implements SingletonInterface
|
||||
|| $item['minPrice'] > ($row['minPrice'] ?? null)) {
|
||||
$item['minPrice'] = ($row['minPrice'] ?? null);
|
||||
// Teaser-specific offer data must describe the cheapest row.
|
||||
$item['teaserNights'] = [($row['nights'] ?? null)];
|
||||
$item['board'] = ($row['board'] ?? null);
|
||||
$item['boardUid'] = ($row['boardUid'] ?? null);
|
||||
$item['daytrip'] = ($row['daytrip'] ?? null);
|
||||
|
||||
@@ -17,7 +17,8 @@ use TYPO3\CMS\Core\Http\RequestFactory;
|
||||
*
|
||||
* Port of the TYPO3 10 import with plain DBAL instead of Extbase persistence. Records are matched by
|
||||
* vendor_uid and updated in place, so the regions keep pointing at their snow report; records no
|
||||
* longer in the feed are flagged deleted. The feed only answers the production server.
|
||||
* longer in the feed are flagged deleted. Webcams flagged manual are maintained by editors and left
|
||||
* alone entirely. The feed only answers the production server.
|
||||
*/
|
||||
class SnowreportImportService implements LoggerAwareInterface
|
||||
{
|
||||
@@ -143,6 +144,7 @@ class SnowreportImportService implements LoggerAwareInterface
|
||||
$now = time();
|
||||
$snowreports = $this->loadIndex(self::SNOWREPORT_TABLE);
|
||||
$webcams = $this->loadIndex(self::WEBCAM_TABLE);
|
||||
$manualWebcamUids = $this->loadManualWebcamUids();
|
||||
$validSnowreports = [];
|
||||
$validWebcams = [];
|
||||
$snowreportConnection = $this->connectionPool->getConnectionForTable(self::SNOWREPORT_TABLE);
|
||||
@@ -178,6 +180,10 @@ class SnowreportImportService implements LoggerAwareInterface
|
||||
$available = $this->convertValue((string)$item->verf, self::TYPE_BOOL, 'verf');
|
||||
$webcamVendorUid = (string)(int)$item->uid;
|
||||
|
||||
if (isset($webcams[$webcamVendorUid]) && in_array($webcams[$webcamVendorUid], $manualWebcamUids, true)) {
|
||||
$validWebcams[] = $webcamVendorUid;
|
||||
continue;
|
||||
}
|
||||
// Cams that are neither current nor already known are skipped
|
||||
if (!isset($webcams[$webcamVendorUid]) && !$include) {
|
||||
continue;
|
||||
@@ -206,7 +212,7 @@ class SnowreportImportService implements LoggerAwareInterface
|
||||
$count++;
|
||||
}
|
||||
|
||||
$this->flagObsolete(self::WEBCAM_TABLE, array_keys($webcams), $validWebcams, $now);
|
||||
$this->flagObsolete(self::WEBCAM_TABLE, array_keys($webcams), $validWebcams, $now, $manualWebcamUids);
|
||||
$this->flagObsolete(self::SNOWREPORT_TABLE, array_keys($snowreports), $validSnowreports, $now);
|
||||
// Inline child counter, which the plain SQL above does not maintain
|
||||
$snowreportConnection->executeStatement(
|
||||
@@ -268,7 +274,28 @@ class SnowreportImportService implements LoggerAwareInterface
|
||||
return $index;
|
||||
}
|
||||
|
||||
private function flagObsolete(string $table, array $currentVendorUids, array $validVendorUids, int $now): void
|
||||
/**
|
||||
* Uids of the webcams editors maintain themselves, whatever their vendor_uid
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
private function loadManualWebcamUids(): array
|
||||
{
|
||||
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::WEBCAM_TABLE);
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(new DeletedRestriction());
|
||||
|
||||
return array_map(intval(...), $queryBuilder
|
||||
->select('uid')
|
||||
->from(self::WEBCAM_TABLE)
|
||||
->where($queryBuilder->expr()->eq('manual', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)))
|
||||
->executeQuery()
|
||||
->fetchFirstColumn());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $keepUids records never flagged, even if they share a vendor_uid with an obsolete one
|
||||
*/
|
||||
private function flagObsolete(string $table, array $currentVendorUids, array $validVendorUids, int $now, array $keepUids = []): void
|
||||
{
|
||||
$obsolete = array_values(array_diff(array_map(strval(...), $currentVendorUids), array_map(strval(...), $validVendorUids)));
|
||||
if ([] === $obsolete) {
|
||||
@@ -280,8 +307,11 @@ class SnowreportImportService implements LoggerAwareInterface
|
||||
->update($table)
|
||||
->set('deleted', 1)
|
||||
->set('tstamp', $now)
|
||||
->where($queryBuilder->expr()->in('vendor_uid', $queryBuilder->createNamedParameter($obsolete, Connection::PARAM_STR_ARRAY)))
|
||||
->executeStatement();
|
||||
->where($queryBuilder->expr()->in('vendor_uid', $queryBuilder->createNamedParameter($obsolete, Connection::PARAM_STR_ARRAY)));
|
||||
if ([] !== $keepUids) {
|
||||
$queryBuilder->andWhere($queryBuilder->expr()->notIn('uid', $queryBuilder->createNamedParameter($keepUids, Connection::PARAM_INT_ARRAY)));
|
||||
}
|
||||
$queryBuilder->executeStatement();
|
||||
}
|
||||
|
||||
private function convertValue(string $raw, string $type, string $key): int|string|bool
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Upgrades;
|
||||
|
||||
use EP\EpProducts\Service\CalendarCodeMigration;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use TYPO3\CMS\Install\Attribute\UpgradeWizard;
|
||||
use TYPO3\CMS\Install\Updates\ChattyInterface;
|
||||
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
|
||||
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
|
||||
|
||||
/**
|
||||
* Fills the Kalender-Codes and "Kalender anzeigen" from the products' calendar hotels. Run by the
|
||||
* deploy, between the schema update and the switch to the new release. Additive: calendar_hotel stays,
|
||||
* so the previous release still works; rollback = clearing show_calendar and calendar_code.
|
||||
*/
|
||||
#[UpgradeWizard('epProductsCalendarCode')]
|
||||
final class CalendarCodeUpdate implements UpgradeWizardInterface, ChattyInterface
|
||||
{
|
||||
private ?OutputInterface $output = null;
|
||||
|
||||
public function __construct(
|
||||
private readonly CalendarCodeMigration $calendarCodeMigration,
|
||||
) {
|
||||
}
|
||||
|
||||
public function setOutput(OutputInterface $output): void
|
||||
{
|
||||
$this->output = $output;
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'E&P Produkte: Kalender-Codes aus den Kalender-Unterkünften';
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Sets "Kalender anzeigen" on products with a calendar hotel and fills the Kalender-Code of the hotels their pages show. Check the result with ep:calendar-codes.';
|
||||
}
|
||||
|
||||
public function updateNecessary(): bool
|
||||
{
|
||||
return $this->calendarCodeMigration->isFillNecessary();
|
||||
}
|
||||
|
||||
public function executeUpdate(): bool
|
||||
{
|
||||
foreach ($this->calendarCodeMigration->fill() as $note) {
|
||||
$this->output?->writeln($note);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getPrerequisites(): array
|
||||
{
|
||||
return [DatabaseUpdatedPrerequisite::class];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace EP\EpProducts\Upgrades;
|
||||
|
||||
use TYPO3\CMS\Install\Attribute\UpgradeWizard;
|
||||
use TYPO3\CMS\Install\Updates\AbstractListTypeToCTypeUpdate;
|
||||
|
||||
/**
|
||||
* Turns the ep_products plugin elements (CType "list") into content elements of their own type, as TYPO3 14
|
||||
* no longer knows list_type. The types keep the plugin signatures as names. Also rewrites the
|
||||
* tt_content:list_type permissions of backend groups. Retired plugins stay "list" elements.
|
||||
*/
|
||||
#[UpgradeWizard('epProductsPluginListTypeToCType')]
|
||||
final class PluginListTypeToCTypeUpdate extends AbstractListTypeToCTypeUpdate
|
||||
{
|
||||
private const array PLUGINS = [
|
||||
'epproducts_searchresult',
|
||||
'epproducts_travelinfo',
|
||||
'epproducts_watchlist',
|
||||
'epproducts_product_detail',
|
||||
'epproducts_product_teasergroup',
|
||||
'epproducts_product_pricetable',
|
||||
'epproducts_snowreport_list',
|
||||
'epproducts_country_detail',
|
||||
'epproducts_region_teasergroup',
|
||||
'epproducts_region_detail',
|
||||
'epproducts_city_teasergroup',
|
||||
'epproducts_city_detail',
|
||||
'epproducts_hotel_teasergroup',
|
||||
'epproducts_hotel_teasergroup_nodate',
|
||||
'epproducts_hotel_detail',
|
||||
'epproducts_hotel_detail_event',
|
||||
'epproducts_concept_teasergroup',
|
||||
'epproducts_concept_detail',
|
||||
'epproducts_teammembers',
|
||||
'epproducts_faq',
|
||||
'epproducts_newsletter_subscription',
|
||||
'epproducts_maps',
|
||||
'epproducts_pricetable',
|
||||
];
|
||||
|
||||
protected function getListTypeToCTypeMapping(): array
|
||||
{
|
||||
return array_combine(self::PLUGINS, self::PLUGINS);
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'E&P Produkte: Plugins als eigene Inhaltstypen';
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Migrates the ep_products plugin elements from list_type to CType, including backend group permissions.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'epImports' => [
|
||||
'title' => 'Importe',
|
||||
'description' => 'Import-Status von Reisedaten, Schneehöhen und groups.swiss',
|
||||
'iconIdentifier' => 'ep-logo',
|
||||
'defaultWidgets' => ['epImportStatus'],
|
||||
'showInWizard' => true,
|
||||
],
|
||||
];
|
||||
@@ -9,4 +9,9 @@ return [
|
||||
'provider' => SvgIconProvider::class,
|
||||
'source' => 'EXT:ep_products/Resources/Public/Icons/logo.svg',
|
||||
],
|
||||
// Content element types of the plugins, the logo of the extension manager
|
||||
'ep-products-plugin' => [
|
||||
'provider' => SvgIconProvider::class,
|
||||
'source' => 'EXT:ep_products/Resources/Public/Icons/Extension.svg',
|
||||
],
|
||||
];
|
||||
@@ -30,6 +30,8 @@ services:
|
||||
public: true
|
||||
EP\EpProducts\Service\SearchResultService:
|
||||
public: true
|
||||
EP\EpProducts\Hooks\ImportCodeCheck:
|
||||
public: true
|
||||
|
||||
cache.ep_cache:
|
||||
class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
|
||||
@@ -72,3 +74,14 @@ services:
|
||||
$hotelImageService: '@ep_products.image_service.hotel'
|
||||
$productImageService: '@ep_products.image_service.product'
|
||||
$regionImageService: '@ep_products.image_service.region'
|
||||
|
||||
EP\EpProducts\Dashboard\ImportStatusWidget:
|
||||
tags:
|
||||
- name: dashboard.widget
|
||||
identifier: 'epImportStatus'
|
||||
groupNames: 'systemInfo'
|
||||
title: 'Import-Status'
|
||||
description: 'Wann Reisedaten, Schneehöhen und groups.swiss zuletzt gelaufen sind und welchen Stand die Daten haben'
|
||||
iconIdentifier: 'ep-logo'
|
||||
height: 'medium'
|
||||
width: 'large'
|
||||
@@ -12,247 +12,199 @@ call_user_func(function (): void {
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'searchresult',
|
||||
'Suchergebnis'
|
||||
'Suchergebnis',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'travelinfo',
|
||||
'Reiseinformationen'
|
||||
'Reiseinformationen',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'watchlist',
|
||||
'Merkliste'
|
||||
'Merkliste',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'product_detail',
|
||||
'Produkt: Details'
|
||||
'Produkt: Details',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'product_teasergroup',
|
||||
'Produkt: Teaser'
|
||||
'Produkt: Teaser',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'product_pricetable',
|
||||
'Buchungstabelle'
|
||||
'Buchungstabelle',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'snowreport_list',
|
||||
'Schneehöhen'
|
||||
'Schneehöhen',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'country_detail',
|
||||
'Land'
|
||||
'Land',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'region_teasergroup',
|
||||
'Gebiet: Teaser'
|
||||
'Gebiet: Teaser',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'region_detail',
|
||||
'Gebiet: Details'
|
||||
'Gebiet: Details',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'city_teasergroup',
|
||||
'Ort: Teaser'
|
||||
'Ort: Teaser',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'city_detail',
|
||||
'Ort: Details'
|
||||
'Ort: Details',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'hotel_teasergroup',
|
||||
'Hotel: Teaser'
|
||||
'Hotel: Teaser',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'hotel_teasergroup_nodate',
|
||||
'Hotel: Teaser (terminunabhängig)'
|
||||
'Hotel: Teaser (terminunabhängig)',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'hotel_detail',
|
||||
'Hotel: Details'
|
||||
'Hotel: Details',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'hotel_detail_event',
|
||||
'Hotel: Details (Event)'
|
||||
'Hotel: Details (Event)',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'concept_teasergroup',
|
||||
'Konzept: Teaser'
|
||||
'Konzept: Teaser',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'concept_detail',
|
||||
'Konzept: Details'
|
||||
'Konzept: Details',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'teammembers',
|
||||
'Team'
|
||||
'Team',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'faq',
|
||||
'FAQ'
|
||||
'FAQ',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'newsletter_subscription',
|
||||
'Newsletter-/RA-Registrierung'
|
||||
'Newsletter-/RA-Registrierung',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'maps',
|
||||
'Übersichtskarte Hotels/Produkte'
|
||||
'Übersichtskarte Hotels/Produkte',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
ExtensionUtility::registerPlugin(
|
||||
'EpProducts',
|
||||
'pricetable',
|
||||
'Preistabelle'
|
||||
'Preistabelle',
|
||||
'ep-products-plugin'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_product_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_product_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_detail.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_product_teasergroup'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_product_teasergroup',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_teaser.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_product_pricetable'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_product_pricetable',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_pricetable.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_snowreport_list'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_snowreport_list',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_snowreport.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_country_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_country_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_country.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_region_teasergroup'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_region_teasergroup',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_teaser.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_region_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_region_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_detail.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_city_teasergroup'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_city_teasergroup',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_teaser.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_city_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_city_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_detail.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_teasergroup'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_hotel_teasergroup',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_teasergroup_nodate'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_hotel_teasergroup_nodate',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_hotel_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_detail_event'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_hotel_detail_event',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_concept_detail'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_concept_detail',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_concept_detail.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_faq'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_faq',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_faq.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_maps'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_maps',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_maps.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_pricetable'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_pricetable',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_pricetable.xml'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_teammembers'] = 'pi_flexform';
|
||||
ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'epproducts_teammembers',
|
||||
'FILE:EXT:ep_products/Configuration/FlexForms/flexform_teammembers.xml'
|
||||
// Content element types since 2026-10 (upgrade wizard epProductsPluginListTypeToCType); the form keeps the
|
||||
// fields of the former "list" type, with the plugin options in place of the plugin selector
|
||||
$flexForms = [
|
||||
'epproducts_product_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_detail.xml',
|
||||
'epproducts_product_teasergroup' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_teaser.xml',
|
||||
'epproducts_product_pricetable' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_product_pricetable.xml',
|
||||
'epproducts_snowreport_list' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_snowreport.xml',
|
||||
'epproducts_country_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_country.xml',
|
||||
'epproducts_region_teasergroup' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_teaser.xml',
|
||||
'epproducts_region_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_detail.xml',
|
||||
'epproducts_city_teasergroup' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_teaser.xml',
|
||||
'epproducts_city_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_detail.xml',
|
||||
'epproducts_hotel_teasergroup' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml',
|
||||
'epproducts_hotel_teasergroup_nodate' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml',
|
||||
'epproducts_hotel_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail.xml',
|
||||
'epproducts_hotel_detail_event' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml',
|
||||
'epproducts_concept_detail' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_concept_detail.xml',
|
||||
'epproducts_faq' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_faq.xml',
|
||||
'epproducts_maps' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_maps.xml',
|
||||
'epproducts_pricetable' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_pricetable.xml',
|
||||
'epproducts_teammembers' => 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_teammembers.xml',
|
||||
];
|
||||
foreach ($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'] as $item) {
|
||||
$cType = (string)($item['value'] ?? '');
|
||||
if (!str_starts_with($cType, 'epproducts_')) {
|
||||
continue;
|
||||
}
|
||||
$GLOBALS['TCA']['tt_content']['types'][$cType]['showitem'] = str_replace(
|
||||
'list_type;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:list_type_formlabel,',
|
||||
isset($flexForms[$cType]) ? 'pi_flexform,' : '',
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['showitem']
|
||||
);
|
||||
if (isset($flexForms[$cType])) {
|
||||
ExtensionManagementUtility::addPiFlexFormValue('*', $flexForms[$cType], $cType);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
@@ -27,7 +27,7 @@ return [
|
||||
'endtime' => 'endtime',
|
||||
],
|
||||
'searchFields' => 'name,headline,teaser,description,features,room_types,additional_information,teaser_images,
|
||||
header_images,images,reseller_images,code,type,category,country,region,city,teamer,products,external_link',
|
||||
header_images,images,reseller_images,code,calendar_code,type,category,country,region,city,teamer,products,external_link',
|
||||
'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg',
|
||||
],
|
||||
'types' => [
|
||||
@@ -43,7 +43,7 @@ return [
|
||||
],
|
||||
'palettes' => [
|
||||
'top' => ['showitem' => 'hidden,earlybird,new,--linebreak--,low_contingent,show_as_teaser,
|
||||
--linebreak--,code,detail_page,--linebreak--,external_link,path_segment'],
|
||||
--linebreak--,code,calendar_code,--linebreak--,detail_page,--linebreak--,external_link,path_segment'],
|
||||
'geolocation' => ['showitem' => 'address, longitude, latitude'],
|
||||
'destinations' => ['showitem' => 'country,region,city'],
|
||||
'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'],
|
||||
@@ -425,13 +425,25 @@ return [
|
||||
],
|
||||
'code' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Code',
|
||||
'label' => 'Import-Code',
|
||||
'description' => 'BusPro-Code, dessen Termine diesem Datensatz zugeordnet werden. Jeder Code darf nur an einem Datensatz stehen. Für den Kalender ohne Bedeutung.',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => 30,
|
||||
'eval' => 'trim'
|
||||
],
|
||||
],
|
||||
'calendar_code' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Kalender-Code',
|
||||
'description' => 'BusPro-Code des Hauses, dessen Belegung Belegungskalender, Preiskalender, Preistabelle und iCal-Feed zeigen. Leer = kein Kalender.',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => 16,
|
||||
'max' => 16,
|
||||
'eval' => 'trim,upper',
|
||||
],
|
||||
],
|
||||
'external_link' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Externer Link (Google MyBusiness)',
|
||||
@@ -569,7 +581,8 @@ return [
|
||||
],
|
||||
'additional_codes' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Zusätzliche Codes',
|
||||
'label' => 'Weitere Import-Codes',
|
||||
'description' => 'BusPro-Codes, deren Termine diesem Datensatz zugeordnet werden. Jeder Code darf nur an einem Datensatz stehen. Für den Kalender ohne Bedeutung.',
|
||||
'config' => [
|
||||
'type' => 'inline',
|
||||
'foreign_table' => 'tx_epproducts_domain_model_matchcode',
|
||||
|
||||
@@ -41,6 +41,7 @@ return [
|
||||
tour_thumbnail,
|
||||
--div--;Bewertung, --palette--;;rating, testimonials,
|
||||
--div--;Buchbarkeit, non_bookable_dates,
|
||||
--div--;Popup, popup_text,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent',
|
||||
],
|
||||
],
|
||||
@@ -54,7 +55,7 @@ return [
|
||||
'alternative' => ['showitem' => 'alt_product, alt_label'],
|
||||
'header' => ['showitem' => 'headline, subline, --linebreak--, header_title, header_subtitle'],
|
||||
'rating' => ['showitem' => 'rating_average, rating_votes_count'],
|
||||
'records' => ['showitem' => 'journey, concept, calendar_hotel, --linebreak--, officetip, badge'],
|
||||
'records' => ['showitem' => 'journey, concept, show_calendar, --linebreak--, officetip, badge'],
|
||||
'misc' => ['showitem' => 'feature,keywords'],
|
||||
],
|
||||
'columns' => [
|
||||
@@ -734,9 +735,17 @@ return [
|
||||
'multiple' => 0,
|
||||
],
|
||||
],
|
||||
'show_calendar' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Kalender anzeigen',
|
||||
'description' => 'Zeigt den Kalender der Unterkunft, die auf der Produktseite angezeigt wird (deren Kalender-Code)',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'calendar_hotel' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Unterkunft für Belegungskalender',
|
||||
'label' => 'Unterkunft für Belegungskalender (alt, nicht mehr verwendet)',
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'default' => 0,
|
||||
@@ -876,6 +885,18 @@ return [
|
||||
'maxitems' => 1,
|
||||
],
|
||||
],
|
||||
'popup_text' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Popup Text',
|
||||
'description' => 'Ersetzt für dieses Produkt den Popup-Text des Konzepts. Leer: Text des Konzepts. Ob ein Popup erscheint, legt weiterhin das Konzept fest.',
|
||||
'config' => [
|
||||
'type' => 'text',
|
||||
'cols' => 40,
|
||||
'rows' => 5,
|
||||
'eval' => 'trim',
|
||||
'enableRichtext' => true,
|
||||
],
|
||||
],
|
||||
'non_bookable_info' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Infobox nicht buchbar',
|
||||
|
||||
@@ -109,6 +109,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Schneereport ID',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'input',
|
||||
'size' => 30,
|
||||
'eval' => 'trim',
|
||||
@@ -119,6 +120,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Skigebiet',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'input',
|
||||
'size' => 30,
|
||||
'eval' => 'trim',
|
||||
@@ -129,6 +131,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Gletscher',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
@@ -136,6 +139,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Höhe max.',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -144,6 +148,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Höhe min.',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -152,6 +157,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Gebiet geöffnet',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
@@ -159,6 +165,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Schneehöhe Berg',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -167,6 +174,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Schneehöhe Tal',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -175,6 +183,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Schneequalität',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'input',
|
||||
'size' => 30,
|
||||
'eval' => 'trim'
|
||||
@@ -184,13 +193,11 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Letzter Schneefall',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'datetime',
|
||||
'size' => 13,
|
||||
'checkbox' => 0,
|
||||
'default' => 0,
|
||||
'range' => [
|
||||
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
|
||||
],
|
||||
'format' => 'date',
|
||||
],
|
||||
],
|
||||
@@ -198,6 +205,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Lifte gesamt',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -206,6 +214,7 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Lifte geöffnet',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'number',
|
||||
'size' => 30
|
||||
],
|
||||
@@ -214,13 +223,11 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Letzte Aktualisierung',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'datetime',
|
||||
'size' => 13,
|
||||
'checkbox' => 0,
|
||||
'default' => 0,
|
||||
'range' => [
|
||||
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
|
||||
],
|
||||
'format' => 'date',
|
||||
],
|
||||
],
|
||||
@@ -237,13 +244,11 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Saison Anfang',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'datetime',
|
||||
'size' => 13,
|
||||
'checkbox' => 0,
|
||||
'default' => 0,
|
||||
'range' => [
|
||||
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
|
||||
],
|
||||
'format' => 'date',
|
||||
],
|
||||
],
|
||||
@@ -251,13 +256,11 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Saison Ende',
|
||||
'config' => [
|
||||
'readOnly' => true,
|
||||
'type' => 'datetime',
|
||||
'size' => 13,
|
||||
'checkbox' => 0,
|
||||
'default' => 0,
|
||||
'range' => [
|
||||
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
|
||||
],
|
||||
'format' => 'date',
|
||||
],
|
||||
],
|
||||
|
||||
@@ -26,7 +26,7 @@ return [
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'hidden, name, url, vendor_uid, available, snowreport, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent',
|
||||
'showitem' => 'hidden, manual, name, url, vendor_uid, available, snowreport, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, sys_language_uid, l10n_parent',
|
||||
],
|
||||
],
|
||||
'columns' => [
|
||||
@@ -128,20 +128,32 @@ return [
|
||||
'vendor_uid' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'ID',
|
||||
'description' => 'Webcam-ID im Feed von skiresort-service.com, leer bei eigenen Webcams',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => 30,
|
||||
'eval' => 'trim',
|
||||
'required' => true
|
||||
],
|
||||
],
|
||||
'available' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'verfügbar',
|
||||
'description' => 'Vom Import gesetzt, gilt nur für importierte Webcams',
|
||||
'displayCond' => 'FIELD:manual:REQ:false',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'manual' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Manuell gepflegt',
|
||||
'description' => 'Der Schneehöhen-Import ändert und löscht diese Webcam nicht; sie wird immer angezeigt (ausblenden über "Verbergen")',
|
||||
'onChange' => 'reload',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => 1,
|
||||
],
|
||||
],
|
||||
'snowreport' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Skigebiet',
|
||||
|
||||
@@ -232,6 +232,7 @@ tx_epproducts_ical {
|
||||
xhtml_cleaning = 0
|
||||
admPanel = 0
|
||||
debug = 0
|
||||
tx_staticfilecache.disableCache = 1
|
||||
}
|
||||
|
||||
10 = USER
|
||||
@@ -239,14 +240,8 @@ tx_epproducts_ical {
|
||||
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
|
||||
extensionName = EpProducts
|
||||
pluginName = ical
|
||||
vendorName = EP
|
||||
controller = Ical
|
||||
action = contingents
|
||||
switchableControllerActions {
|
||||
Ical {
|
||||
1 = contingents
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
options.dashboard.dashboardPresetsForNewUsers = default, epImports
|
||||
@@ -1,17 +0,0 @@
|
||||
Queries for plugin renaming
|
||||
===========================
|
||||
|
||||
```mysql
|
||||
update tt_content set list_type='epproducts_searchbar' where list_type='epproducts_pi1';
|
||||
update tt_content set list_type='epproducts_product_detail' where list_type='epproducts_pi3';
|
||||
update tt_content set list_type='epproducts_searchresult' where list_type='epproducts_pi2';
|
||||
update tt_content set list_type='epproducts_product_teasergroup' where list_type='epproducts_pi4';
|
||||
update tt_content set list_type='epproducts_country_detail' where list_type='epproducts_pi5';
|
||||
update tt_content set list_type='epproducts_region_teasergroup' where list_type='epproducts_pi6';
|
||||
update tt_content set list_type='epproducts_region_detail' where list_type='epproducts_pi10';
|
||||
update tt_content set list_type='epproducts_city_teasergroup' where list_type='epproducts_pi7';
|
||||
update tt_content set list_type='epproducts_city_detail' where list_type='epproducts_pi11';
|
||||
update tt_content set list_type='epproducts_hotel_teasergroup' where list_type='epproducts_pi8';
|
||||
update tt_content set list_type='epproducts_hotel_detail' where list_type='epproducts_pi12';
|
||||
update tt_content set list_type='epproducts_faq' where list_type='epproducts_pi9';
|
||||
```
|
||||
@@ -0,0 +1,71 @@
|
||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
|
||||
<f:layout name="Widget/Widget" />
|
||||
<f:section name="main">
|
||||
|
||||
<table class="table table-sm table-striped mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Import</th>
|
||||
<th>Datenstand</th>
|
||||
<th>Letzter Lauf</th>
|
||||
<th>Nächster Lauf</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{rows}" as="row">
|
||||
<tr>
|
||||
<td>{row.label}</td>
|
||||
<td>
|
||||
<f:if condition="{row.dataAt}" then="{row.dataAt -> f:format.date(format: 'd.m.Y H:i')}" else="–" />
|
||||
</td>
|
||||
<f:if condition="{row.task}">
|
||||
<f:then>
|
||||
<td>
|
||||
<f:if condition="{row.task.lastRun}" then="{row.task.lastRun -> f:format.date(format: 'd.m.Y H:i')}" else="–" />
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{row.task.disabled}" then="–" else="{row.task.nextRun -> f:format.date(format: 'd.m.Y H:i')}" />
|
||||
</td>
|
||||
<td>
|
||||
<f:if condition="{row.task.disabled}">
|
||||
<f:then><span class="badge badge-default">deaktiviert</span></f:then>
|
||||
<f:else if="{row.task.failure}">
|
||||
<span class="badge badge-danger" title="{row.task.failure}">Fehler</span>
|
||||
<div class="text-danger small">{row.task.failure}</div>
|
||||
</f:else>
|
||||
<f:else if="{row.task.overdue}">
|
||||
<span class="badge badge-warning">überfällig</span>
|
||||
<div class="small">Der Scheduler läuft nicht.</div>
|
||||
</f:else>
|
||||
<f:else><span class="badge badge-success">OK</span></f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<td>–</td>
|
||||
<td>–</td>
|
||||
<td><span class="badge badge-warning">kein Scheduler-Task</span></td>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</tr>
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="mt-3 mb-0">
|
||||
Letzter Export in MyE&P:
|
||||
<f:if condition="{myEpUnreachable}">
|
||||
<f:then><span class="badge badge-danger">MyE&P nicht erreichbar</span></f:then>
|
||||
<f:else if="{myEpLastUpdate}">
|
||||
{myEpLastUpdate -> f:format.date(format: 'd.m.Y H:i')}
|
||||
<f:if condition="{importPending}">
|
||||
<span class="badge badge-info">wird mit dem nächsten Lauf importiert</span>
|
||||
</f:if>
|
||||
</f:else>
|
||||
<f:else>–</f:else>
|
||||
</f:if>
|
||||
</p>
|
||||
|
||||
</f:section>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.41421" viewBox="0 -25 124 124" xmlns="http://www.w3.org/2000/svg"><g fill-rule="nonzero"><path d="m107 .3c-36.4 5.5-81.6 19.1-81.6 38.2 0 17.7 41.8 13.2 41.8 13.2s-67 22.3-67-7c0-33.2 84.5-44.4 106.8-44.4z" fill="#0084d4"/><path d="m17 73.5c36.4-5.4 81.6-19.1 81.6-38.2 0-17.7-41.8-13.2-41.8-13.2s67-22.3 67 7c0 33.3-84.5 44.4-106.8 44.4z" fill="#f8c62f"/><path d="m60.7 34.3-12.8 4 12.2.8-.4-2.4z" fill="#0084d4"/><path d="m75.9 35.2-9.2 2.9-3.5 9.7-1.7-11.3 4-10.7 1.7 7.9z" fill="#f8c62f"/></g></svg>
|
||||
|
After Width: | Height: | Size: 593 B |
@@ -11,6 +11,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"kigkonsult/icalcreator": "^2.41",
|
||||
"league/oauth2-client": "^2.9",
|
||||
"league/period": "^4.12",
|
||||
"symfony/http-client": "^7.4",
|
||||
|
||||
@@ -40,9 +40,12 @@ bpnConnectApiTimeout = 5
|
||||
# cat=MyEpAPI; type=int; label=Bpn Connect API max total request duration in seconds (0 = unlimited)
|
||||
bpnConnectApiMaxDuration = 15
|
||||
|
||||
# cat=ContentFeed; type=string; label=API key for the CMS backchannel endpoints used by MyE&P (/api/hotel, /api/product, /api/content/*); sent as X-Api-Key or ?key=. Empty denies every request.
|
||||
# cat=ContentFeed; type=string; label=API key for the CMS backchannel endpoints (/api/hotel, /api/product, /api/calendar-hotels for MyE&P; /api/content/* for the chatbot; see docs/cms-api.md); sent as X-Api-Key or ?key=. Empty denies every request.
|
||||
cmsApiKey =
|
||||
|
||||
# cat=JsonLd; type=string; label=API key for n8n's PUT /api/json-ld/{uid} (see docs/cms-api.md); sent as X-Api-Key header only. Empty denies every request.
|
||||
jsonLdApiKey =
|
||||
|
||||
# cat=ContentFeed; type=boolean; label=Serve the chatbot content feed (off: all feed endpoints answer 503)
|
||||
contentFeedEnabled = 1
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<?php
|
||||
use TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask;
|
||||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use EP\EpProducts\Controller\ProductController;
|
||||
use EP\EpProducts\Controller\CityController;
|
||||
use EP\EpProducts\Controller\ConceptController;
|
||||
use EP\EpProducts\Controller\CountryController;
|
||||
use EP\EpProducts\Controller\FaqController;
|
||||
use EP\EpProducts\Controller\HotelController;
|
||||
use EP\EpProducts\Controller\IcalController;
|
||||
use EP\EpProducts\Controller\MapController;
|
||||
use EP\EpProducts\Controller\NewsletterController;
|
||||
use EP\EpProducts\Controller\PricetableController;
|
||||
@@ -24,6 +26,7 @@ use EP\EpProducts\Controller\AjaxWatchlistController;
|
||||
use EP\EpProducts\Controller\AjaxCalendarController;
|
||||
use EP\EpProducts\Controller\AjaxTeaserPopupController;
|
||||
use EP\EpProducts\Routing\Aspect\PassthroughMapper;
|
||||
use EP\EpProducts\Hooks\ImportCodeCheck;
|
||||
use TYPO3\CMS\Core\Log\LogLevel;
|
||||
use EP\EpProducts\Log\Writer;
|
||||
|
||||
@@ -43,6 +46,8 @@ $boot = function (): void {
|
||||
// Client-side callers pass these parameters in POST bodies, which cHash never inspects.
|
||||
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['requireCacheHashPresenceParameters'][] = '^tx_epproducts_ajax';
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['ep_products_import_code'] = ImportCodeCheck::class;
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][TableGarbageCollectionTask::class]['options']['tables']['tx_epproducts_log'] = [
|
||||
'dateField' => 'time_micro',
|
||||
'expirePeriod' => 180,
|
||||
@@ -53,7 +58,9 @@ $boot = function (): void {
|
||||
'product_detail',
|
||||
[
|
||||
ProductController::class => 'detail,hotelList',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -61,7 +68,9 @@ $boot = function (): void {
|
||||
'product_teasergroup',
|
||||
[
|
||||
ProductController::class => 'teasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -69,7 +78,9 @@ $boot = function (): void {
|
||||
'product_pricetable',
|
||||
[
|
||||
ProductController::class => 'pricetable',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -77,7 +88,9 @@ $boot = function (): void {
|
||||
'country_detail',
|
||||
[
|
||||
CountryController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -85,7 +98,9 @@ $boot = function (): void {
|
||||
'region_teasergroup',
|
||||
[
|
||||
RegionController::class => 'teasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -93,7 +108,9 @@ $boot = function (): void {
|
||||
'region_detail',
|
||||
[
|
||||
RegionController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -101,7 +118,9 @@ $boot = function (): void {
|
||||
'city_teasergroup',
|
||||
[
|
||||
CityController::class => 'teasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -109,7 +128,9 @@ $boot = function (): void {
|
||||
'city_detail',
|
||||
[
|
||||
CityController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -117,7 +138,9 @@ $boot = function (): void {
|
||||
'hotel_teasergroup',
|
||||
[
|
||||
HotelController::class => 'teasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -125,7 +148,9 @@ $boot = function (): void {
|
||||
'hotel_teasergroup_nodate',
|
||||
[
|
||||
HotelController::class => 'dateIndependentTeasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -133,7 +158,9 @@ $boot = function (): void {
|
||||
'hotel_detail',
|
||||
[
|
||||
HotelController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -141,7 +168,9 @@ $boot = function (): void {
|
||||
'hotel_detail_event',
|
||||
[
|
||||
HotelController::class => 'detailEvent',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -149,7 +178,9 @@ $boot = function (): void {
|
||||
'faq',
|
||||
[
|
||||
FaqController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -157,7 +188,9 @@ $boot = function (): void {
|
||||
'concept_teasergroup',
|
||||
[
|
||||
ConceptController::class => 'teasergroup',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -165,7 +198,9 @@ $boot = function (): void {
|
||||
'concept_detail',
|
||||
[
|
||||
ConceptController::class => 'detail',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -173,7 +208,9 @@ $boot = function (): void {
|
||||
'teammembers',
|
||||
[
|
||||
TeamController::class => 'list,show',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -184,7 +221,8 @@ $boot = function (): void {
|
||||
],
|
||||
[
|
||||
NewsletterController::class => 'subscriptionForm,subscriptionFormSubmit',
|
||||
]
|
||||
],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -192,7 +230,9 @@ $boot = function (): void {
|
||||
'maps',
|
||||
[
|
||||
MapController::class => 'general',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -200,6 +240,19 @@ $boot = function (): void {
|
||||
'pricetable',
|
||||
[
|
||||
PricetableController::class => 'event',
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
'EpProducts',
|
||||
'ical',
|
||||
[
|
||||
IcalController::class => 'contingents',
|
||||
],
|
||||
[
|
||||
IcalController::class => 'contingents',
|
||||
]
|
||||
);
|
||||
|
||||
@@ -211,7 +264,8 @@ $boot = function (): void {
|
||||
],
|
||||
[
|
||||
SearchController::class => 'searchresult',
|
||||
]
|
||||
],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
// The search bar in the page header (lib.searchBar), not a content element
|
||||
@@ -220,7 +274,9 @@ $boot = function (): void {
|
||||
'searchbar',
|
||||
[
|
||||
SearchbarController::class => 'index',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -228,7 +284,9 @@ $boot = function (): void {
|
||||
'watchlist',
|
||||
[
|
||||
WatchlistController::class => 'list',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -236,7 +294,9 @@ $boot = function (): void {
|
||||
'travelinfo',
|
||||
[
|
||||
TravelinfoController::class => 'travelInfo,travelCode',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -244,7 +304,9 @@ $boot = function (): void {
|
||||
'snowreport_list',
|
||||
[
|
||||
SnowreportController::class => 'list',
|
||||
]
|
||||
],
|
||||
[],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
ExtensionUtility::configurePlugin(
|
||||
@@ -255,7 +317,7 @@ $boot = function (): void {
|
||||
AjaxFilterPanelController::class => 'index',
|
||||
AjaxWatchlistController::class => 'list',
|
||||
AjaxTableController::class => 'datestable,pricetable,pricetableHtml,eventPricetable',
|
||||
AjaxCalendarController::class => 'priceCalendar,priceTable',
|
||||
AjaxCalendarController::class => 'priceCalendar,priceTable,availability',
|
||||
AjaxTeaserPopupController::class => 'concept',
|
||||
],
|
||||
[
|
||||
@@ -264,9 +326,19 @@ $boot = function (): void {
|
||||
AjaxWatchlistController::class => 'list',
|
||||
AjaxTableController::class => 'datestable,pricetable,pricetableHtml,eventPricetable',
|
||||
AjaxTeaserPopupController::class => 'concept',
|
||||
]
|
||||
],
|
||||
ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT
|
||||
);
|
||||
|
||||
// Elements not yet migrated by the upgrade wizard epProductsPluginListTypeToCType (deploy first, then run
|
||||
// the wizard) still render: list_type plugin => content element type of the same name
|
||||
$listTypeAliases = '';
|
||||
foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['EpProducts']['plugins']) as $pluginName) {
|
||||
$signature = 'epproducts_' . strtolower((string)$pluginName);
|
||||
$listTypeAliases .= 'tt_content.list.20.' . $signature . ' < tt_content.' . $signature . ".20\n";
|
||||
}
|
||||
ExtensionManagementUtility::addTypoScript('ep_products', 'setup', $listTypeAliases, 'defaultContentRendering');
|
||||
|
||||
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = '_gl';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'gclid';
|
||||
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'ref';
|
||||
|
||||
@@ -56,6 +56,7 @@ CREATE TABLE tx_epproducts_domain_model_product
|
||||
dates int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
hotels int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
calendar_hotel int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
show_calendar tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||||
faqs int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
officetip int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
alt_product int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
@@ -65,6 +66,7 @@ CREATE TABLE tx_epproducts_domain_model_product
|
||||
badge int(11) unsigned NOT NULL default '0',
|
||||
non_bookable_info int(11) unsigned NOT NULL default '0',
|
||||
non_bookable_dates varchar(255) DEFAULT '' NOT NULL,
|
||||
popup_text text NOT NULL,
|
||||
min_price int(11) unsigned NOT NULL default '0',
|
||||
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
crdate int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
@@ -237,6 +239,7 @@ CREATE TABLE tx_epproducts_domain_model_hotel
|
||||
images int(11) unsigned NOT NULL default '0',
|
||||
reseller_images int(11) unsigned NOT NULL default '0',
|
||||
code varchar(255) DEFAULT '' NOT NULL,
|
||||
calendar_code varchar(16) DEFAULT '' NOT NULL,
|
||||
external_link varchar(255) DEFAULT '' NOT NULL,
|
||||
path_segment varchar(255) DEFAULT '' NOT NULL,
|
||||
type varchar(255) DEFAULT '' NOT NULL,
|
||||
@@ -1075,6 +1078,7 @@ CREATE TABLE tx_epproducts_domain_model_webcam
|
||||
|
||||
vendor_uid varchar(32) DEFAULT '' NOT NULL,
|
||||
available tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||||
manual tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||||
snowreport int(11) unsigned DEFAULT '0',
|
||||
name varchar(255) DEFAULT '' NOT NULL,
|
||||
url varchar(255) DEFAULT '' NOT NULL,
|
||||
|
||||
@@ -41,8 +41,8 @@ class ProductRatingProcessor implements DataProcessorInterface
|
||||
'name' => 'E&P Reisen und Events GmbH',
|
||||
'address' => [
|
||||
'@type' => 'PostalAddress',
|
||||
'streetAddress' => 'Aachener Str. 326-328',
|
||||
'postalCode' => '50933',
|
||||
'streetAddress' => 'Neue Weyerstraße 6',
|
||||
'postalCode' => '50676',
|
||||
'addressLocality' => 'Köln,Deutschland'
|
||||
],
|
||||
'telephone' => '00492212722760',
|
||||
|
||||
@@ -52,12 +52,20 @@ class SliderProcessor implements DataProcessorInterface
|
||||
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
|
||||
foreach ($slides as $slide) {
|
||||
$processedData['slides'][$slide['uid']] = $slide;
|
||||
$processedData['slides'][$slide['uid']]['image'] = $fileRepository->findByRelation(
|
||||
$images = $fileRepository->findByRelation(
|
||||
'tx_eptheme_domain_model_slide',
|
||||
'image',
|
||||
$slide['uid']
|
||||
);
|
||||
if ([] === $images) {
|
||||
$images = $fileRepository->findByRelation(
|
||||
'tx_eptheme_domain_model_slide',
|
||||
'images',
|
||||
$slide['uid']
|
||||
);
|
||||
}
|
||||
$processedData['slides'][$slide['uid']]['image'] = $images;
|
||||
}
|
||||
}
|
||||
|
||||
if (1 === count($slides)) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
name: ep/theme
|
||||
label: 'EP Theme'
|
||||
@@ -0,0 +1 @@
|
||||
@import 'EXT:ep_theme/Configuration/TypoScript/constants.typoscript'
|
||||
@@ -0,0 +1,646 @@
|
||||
categories:
|
||||
epTheme:
|
||||
label: 'E&P Theme'
|
||||
epTheme.pages:
|
||||
label: 'Seiten und Navigation'
|
||||
parent: epTheme
|
||||
epTheme.contact:
|
||||
label: Kontakt
|
||||
parent: epTheme
|
||||
epTheme.display:
|
||||
label: Darstellung
|
||||
parent: epTheme
|
||||
epTheme.events:
|
||||
label: Events
|
||||
parent: epTheme
|
||||
epTheme.services:
|
||||
label: 'Dienste und Tracking'
|
||||
parent: epTheme
|
||||
epTheme.social:
|
||||
label: 'Social Media'
|
||||
parent: epTheme
|
||||
epTheme.seo:
|
||||
label: 'Sitemap und Feeds'
|
||||
parent: epTheme
|
||||
epTheme.records:
|
||||
label: Datensätze
|
||||
parent: epTheme
|
||||
epProducts:
|
||||
label: 'E&P Produkte'
|
||||
epProducts.storage:
|
||||
label: Speicherorte
|
||||
parent: epProducts
|
||||
epProducts.pages:
|
||||
label: Seiten
|
||||
parent: epProducts
|
||||
epProducts.search:
|
||||
label: 'Suche und Filter'
|
||||
parent: epProducts
|
||||
epProducts.groups:
|
||||
label: Gruppenanfragen
|
||||
parent: epProducts
|
||||
epProducts.misc:
|
||||
label: Sonstiges
|
||||
parent: epProducts
|
||||
|
||||
settings:
|
||||
plugin.tx_eptheme.settings.themekey:
|
||||
label: 'Theme key'
|
||||
type: 'string'
|
||||
default: 'ep'
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.topNavPid:
|
||||
label: 'Top navigation PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.mainNavPid:
|
||||
label: 'Main navigation PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.mobileNavPid:
|
||||
label: 'Mobile navigation PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.footerNavPid:
|
||||
label: 'Footer navigation PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.defaultHomeUid:
|
||||
label: 'Default homepage UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.mainSitePid:
|
||||
label: 'Main site PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.logoLink:
|
||||
label: 'Link to apply to logo (overrides defaultHomeUid)'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.defaultAjaxUid:
|
||||
label: 'Default page UID for ajax requests'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.defaultContactFormPageUid:
|
||||
label: 'Default contact form page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.legalNoticePageUid:
|
||||
label: 'Legal notice page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.termsAndConditionsPageUid:
|
||||
label: 'Terms and conditions page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.dataProtectionPageUid:
|
||||
label: 'Data protection page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.imageCreditsPageUid:
|
||||
label: 'Image credits page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.cookiePolicyPageUid:
|
||||
label: 'Cookie policy page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.faqPageUid:
|
||||
label: 'FAQ page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.infoPageUid:
|
||||
label: 'Info page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.groupsPageUid:
|
||||
label: 'Groups page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.blogDetailPageUid:
|
||||
label: 'Blog detail page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.blogTagListPageUid:
|
||||
label: 'Blog tag list page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.groupsContactFormPageUid:
|
||||
label: 'Groups contact form page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.ratingPageUid:
|
||||
label: 'Rating page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.watchlistPageUid:
|
||||
label: 'Watchlist page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.skipassPageUid:
|
||||
label: 'Skipass info page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.englishPageUid:
|
||||
label: 'English page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.germanPageUid:
|
||||
label: 'German page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.conceptsPageUid:
|
||||
label: 'Concepts page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.myEpPageUid:
|
||||
label: 'My E&P page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.bookingLinksPid:
|
||||
label: 'Booking links PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.groupsPricePopupPageUid:
|
||||
label: 'Groups price popup page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.travelAlertPageUid:
|
||||
label: "'Reisen Alert' page UID"
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.coronaUpdatesPageUid:
|
||||
label: "'Corona Updates' page UID"
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.pages'
|
||||
plugin.tx_eptheme.settings.phoneNumber:
|
||||
label: 'Phone number general'
|
||||
type: 'string'
|
||||
default: '0221 - 272 276 0'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.whatsApp:
|
||||
label: 'Phone number WhatsApp'
|
||||
type: 'string'
|
||||
default: '0221 - 272 276 0'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.phoneNumberLink:
|
||||
label: 'Phone number general'
|
||||
type: 'string'
|
||||
default: '+492212722760'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.whatsAppNumberLink:
|
||||
label: 'Phone number WhatsApp'
|
||||
type: 'string'
|
||||
default: 'https://wa.me/492212722760'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.businessHoursDays:
|
||||
label: 'Business hours days'
|
||||
type: 'string'
|
||||
default: 'Montag - Freitag'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.businessHoursTime:
|
||||
label: 'Business hours time'
|
||||
type: 'string'
|
||||
default: '08:30 bis 18:30'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.contactFormToEmail:
|
||||
label: 'Contact form email to'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.contactFormToName:
|
||||
label: 'Contact form name to'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.enableContactFormAutoreply:
|
||||
label: 'Enable contact form autoreply'
|
||||
type: 'string'
|
||||
default: '0'
|
||||
category: 'epTheme.contact'
|
||||
enum:
|
||||
'0': Nein
|
||||
'1': Ja
|
||||
plugin.tx_eptheme.settings.contactFormAutoreplySubject:
|
||||
label: 'Contact form autoreply subject'
|
||||
type: 'string'
|
||||
default: 'Ihre Anfrage bei E&P Reisen'
|
||||
category: 'epTheme.contact'
|
||||
plugin.tx_eptheme.settings.mapTileUrl:
|
||||
label: 'Map tile URL template (without apiKey)'
|
||||
type: 'string'
|
||||
default: 'https://api-eu.geoapify.com/v1/tile/osm-bright/{z}/{x}/{y}.png'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.mapApiKey:
|
||||
label: 'Map tile API key (Geoapify), restricted by referrer'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.mapAttribution:
|
||||
label: 'Map attribution (Geoapify and OpenStreetMap credits are both required)'
|
||||
type: 'string'
|
||||
default: 'Powered by <a href="https://www.geoapify.com/">Geoapify</a> | © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.teaserTextMaxChars:
|
||||
label: 'Teasertext max characters'
|
||||
type: 'string'
|
||||
default: '120'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.defaultBodyclass:
|
||||
label: 'Default bodyclass'
|
||||
type: 'string'
|
||||
default: 'subpage'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.logoImage:
|
||||
label: 'Logo image'
|
||||
type: 'string'
|
||||
default: 'EXT:ep_theme/Resources/Public/images/logo_wide.svg'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.faviconPath:
|
||||
label: 'Favicon folder (realfavicongenerator set, without leading/trailing slash)'
|
||||
type: 'string'
|
||||
default: 'fileadmin/user_upload/favicon/ep'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.faviconAppTitle:
|
||||
label: 'Home screen title (apple-mobile-web-app-title)'
|
||||
type: 'string'
|
||||
default: 'E&P Reisen und Events'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.forceActiveTopnavUid:
|
||||
label: 'Force active topnav uid'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.bpnBookingUrlTemplateCode:
|
||||
label: 'Booking URL template code'
|
||||
type: 'string'
|
||||
default: 'base'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.searchPageHeaderImage:
|
||||
label: 'Search page header image'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.ratingWidgetLabel:
|
||||
label: 'Rating widget label'
|
||||
type: 'string'
|
||||
default: 'Reisebewertung'
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.hideAreaNavigation:
|
||||
label: 'Hide area/top navigation'
|
||||
type: 'string'
|
||||
default: '0'
|
||||
category: 'epTheme.display'
|
||||
enum:
|
||||
'0': Nein
|
||||
'1': Ja
|
||||
plugin.tx_eptheme.settings.hideSearchbar:
|
||||
label: 'Hide searchbar'
|
||||
type: 'string'
|
||||
default: '0'
|
||||
category: 'epTheme.display'
|
||||
enum:
|
||||
'0': Nein
|
||||
'1': Ja
|
||||
plugin.tx_eptheme.settings.globalConceptCode:
|
||||
label: 'Global concept code'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.display'
|
||||
plugin.tx_eptheme.settings.eventDateDayFrom:
|
||||
label: 'Event date day from'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDateDayTo:
|
||||
label: 'Event date day to'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDateMonth:
|
||||
label: 'Event date month'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventHeroClaim:
|
||||
label: 'Event herounit claim'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventHeroDescription:
|
||||
label: 'Event herounit description'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDisturberHeadline:
|
||||
label: 'Event disturber headline'
|
||||
type: 'string'
|
||||
default: 'Absolut<br>Unschlagbarer<br>Preis'
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDisturberListitems:
|
||||
label: 'Event disturber list items'
|
||||
type: 'string'
|
||||
default: '7 Übernachtungen in Top Apartments;6 Tage Skipass Val Thoerens;Ski & Boarderweek Event-Ticket'
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDisturberButtonLabel:
|
||||
label: 'Event disturber button label'
|
||||
type: 'string'
|
||||
default: 'Jetzt ab 249€ buchen'
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.eventDisturberButtonLink:
|
||||
label: 'Event disturber button link'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.forcePartnerIdSelect:
|
||||
label: 'Force Partner ID selection'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
enum:
|
||||
'0': Nein
|
||||
'1': Ja
|
||||
plugin.tx_eptheme.settings.partnerIdSelectLabel:
|
||||
label: 'Partner ID selection label'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.events'
|
||||
plugin.tx_eptheme.settings.cookieFirstScriptUrl:
|
||||
label: 'Cookiefirst Script'
|
||||
type: 'string'
|
||||
default: 'https://consent.cookiefirst.com/sites/ep-reisen.de-fabb1554-8932-4075-85dc-97fa68892918/consent.js'
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.googleStaticMapsBaseUrl:
|
||||
label: 'Google Static Maps Base Url'
|
||||
type: 'string'
|
||||
default: 'https://maps.googleapis.com/maps/api/staticmap?key=AIzaSyDDOforD1O_j4xXy2nJybC2yQqbUAw9ClY'
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.googleMapsJsApiUrl:
|
||||
label: 'Google Maps Js API Url'
|
||||
type: 'string'
|
||||
default: 'https://maps.googleapis.com/maps/api/js?key=AIzaSyDDOforD1O_j4xXy2nJybC2yQqbUAw9ClY'
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.googleMapsApiKey:
|
||||
label: 'Google Maps Js API Url'
|
||||
type: 'string'
|
||||
default: 'AIzaSyDDOforD1O_j4xXy2nJybC2yQqbUAw9ClY'
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.canonicalBaseUrl:
|
||||
label: 'Canonical base URL/Domain'
|
||||
type: 'string'
|
||||
default: 'https://www.ep-reisen.de'
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.googleSiteVerification:
|
||||
label: 'Google site verification'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.googleTagManagerId:
|
||||
label: 'Google Tag Manager ID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.services'
|
||||
plugin.tx_eptheme.settings.facebookUrl:
|
||||
label: 'Facebook URL'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.instagramUrl:
|
||||
label: 'Instagram URL'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.youtubeUrl:
|
||||
label: 'YouTube URL'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.tiktokUrl:
|
||||
label: 'tiktok URL'
|
||||
type: 'string'
|
||||
default: 'https://www.tiktok.com/@ep_reisen'
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.facebookViewContentProductUid:
|
||||
label: "Facebook ViewContent 'product uid'"
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.facebookViewContentNameInternal:
|
||||
label: "Facebook ViewContent 'name internal'"
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.social'
|
||||
plugin.tx_eptheme.settings.xmlSitemapRootPageUid:
|
||||
label: 'XML sitemap root page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.seo'
|
||||
plugin.tx_eptheme.settings.xmlSitemapExcludeUids:
|
||||
label: 'XML sitemap page UIDs to exclude'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.seo'
|
||||
plugin.tx_eptheme.settings.contentOnlyExcludedCTypes:
|
||||
label: 'CTypes left out of the chatbot content-only page type (quoted, comma-separated)'
|
||||
type: 'string'
|
||||
default: "'list','form_formframework','menu_subpages','teaser_product','teaser_hotel','teaser_concept','teaser_country','teaser_region','ep_container_teasergroup'"
|
||||
category: 'epTheme.seo'
|
||||
plugin.tx_eptheme.settings.sliderStoragePid:
|
||||
label: 'Slider storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.records'
|
||||
plugin.tx_eptheme.settings.teamMemberStoragePid:
|
||||
label: 'Teammember storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.records'
|
||||
plugin.tx_eptheme.settings.disrupterStoragePid:
|
||||
label: 'Disrupter storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.records'
|
||||
plugin.tx_eptheme.settings.showSkipassBadge:
|
||||
label: "Show 'skipass inklusive' badge"
|
||||
type: 'string'
|
||||
default: '1'
|
||||
category: 'epTheme.records'
|
||||
enum:
|
||||
'0': Nein
|
||||
'1': Ja
|
||||
plugin.tx_eptheme.settings.badgeStoragePid:
|
||||
label: 'Custom badge storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epTheme.records'
|
||||
plugin.tx_epproducts.settings.productsStoragePid:
|
||||
label: 'Products storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.hotelsStoragePid:
|
||||
label: 'Hotels storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.conceptsStoragePid:
|
||||
label: 'Concepts storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.factsStoragePid:
|
||||
label: 'Facts storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.faqsStoragePid:
|
||||
label: 'Faqs storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.destinationsStoragePid:
|
||||
label: 'Destinations storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.regionsStoragePid:
|
||||
label: 'Regions storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.citiesStoragePid:
|
||||
label: 'Cities storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.teammemberStoragePid:
|
||||
label: 'Teammember storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.officetipStoragePid:
|
||||
label: 'Officetip storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.snowReportStoragePid:
|
||||
label: 'Snow report storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.persistence.storagePid:
|
||||
label: 'Default storage PID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.storage'
|
||||
plugin.tx_epproducts.settings.defaultSearchPageUid:
|
||||
label: 'Default search page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.pages'
|
||||
plugin.tx_epproducts.settings.defaultDetailPageUid:
|
||||
label: 'Default product detail page UID'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.pages'
|
||||
plugin.tx_epproducts.settings.resellerExportPageUid:
|
||||
label: 'Page UID with reseller export plugin'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.pages'
|
||||
plugin.tx_epproducts.settings.travelInfoPageUid:
|
||||
label: 'Page UID with travel info plugin'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.pages'
|
||||
plugin.tx_epproducts.settings.excludedConceptUids:
|
||||
label: 'Exclude products with concept UIDs from search result (CSV)'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.search'
|
||||
plugin.tx_epproducts.settings.excludedRegionUids:
|
||||
label: 'Exclude regions with these UIDs from filter options (CSV)'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.search'
|
||||
plugin.tx_epproducts.settings.forcedConceptUids:
|
||||
label: 'Force concept UID in all search related parts (CSV)'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.search'
|
||||
plugin.tx_epproducts.settings.noInfoConceptUids:
|
||||
label: "Don't show availability info for products with these concept UIDs"
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.search'
|
||||
plugin.tx_epproducts.settings.groupsPriceToEmail:
|
||||
label: 'Email recipient for groups price inquiries'
|
||||
type: 'string'
|
||||
default: '[email protected]'
|
||||
category: 'epProducts.groups'
|
||||
plugin.tx_epproducts.settings.groupsPriceToName:
|
||||
label: 'Email recipient for groups price inquiries'
|
||||
type: 'string'
|
||||
default: 'EP Reisen'
|
||||
category: 'epProducts.groups'
|
||||
plugin.tx_epproducts.settings.groupsBookingUrl:
|
||||
label: 'Email recipient for groups price inquiries'
|
||||
type: 'string'
|
||||
default: 'https://myep.ddev.site/groups/booking/init'
|
||||
category: 'epProducts.groups'
|
||||
plugin.tx_epproducts.settings.priceTableRoomTypes:
|
||||
label: 'Room types for pricetables (CSV)'
|
||||
type: 'string'
|
||||
default: '1,2,3,4,5,6,7,8,9,10'
|
||||
category: 'epProducts.misc'
|
||||
plugin.tx_epproducts.settings.searchLogIgnoreIps:
|
||||
label: 'Ignore following IPs in searchlog'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.misc'
|
||||
plugin.tx_epproducts.settings.groupInquiryFormConceptUids:
|
||||
label: 'Concept UIDs to trigger inquiry form on product detail page (CSV)'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.misc'
|
||||
plugin.tx_epproducts.settings.myEpUrl:
|
||||
label: 'Per-site MyE&P booking URL override'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.misc'
|
||||
plugin.tx_epproducts.settings.myEpStagingUrl:
|
||||
label: 'Per-site MyE&P staging booking URL override'
|
||||
type: 'string'
|
||||
default: ''
|
||||
category: 'epProducts.misc'
|
||||
@@ -0,0 +1 @@
|
||||
@import 'EXT:ep_theme/Configuration/TypoScript/setup.typoscript'
|
||||
@@ -32,13 +32,18 @@ call_user_func(function (): void {
|
||||
);
|
||||
|
||||
// Column layouts, migrated from gridelements in 2026 (commit 4172ed9). colPos = 200 + 10 × layout + column
|
||||
// ep_products plugins are content element types of their own since 2026-10; "list" stays for retired plugins
|
||||
$plugins = implode(',', array_filter(
|
||||
array_map(static fn(array $item): string => (string)($item['value'] ?? ''), $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items']),
|
||||
static fn(string $cType): bool => str_starts_with($cType, 'epproducts_')
|
||||
));
|
||||
$menus = 'menu_abstract,menu_categorized_content,menu_categorized_pages,menu_recently_updated,menu_related_pages,menu_section_pages,menu_sitemap,menu_sitemap_pages';
|
||||
$columnContainers = [
|
||||
'ep_container_halves' => ['Spalten 50/50', 'Zwei gleich breite Spalten', 'halves', [[201], [202]]],
|
||||
'ep_container_thirds' => ['Spalten 33/33/33', 'Drei gleich breite Spalten', 'thirds', [[211], [212], [213]]],
|
||||
'ep_container_columns_quarters' => ['Spalten 25/25/25/25', 'Vier gleich breite Spalten', 'quarters', [[221], [222], [223], [224]]],
|
||||
'ep_container_half_and_two_quarters' => ['Spalten 50/25/25', 'Eine breite und zwei schmale Spalten', 'half_and_two_quarters', [[231, 'textmedia,teaser,list,form_formframework'], [232], [233]]],
|
||||
'ep_container_two_quarters_and_half' => ['Spalten 25/25/50', 'Zwei schmale und eine breite Spalte', 'two_quarters_and_half', [[241], [242], [243, 'textmedia,teaser,list,gmap,nlform,form_formframework,menu_pages,menu_subpages,menu_section']]],
|
||||
'ep_container_half_and_two_quarters' => ['Spalten 50/25/25', 'Eine breite und zwei schmale Spalten', 'half_and_two_quarters', [[231, 'textmedia,teaser,list,form_formframework,' . $plugins], [232], [233]]],
|
||||
'ep_container_two_quarters_and_half' => ['Spalten 25/25/50', 'Zwei schmale und eine breite Spalte', 'two_quarters_and_half', [[241], [242], [243, 'textmedia,teaser,list,gmap,nlform,form_formframework,menu_pages,menu_subpages,menu_section,' . $plugins]]],
|
||||
];
|
||||
// No container inside these columns (topLevelLayout of the gridelements configuration)
|
||||
$containers = implode(',', array_merge(['ep_container_quarters', 'ep_container_teasergroup'], array_keys($columnContainers)));
|
||||
|
||||
@@ -157,8 +157,6 @@ return [
|
||||
'exclude' => 0,
|
||||
'label' => 'Bild',
|
||||
'config' => [
|
||||
// TODO: Important! Verify that the fieldname value in foreign table either matches the column name
|
||||
// or is set properly in the following TCA, see https://docs.typo3.org/permalink/t3tca:confval-inline-foreign-match-fields
|
||||
'type' => 'file',
|
||||
'allowed' => 'jpg,jpeg',
|
||||
'appearance' => [
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
# Plugins (the booking widget on product detail pages), forms, sub-page menus and teaser cards
|
||||
# are left out: MyE&P has trip data first-hand, and the pages and records the cards link to are
|
||||
# in the feed in their own right. The filter applies to top-level elements only; a plugin nested
|
||||
# in a grid or container element is still rendered by its parent.
|
||||
# in a grid or container element is still rendered by its parent. The ep_products plugins are content
|
||||
# element types of their own (epproducts_*); "list" in the setting covers the retired plugins.
|
||||
lib.contentOnly < lib.dynamicContent
|
||||
lib.contentOnly.20.select.where = colPos={register:colPos} AND CType NOT IN ({$plugin.tx_eptheme.settings.contentOnlyExcludedCTypes})
|
||||
lib.contentOnly.20.select.where = colPos={register:colPos} AND CType NOT IN ({$plugin.tx_eptheme.settings.contentOnlyExcludedCTypes}) AND CType NOT LIKE 'epproducts_%'
|
||||
|
||||
tx_eptheme_content_only = PAGE
|
||||
tx_eptheme_content_only {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.41421" viewBox="0 -25 124 124" xmlns="http://www.w3.org/2000/svg"><g fill-rule="nonzero"><path d="m107 .3c-36.4 5.5-81.6 19.1-81.6 38.2 0 17.7 41.8 13.2 41.8 13.2s-67 22.3-67-7c0-33.2 84.5-44.4 106.8-44.4z" fill="#0084d4"/><path d="m17 73.5c36.4-5.4 81.6-19.1 81.6-38.2 0-17.7-41.8-13.2-41.8-13.2s67-22.3 67 7c0 33.3-84.5 44.4-106.8 44.4z" fill="#f8c62f"/><path d="m60.7 34.3-12.8 4 12.2.8-.4-2.4z" fill="#0084d4"/><path d="m75.9 35.2-9.2 2.9-3.5 9.7-1.7-11.3 4-10.7 1.7 7.9z" fill="#f8c62f"/></g></svg>
|
||||
|
After Width: | Height: | Size: 593 B |
@@ -0,0 +1,25 @@
|
||||
import { Controller } from '@hotwired/stimulus'
|
||||
|
||||
// The page is cached alike for every visitor, so the link back to the visitor's own search is
|
||||
// taken from ?ref= here, and only when it points to this site: anything else, javascript: URLs
|
||||
// included, has a different origin
|
||||
export default class extends Controller {
|
||||
|
||||
connect() {
|
||||
const ref = new URLSearchParams(window.location.search).get('ref')
|
||||
if (null === ref) {
|
||||
return
|
||||
}
|
||||
let url
|
||||
try {
|
||||
url = new URL(ref, window.location.href)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
if (url.origin !== window.location.origin) {
|
||||
return
|
||||
}
|
||||
this.element.href = url.href
|
||||
this.element.classList.remove('hidden')
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,16 @@
|
||||
import { Controller } from '@hotwired/stimulus'
|
||||
import { useFetch } from '../mixins/use_fetch'
|
||||
|
||||
export default class extends Controller {
|
||||
|
||||
static targets = [
|
||||
'container',
|
||||
'field',
|
||||
'loadingIndicator',
|
||||
'month',
|
||||
]
|
||||
|
||||
static values = {
|
||||
loading: Boolean,
|
||||
uri: String,
|
||||
hotelUid: Number,
|
||||
}
|
||||
|
||||
initialize() {
|
||||
useFetch(this)
|
||||
}
|
||||
|
||||
connect() {
|
||||
let months = []
|
||||
let today = new Date()
|
||||
let year = today.getFullYear()
|
||||
let month = today.getMonth()
|
||||
for (let i = 0; i < 20; i++) {
|
||||
let selectableDate = new Date(year, month, 1)
|
||||
months.push(selectableDate)
|
||||
if (month < 12) {
|
||||
month++
|
||||
} else {
|
||||
month = 1
|
||||
year++
|
||||
}
|
||||
this.fieldTarget.options[i] = new Option(selectableDate.toLocaleDateString('de-DE', {year: 'numeric', month: 'long'}), i.toString())
|
||||
}
|
||||
this.selectableMonths = months
|
||||
this.load(0)
|
||||
}
|
||||
|
||||
select(e) {
|
||||
let selectedIndex = e.currentTarget.value
|
||||
this.load(selectedIndex)
|
||||
}
|
||||
|
||||
load(selectedIndex) {
|
||||
this.loadingValue = true
|
||||
let selectedMonth = this.selectableMonths[selectedIndex]
|
||||
let data = new URLSearchParams()
|
||||
data.set('tx_epproducts_ajax[hotel]', this.hotelUidValue)
|
||||
data.set('tx_epproducts_ajax[month]', selectedMonth.getMonth() + 1)
|
||||
data.set('tx_epproducts_ajax[year]', selectedMonth.getFullYear())
|
||||
fetch(this.uriValue, { method: 'POST', body: data })
|
||||
.then(this.checkStatus)
|
||||
.then(this.parseHTML)
|
||||
.then(html => (
|
||||
this.containerTarget.innerHTML = html
|
||||
))
|
||||
.finally(() => {
|
||||
this.loadingValue = false
|
||||
select() {
|
||||
const selectedIndex = parseInt(this.fieldTarget.value, 10)
|
||||
this.monthTargets.forEach((month, index) => {
|
||||
month.classList.toggle('hidden', index !== selectedIndex)
|
||||
})
|
||||
}
|
||||
|
||||
loadingValueChanged() {
|
||||
this.loadingIndicatorTarget.classList.toggle('hidden', this.loadingValue === false)
|
||||
}
|
||||
}
|
||||
@@ -10,15 +10,15 @@
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMin meet"
|
||||
class="w-full h-full">
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark" cx="100" cy="100" r="70"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50 sbw:text-sbw-primary/50 snz:text-snz-primary/50 suz:text-suz-primary/50 uch:text-uch-primary/50 ser:text-ser-secondary/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark sbw:text-sbw-primary snz:text-snz-primary suz:text-suz-primary uch:text-uch-primary ser:text-ser-secondary" cx="100" cy="100" r="70"/>
|
||||
</svg>
|
||||
<div class="absolute top-0 left-0 inset-0 flex flex-col items-center justify-center p-8">
|
||||
<span class="block text-center text-white bg-ep-primary-dark uppercase font-bold leading-none text-xl">
|
||||
<span class="block text-center text-white bg-ep-primary-dark sbw:bg-sbw-primary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary ser:bg-ser-secondary uppercase font-bold leading-none text-xl">
|
||||
{badge.title -> f:format.raw()}
|
||||
</span>
|
||||
<f:if condition="{badge.subtitle}">
|
||||
<span class="block text-center text-white bg-ep-primary-dark uppercase font-bold leading-none">
|
||||
<span class="block text-center text-white bg-ep-primary-dark sbw:bg-sbw-primary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary ser:bg-ser-secondary uppercase font-bold leading-none">
|
||||
{badge.subtitle -> f:format.raw()}
|
||||
</span>
|
||||
</f:if>
|
||||
|
||||
@@ -62,13 +62,13 @@
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMin meet"
|
||||
class="w-full h-full">
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark" cx="100" cy="100" r="70"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50 sbw:text-sbw-primary/50 snz:text-snz-primary/50 suz:text-suz-primary/50 uch:text-uch-primary/50 ser:text-ser-secondary/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark sbw:text-sbw-primary snz:text-snz-primary suz:text-suz-primary uch:text-uch-primary ser:text-ser-secondary" cx="100" cy="100" r="70"/>
|
||||
</svg>
|
||||
<div class="absolute top-0 left-0 inset-0 flex flex-col items-center justify-center p-8">
|
||||
<span class="block text-center text-white bg-ep-primary-dark uppercase font-bold leading-none text-xl">{badgeData.title -> f:format.raw()}</span>
|
||||
<span class="block text-center text-white bg-ep-primary-dark sbw:bg-sbw-primary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary ser:bg-ser-secondary uppercase font-bold leading-none text-xl">{badgeData.title -> f:format.raw()}</span>
|
||||
<f:if condition="{badgeData.subtitle}">
|
||||
<span class="block text-center text-white bg-ep-primary-dark uppercase font-bold leading-none">{badgeData.subtitle -> f:format.raw()}</span>
|
||||
<span class="block text-center text-white bg-ep-primary-dark sbw:bg-sbw-primary snz:bg-snz-primary suz:bg-suz-primary uch:bg-uch-primary ser:bg-ser-secondary uppercase font-bold leading-none">{badgeData.subtitle -> f:format.raw()}</span>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMin meet"
|
||||
class="w-full h-full">
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark" cx="100" cy="100" r="70"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50 sbw:text-sbw-primary/50 snz:text-snz-primary/50 suz:text-suz-primary/50 uch:text-uch-primary/50 ser:text-ser-secondary/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark sbw:text-sbw-primary snz:text-snz-primary suz:text-suz-primary uch:text-uch-primary ser:text-ser-secondary" cx="100" cy="100" r="70"/>
|
||||
</svg>
|
||||
<div class="absolute top-0 left-0 inset-0 flex flex-col items-center justify-center p-8">
|
||||
<span class="block text-center text-white uppercase font-bold leading-none text-xl">{badgeData.title -> f:format.raw()}</span>
|
||||
|
||||
@@ -55,12 +55,10 @@
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
<f:if condition="{referringUrl}">
|
||||
<a href="{referringUrl}" class="button bg-button button--small mt-8">
|
||||
<a class="button bg-button button--small mt-8 hidden" data-controller="backlink">
|
||||
{ep:icon(icon: 'chevron-left', class: 'w-4 h-4 text-white')}
|
||||
<span>{backlinkLabel}</span>
|
||||
<span>zurück zum Suchergebnis</span>
|
||||
</a>
|
||||
</f:if>
|
||||
</div>
|
||||
</div>
|
||||
<f:render partial="Badge" arguments="{badge: product.badge}"/>
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
|
||||
|
||||
<div data-controller="price-calendar"
|
||||
data-price-calendar-hotel-code-value="{product.calendarHotel.code}"
|
||||
data-price-calendar-hotel-code-value="{calendarHotel.calendarCode}"
|
||||
data-price-calendar-groups-booking-url-value="{settings.groupsBookingUrl}"
|
||||
class="relative p-4 bg-zinc-50">
|
||||
<div class="pc-loading-indicator items-center justify-center space-x-4 text-sm p-4"
|
||||
id="pc-loading-{product.calendarHotel.uid}">
|
||||
id="pc-loading-{calendarHotel.uid}">
|
||||
<f:image class="block w-4 h-4" src="EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif" alt=""/>
|
||||
<span>Preiskalender wird geladen …</span>
|
||||
</div>
|
||||
<div data-price-calendar-target="mount"
|
||||
hx-get="{ep:uri.ajax(action: 'priceCalendar', controller: 'AjaxCalendar', extensionName: 'epproducts', pageUid: settings.defaultAjaxUid, arguments: '{hotel: product.calendarHotel}', format: 'html')}"
|
||||
hx-get="{ep:uri.ajax(action: 'priceCalendar', controller: 'AjaxCalendar', extensionName: 'epproducts', pageUid: settings.defaultAjaxUid, arguments: '{hotel: calendarHotel}', format: 'html')}"
|
||||
hx-trigger="load"
|
||||
hx-indicator="#pc-loading-{product.calendarHotel.uid}">
|
||||
hx-indicator="#pc-loading-{calendarHotel.uid}">
|
||||
</div>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="h-8 text-sm" data-price-calendar-target="message"></div>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<div class="flex-1 flex flex-col space-y-1 px-2 py-4 md:p-4">
|
||||
<a href="{targetUrl}" class="peer"
|
||||
<f:if condition="{concept.popupText} && {settings.globalConceptCode} != {concept.code}">
|
||||
hx-get="{ep:uri.ajax(action: 'concept', controller: 'AjaxTeaserPopup', arguments: '{concept: concept.uid, targetUrl: targetUrl}', format: 'html', pageUid: settings.defaultAjaxUid)}"
|
||||
hx-get="{ep:uri.ajax(action: 'concept', controller: 'AjaxTeaserPopup', arguments: '{concept: concept.uid, product: product.uid, targetUrl: targetUrl}', format: 'html', pageUid: settings.defaultAjaxUid)}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend"
|
||||
</f:if>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
|
||||
|
||||
<f:if condition="{region.webcam.available}">
|
||||
<f:if condition="{region.webcam.visible}">
|
||||
<div class="bg-zinc-50 p-4 mb-8">
|
||||
<p class="font-bold mb-2">
|
||||
Webcam
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
country: item.country,
|
||||
region: item.region,
|
||||
productImage: searchProductImage,
|
||||
nights: item.teaserNights,
|
||||
nights: item.nights,
|
||||
board: item.board,
|
||||
minPrice: item.minPrice,
|
||||
daytrip: item.daytrip,
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
preserveAspectRatio="xMinYMin meet"
|
||||
class="w-full h-full">
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark" cx="100" cy="100" r="70"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark/50 sbw:text-sbw-primary/50 snz:text-snz-primary/50 suz:text-suz-primary/50 uch:text-uch-primary/50 ser:text-ser-secondary/50" cx="100" cy="100" r="100"/>
|
||||
<circle fill="currentColor" class="text-ep-primary-dark sbw:text-sbw-primary snz:text-snz-primary suz:text-suz-primary uch:text-uch-primary ser:text-ser-secondary" cx="100" cy="100" r="70"/>
|
||||
</svg>
|
||||
<div class="absolute top-0 left-0 inset-0 flex flex-col items-center justify-center p-8">
|
||||
<span class="block text-center text-white uppercase font-bold leading-none text-xl">{badgeData.title -> f:format.raw()}</span>
|
||||
|
||||
@@ -69,11 +69,18 @@
|
||||
Adresse
|
||||
</h3>
|
||||
<p>
|
||||
<f:if condition="{hotelAddress}">
|
||||
<f:then>
|
||||
<f:format.nl2br>{hotelAddress}</f:format.nl2br>
|
||||
</f:then>
|
||||
<f:else>
|
||||
{travelData.hotel.name}
|
||||
<br>
|
||||
{travelData.hotel.street}
|
||||
<br>
|
||||
{travelData.hotel.country} {travelData.hotel.city}
|
||||
</f:else>
|
||||
</f:if>
|
||||
</p>
|
||||
</f:else>
|
||||
</f:if>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<html data-namespace-typo3-fluid="true" lang="en"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
|
||||
|
||||
<f:if condition="{error}">
|
||||
<f:then>
|
||||
<div class="text-sm text-red-600">
|
||||
Der Kalender konnte aktuell nicht geladen werden.
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else if="{calendarMonths -> f:count()} == 0">
|
||||
<div class="text-sm">
|
||||
Für die Wintersaison liegen noch keine Belegungsdaten vor.
|
||||
</div>
|
||||
</f:else>
|
||||
<f:else>
|
||||
<div data-controller="calendar">
|
||||
<select class="w-full border-zinc-400 focus:border-zinc-400"
|
||||
data-calendar-target="field"
|
||||
data-action="calendar#select">
|
||||
<f:for each="{calendarMonths}" as="month" iteration="i">
|
||||
<option value="{i.index}"><f:format.date format="%B %Y">{month.date}</f:format.date></option>
|
||||
</f:for>
|
||||
</select>
|
||||
<f:for each="{calendarMonths}" as="month" iteration="i">
|
||||
<table class="min-w-full border border-zinc-400 border-collapse mt-4 mb-0{f:if(condition: i.isFirst, else: ' hidden')}"
|
||||
data-calendar-target="month">
|
||||
<thead>
|
||||
<tr>
|
||||
<f:for each="{0: 'Mo', 1: 'Di', 2: 'Mi', 3: 'Do', 4: 'Fr', 5: 'Sa', 6: 'So'}" as="weekday">
|
||||
<th class="px-1 py-2 border border-zinc-300 text-center">
|
||||
{weekday}
|
||||
</th>
|
||||
</f:for>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<f:for each="{month.weeks}" as="week">
|
||||
<tr>
|
||||
<f:for each="{week}" as="day">
|
||||
<td class="px-1 py-2 border border-zinc-300 text-center">
|
||||
<f:if condition="{day.inMonth}">
|
||||
<f:then>
|
||||
<f:variable name="dateKey" value="{f:format.date(format: 'Y-m-d', date: day.date)}"/>
|
||||
<span class="block p-1 leading-none text-sm {classByDate.{dateKey}}">{f:format.date(format: 'd', date: day.date)}</span>
|
||||
</f:then>
|
||||
<f:else>
|
||||
|
||||
</f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
</f:for>
|
||||
</tr>
|
||||
</f:for>
|
||||
</tbody>
|
||||
</table>
|
||||
</f:for>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
|
||||
</html>
|
||||
@@ -65,14 +65,10 @@
|
||||
{f:if(condition: '{row.rooms.{type}.undersubscription}', then: '*')}
|
||||
</f:link.typolink>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{row.rooms.{type}.available}">
|
||||
<f:else>
|
||||
<f:else if="{row.rooms.{type}.price}">
|
||||
<span class="line-through text-zinc-500">{row.rooms.{type}.price -> ep:price()}</span>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</td>
|
||||
</f:for>
|
||||
</tr>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<h3>
|
||||
{concept.name}
|
||||
</h3>
|
||||
{concept.popupText -> f:format.html()}
|
||||
{popupText -> f:format.html()}
|
||||
<a href="{targetUrl}" target="_blank" class="button bg-button">
|
||||
{concept.popupButtonLabel}
|
||||
</a>
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<f:if condition="{product.calendarHotel}">
|
||||
<f:if condition="{calendarHotel}">
|
||||
<f:if condition="{product.season} == 's'">
|
||||
<f:render partial="Product/PriceCalendar" arguments="{_all}"/>
|
||||
|
||||
<f:variable name="currentYear" value="{f:format.date(date: 'now', format: 'Y')}"/>
|
||||
<f:render section="PriceTable" arguments="{product: product, settings: settings, year: currentYear}"/>
|
||||
<f:render section="PriceTable" arguments="{calendarHotel: calendarHotel, settings: settings, year: currentYear}"/>
|
||||
|
||||
<f:variable name="nextYear" value="{f:format.date(date: '+1 year', format: 'Y')}"/>
|
||||
<f:render section="PriceTable" arguments="{product: product, settings: settings, year: nextYear}"/>
|
||||
<f:render section="PriceTable" arguments="{calendarHotel: calendarHotel, settings: settings, year: nextYear}"/>
|
||||
</f:if>
|
||||
</f:if>
|
||||
|
||||
@@ -171,6 +171,9 @@
|
||||
<f:if condition="{showGallery}">
|
||||
<f:render section="SidebarGallery" arguments="{_all}"/>
|
||||
</f:if>
|
||||
<f:if condition="{calendarHotel} && {product.season} != 's'">
|
||||
<f:render section="AvailabilityCalendar" arguments="{_all}"/>
|
||||
</f:if>
|
||||
<f:if condition="{product.tourLink}">
|
||||
<div class="bg-zinc-50 p-4 mb-4"
|
||||
data-controller="lightbox">
|
||||
@@ -357,12 +360,32 @@
|
||||
paint that compete with the price calendar for PHP workers. The tables sit below
|
||||
the fold, so fetch them when they actually come into view.
|
||||
--></f:comment>
|
||||
<div hx-get="{ep:uri.ajax(action: 'priceTable', controller: 'AjaxCalendar', extensionName: 'epproducts', pageUid: settings.defaultAjaxUid, arguments: '{hotel: product.calendarHotel, year: year}', format: 'html')}"
|
||||
<div hx-get="{ep:uri.ajax(action: 'priceTable', controller: 'AjaxCalendar', extensionName: 'epproducts', pageUid: settings.defaultAjaxUid, arguments: '{hotel: calendarHotel, year: year}', format: 'html')}"
|
||||
hx-trigger="revealed">
|
||||
<f:render section="TableLoadingIndicator"/>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="AvailabilityCalendar">
|
||||
<div class="bg-zinc-50 p-4 flex flex-col space-y-2 mb-4">
|
||||
<span class="block font-bold">
|
||||
Belegungskalender
|
||||
</span>
|
||||
<div hx-get="{ep:uri.ajax(action: 'availability', controller: 'AjaxCalendar', extensionName: 'epproducts', pageUid: settings.defaultAjaxUid, arguments: '{hotel: calendarHotel}', format: 'html')}"
|
||||
hx-trigger="intersect once">
|
||||
<div class="flex items-center justify-center space-x-4 text-sm p-4">
|
||||
<f:image class="block w-4 h-4" src="EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif" alt=""/>
|
||||
<span>Belegungskalender wird geladen …</span>
|
||||
</div>
|
||||
</div>
|
||||
<f:if condition="{product.concept.code} == 'gsr'">
|
||||
<f:link.typolink class="button bg-button" parameter="{settings.groupsContactFormPageUid}" additionalParams="&ref={currentPageUid}">
|
||||
Zum Anfrageformular
|
||||
</f:link.typolink>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="TableLoadingIndicator">
|
||||
<div class="flex items-center justify-center space-x-4 text-sm p-4">
|
||||
<f:image class="block w-4 h-4" src="EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif" alt=""/>
|
||||
|
||||
@@ -8,7 +8,7 @@ $EM_CONF[$_EXTKEY] = [
|
||||
'category' => 'plugins',
|
||||
'author' => 'Björn Fromme',
|
||||
'author_email' => '[email protected]',
|
||||
'state' => 'beta',
|
||||
'state' => 'stable',
|
||||
'dividers2tabs' => true,
|
||||
'version' => '3.0.0',
|
||||
'constraints' => [
|
||||
|
||||
@@ -326,6 +326,13 @@ AddDefaultCharset utf-8
|
||||
RewriteCond %{HTTP_HOST} skiboarderweek\.(de|eu)$ [NC]
|
||||
RewriteRule ^(.*) https://www.ski-boarderweek.de/$1 [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?boarderweek\.de$ [NC]
|
||||
RewriteRule ^(.*) https://www.ski-boarderweek.de/$1 [L,R=301]
|
||||
|
||||
# Every page goes to the Haus Christiler page on semesterende-skireisen
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?ahrntal\-christiler\.de$ [NC]
|
||||
RewriteRule ^ https://www.semesterende-skireisen.de/reiseziele/italien/ahrntal/haus-christiler [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^ski\-wochenenden\.de$ [NC]
|
||||
RewriteRule ^(.*) https://www.ski-wochenenden.de/$1 [L,R=301]
|
||||
|
||||
@@ -336,12 +343,19 @@ AddDefaultCharset utf-8
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?ep\-events\.de$ [NC]
|
||||
RewriteRule ^ https://www.ep-reisen.de/reisen-fuer-gruppen/gruppenreisen/firmenreisen/ [L,R=301]
|
||||
|
||||
# Every page goes to the Haus Waldschlössli group house page
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?waldschloessli\-davos\.de$ [NC]
|
||||
RewriteRule ^ https://www.ep-reisen.de/reisen-fuer-gruppen/gruppenhaeuser/gruppenhaeuser-mieten/davos-haus-waldschloessli/ [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^ep\-reisen\.de$ [NC]
|
||||
RewriteRule ^(.*) https://www.ep-reisen.de/$1 [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?ep\-reisen\.(com|info)$ [NC]
|
||||
RewriteRule ^(.*) https://www.ep-reisen.de/$1 [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?epreisen\.de$ [NC]
|
||||
RewriteRule ^(.*) https://www.ep-reisen.de/$1 [L,R=301]
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^(www\.)?schneereisen\.com$ [NC]
|
||||
RewriteRule ^(.*) https://www.ep-reisen.de/$1 [L,R=301]
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ module.exports = {
|
||||
'bg-concept-sfl', 'bg-concept-sfl/70',
|
||||
'bg-concept-ser', 'bg-concept-ser/70',
|
||||
'flatpickr-input', 'flatpickr-calendar', 'flatpickr-day', 'flatpickr-day.selected',
|
||||
'availability-full', 'availability-partial', 'availability-none',
|
||||
'availability-full-to-none','availability-full-to-partial', 'availability-none-to-full',
|
||||
'availability-partial-to-full', 'availability-none-to-partial', 'availability-partial-to-none',
|
||||
],
|
||||
|
||||
@@ -50,6 +50,8 @@ Encore
|
||||
.copyFiles([
|
||||
{ from: './packages/ep_theme/Resources/Private/Assets/images', to: 'images/[name].[ext]' },
|
||||
{ from: './packages/ep_theme/Resources/Private/Assets/images/icons', to: 'images/icons/[name].[ext]' },
|
||||
// TYPO3 takes the extension icon from this fixed path
|
||||
{ from: './packages/ep_theme/Resources/Private/Assets/icons', to: 'Icons/[name].[ext]' },
|
||||
])
|
||||
// The content hash is what lets .htaccess serve these as `immutable` for a year: a new
|
||||
// build is a new URL, so a browser never has to revalidate one. It also replaces TYPO3's
|
||||
|
||||
Reference in new issue
Block a user