You are here

function _spaces_casetracker_views_cases_recent in Spaces 5

Same name and namespace in other branches
  1. 5.2 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 467

Code

function _spaces_casetracker_views_cases_recent() {
  $view = new stdClass();
  $view->name = 'spaces_cases_recent';
  $view->description = '';
  $view->view_args_php = 'return _spaces_views_arg_og_handler($args);';
  $view->access = array();
  $view->page = TRUE;
  $view->page_title = t('Recent Cases');
  $view->page_type = 'table';
  $view->url = 'recent-cases';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '50';
  $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->argument = array(
    array(
      'type' => 'gid',
      'argdefault' => '2',
    ),
  );
  $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 = array(
    array(
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array(
        0 => 'casetracker_basic_case',
      ),
    ),
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
      'defaultsort' => 'ASC',
    ),
    array(
      'tablename' => 'og_uid_node',
      'field' => 'currentuid',
      'operator' => '=',
      'options' => '',
      'value' => '***CURRENT_USER***',
    ),
    array(
      'tablename' => 'node',
      'field' => 'changed',
      'operator' => '>',
      'options' => -1 * SPACES_ARCHIVE_TIMESTAMP,
      'value' => 'now',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    node,
    casetracker_case,
    og_node_data,
    og_uid_node,
  );
  return $view;
}