Prepopulate configurator form
This commit is contained in:
@@ -51,9 +51,17 @@ class FormController extends ActionController
|
|||||||
$this->view->assign('inquiry', $inquiry);
|
$this->view->assign('inquiry', $inquiry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configuratorAction()
|
/**
|
||||||
|
* @param int $travelType
|
||||||
|
* @param int $locationType
|
||||||
|
*/
|
||||||
|
public function configuratorAction($travelType = 0, $locationType = 0)
|
||||||
{
|
{
|
||||||
$inquiry = $this->getInquiryFromContext();
|
if ($travelType !== 0) {
|
||||||
|
$inquiry = Inquiry::fromArguments($travelType, $locationType);
|
||||||
|
} else {
|
||||||
|
$inquiry = $this->getInquiryFromContext();
|
||||||
|
}
|
||||||
$this->view->assign('inquiry', $inquiry);
|
$this->view->assign('inquiry', $inquiry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ class OfferProcessor implements DataProcessorInterface
|
|||||||
$configuratorType = $offer->getConfiguratorType();
|
$configuratorType = $offer->getConfiguratorType();
|
||||||
/** @var \EP\EpEvents\Domain\Repository\TraveltypeRepository $repository */
|
/** @var \EP\EpEvents\Domain\Repository\TraveltypeRepository $repository */
|
||||||
$repository = $objectManager->get(TraveltypeRepository::class);
|
$repository = $objectManager->get(TraveltypeRepository::class);
|
||||||
$processedData['travelType'] = $repository->findOneByConfiguratorType($configuratorType);
|
$processedData['traveltype'] = $repository->findOneByConfiguratorType($configuratorType);
|
||||||
|
}
|
||||||
|
if ($offer->getLocation()) {
|
||||||
|
$processedData['locationtype'] = $offer->getLocation()->getConfiguratorType();
|
||||||
}
|
}
|
||||||
$processedData['search'] = GeneralUtility::_GET('search');
|
$processedData['search'] = GeneralUtility::_GET('search');
|
||||||
return $processedData;
|
return $processedData;
|
||||||
|
|||||||
@@ -185,8 +185,12 @@ class Inquiry extends AbstractValueObject
|
|||||||
public static function fromArguments($travelType = 0, $locationType = 0)
|
public static function fromArguments($travelType = 0, $locationType = 0)
|
||||||
{
|
{
|
||||||
$inquiry = new self;
|
$inquiry = new self;
|
||||||
$inquiry->setTravelType((string) $travelType);
|
if ($travelType) {
|
||||||
$inquiry->setLocationType((string) $locationType);
|
$inquiry->setTravelType((string) $travelType);
|
||||||
|
}
|
||||||
|
if ($locationType) {
|
||||||
|
$inquiry->setLocationType((string) $locationType);
|
||||||
|
}
|
||||||
return $inquiry;
|
return $inquiry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,11 +85,11 @@
|
|||||||
</svg>
|
</svg>
|
||||||
<a class="button button--page-header" href="{f:uri.action(
|
<a class="button button--page-header" href="{f:uri.action(
|
||||||
pageUid: settings.configuratorPageUid,
|
pageUid: settings.configuratorPageUid,
|
||||||
action: 'contactForm',
|
action: 'configurator',
|
||||||
controller: 'Form',
|
controller: 'Form',
|
||||||
extensionName: 'epevents'
|
extensionName: 'epevents'
|
||||||
pluginName: 'ContactForm',
|
pluginName: 'Configurator',
|
||||||
arguments: '{travelType: \'{traveltype.configuratorType -> v:or(alternative: 0)}\'}',
|
arguments: '{travelType: \'{traveltype.configuratorType -> v:or(alternative: 0)}\', locationType: \'{locationtype -> v:or(alternative: 0)}\'}',
|
||||||
additionalParams: '{ref: data.uid}',
|
additionalParams: '{ref: data.uid}',
|
||||||
noCacheHash: 1
|
noCacheHash: 1
|
||||||
)}">» Anfragen «</a>
|
)}">» Anfragen «</a>
|
||||||
|
|||||||
@@ -106,6 +106,22 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [
|
|||||||
'GETvar' => 'tx_epevents_contactform[travelType]',
|
'GETvar' => 'tx_epevents_contactform[travelType]',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'events_configurator' => [
|
||||||
|
[
|
||||||
|
'GETvar' => 'tx_epevents_configurator[controller]',
|
||||||
|
'noMatch' => 'bypass',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'GETvar' => 'tx_epevents_configurator[action]',
|
||||||
|
'noMatch' => 'bypass',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'GETvar' => 'tx_epevents_configurator[travelType]',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'GETvar' => 'tx_epevents_configurator[locationType]',
|
||||||
|
],
|
||||||
|
],
|
||||||
'events_activity' => [
|
'events_activity' => [
|
||||||
[
|
[
|
||||||
'GETvar' => 'tx_epevents_activitydetail[controller]',
|
'GETvar' => 'tx_epevents_activitydetail[controller]',
|
||||||
@@ -171,6 +187,7 @@ $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [
|
|||||||
1473 => 'team',
|
1473 => 'team',
|
||||||
1488 => 'team',
|
1488 => 'team',
|
||||||
987 => 'events_contactform',
|
987 => 'events_contactform',
|
||||||
|
1263 => 'events_configurator',
|
||||||
1300 => 'events_activity',
|
1300 => 'events_activity',
|
||||||
1444 => 'reseller',
|
1444 => 'reseller',
|
||||||
1448 => 'reseller',
|
1448 => 'reseller',
|
||||||
|
|||||||
Reference in New Issue
Block a user