Commit 4626c19d authored by nicola85's avatar nicola85

Fix definition of webform element "BEE reservation form"

parent 1d321ecd
......@@ -67,17 +67,14 @@ function bee_webform_form_submit($form, FormStateInterface $form_state) {
if ($bee_settings['bookable_type'] == 'daily') {
$booked_state = bat_event_load_state_by_machine_name('bee_daily_booked');
$start_date = new \DateTime($start_date);
$end_date = new \DateTime($end_date);
}
else {
$booked_state = bat_event_load_state_by_machine_name('bee_hourly_booked');
$start_date = new \DateTime($start_date);
$end_date = new \DateTime($end_date);
}
$start_date = new \DateTime($start_date);
$end_date = new \DateTime($end_date);
foreach ($node_available_units as $unit) {
if ($bee_settings['bookable_type'] == 'daily') {
$event = bat_event_create(['type' => 'availability_daily']);
......
......@@ -46,6 +46,7 @@ class WebformBeeReservationForm extends WebformCompositeBase {
else {
$elements['content_type'] = [
'#type' => 'hidden',
'#title' => t('Content type'),
'#value' => key($content_type_options),
];
}
......
......@@ -14,6 +14,9 @@ use Drupal\webform\Plugin\WebformElement\WebformCompositeBase;
* label = @Translation("BEE reservation form"),
* description = @Translation("BEE reservation form."),
* category = @Translation("Advanced elements"),
* multiline = TRUE,
* composite = TRUE,
* states_wrapper = TRUE,
* )
*/
class WebformBeeReservationForm extends WebformCompositeBase {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment