You are here

function bat_booking_create_form_wrapper in Booking and Availability Management Tools for Drupal 7

Form callback wrapper: create a Booking.

Parameters

string $type: The Booking type for the booking to be created.

1 string reference to 'bat_booking_create_form_wrapper'
BatBookingUIController::hook_menu in modules/bat_booking/bat_booking.admin.inc
Overrides hook_menu() defaults.

File

modules/bat_booking/bat_booking.admin.inc, line 190
BatBooking editing UI.

Code

function bat_booking_create_form_wrapper($type) {
  global $user;

  // Add the breadcrumb for the form's location.
  bat_booking_set_breadcrumb();
  $booking = bat_booking_create(array(
    'type' => $type,
    'uid' => $user->uid,
  ));
  $booking->created = REQUEST_TIME;
  $booking->author_name = $user->name;
  $booking->status = 1;
  return drupal_get_form('bat_booking_edit_form', $booking);
}