first commit
[step2_drupal.git] / casetracker / includes / casetracker_views_handler_field_project_name.inc
blobbeb36b5066e8842b067bd2763119f1c0895ae0c7
1 <?php
2 // $Id: casetracker_views_handler_field_project_name.inc,v 1.1 2009/02/09 23:22:58 jmiccolis Exp $
4 /**
5  * Field handler to show Selective state.
6  *
7  * @ingroup views_field_handlers
8  */
9 class casetracker_views_handler_field_project_name extends views_handler_field {
11   function render($values) {
12     $node = db_fetch_object(db_query(db_rewrite_sql("SELECT n.nid, n.title FROM {node} n WHERE n.nid = %d"), $values->casetracker_case_pid));
13     if ($node->nid) { 
14       return l($node->title, "node/$node->nid"); 
15     } // returns a linked case tracker project title.
16   }