From 81ceecd9f89975c1518efcf352e05386c80cd117 Mon Sep 17 00:00:00 2001
From: Jingsheng Wang <skyred@gmail.com>
Date: Thu, 21 Mar 2013 12:59:58 +0800
Subject: [PATCH] Issue #1714470 by skyredwang: Fixed views integration
 filter.

---
 casetracker.module            |    5 ++---
 casetracker.views_default.inc |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/casetracker.module b/casetracker.module
index 1c43065..4795c44 100755
--- a/casetracker.module
+++ b/casetracker.module
@@ -1100,8 +1100,7 @@ function casetracker_project_options() {
     $view->execute();
 
     foreach ($view->result as $row) {
-      //$projects[$row->nid] = $row->node_title;
-      $projects[1] = $row->node_title;
+      $projects[$row->nid] = $row->node_title;
     }
   }
   return $projects;
@@ -1275,4 +1274,4 @@ function db_type_placeholder($type) {
   // There is no safe value to return here, so return something that
   // will cause the query to fail.
   return 'unsupported type ' . $type . 'for db_type_placeholder';
-}
\ No newline at end of file
+}
diff --git a/casetracker.views_default.inc b/casetracker.views_default.inc
index c0dd58c..f98c944 100755
--- a/casetracker.views_default.inc
+++ b/casetracker.views_default.inc
@@ -38,6 +38,39 @@ function _view_casetracker_project_options() {
       'field' => 'title',
       'relationship' => 'none',
     ),
+      'nid' => array(
+        'label' => 'Nid',
+        'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'absolute' => 0,
+        'link_class' => '',
+        'alt' => '',
+        'rel' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'html' => 0,
+        'strip_tags' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'hide_alter_empty' => 1,
+      'link_to_node' => 0,
+      'exclude' => 0,
+      'id' => 'nid',
+      'table' => 'node',
+      'field' => 'nid',
+      'relationship' => 'none',
+    ),
   ));
   $handler->override_option('sorts', array(
     'title' => array(
-- 
1.7.10.4

