function pmexpense_views_data in Drupal PM (Project Management) 7
Implements hook_views_data().
File
- pmexpense/
pmexpense.views.inc, line 10 - Functions to expose Project Management expense data to views
Code
function pmexpense_views_data() {
$data['pmexpense']['table']['group'] = t('Project Management Expense');
$data['pmexpense']['table']['join'] = array(
'node' => array(
'left_field' => 'vid',
'field' => 'vid',
),
);
$data['pmexpense']['organization_nid'] = array(
'title' => t('Organization'),
'help' => t('Expense -> Organization'),
'relationship' => array(
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Expense -> Organization'),
),
);
$data['pmexpense']['organization_title'] = array(
'title' => t('Organization'),
'help' => t('Project Management Expense: Organization (title only)'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['pmexpense']['project_nid'] = array(
'title' => t('Project'),
'help' => t('Expense -> Project'),
'relationship' => array(
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Expense -> Project'),
),
);
$data['pmexpense']['project_title'] = array(
'title' => t('Project'),
'help' => t('Project Management Expense Project (title only)'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['pmexpense']['task_nid'] = array(
'title' => t('Task'),
'help' => t('Expense -> Task'),
'relationship' => array(
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Expense -> Task'),
),
);
$data['pmexpense']['task_stepno'] = array(
'title' => t('Task step number'),
'help' => t('Project Management Expense Task Step Number'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
);
$data['pmexpense']['task_title'] = array(
'title' => t('Task'),
'help' => t('Project Management Expense Task (title only)'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['pmexpense']['ticket_nid'] = array(
'title' => t('Ticket'),
'help' => t('Expense -> Ticket'),
'relationship' => array(
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Expense -> Ticket'),
),
);
$data['pmexpense']['ticket_title'] = array(
'title' => t('Ticket'),
'help' => t('Project Management Expense Ticket (title only)'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['pmexpense']['provider_nid'] = array(
'title' => t('Provider'),
'help' => t('Expense -> Provider'),
'relationship' => array(
'base' => 'node',
'base field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Expense -> Provider'),
),
);
$data['pmexpense']['provider_title'] = array(
'title' => t('Provider'),
'help' => t('Project Management Expense Provider (title only)'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['pmexpense']['amount'] = array(
'title' => t('Amount'),
'help' => t('Project Management Expense Amount'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
);
$data['pmexpense']['tax'] = array(
'title' => t('Tax'),
'help' => t('Project Management Expense Tax'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
);
$data['pmexpense']['total'] = array(
'title' => t('Total'),
'help' => t('Project Management Expense Total'),
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
),
);
$data['pmexpense']['operation'] = array(
'field' => array(
'title' => t('Edit/Delete link'),
'help' => t('Provide a simple link to edit and delete the node.'),
'handler' => 'pm_handler_field_operation',
'type' => 'pmexpense',
),
);
return $data;
}