I'm looking for assistance in the use of registration states. I'm using

  • Entity Registrations 7.x-1.0-beta3
  • Commerce Registration 7.x-2.0-beta2
  • 7.x-1.3

What I'd like to do is set up a system for putting registrants on a waitlist if all the slots are full.
I see that I can add registration states, but it's not making much sense to me:

  1. How could multiple states be the default? Shouldn't that be a column of radio buttons instead of checkboxes?
  2. "Show on Form?" What form? Where should I be expecting these options to show up? I haven't seen them anywhere yet.

Presumably there would be a way to change the state of any particular registration, but I haven't found that either. I figured it might be done with Rules, but nothing has popped out at me as I've clicked through options there.

Answers to any of these questions would be appreciated.

Comments

visuaLatte’s picture

I don't have an answer for how multiple registration states could be "default", but as to the "Show on form" option, checking that box causes the registration status option to show up on the registration form-- i.e. the form people fill out when registering. This form usually appears at a path like node/[node:nid]/register, with [node:nid] being the NID of the node that people are registering for.

One issue I noticed, however, is that there don't appear to be permissions for the various registration states. If, for example, I only want site admins to be able to set the status, I can't do that; the "State" field appears even for anonymous or other non-admin users.

An alternate method, which may help with the permissions issue and with granularity, would be to accomplish "registration statuses" via a field on the registration entity, or via Taxonomy. That way, multiple configurable registration statuses could be created, per-entity-bundle, and of course permissions could be accomplished via the Field Permissions module.

Hope this helps!

msypes’s picture

Thanks! The taxonomy idea may give me just what I want. I'll have to try it out.

seanb’s picture

A permission to make to registration state only available to certain user roles does seem to make sense. I will add it with a form_alter() for now.

<?php
/**
 * Implements hook_form_alter().
 */
function modulename_form_alter(&$form, &$form_state, $form_id){
  if ($form_id == 'registration_form') {
    // Add permission for state field
    $form['state']['#access'] = user_access('modulename registration state');
  }
}

/**
* Implementation of hook_permission().
*/
function modulename_permission() {
  // Add custom permission for editing a registration state of a user
  return array(
    'modulename registration state' => array('title' => t('Change states of a registration')),
  );
}
?>
jhm’s picture

I believe this is a very important enhancement. Currently the registration form displays all states (marked to display in form), which practically makes a Pending state useless because a user can just change to the desired state when registering.

When the state is marked as not in form, there is no way to change the registration state, because it won't be in ANY form.

levelos’s picture

Status: Active » Closed (fixed)

This is already implemented.

  $form['state'] = array(
    '#type' => 'select',
    '#title' => t('State'),
    '#description' => t('State of this registration'),
    '#default_value' => ($state ? $state->identifier() : $default_state->identifier()),
    '#options' => $states,
    '#access' => !empty($states) && user_access('edit ' . $registration->type . ' registration state')
  );
levelos’s picture

This is already implemented.

  $form['state'] = array(
    '#type' => 'select',
    '#title' => t('State'),
    '#description' => t('State of this registration'),
    '#default_value' => ($state ? $state->identifier() : $default_state->identifier()),
    '#options' => $states,
    '#access' => !empty($states) && user_access('edit ' . $registration->type . ' registration state')
  );
jhm’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev

Indeed. I accidentally overwrote my -dev version of the module with the 1.0 version (thanks drush)