add option to elide where no booking options to make

This commit is contained in:
2019-02-07 00:35:27 +00:00
parent 3d9846385c
commit 91a59d5f36
2 changed files with 19 additions and 2 deletions

View File

@ -718,8 +718,16 @@ function fulcrm_shoppingcart_buy_eventbookingtype_form( $form, &$form_state, $pe
}
}
$form[ 'eventslots' ][ '#title' ] = 'Itinerary';
$form[ 'eventslots' ][ '#type' ] = 'fieldset';
if ( !$choices && ( variable_get( 'fulcrm_shoppingcart_event_itinerary', 'full' ) === 'elide' ) ) {
$form[ 'eventslots' ][ '#type' ] = 'container';
foreach ( $form[ 'eventslots' ] as $eventpart_id => $eventpart_form ) {
$form[ 'eventslots' ][ $eventpart_id ][ '#value' ] = $form[ 'eventslots' ][ $eventpart_id ][ '#default_value' ];
$form[ 'eventslots' ][ $eventpart_id ][ '#type' ] = 'hidden';
}
} else {
$form[ 'eventslots' ][ '#title' ] = 'Itinerary';
$form[ 'eventslots' ][ '#type' ] = 'fieldset';
}
_fulcrm_shoppingcart_buy_donation_product_update_form( $form, $form_state, variable_get( 'fulcrm_shoppingcart_donation_cart_product', 0 ) );