feat: additional fields for groups price calculator
This commit is contained in:
@@ -84,9 +84,18 @@ class AjaxGroupsPriceController extends ActionController
|
|||||||
$selectedOptions = [];
|
$selectedOptions = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mode = $groupsPriceInquiry->getMode();
|
||||||
|
|
||||||
|
if (false === in_array($mode, [GroupsPriceInquiry::MODE_BOOKING, GroupsPriceInquiry::MODE_INQUIRY])) {
|
||||||
|
$mode = GroupsPriceInquiry::MODE_BOOKING;
|
||||||
|
}
|
||||||
|
|
||||||
$variables = [
|
$variables = [
|
||||||
|
'mode' => $mode,
|
||||||
'hotel' => $hotel,
|
'hotel' => $hotel,
|
||||||
'name' => $groupsPriceInquiry->getName(),
|
'name' => $groupsPriceInquiry->getName(),
|
||||||
|
'group' => $groupsPriceInquiry->getGroup(),
|
||||||
|
'address' => $groupsPriceInquiry->getAddress(),
|
||||||
'email' => $groupsPriceInquiry->getEmail(),
|
'email' => $groupsPriceInquiry->getEmail(),
|
||||||
'phone' => $groupsPriceInquiry->getPhone(),
|
'phone' => $groupsPriceInquiry->getPhone(),
|
||||||
'remarks' => $groupsPriceInquiry->getRemarks(),
|
'remarks' => $groupsPriceInquiry->getRemarks(),
|
||||||
|
|||||||
@@ -28,12 +28,32 @@ namespace EP\EpProducts\Domain\Model\Dto;
|
|||||||
|
|
||||||
class GroupsPriceInquiry
|
class GroupsPriceInquiry
|
||||||
{
|
{
|
||||||
|
const MODE_INQUIRY = 'inquiry';
|
||||||
|
const MODE_BOOKING = 'booking';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $mode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
|
*/
|
||||||
|
protected $group;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
|
*/
|
||||||
|
protected $address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
||||||
@@ -99,6 +119,27 @@ class GroupsPriceInquiry
|
|||||||
*/
|
*/
|
||||||
protected $summary;
|
protected $summary;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->mode = self::MODE_BOOKING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getMode()
|
||||||
|
{
|
||||||
|
return $this->mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $mode
|
||||||
|
*/
|
||||||
|
public function setMode($mode)
|
||||||
|
{
|
||||||
|
$this->mode = $mode;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@@ -115,6 +156,42 @@ class GroupsPriceInquiry
|
|||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getGroup()
|
||||||
|
{
|
||||||
|
return $this->group;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $group
|
||||||
|
*/
|
||||||
|
public function setGroup($group)
|
||||||
|
{
|
||||||
|
$this->group = $group;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getAddress()
|
||||||
|
{
|
||||||
|
return $this->address;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $address
|
||||||
|
*/
|
||||||
|
public function setAddress($address)
|
||||||
|
{
|
||||||
|
$this->address = $address;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
+42
-5
@@ -153,7 +153,7 @@
|
|||||||
<div class="mb-8"
|
<div class="mb-8"
|
||||||
v-show="nightsCount > 0 && !submitted">
|
v-show="nightsCount > 0 && !submitted">
|
||||||
<div class="p-2 uppercase bg-ep-primary-dark text-white w-full">
|
<div class="p-2 uppercase bg-ep-primary-dark text-white w-full">
|
||||||
Angebot anfordern
|
Jetzt buchen
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-zinc-100 p-2">
|
<div class="bg-zinc-100 p-2">
|
||||||
<div class="grid md:grid-cols-2 gap-4 mb-4">
|
<div class="grid md:grid-cols-2 gap-4 mb-4">
|
||||||
@@ -168,6 +168,29 @@
|
|||||||
v-show="formErrors.name"
|
v-show="formErrors.name"
|
||||||
v-html="formErrors.name"></div>
|
v-html="formErrors.name"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div :class="{ 'has-error': formErrors.name }">
|
||||||
|
<label class="font-bold mb-2">
|
||||||
|
Adresse*
|
||||||
|
</label>
|
||||||
|
<textarea class="form-field"
|
||||||
|
cols="30"
|
||||||
|
rows="3"
|
||||||
|
v-model="address"/>
|
||||||
|
<div class="text-sm text-red-600 mt-1"
|
||||||
|
v-show="formErrors.address"
|
||||||
|
v-html="formErrors.address"></div>
|
||||||
|
</div>
|
||||||
|
<div :class="{ 'has-error': formErrors.group }">
|
||||||
|
<label class="font-bold mb-2">
|
||||||
|
Name der Gruppe*
|
||||||
|
</label>
|
||||||
|
<input type="text"
|
||||||
|
class="form-field"
|
||||||
|
v-model="group">
|
||||||
|
<div class="text-sm text-red-600 mt-1"
|
||||||
|
v-show="formErrors.group"
|
||||||
|
v-html="formErrors.group"></div>
|
||||||
|
</div>
|
||||||
<div :class="{ 'has-error': formErrors.email }">
|
<div :class="{ 'has-error': formErrors.email }">
|
||||||
<label class="font-bold mb-2">
|
<label class="font-bold mb-2">
|
||||||
E-Mail*
|
E-Mail*
|
||||||
@@ -200,11 +223,22 @@
|
|||||||
v-model="remarks"/>
|
v-model="remarks"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="button"
|
<div class="py-4">
|
||||||
|
Ihr erhaltet von uns eine Bestätigung. Wir behalten uns vor die Buchung zu prüfen / erst nach
|
||||||
|
Rückbestätigung von uns gilt die Buchung auch von unserer Seite als bindend.
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center space-x-2">
|
||||||
|
<button class="button bg-button"
|
||||||
type="submit"
|
type="submit"
|
||||||
@click.prevent="submitForm()">
|
@click.prevent="submitForm('booking')">
|
||||||
Senden
|
Buchung abschicken
|
||||||
</button>
|
</button>
|
||||||
|
<button class="button bg-button button--small bg-ep-secondary"
|
||||||
|
type="submit"
|
||||||
|
@click.prevent="submitForm('inquiry')">
|
||||||
|
nur als Anfrage senden
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="py-8 text-xl text-center font-bold" v-show="submitted">
|
<div class="py-8 text-xl text-center font-bold" v-show="submitted">
|
||||||
@@ -336,9 +370,12 @@ export default {
|
|||||||
this.selectedBoard = null;
|
this.selectedBoard = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm(mode) {
|
||||||
let formData = new URLSearchParams({
|
let formData = new URLSearchParams({
|
||||||
|
'tx_epproducts_ajax[groupsPriceInquiry][mode]': mode,
|
||||||
'tx_epproducts_ajax[groupsPriceInquiry][name]': this.name ? this.name : '',
|
'tx_epproducts_ajax[groupsPriceInquiry][name]': this.name ? this.name : '',
|
||||||
|
'tx_epproducts_ajax[groupsPriceInquiry][group]': this.group ? this.group : '',
|
||||||
|
'tx_epproducts_ajax[groupsPriceInquiry][address]': this.address ? this.address : '',
|
||||||
'tx_epproducts_ajax[groupsPriceInquiry][email]': this.email? this.email : '',
|
'tx_epproducts_ajax[groupsPriceInquiry][email]': this.email? this.email : '',
|
||||||
'tx_epproducts_ajax[groupsPriceInquiry][phone]': this.phone ? this.phone : '',
|
'tx_epproducts_ajax[groupsPriceInquiry][phone]': this.phone ? this.phone : '',
|
||||||
'tx_epproducts_ajax[groupsPriceInquiry][remarks]': this.remarks,
|
'tx_epproducts_ajax[groupsPriceInquiry][remarks]': this.remarks,
|
||||||
|
|||||||
@@ -84,6 +84,12 @@
|
|||||||
<trans-unit id="tx_eptheme.message.name.1221560718">
|
<trans-unit id="tx_eptheme.message.name.1221560718">
|
||||||
<source>Bitte angeben</source>
|
<source>Bitte angeben</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="tx_eptheme.message.group.1221560910">
|
||||||
|
<source>Bitte angeben</source>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="tx_eptheme.message.address.1221560910">
|
||||||
|
<source>Bitte angeben</source>
|
||||||
|
</trans-unit>
|
||||||
<trans-unit id="tx_eptheme.message.phone.1221560718">
|
<trans-unit id="tx_eptheme.message.phone.1221560718">
|
||||||
<source>Bitte angeben</source>
|
<source>Bitte angeben</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|||||||
@@ -7,6 +7,14 @@
|
|||||||
<f:section name="Main">
|
<f:section name="Main">
|
||||||
<h1>Anfrage Gruppenhaus vom <f:format.date date="now" format="d.m.y" /></h1>
|
<h1>Anfrage Gruppenhaus vom <f:format.date date="now" format="d.m.y" /></h1>
|
||||||
<table>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Art
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
{f:if(condition: '{mode} == "booking"', then: 'Buchung', else: 'Anfrage')}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Haus</th>
|
<th>Haus</th>
|
||||||
<td>{hotel.name}</td>
|
<td>{hotel.name}</td>
|
||||||
@@ -15,6 +23,14 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<td>{name}</td>
|
<td>{name}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Name der Gruppe</th>
|
||||||
|
<td>{group}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Adresse</th>
|
||||||
|
<td>{address -> f:format.nl2br()}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>E-Mail</th>
|
<th>E-Mail</th>
|
||||||
<td>{email}</td>
|
<td>{email}</td>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="max-w-screen-lg mx-auto">
|
<div class="max-w-screen-lg mx-auto">
|
||||||
<h1 class="headline--underlined headline--has-subline">
|
<h1 class="headline--underlined headline--has-subline">
|
||||||
<span class="subline">{hotel.name}</span>
|
<span class="subline">{hotel.name}</span>
|
||||||
Preisberechnung
|
Preisrechner und buchen
|
||||||
</h1>
|
</h1>
|
||||||
<f:format.raw>
|
<f:format.raw>
|
||||||
<groups-price-calculator
|
<groups-price-calculator
|
||||||
|
|||||||
Reference in New Issue
Block a user