You are here

function _spaces_casetracker_views_cases_recent in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_casetracker/spaces_casetracker.module \_spaces_casetracker_views_cases_recent()
1 string reference to '_spaces_casetracker_views_cases_recent'
spaces_casetracker_views_default_views in spaces_casetracker/spaces_casetracker.module
Implementation of hook_default_views

File

spaces_casetracker/spaces_casetracker.module, line 561

Code

function _spaces_casetracker_views_cases_recent() {
  $view = _spaces_casetracker_views_base();
  $view->name = 'spaces_cases_recent';
  $view->description = t('Spaces > Casetracker > Recent cases');
  $view->page = TRUE;
  $view->page_title = t('Recent Cases');
  $view->url = 'recent-cases';
  $view->block = TRUE;
  $view->block_title = t('Recent Cases');
  $view->block_empty = "<p class='views-empty'>" . t('No recent cases.') . "</p>";
  $view->block_empty_format = '1';
  $view->block_type = 'spaces_datetitle';
  $view->nodes_per_block = '5';
  $view->sort = array(
    array(
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->field = array(
    array(
      'tablename' => 'og_node_data',
      'field' => 'title',
      'label' => 'Group',
      'handler' => 'spaces_views_handler_crayon_name',
      'options' => 'og',
    ),
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => 'Case',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array(
      'tablename' => 'node',
      'field' => 'created',
      'label' => 'Created On',
      'handler' => 'views_handler_field_since',
      'options' => 1,
    ),
    array(
      'tablename' => 'casetracker_case',
      'field' => 'assign_to',
      'label' => 'Assigned To',
    ),
  );
  $view->filter['og'] = array(
    'tablename' => 'og_uid_node',
    'field' => 'currentuid',
    'operator' => '=',
    'options' => '',
    'value' => '***CURRENT_USER***',
  );
  $view->filter['spaces']['operator'] = 'active';
  $view->filter['changed'] = array(
    'tablename' => 'node',
    'field' => 'changed',
    'operator' => '>',
    'options' => -1 * SPACES_ARCHIVE_TIMESTAMP,
    'value' => 'now',
  );
  $view->requires = array(
    node,
    casetracker_case,
    og_node_data,
    og_uid_node,
  );
  return $view;
}