You are here

function _spaces_casetracker_views_cases_myblock in Spaces 5.2

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

File

spaces_casetracker/spaces_casetracker.module, line 783

Code

function _spaces_casetracker_views_cases_myblock() {
  $view = new stdClass();
  $view->name = 'spaces_cases_myblock';
  $view->description = t('Provides a block listing of cases assigned to current user.');
  $view->access = array();
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->block = TRUE;
  $view->block_title = t('My Cases');
  $view->block_empty = "<p class='views-empty'>" . t('No cases found.') . "</p>";
  $view->block_empty_format = '2';
  $view->block_type = 'spaces_datetitle';
  $view->nodes_per_block = '10';
  $view->sort = array(
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_comment_timestamp',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array();
  $view->field = array(
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_comment_timestamp',
      'label' => '',
      'handler' => 'views_handler_field_since',
      'options' => 1,
    ),
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array(
      'tablename' => 'users',
      'field' => 'name',
      'label' => t('Author'),
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'casetracker_case',
      'field' => 'assign_to_currentuid',
      'operator' => '=',
      'options' => '',
      'value' => '***CURRENT_USER***',
    ),
    array(
      'tablename' => 'casetracker_case',
      'field' => 'case_status_id',
      'operator' => 'OR',
      'options' => '',
      'value' => array(
        0 => '6',
        1 => '8',
        2 => '9',
        3 => '10',
      ),
    ),
    array(
      'tablename' => 'spaces',
      'field' => 'type',
      'operator' => 'all',
      'options' => '',
      'value' => 'all',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    node_comment_statistics,
    node,
    casetracker_case,
  );
  return $view;
}