|
|
@ -143,9 +143,6 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form_submit( $form, &$form_sta
|
|
|
|
$query = array( 'expand' => 'd' ) );
|
|
|
|
$query = array( 'expand' => 'd' ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// $cart[ 'd' ][ 'fulcrm' ][ 'person' ] = array( $uuid => array() );
|
|
|
|
|
|
|
|
// $cart[ 'd' ][ 'fulcrm' ][ 'transaction' ][ 'person' ] = $uuid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ( $form_state[ 'values' ][ 'ticket_for_persons' ] as $ticket_for_person ) {
|
|
|
|
foreach ( $form_state[ 'values' ][ 'ticket_for_persons' ] as $ticket_for_person ) {
|
|
|
|
if ( $ticket_for_person === 'myself' ) {
|
|
|
|
if ( $ticket_for_person === 'myself' ) {
|
|
|
|
$person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
|
|
|
|
$person_uuid = $form_state[ 'fulcrm_shoppingcart' ][ 'person' ][ 'uuid' ];
|
|
|
@ -160,14 +157,23 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form_submit( $form, &$form_sta
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'eventbookingtype' ][ 'name' ] . "\r\n" .
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'eventbookingtype' ][ 'name' ] . "\r\n" .
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'eventbookingtype' ][ 'event' ][ 'name' ] );
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'eventbookingtype' ][ 'event' ][ 'name' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$eventslotbookings = array();
|
|
|
|
|
|
|
|
foreach ( $form_state[ 'fulcrm_shoppingcart' ][ 'eventbookingtype' ][ 'eventslotbookings' ] as $eventslotbooking ) {
|
|
|
|
|
|
|
|
$eventpart_id = fulcrm_apiv2_url_to_pk( $eventslotbooking[ 'eventslot' ][ 'eventpart' ] );
|
|
|
|
|
|
|
|
$eventslot_id = fulcrm_apiv2_url_to_pk( $eventslotbooking[ 'eventslot' ][ 'url' ] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( array_key_exists( $eventpart_id, $eventslotbookings ) )
|
|
|
|
|
|
|
|
drupal_set_message( 'XXX cannot yet cope with multiple choice event slot bookings; defaulting to first.', 'warning' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$eventslotbookings[ $eventpart_id ] = $eventslot_id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( $person_uuid ) {
|
|
|
|
if ( $person_uuid ) {
|
|
|
|
$item = array( 'shoppingcart' => $cart[ 'url' ],
|
|
|
|
$item = array( 'shoppingcart' => $cart[ 'url' ],
|
|
|
|
'product' => fulcrm_apiv2_make_url( 'product', $product_id ),
|
|
|
|
'product' => fulcrm_apiv2_make_url( 'product', $product_id ),
|
|
|
|
'quantity' => 1.0,
|
|
|
|
'quantity' => 1.0,
|
|
|
|
'd' => array( 'fulcrm' => array( 'eventbooking' => array( 'eventbooking' => array( 'foo' => 'bar',
|
|
|
|
'd' => array( 'fulcrm' => array( 'eventbooking' => array( 'eventbooking' => array(),
|
|
|
|
),
|
|
|
|
'eventslotbookings' => $eventslotbookings,
|
|
|
|
// 'eventslotbookings' => array( $part => $slot )
|
|
|
|
|
|
|
|
'person' => $person_uuid,
|
|
|
|
'person' => $person_uuid,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -292,7 +298,9 @@ function fulcrm_shoppingcart_buy( $product_id, $hmac ) {
|
|
|
|
$eventbookingtype_data = fulcrm_apiv2_GET( $product_data[ 'data' ][ 'content_object' ][ 'url' ],
|
|
|
|
$eventbookingtype_data = fulcrm_apiv2_GET( $product_data[ 'data' ][ 'content_object' ][ 'url' ],
|
|
|
|
$query = array( 'expand' => implode( ',', array( 'event',
|
|
|
|
$query = array( 'expand' => implode( ',', array( 'event',
|
|
|
|
'person_ddatacollection',
|
|
|
|
'person_ddatacollection',
|
|
|
|
'eventbooking_ddatacollection' ) ) ) );
|
|
|
|
'eventbooking_ddatacollection',
|
|
|
|
|
|
|
|
'eventbookingtypeslots',
|
|
|
|
|
|
|
|
'eventbookingtypeslots.eventslot' ) ) ) );
|
|
|
|
if ( $eventbookingtype_data[ 'success' ] ) {
|
|
|
|
if ( $eventbookingtype_data[ 'success' ] ) {
|
|
|
|
return drupal_get_form( 'fulcrm_shoppingcart_buy_eventbookingtype_form', $person_data[ 'data' ], $eventbookingtype_data[ 'data' ], $product_data[ 'data' ] );
|
|
|
|
return drupal_get_form( 'fulcrm_shoppingcart_buy_eventbookingtype_form', $person_data[ 'data' ], $eventbookingtype_data[ 'data' ], $product_data[ 'data' ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -319,7 +327,6 @@ function fulcrm_shoppingcart_remove_shoppingitem_confirm_submit( $form, &$form_s
|
|
|
|
$form_state[ 'redirect' ] = 'fulcrm/cart';
|
|
|
|
$form_state[ 'redirect' ] = 'fulcrm/cart';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function fulcrm_shoppingcart_remove_shoppingitem_confirm( $form, &$form_state, $shoppingitem ) {
|
|
|
|
function fulcrm_shoppingcart_remove_shoppingitem_confirm( $form, &$form_state, $shoppingitem ) {
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'shoppingitem' ] = $shoppingitem;
|
|
|
|
$form_state[ 'fulcrm_shoppingcart' ][ 'shoppingitem' ] = $shoppingitem;
|
|
|
|
|
|
|
|
|
|
|
|