You are here

function _signup_views_tables in Signup 5.2

Private implementation of hook_views_tables().

1 call to _signup_views_tables()
signup_views_tables in ./signup.module
Implementation of hook_views_tables().

File

views/views.inc, line 19
Provides support for Views integration.

Code

function _signup_views_tables() {
  $tables['signup_log'] = array(
    'name' => 'signup_log',
    'join' => array(
      'type' => 'inner',
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'fields' => array(
      'uid' => array(
        'name' => t('Signup: User: Name'),
        'handler' => 'views_handler_field_uid',
        'sortable' => TRUE,
        'help' => t('Username of an authenticated user who signed up, or %anonymous for anonymous signups.', array(
          '%anonymous' => variable_get('anonymous', t('Anonymous')),
        )),
      ),
      'email' => array(
        'name' => t('Signup: User: Email Address'),
        'handler' => 'views_handler_field_signup_email',
        'sortable' => TRUE,
        'field' => 'uid',
        'addlfields' => array(
          'anon_mail',
        ),
        'help' => t('Email address of a user (authenticated or anonymous) who signed up.') . ' <strong>' . t('WARNING: only expose this data in a view that is restricted to users whom you can trust with such sensitive information.') . '</strong>',
      ),
      'signup_time' => array(
        'name' => t('Signup: User: Signup Time'),
        'sortable' => TRUE,
        'handler' => views_handler_field_dates(),
        'option' => 'string',
        'help' => t('Time when user signed up.'),
      ),
      'form_data' => array(
        'name' => t('Signup: User: Additional Signup Info'),
        'handler' => 'views_handler_field_signup_form_data',
        'option' => 'string',
        'help' => t('Enter the additional field name (from signup.theme) in the Option column.'),
      ),
    ),
    'sorts' => array(
      'signup_time' => array(
        'name' => t('Signup: User: Signup Time'),
        'handler' => 'views_handler_sort_date',
        'option' => views_handler_sort_date_options(),
        'help' => t('Sorts by time of sign up.'),
      ),
    ),
    'filters' => array(
      'signup_time' => array(
        'name' => t('Signup: User: Signup Time'),
        'operator' => 'views_handler_operator_gtlt',
        'value' => views_handler_filter_date_value_form(),
        'handler' => 'views_handler_filter_timestamp',
        'option' => 'string',
        'help' => t('Enter dates in the format: CCYY-MM-DD HH:MM:SS. Enter \'now\' to use the current time. You may enter a delta (in seconds) to the option that will be added to the time; this is most useful when combined with now. If you have the jscalendar module from jstools installed, you can use a popup date picker here.'),
      ),
      'signup_user_auth' => array(
        'name' => t('Signup: User: Anonymous/Authenticated'),
        'field' => 'uid',
        'operator' => array(
          '=' => t('is'),
        ),
        'value' => array(
          '#type' => 'select',
          '#options' => array(
            0 => variable_get('anonymous', t('Anonymous')),
            1 => t('Authenticated'),
          ),
        ),
        'handler' => 'views_handler_filter_signup_uid',
        'help' => t('Filter on if a user who signed up is anonymous, or an authenticated user on the site.'),
      ),
      'signup_user_current' => array(
        'field' => 'uid',
        'name' => t('Signup: User: Current User'),
        'operator' => 'views_handler_operator_eqneq',
        'list' => 'views_handler_filter_usercurrent',
        'list-type' => 'select',
        'help' => t('This allows you to filter by whether or not the node was signed up by the logged in user of the view.'),
      ),
    ),
  );
  $tables['signup'] = array(
    'name' => 'signup',
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'fields' => array(
      'status' => array(
        'name' => t('Signup: Node: Open/Closed'),
        'sortable' => TRUE,
        'handler' => 'views_handler_field_signup_status',
        'help' => t('Are signups open or closed for this node?'),
      ),
      'close_signup_limit' => array(
        'name' => t('Signup: Node: Signup Limit'),
        'sortable' => TRUE,
        'help' => t('Maximum number of users who can sign up before signups are automatically closed (set to 0 for no limit).'),
      ),
      'forwarding_email' => array(
        'name' => t('Signup: Notification: Email Address'),
        'help' => t('Address where notification emails are sent wenever a user signs up.'),
      ),
      'send_confirmation' => array(
        'name' => t('Signup: Confirmation: Enabled/Disabled'),
        'sortable' => TRUE,
        'help' => t('Should confirmation email be sent to each user who signs up.'),
      ),
      'confirmation_email' => array(
        'name' => t('Signup: Confirmation: Message'),
        'help' => t('The body of the optional confirmation email that can be sent whenever a user signs up.'),
      ),
      'send_reminder' => array(
        'name' => t('Signup: Reminder: Enabled/Disabled'),
        'sortable' => TRUE,
        'help' => t('Should a reminder email be automatically sent to all users who signed up. This will be false if either an administrator disabled the feature for a given event, or if the reminder was already sent.'),
      ),
      'reminder_days_before' => array(
        'name' => t('Signup: Reminder: Days Before Event for Email'),
        'sortable' => TRUE,
        'help' => t('How many days before an event will the reminder email be sent.'),
      ),
      'reminder_email' => array(
        'name' => t('Signup: Reminder: Message'),
        'help' => t('The body of the optional reminder email that can be sent a configurable time before an event begins.'),
      ),
    ),
    'sorts' => array(
      'status' => array(
        'name' => t('Signup: Node: Open/Closed'),
        'help' => t('Sort by if signups are closed or open.'),
      ),
    ),
    'filters' => array(
      'status' => array(
        'name' => t('Signup: Node: Open/Closed'),
        'operator' => array(
          '=' => t('are'),
        ),
        'value' => array(
          '#type' => 'select',
          '#options' => array(
            1 => t('Open'),
            0 => t('Closed'),
          ),
        ),
        'help' => t('Filter on if signups are open or closed for each node.'),
      ),
      'close_signup_limit' => array(
        'name' => t('Signup: Node: Signup Limit'),
        'operator' => 'views_handler_operator_gtlt',
        'help' => t('Filter by the maximum number of users who can sign up before signups are automatically closed (set to 0 for no limit).'),
      ),
      'signup_disabled' => array(
        'name' => t('Signup: Node: Enabled/Disabled'),
        'field' => 'nid',
        'operator' => array(
          'IS' => t('are'),
        ),
        'value' => array(
          '#type' => 'select',
          '#options' => array(
            'NULL' => t('Disabled'),
            'NOT NULL' => t('Enabled'),
          ),
        ),
        'handler' => 'views_handler_filter_is_null',
        'help' => t('Filter on if signups are enabled or disabled.'),
      ),
    ),
  );
  return $tables;
}