summaryrefslogtreecommitdiffstats
path: root/modules/hosting/task/hosting_task.views.inc
blob: 161be540fd0c98a1eed93380dfb253e34a9eca90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
 * @file Hosting task views integration.
 */

/**
 * Implementation of hook_views_handlers() to register all of the basic handlers
 * views uses.
 */
function hosting_task_views_handlers() {
  return array(
    'info' => array(
      'path' => drupal_get_path('module', 'hosting_task'),
      ),
    'handlers' => array(
      'hosting_task_handler_filter_hosting_task_type' => array(
        'parent' => 'views_handler_filter_in_operator',
      ),
    ),
  );
}

/** 
 * Implements hook_views_data().
 */
function hosting_task_views_data() {
  $data['hosting_task'] = array(
    'table' => array(
      'group' => 'Hosting Task',
      'title' => 'Task',
      'join' => array(
         'node' => array(
           'left_field' => 'vid',
           'field' => 'vid',
        ),
      ),
    ),
    'task_type' => array(
      'title' => t('Type'),
      'help' => t(''),
      'field' => array(
        'handler' => 'views_handler_field',
        'click sortable' => TRUE,
      ),
      'filter' => array(
       'handler' => 'hosting_task_handler_filter_hosting_task_type',
      ),
    ),
    'rid' => array(
      'title' => t('Reference'),
      'help' => t(''),
    'relationship' => array(
        'handler' => 'views_handler_relationship',
        'base' => 'node',
        'field' => 'nid',
        'label' => t('Reference'),
      ),
    ),
    'task_status' => array(
      'title' => t('Status'),
      'help' => t('Current status of the task.'),
      'field' => array(
        'handler' => 'views_handler_field',
        'click sortable' => TRUE,
      ),
    ),
    'executed' => array(
      'title' => t('Executed'),
      'help' => t('Date this task was executed.'),
      'field' => array(
        'handler' => 'views_handler_field_date',
        'click sortable' => TRUE,
      ),
    ),
  );
  return $data;
}