You are here

function support_pm_node_load in Support Ticketing System 7

Implements hook_node_load().

File

support_pm/support_pm.module, line 217
Support Project Management. @author Jeremy Andrews <jeremy@tag1consulting.com> @package Support

Code

function support_pm_node_load($nodes, $types) {
  if (!in_array('support_ticket', $types)) {
    return;
  }
  $result = db_query('SELECT * FROM {support_project_ticket} spt LEFT JOIN {support_project} sp ON spt.projid = sp.projid WHERE spt.nid IN (:nids)', array(
    ':nids' => array_keys($nodes),
  ));
  foreach ($result as $additions) {
    $nodes[$additions->nid]->project = $additions;

    // @@@ Deprecate.
    drupal_alter('support_pm_project_load_nid', $nodes[$additions->nid]->project);
  }
}