You are here

function workflow_views_tables in Workflow 5.2

Same name and namespace in other branches
  1. 5 workflow.module \workflow_views_tables()

Implementation of hook_views_tables()

File

./workflow.module, line 2005

Code

function workflow_views_tables() {
  $table = array(
    'name' => 'workflow_node',
    'provider' => 'workflow',
    'join' => array(
      'left' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
    ),
    'filters' => array(
      'sid' => array(
        'name' => t('Workflow: state'),
        'operator' => 'views_handler_operator_andor',
        'list' => 'workflow_handler_filter_sid',
        'list-type' => 'list',
        'value-type' => 'array',
        'help' => t('Include only nodes in the selected workflow states.'),
      ),
    ),
  );
  $tables[$table['name']] = $table;
  $table = array(
    'name' => 'workflow_states',
    'provider' => 'workflow',
    'join' => array(
      'left' => array(
        'table' => 'workflow_node',
        'field' => 'sid',
      ),
      'right' => array(
        'field' => 'sid',
      ),
    ),
    "sorts" => array(
      'weight' => array(
        'name' => t('Workflow: state'),
        'field' => array(
          'weight',
          'state',
        ),
        'help' => t('Order nodes by workflow state.'),
      ),
    ),
    "fields" => array(
      'state' => array(
        'name' => t('Workflow: state'),
        'sortable' => TRUE,
        'help' => t('Display the workflow state of the node.'),
      ),
    ),
  );
  $tables[$table['name']] = $table;
  $table = array(
    'name' => 'workflow_node_history',
    'provider' => 'workflow',
    'join' => array(
      'left' => array(
        'table' => 'workflow_node',
        'field' => 'nid',
      ),
      'right' => array(
        'field' => 'nid',
      ),
      'extra' => array(
        'stamp = workflow_node.stamp' => NULL,
      ),
    ),
    "fields" => array(
      'comment' => array(
        'name' => t('Workflow: comment'),
        'sortable' => false,
        'help' => t('Display the most recent workflow comment of the node.'),
      ),
    ),
  );
  $tables[$table['name']] = $table;
  return $tables;
}