Connect contact forms with buspro api
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"helhum/typo3-console": "^5.6",
|
"helhum/typo3-console": "^5.6",
|
||||||
"league/csv": "^9.2",
|
"league/csv": "^9.2",
|
||||||
"pixelant/pxa-social-feed": "^1.10",
|
"pixelant/pxa-social-feed": "^1.10",
|
||||||
|
"symfony/http-client": "^4.3",
|
||||||
"symfony/options-resolver": "^4.2",
|
"symfony/options-resolver": "^4.2",
|
||||||
"symfony/property-access": "^4.3",
|
"symfony/property-access": "^4.3",
|
||||||
"symfony/serializer": "^4.2",
|
"symfony/serializer": "^4.2",
|
||||||
|
|||||||
Generated
+164
-45
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "43ff1e099d6b3f1ded82923c05a3e7f8",
|
"content-hash": "65c7db27e084cf03eddd1ddb83812563",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "algo26-matthias/idna-convert",
|
"name": "algo26-matthias/idna-convert",
|
||||||
@@ -1173,9 +1173,9 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Helmut Hummel",
|
"name": "Helmut Hummel",
|
||||||
|
"role": "Developer",
|
||||||
"email": "[email protected]",
|
"email": "[email protected]",
|
||||||
"homepage": "http://helhum.io",
|
"homepage": "http://helhum.io"
|
||||||
"role": "Developer"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "A reliable and powerful command line interface for TYPO3 CMS",
|
"description": "A reliable and powerful command line interface for TYPO3 CMS",
|
||||||
@@ -1294,9 +1294,9 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Ignace Nyamagana Butera",
|
"name": "Ignace Nyamagana Butera",
|
||||||
|
"role": "Developer",
|
||||||
"email": "[email protected]",
|
"email": "[email protected]",
|
||||||
"homepage": "https://github.com/nyamsprod/",
|
"homepage": "https://github.com/nyamsprod/"
|
||||||
"role": "Developer"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Csv data manipulation made easy in PHP",
|
"description": "Csv data manipulation made easy in PHP",
|
||||||
@@ -2122,6 +2122,125 @@
|
|||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2019-08-14T12:26:46+00:00"
|
"time": "2019-08-14T12:26:46+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/http-client",
|
||||||
|
"version": "v4.3.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/http-client.git",
|
||||||
|
"reference": "9a4fa769269ed730196a5c52c742b30600cf1e87"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/http-client/zipball/9a4fa769269ed730196a5c52c742b30600cf1e87",
|
||||||
|
"reference": "9a4fa769269ed730196a5c52c742b30600cf1e87",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.1.3",
|
||||||
|
"psr/log": "^1.0",
|
||||||
|
"symfony/http-client-contracts": "^1.1.6",
|
||||||
|
"symfony/polyfill-php73": "^1.11"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-client-implementation": "1.0",
|
||||||
|
"symfony/http-client-implementation": "1.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"nyholm/psr7": "^1.0",
|
||||||
|
"psr/http-client": "^1.0",
|
||||||
|
"symfony/http-kernel": "^4.3",
|
||||||
|
"symfony/process": "^4.2"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "4.3-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\HttpClient\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "[email protected]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony HttpClient component",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"time": "2019-08-20T14:27:59+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/http-client-contracts",
|
||||||
|
"version": "v1.1.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/http-client-contracts.git",
|
||||||
|
"reference": "6005fe61a33724405d56eb5b055d5d370192a1bd"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/6005fe61a33724405d56eb5b055d5d370192a1bd",
|
||||||
|
"reference": "6005fe61a33724405d56eb5b055d5d370192a1bd",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.1.3"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/http-client-implementation": ""
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.1-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Contracts\\HttpClient\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "[email protected]"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Generic abstractions related to HTTP clients",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"abstractions",
|
||||||
|
"contracts",
|
||||||
|
"decoupling",
|
||||||
|
"interfaces",
|
||||||
|
"interoperability",
|
||||||
|
"standards"
|
||||||
|
],
|
||||||
|
"time": "2019-08-08T10:05:21+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/inflector",
|
"name": "symfony/inflector",
|
||||||
"version": "v4.3.4",
|
"version": "v4.3.4",
|
||||||
@@ -3222,8 +3341,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The TYPO3 admin panel provides a panel with additional functionality in the frontend (Debugging, Caching, Preview...)",
|
"description": "The TYPO3 admin panel provides a panel with additional functionality in the frontend (Debugging, Caching, Preview...)",
|
||||||
@@ -3287,8 +3406,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Classes for the TYPO3 backend.",
|
"description": "Classes for the TYPO3 backend.",
|
||||||
@@ -3391,8 +3510,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Backend user administration and overview. Allows you to compare the settings of users and verify their permissions and see who is online.",
|
"description": "Backend user administration and overview. Allows you to compare the settings of users and verify their permissions and see who is online.",
|
||||||
@@ -3606,8 +3725,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The core library of TYPO3.",
|
"description": "The core library of TYPO3.",
|
||||||
@@ -3722,8 +3841,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "TYPO3 Extension Manager",
|
"description": "TYPO3 Extension Manager",
|
||||||
@@ -3828,8 +3947,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Listing of files in the directory",
|
"description": "Listing of files in the directory",
|
||||||
@@ -3933,8 +4052,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Fluid is a next-generation templating engine which makes the life of extension authors a lot easier!",
|
"description": "Fluid is a next-generation templating engine which makes the life of extension authors a lot easier!",
|
||||||
@@ -4102,8 +4221,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Classes for the frontend of TYPO3.",
|
"description": "Classes for the frontend of TYPO3.",
|
||||||
@@ -4161,8 +4280,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Shows various infos",
|
"description": "Shows various infos",
|
||||||
@@ -4219,8 +4338,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The Install Tool mounted as the module Tools>Install in TYPO3.",
|
"description": "The Install Tool mounted as the module Tools>Install in TYPO3.",
|
||||||
@@ -4276,8 +4395,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Enables the 'Config' and 'DB Check' modules for technical analysis of the system. This includes raw database search, checking relations, counting pages and records etc.",
|
"description": "Enables the 'Config' and 'DB Check' modules for technical analysis of the system. This includes raw database search, checking relations, counting pages and records etc.",
|
||||||
@@ -4335,8 +4454,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "List of database-records",
|
"description": "List of database-records",
|
||||||
@@ -4387,8 +4506,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The recycler offers the possibility to restore deleted records or remove them from the database permanently. These actions can be applied to a single record, multiple records, and recursively to child records (ex. restoring a page can restore all content elements on that page). Filtering by page and by table provides a quick overview of deleted records before taking action on them.",
|
"description": "The recycler offers the possibility to restore deleted records or remove them from the database permanently. These actions can be applied to a single record, multiple records, and recursively to child records (ex. restoring a page can restore all content elements on that page). Filtering by page and by table provides a quick overview of deleted records before taking action on them.",
|
||||||
@@ -4441,8 +4560,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Custom redirects in TYPO3.",
|
"description": "Custom redirects in TYPO3.",
|
||||||
@@ -4556,8 +4675,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Integration of CKEditor as Rich Text Editor.",
|
"description": "Integration of CKEditor as Rich Text Editor.",
|
||||||
@@ -4605,8 +4724,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The TYPO3 Scheduler let's you register tasks to happen at a specific time",
|
"description": "The TYPO3 Scheduler let's you register tasks to happen at a specific time",
|
||||||
@@ -4659,8 +4778,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "SEO features for TYPO3.",
|
"description": "SEO features for TYPO3.",
|
||||||
@@ -4768,8 +4887,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "JavaScript-driven editor with syntax highlighting and codecompletion. Based on CodeMirror.",
|
"description": "JavaScript-driven editor with syntax highlighting and codecompletion. Based on CodeMirror.",
|
||||||
@@ -4869,8 +4988,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Framework for management of TypoScript template records for the CMS frontend.",
|
"description": "Framework for management of TypoScript template records for the CMS frontend.",
|
||||||
@@ -4921,8 +5040,8 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "TYPO3 Core Team",
|
"name": "TYPO3 Core Team",
|
||||||
"email": "[email protected]",
|
"role": "Developer",
|
||||||
"role": "Developer"
|
"email": "[email protected]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Shows the frontend webpage inside the backend frameset.",
|
"description": "Shows the frontend webpage inside the backend frameset.",
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace EP\EpTheme\Controller;
|
|||||||
* This copyright notice MUST APPEAR in all copies of the script!
|
* This copyright notice MUST APPEAR in all copies of the script!
|
||||||
***************************************************************/
|
***************************************************************/
|
||||||
|
|
||||||
|
use EP\EpTheme\Service\BookingApiService;
|
||||||
use EP\EpTheme\Service\EmailService;
|
use EP\EpTheme\Service\EmailService;
|
||||||
use EP\EpTheme\Domain\Model\Dto\ContactForm;
|
use EP\EpTheme\Domain\Model\Dto\ContactForm;
|
||||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||||
@@ -40,12 +41,20 @@ class AjaxFormController extends ActionController
|
|||||||
protected $emailService;
|
protected $emailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param EmailService $emailService
|
* @var BookingApiService
|
||||||
*/
|
*/
|
||||||
public function __construct(EmailService $emailService)
|
protected $bookingApiService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param EmailService $emailService
|
||||||
|
* @param BookingApiService $bookingApiService
|
||||||
|
*/
|
||||||
|
public function __construct(EmailService $emailService, BookingApiService $bookingApiService)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->emailService = $emailService;
|
$this->emailService = $emailService;
|
||||||
|
$this->bookingApiService = $bookingApiService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,6 +72,15 @@ class AjaxFormController extends ActionController
|
|||||||
[ 'contactForm' => $contactForm ]
|
[ 'contactForm' => $contactForm ]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$addressData = [
|
||||||
|
'name' => $contactForm->getName(),
|
||||||
|
'vorname' => $contactForm->getFirstName(),
|
||||||
|
'email' => $contactForm->getEmail(),
|
||||||
|
'geschlecht' => $contactForm->getGender(),
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->bookingApiService->registerAddress($addressData);
|
||||||
|
|
||||||
return json_encode($response);
|
return json_encode($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,18 @@ class ContactForm
|
|||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
|
*/
|
||||||
|
protected $firstName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
|
*/
|
||||||
|
protected $gender;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@@ -121,6 +133,38 @@ class ContactForm
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getFirstName()
|
||||||
|
{
|
||||||
|
return $this->firstName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $firstName
|
||||||
|
*/
|
||||||
|
public function setFirstName($firstName)
|
||||||
|
{
|
||||||
|
$this->firstName = $firstName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getGender()
|
||||||
|
{
|
||||||
|
return $this->gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $gender
|
||||||
|
*/
|
||||||
|
public function setGender($gender)
|
||||||
|
{
|
||||||
|
$this->gender = $gender;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace EP\EpTheme\Form;
|
||||||
|
|
||||||
|
use EP\EpTheme\Service\BookingApiService;
|
||||||
|
use TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher;
|
||||||
|
|
||||||
|
class BpnApiFinisher extends AbstractFinisher
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var BookingApiService
|
||||||
|
*/
|
||||||
|
protected $bookingApiService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param BookingApiService $bookingApiService
|
||||||
|
*/
|
||||||
|
public function injectBookingApiService(BookingApiService $bookingApiService)
|
||||||
|
{
|
||||||
|
$this->bookingApiService = $bookingApiService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
protected function executeInternal()
|
||||||
|
{
|
||||||
|
$formValues = $this->finisherContext->getFormValues();
|
||||||
|
$addressData = [
|
||||||
|
'name' => $formValues['name'],
|
||||||
|
'vorname' => $formValues['vorname'],
|
||||||
|
'geschlecht' => $formValues['geschlecht'],
|
||||||
|
'email' => $formValues['email'],
|
||||||
|
'strasse' => $formValues['strasse'],
|
||||||
|
'plz' => $formValues['plz'],
|
||||||
|
'ort' => $formValues['ort'],
|
||||||
|
'telefon' => $formValues['telefon'],
|
||||||
|
];
|
||||||
|
$this->bookingApiService->registerAddress($addressData);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace EP\EpTheme\Service;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpClient\HttpClient;
|
||||||
|
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||||
|
use TYPO3\CMS\Core\SingletonInterface;
|
||||||
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||||
|
|
||||||
|
class BookingApiService implements SingletonInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $apiToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $apiEndpointUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ConfigurationManagerInterface $manager
|
||||||
|
*/
|
||||||
|
public function __construct(ConfigurationManagerInterface $manager)
|
||||||
|
{
|
||||||
|
$settings = GeneralUtility::removeDotsFromTS(
|
||||||
|
$manager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->apiToken = $settings['plugin']['tx_eptheme']['settings']['myEpApiToken'];
|
||||||
|
$this->apiEndpointUrl = $settings['plugin']['tx_eptheme']['settings']['myEpApiBaseUrl'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $addressData
|
||||||
|
*/
|
||||||
|
public function registerAddress(array $addressData)
|
||||||
|
{
|
||||||
|
$client = HttpClient::create();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$client->request('POST', $this->apiEndpointUrl . '/booking/address', [
|
||||||
|
'headers' => [
|
||||||
|
'X-AUTH-TOKEN' => $this->apiToken,
|
||||||
|
],
|
||||||
|
'body' => [
|
||||||
|
'data' => $addressData,
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
catch (TransportExceptionInterface $e)
|
||||||
|
{}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,9 @@ TYPO3:
|
|||||||
|
|
||||||
prototypes:
|
prototypes:
|
||||||
standard:
|
standard:
|
||||||
|
finishersDefinition:
|
||||||
|
BpnApiFinisher:
|
||||||
|
implementationClassName: 'EP\EpTheme\Form\BpnApiFinisher'
|
||||||
formElementsDefinition:
|
formElementsDefinition:
|
||||||
Form:
|
Form:
|
||||||
renderingOptions:
|
renderingOptions:
|
||||||
|
|||||||
@@ -157,7 +157,9 @@ plugin.tx_eptheme {
|
|||||||
partnerIdSelectLabel =
|
partnerIdSelectLabel =
|
||||||
|
|
||||||
# cat=eptheme/900/100; type=string; label=MyE&P API base url
|
# cat=eptheme/900/100; type=string; label=MyE&P API base url
|
||||||
myEpApiBaseUrl = https://myep.burn.dpn
|
myEpApiBaseUrl =
|
||||||
|
# cat=eptheme/900/110; type=string; label=MyE&P API auth token
|
||||||
|
myEpApiToken =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ plugin.tx_eptheme {
|
|||||||
conceptsPageUid = {$plugin.tx_eptheme.settings.conceptsPageUid}
|
conceptsPageUid = {$plugin.tx_eptheme.settings.conceptsPageUid}
|
||||||
myEpPageUid = {$plugin.tx_eptheme.settings.myEpPageUid}
|
myEpPageUid = {$plugin.tx_eptheme.settings.myEpPageUid}
|
||||||
myEpApiBaseUrl = {$plugin.tx_eptheme.settings.myEpApiBaseUrl}
|
myEpApiBaseUrl = {$plugin.tx_eptheme.settings.myEpApiBaseUrl}
|
||||||
|
myEpApiToken = {$plugin.tx_eptheme.settings.myEpApiToken}
|
||||||
facebookViewContentValues {
|
facebookViewContentValues {
|
||||||
productUid = {$plugin.tx_eptheme.settings.facebookViewContentProductUid}
|
productUid = {$plugin.tx_eptheme.settings.facebookViewContentProductUid}
|
||||||
nameInternal = {$plugin.tx_eptheme.settings.facebookViewContentNameInternal}
|
nameInternal = {$plugin.tx_eptheme.settings.facebookViewContentNameInternal}
|
||||||
|
|||||||
@@ -7,12 +7,16 @@ label: Kontaktformular
|
|||||||
prototypeName: contactform
|
prototypeName: contactform
|
||||||
finishers:
|
finishers:
|
||||||
-
|
-
|
||||||
|
identifier: BpnApiFinisher
|
||||||
options:
|
options:
|
||||||
subject: 'Kontaktanfrage von {text-1}'
|
apiToken: foobarbaz
|
||||||
|
-
|
||||||
|
options:
|
||||||
|
subject: 'Kontaktanfrage von {vorname} {name}'
|
||||||
recipientAddress: [email protected]
|
recipientAddress: [email protected]
|
||||||
recipientName: 'E&P Reisen'
|
recipientName: 'E&P Reisen'
|
||||||
senderAddress: '{text-4}'
|
senderAddress: '{email}'
|
||||||
senderName: '{text-1}'
|
senderName: '{vorname} {name}'
|
||||||
replyToAddress: [email protected]
|
replyToAddress: [email protected]
|
||||||
carbonCopyAddress: ''
|
carbonCopyAddress: ''
|
||||||
blindCarbonCopyAddress: ''
|
blindCarbonCopyAddress: ''
|
||||||
@@ -38,11 +42,11 @@ renderables:
|
|||||||
-
|
-
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
type: Text
|
type: Text
|
||||||
identifier: text-1
|
identifier: vorname
|
||||||
label: Name
|
label: Vorname
|
||||||
properties:
|
properties:
|
||||||
fluidAdditionalAttributes:
|
fluidAdditionalAttributes:
|
||||||
placeholder: 'Vor- & Nachname'
|
placeholder: 'Vorname'
|
||||||
required: required
|
required: required
|
||||||
elementDescription: ''
|
elementDescription: ''
|
||||||
validators:
|
validators:
|
||||||
@@ -51,21 +55,34 @@ renderables:
|
|||||||
-
|
-
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
type: Text
|
type: Text
|
||||||
identifier: text-2
|
identifier: name
|
||||||
label: Anschrift
|
label: Nachname
|
||||||
properties:
|
properties:
|
||||||
fluidAdditionalAttributes:
|
fluidAdditionalAttributes:
|
||||||
placeholder: 'Straße & Nr.'
|
placeholder: 'Nachname'
|
||||||
|
required: required
|
||||||
elementDescription: ''
|
elementDescription: ''
|
||||||
|
validators:
|
||||||
|
-
|
||||||
|
identifier: NotEmpty
|
||||||
|
-
|
||||||
|
properties:
|
||||||
|
options:
|
||||||
|
m: m
|
||||||
|
w: w
|
||||||
|
d: d
|
||||||
|
fluidAdditionalAttributes:
|
||||||
|
required: required
|
||||||
|
type: SingleSelect
|
||||||
|
identifier: geschlecht
|
||||||
|
label: Gender
|
||||||
|
validators:
|
||||||
|
-
|
||||||
|
identifier: NotEmpty
|
||||||
-
|
-
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
type: Text
|
type: Text
|
||||||
identifier: text-3
|
identifier: email
|
||||||
label: 'PLZ, Ort'
|
|
||||||
-
|
|
||||||
defaultValue: ''
|
|
||||||
type: Text
|
|
||||||
identifier: text-4
|
|
||||||
label: E-Mail
|
label: E-Mail
|
||||||
properties:
|
properties:
|
||||||
fluidAdditionalAttributes:
|
fluidAdditionalAttributes:
|
||||||
@@ -78,16 +95,35 @@ renderables:
|
|||||||
-
|
-
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
type: Text
|
type: Text
|
||||||
identifier: text-5
|
identifier: strasse
|
||||||
|
label: Straße
|
||||||
|
properties:
|
||||||
|
fluidAdditionalAttributes:
|
||||||
|
placeholder: 'Straße & Nr.'
|
||||||
|
elementDescription: ''
|
||||||
|
-
|
||||||
|
defaultValue: ''
|
||||||
|
type: Text
|
||||||
|
identifier: plz
|
||||||
|
label: 'PLZ'
|
||||||
|
-
|
||||||
|
defaultValue: ''
|
||||||
|
type: Text
|
||||||
|
identifier: ort
|
||||||
|
label: 'Ort'
|
||||||
|
-
|
||||||
|
defaultValue: ''
|
||||||
|
type: Text
|
||||||
|
identifier: telefon
|
||||||
label: Telefon
|
label: Telefon
|
||||||
-
|
-
|
||||||
defaultValue: ''
|
defaultValue: ''
|
||||||
type: Textarea
|
type: Textarea
|
||||||
identifier: textarea-1
|
identifier: message
|
||||||
label: 'Deine Kontaktanfrage'
|
label: 'Deine Kontaktanfrage'
|
||||||
-
|
-
|
||||||
type: Checkbox
|
type: Checkbox
|
||||||
identifier: checkbox-1
|
identifier: privacypolicyaccepted
|
||||||
label: 'Ich habe die Datenschutzbestimmungen gelesen und akzeptiere sie'
|
label: 'Ich habe die Datenschutzbestimmungen gelesen und akzeptiere sie'
|
||||||
properties:
|
properties:
|
||||||
elementDescription: ''
|
elementDescription: ''
|
||||||
|
|||||||
@@ -76,6 +76,9 @@
|
|||||||
<trans-unit id="tx_eptheme.message.contactForm.name.1221560718">
|
<trans-unit id="tx_eptheme.message.contactForm.name.1221560718">
|
||||||
<target>Bitte angeben</target>
|
<target>Bitte angeben</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="tx_eptheme.message.contactForm.firstName.1221560718">
|
||||||
|
<target>Bitte angeben</target>
|
||||||
|
</trans-unit>
|
||||||
<trans-unit id="tx_eptheme.message.contactForm.email.1221560718">
|
<trans-unit id="tx_eptheme.message.contactForm.email.1221560718">
|
||||||
<target>Bitte angeben</target>
|
<target>Bitte angeben</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|||||||
@@ -75,6 +75,9 @@
|
|||||||
<trans-unit id="tx_eptheme.message.contactForm.name.1221560718">
|
<trans-unit id="tx_eptheme.message.contactForm.name.1221560718">
|
||||||
<source>Bitte angeben</source>
|
<source>Bitte angeben</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="tx_eptheme.message.contactForm.firstName.1221560718">
|
||||||
|
<source>Bitte angeben</source>
|
||||||
|
</trans-unit>
|
||||||
<trans-unit id="tx_eptheme.message.contactForm.email.1221560718">
|
<trans-unit id="tx_eptheme.message.contactForm.email.1221560718">
|
||||||
<source>Bitte angeben</source>
|
<source>Bitte angeben</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|||||||
@@ -18,6 +18,18 @@
|
|||||||
<div class="help-block"
|
<div class="help-block"
|
||||||
v-show="formErrors.name" v-html="formErrors.name"></div>
|
v-show="formErrors.name" v-html="formErrors.name"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group" :class="{ 'has-error': formErrors.firstName }">
|
||||||
|
<label for="firstName" class="control-label">Vorname*</label>
|
||||||
|
<f:form.textfield class="form-control" property="firstName"/>
|
||||||
|
<div class="help-block"
|
||||||
|
v-show="formErrors.firstName" v-html="formErrors.firstName"></div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" :class="{ 'has-error': formErrors.gender }">
|
||||||
|
<label for="gender" class="control-label">Gender*</label>
|
||||||
|
<f:form.select class="form-control" property="gender" options="{m: 'M', w: 'W', d: 'D'}"/>
|
||||||
|
<div class="help-block"
|
||||||
|
v-show="formErrors.gender" v-html="formErrors.gender"></div>
|
||||||
|
</div>
|
||||||
<div class="form-group" :class="{ 'has-error': formErrors.company }">
|
<div class="form-group" :class="{ 'has-error': formErrors.company }">
|
||||||
<label for="company" class="control-label">Firma/Verein</label>
|
<label for="company" class="control-label">Firma/Verein</label>
|
||||||
<f:form.textfield class="form-control" property="company"/>
|
<f:form.textfield class="form-control" property="company"/>
|
||||||
|
|||||||
@@ -12,12 +12,24 @@
|
|||||||
pageUid="{settings.defaultAjaxUid}" class="border"
|
pageUid="{settings.defaultAjaxUid}" class="border"
|
||||||
additionalAttributes="{'v-show': '!success', '@submit.prevent': 'submitForm()'}">
|
additionalAttributes="{'v-show': '!success', '@submit.prevent': 'submitForm()'}">
|
||||||
<f:form.hidden property="pageUrl"/>
|
<f:form.hidden property="pageUrl"/>
|
||||||
|
<div class="form-group" :class="{ 'has-error': formErrors.gender }">
|
||||||
|
<label for="gender" class="control-label">Geschlecht</label>
|
||||||
|
<f:form.select options="{m: 'm', w: 'w', d: 'd'}" property="gender" />
|
||||||
|
<div class="help-block"
|
||||||
|
v-show="formErrors.gender" v-html="formErrors.gender"></div>
|
||||||
|
</div>
|
||||||
<div class="form-group" :class="{ 'has-error': formErrors.name }">
|
<div class="form-group" :class="{ 'has-error': formErrors.name }">
|
||||||
<label for="name" class="control-label">Name</label>
|
<label for="name" class="control-label">Name</label>
|
||||||
<f:form.textfield class="form-control" property="name"/>
|
<f:form.textfield class="form-control" property="name"/>
|
||||||
<div class="help-block"
|
<div class="help-block"
|
||||||
v-show="formErrors.name" v-html="formErrors.name"></div>
|
v-show="formErrors.name" v-html="formErrors.name"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group" :class="{ 'has-error': formErrors.firstName }">
|
||||||
|
<label for="firstName" class="control-label">Vorname</label>
|
||||||
|
<f:form.textfield class="form-control" property="firstName"/>
|
||||||
|
<div class="help-block"
|
||||||
|
v-show="formErrors.firstName" v-html="formErrors.firstName"></div>
|
||||||
|
</div>
|
||||||
<div class="form-group" :class="{ 'has-error': formErrors.email }">
|
<div class="form-group" :class="{ 'has-error': formErrors.email }">
|
||||||
<label for="email" class="control-label">E-Mail</label>
|
<label for="email" class="control-label">E-Mail</label>
|
||||||
<f:form.textfield class="form-control" property="email"/>
|
<f:form.textfield class="form-control" property="email"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user