Skip to content

Commit

Permalink
CRM-21016: Allow Drupal views to be used for Notes related to contrib…
Browse files Browse the repository at this point in the history
…utions
  • Loading branch information
monishdeb committed Aug 7, 2017
1 parent f7ed137 commit 428460e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions modules/views/components/civicrm.core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1139,24 +1139,23 @@ function _civicrm_core_data(&$data, $enabled) {
civicrm_views_add_fields($fields, $data['civicrm_address'], 'civicrm_address');

// CIVICRM_NOTE table

$data['civicrm_note']['table']['group'] = t('CiviCRM Note');
$data['civicrm_note']['table']['join'] = array();

// Explain how this table joins to others.
$data['civicrm_note']['table']['join'] = array(
// Directly links to contact table.
'civicrm_contact' => array(
foreach (array_keys(CRM_Core_BAO_Note::entityTables()) as $entityTable) {
// Explain how this table joins to others.
$data['civicrm_note']['table']['join'][$entityTable] = array(
'left_field' => 'id',
'field' => 'entity_id',
'extra' => array(
array(
'field' => 'entity_table',
'value' => 'civicrm_contact',
'value' => $entityTable,
'numeric' => FALSE,
),
),
),
);
);
}

// NOTE TEXT
$data['civicrm_note']['note'] = array(
Expand Down

0 comments on commit 428460e

Please sign in to comment.