default to self if only self to make bookings for

master
Marek Isalski 6 years ago
parent 877e946c0b
commit cf2bdabbea

@ -456,7 +456,7 @@ function _fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( &$form_s
drupal_set_message( t('There was a problem adding your item to the shopping cart.'), 'error' ); drupal_set_message( t('There was a problem adding your item to the shopping cart.'), 'error' );
} }
} else { } else {
/* drupal_set_message( t('Cannot find your record\'s UUID. This order might have problems...'), 'error' ); */ drupal_set_message( t('Cannot find your record\'s UUID. This order might have problems...'), 'error' );
} }
} }
@ -540,10 +540,12 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form_submit( $form, &$form_sta
$made_choices = $made_choices ); $made_choices = $made_choices );
} }
} else { } else {
$person = $cart[ 'd' ][ 'fulcrm' ][ 'person' ][ $person_uuid ]; if ( $person_uuid ) {
_fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart, $person = $cart[ 'd' ][ 'fulcrm' ][ 'person' ][ $person_uuid ];
$person_uuid, $person[ 'name' ], $product_id, _fulcrm_shoppingcart_buy_eventbookingtype_create_shoppingitem( $form_state, $cart,
$made_choices = $made_choices ); $person_uuid, $person[ 'name' ], $product_id,
$made_choices = $made_choices );
}
} }
if ( !empty( $ac ) ) { if ( !empty( $ac ) ) {
@ -674,6 +676,11 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
$form[ '#submit' ] = 'fulcrm_shoppingcart_buy_eventbookingtype_person_add_guest_form_submit'; $form[ '#submit' ] = 'fulcrm_shoppingcart_buy_eventbookingtype_person_add_guest_form_submit';
} }
if ( count( $form[ 'ticket_for_persons' ][ '#options' ] ) == 1 ) {
foreach ( $form[ 'ticket_for_persons' ][ '#options' ] as $k => $v )
$form[ 'ticket_for_persons' ][ '#default_value' ] = $k;
}
$form[ 'eventslots' ] = array(); $form[ 'eventslots' ] = array();
$eventslots = array(); $eventslots = array();
$eventpart = array(); $eventpart = array();

Loading…
Cancel
Save