You are here

function registration_checkin_search_form_reset in Entity Registration 7.2

AJAX callback to reset the checkin table back to an unfiltered state.

1 string reference to 'registration_checkin_search_form_reset'
registration_checkin_search_form in modules/registration_checkin/registration_checkin.module
Form builder for the checkin page search function.

File

modules/registration_checkin/registration_checkin.module, line 302
Entity Registration registrant checkin workflow and UI for registration.

Code

function registration_checkin_search_form_reset($form, &$form_state) {

  // Get the host entity info.
  $entity_id = $form_state['values']['entity_id'];
  $entity_type = $form_state['values']['entity_type'];
  $entity = menu_get_object();
  $label = entity_label($entity_type, $entity);
  $pager_limit = 20;
  $registrants = registration_checkin_get_all_registrations($entity_id, $entity_type, $pager_limit);

  // Rebuild the original listing.
  if ($registrants) {
    $table = array(
      'header' => registration_checkin_get_registration_table_headers(),
      'rows' => registration_checkin_get_registration_table_rows($registrants),
    );
    $registrant_markup = theme('table', $table) . theme('pager');
  }
  else {
    $registrant_markup = t('There are no registrants for %name', array(
      '%name' => $label,
    ));
  }
  $build = registration_checkin_prepare_registrants_checkin_build($registrant_markup);
  return render($build);
}