Browse Source

Contact: Created default admin view

Lacey Sanderson 11 years ago
parent
commit
db24a426fd

+ 38 - 3
tripal_contact/includes/tripal_contact.admin.inc

@@ -1,4 +1,39 @@
 <?php
+
+/**
+ *
+ */
+function tripal_contact_admin_contact_view() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Chado', 'admin/tripal/chado');
+  $breadcrumb[] = l('Contacts', 'admin/tripal/chado/tripal_contact');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_contact_admin_contacts','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Contact module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Contacts View', 'admin/tripal/chado/tripal_contact/views/contacts/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}
+
+
 /**
  * Administrative settings form
  *
@@ -18,7 +53,7 @@ function tripal_contact_admin() {
   // add the field set for syncing maps
   if (!$active_jobs) {
     get_tripal_contact_admin_form_cleanup_set($form);
-// TODO: complete coding of indexing and taxonomy assignment to features.    
+// TODO: complete coding of indexing and taxonomy assignment to features.
 //    get_tripal_contact_admin_form_reindex_set($form);
 //    get_tripal_contact_admin_form_taxonomy_set($form);
   }
@@ -125,7 +160,7 @@ function tripal_contact_admin_validate($form, &$form_state) {
       }
     }
   }
-  
+
   // -------------------------------------
   // Submit the Cleanup Job if selected
   if ($form_state['values']['op'] == t('Clean up orphaned maps')) {
@@ -148,7 +183,7 @@ function tripal_contact_admin_validate($form, &$form_state) {
 function tripal_contact_cleanup($dummy = NULL, $job_id = NULL) {
 
   return tripal_core_clean_orphaned_nodes('contact', $job_id);
-  
+
 }
 /**
  * Add the map as a taxonomy term for associating with map_features

+ 72 - 62
tripal_contact/tripal_contact.module

@@ -49,7 +49,7 @@ function tripal_contact_views_api() {
 function tripal_contact_init() {
   drupal_add_js(drupal_get_path('module', 'tripal_contact') . '/theme/js/tripal_contact.js');
   drupal_add_css(drupal_get_path('module', 'tripal_contact') . '/theme/css/tripal_contact.css');
-    
+
 }
 
 /**
@@ -87,34 +87,44 @@ function tripal_contact_menu() {
 
   $items = array();
 
-  $items[ 'admin/tripal/tripal_contact' ]= array(
+  $items['admin/tripal/chado/tripal_contact']= array(
     'title' => 'Contacts',
-    'description' => ('A module for interfacing the GMOD chado database with Drupal, providing viewing of contacts'),
-    'page callback' => 'theme',
-    'page arguments' => array('tripal_contact_admin'),
+    'description' => ('Model persons, institutes, groups, organizations, etc.'),
+    'page callback' => 'tripal_contact_admin_contact_view',
     'access arguments' => array('administer tripal contacts'),
     'type' => MENU_NORMAL_ITEM
   );
-  
-  $items['admin/tripal/tripal_contact/configuration'] = array(
-    'title' => 'Configuration',
+
+  $items['admin/tripal/chado/tripal_contact/configuration'] = array(
+    'title' => 'Settings',
     'description' => 'Integration of Chado contacts.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_contact_admin'),
     'access arguments' => array('administer tripal contact'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 5
+  );
+
+  $items['admin/tripal/chado/tripal_contact/help']= array(
+    'title' => 'Help',
+    'description' => ('Help with the contact module.'),
+    'page callback' => 'theme',
+    'page arguments' => array('tripal_contact_help'),
+    'access arguments' => array('administer tripal contacts'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 10
   );
-  
-  
-  $items['admin/tripal/tripal_contact/sync'] = array(
-    'title' => ' Sync Contacts',
+
+  $items['admin/tripal/chado/tripal_contact/sync'] = array(
+    'title' => ' Sync',
     'description' => 'Sync contacts in Chado with Drupal',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_contact_sync_form'),
     'access arguments' => array('administer tripal contacts'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 0
   );
-  
+
   // AJAX calls for adding/removing properties to a contact
   $items['tripal_contact/properties/add'] = array(
     'page callback' => 'tripal_contact_property_add',
@@ -132,10 +142,10 @@ function tripal_contact_menu() {
     'access arguments' => array('edit chado_contact content'),
     'type ' => MENU_CALLBACK,
   );
-  
+
   return $items;
 }
-  
+
 /**
  * Implements hook_theme(): Register themeing functions for this module
  *
@@ -163,12 +173,12 @@ function tripal_contact_theme() {
       'arguments' => array('node' => NULL),
       'template' => 'tripal_contact_publications',
     ),
-    'tripal_contact_admin' => array(
-      'template' => 'tripal_contact_admin',  
-      'arguments' =>  array(NULL),  
-      'path' => drupal_get_path('module', 'tripal_contact') . '/theme' 
+    'tripal_contact_help' => array(
+      'template' => 'tripal_contact_help',
+      'arguments' =>  array(NULL),
+      'path' => drupal_get_path('module', 'tripal_contact') . '/theme'
     ),
-    
+
     // Themed Forms
     'chado_contact_node_form' => array(
       'arguments' => array('form'),
@@ -263,7 +273,7 @@ function tripal_contact_permissions() {
  *  @param $node
  *  The node on which the operation is to be performed, or, if it does not yet exist, the
  *  type of node to be created
- *  
+ *
  *  @param $op
  *  The operation to be performed
  *
@@ -273,7 +283,7 @@ function tripal_contact_permissions() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
  *
  */
@@ -317,8 +327,8 @@ function chado_contact_node_access($node, $op, $account ) {
  *
  */
 function chado_contact_insert($node) {
- 
-  // if a contact_id already exists for this node then it already exists in Chado and 
+
+  // if a contact_id already exists for this node then it already exists in Chado and
   // we get here because we are syncing the node.  Therefore, we can skip the insert
   if ($node->contact_id) {
     $contact['contact_id'] = $node->contact_id;
@@ -336,12 +346,12 @@ function chado_contact_insert($node) {
     if (!$contact) {
       drupal_set_message(t('Could not add the contact'), 'error');
       watchdog('tripal_contact','Could not add the contact', array(), WATCHDOG_ERROR);
-      return FALSE; 
+      return FALSE;
     }
-    
+
     // now add the properties
     $properties = array(); // stores all of the properties we need to add
-  
+
     // get the list of properties for easy lookup (without doing lots of database queries
     $properties_list = array();
     $sql = "
@@ -350,16 +360,16 @@ function chado_contact_insert($node) {
         INNER JOIN {cvterm} CVTS ON CVTP.subject_id = CVTS.cvterm_id
         INNER JOIN {cvterm} CVTO ON CVTP.object_id = CVTO.cvterm_id
         INNER JOIN {cv} CV       ON CVTO.cv_id = CV.cv_id
-      WHERE 
-        CV.name = 'tripal_contact' AND 
-        NOT CVTO.name = 'Contact Type' 
-      ORDER BY CVTS.name ASC 
+      WHERE
+        CV.name = 'tripal_contact' AND
+        NOT CVTO.name = 'Contact Type'
+      ORDER BY CVTS.name ASC
     ";
     $prop_types = chado_query($sql);
     while ($prop = $prop_types->fetchObject()) {
       $properties_list[$prop->cvterm_id] = $prop->name;
-    }   
-  
+    }
+
     // get the properties that should be added. Properties are in one of two forms:
     //  1) prop_value-[type id]-[index]
     //  2) new_value-[type id]-[index]
@@ -377,11 +387,11 @@ function chado_contact_insert($node) {
       $index = count($properties[$name]);
       $name = $properties_list[$type_id];
       $properties[$name][$index] = trim($node->new_value);
-    } 
+    }
     // now add in the properties
     foreach ($properties as $property => $elements) {
       foreach ($elements as $rank => $value) {
-         
+
         $status = tripal_contact_insert_property($contact['contact_id'], $property, $value, FALSE);
         if (!$status) {
           drupal_set_message("Error cannot add property: $property", "error");
@@ -389,16 +399,16 @@ function chado_contact_insert($node) {
           array('%property' => $property), WATCHDOG_ERROR);
         }
       }
-    } 
+    }
   }
 
   // add the record to the chado_contact table in Drupal
-  if ($contact) {   
-   
+  if ($contact) {
+
     // add the description property
     tripal_contact_insert_property($contact['contact_id'], 'contact_description',
       $node->description, TRUE);
-    
+
     // make sure the entry for this contact doesn't already exist in the chado_contact table
     // if it doesn't exist then we want to add it.
     $contact_id = chado_get_id_for_node('contact', $node->nid) ;
@@ -435,17 +445,17 @@ function chado_contact_update($node) {
     // there is no way to handle revisions in Chado but leave
     // this here just to make not we've addressed it.
   }
-  
+
   $contact_id = chado_get_id_for_node('contact', $node->nid) ;
-  
-  // check to see if this contact name doens't already exists.    
+
+  // check to see if this contact name doens't already exists.
   $sql = "SELECT contact_id FROM {contact} WHERE NOT contact_id = :contact_id AND name = :name";
   $contact = chado_query($sql, array(':contact_id' => $contact_id, ':name' => $node->contact_name))->fetchObject();
   if ($contact) {
     drupal_set_message(t('A contact with this name already exists. Cannot perform update.'), 'warning');
-    return;  
-  }    
-  
+    return;
+  }
+
   // update the contact record
   $match = array(
      'contact_id' => $contact_id,
@@ -461,10 +471,10 @@ function chado_contact_update($node) {
     watchdog('t_contact', "Error updating contact", array(), WATCHDOG_ERROR);
     return;
   }
-  
+
   // now update the properties
   $properties = array(); // stores all of the properties we need to add
-   
+
   // get the list of properties for easy lookup (without doing lots of database queries
   $properties_list = array();
   $sql = "
@@ -473,16 +483,16 @@ function chado_contact_update($node) {
       INNER JOIN {cvterm} CVTS ON CVTP.subject_id = CVTS.cvterm_id
       INNER JOIN {cvterm} CVTO ON CVTP.object_id = CVTO.cvterm_id
       INNER JOIN {cv} CV       ON CVTO.cv_id = CV.cv_id
-    WHERE 
-      CV.name = 'tripal_contact' AND 
-      NOT CVTO.name = 'Contact Type' 
-    ORDER BY CVTS.name ASC 
+    WHERE
+      CV.name = 'tripal_contact' AND
+      NOT CVTO.name = 'Contact Type'
+    ORDER BY CVTS.name ASC
   ";
   $prop_types = chado_query($sql);
   while ($prop = $prop_types->fetchObject()) {
     $properties_list[$prop->cvterm_id] = $prop->name;
   }
-  
+
   // get the properties that should be added. Properties are in one of three forms:
   //  1) prop_value-[type id]-[index]
   //  2) new_value-[type id]-[index]
@@ -508,7 +518,7 @@ function chado_contact_update($node) {
     $index = count($properties[$name]);
     $properties[$name][$index] = trim($node->new_value);
   }
-  
+
   // now add in the properties by first removing any the contact
   // already has and adding the ones we have
   tripal_core_chado_delete('contactprop', array('contact_id' => $contact_id));
@@ -521,8 +531,8 @@ function chado_contact_update($node) {
         array('%prop' => $property), WATCHDOG_ERROR);
       }
     }
-  } 
-  
+  }
+
   tripal_contact_update_property($contact_id, 'contact_description', $node->description, 1);
 }
 
@@ -547,7 +557,7 @@ function chado_contact_load($node) {
 
   // get the contact description and replace the contact.description field with this one
   $values = array(
-    'contact_id' => $contact->contact_id, 
+    'contact_id' => $contact->contact_id,
     'type_id' => array(
       'name' => 'contact_description',
     ),
@@ -556,12 +566,12 @@ function chado_contact_load($node) {
     'return_array' => 1,
     'include_fk' => array('type_id' => 1),
   );
-  $description = tripal_core_generate_chado_var('contactprop', $values, $options);    
+  $description = tripal_core_generate_chado_var('contactprop', $values, $options);
   if (count($description) == 1) {
-    $description = tripal_core_expand_chado_vars($description, 'field', 'contactprop.value');  
+    $description = tripal_core_expand_chado_vars($description, 'field', 'contactprop.value');
     $contact->description = $description[0]->value;
   }
-    
+
 
   $additions = new stdClass();
   $additions->contact = $contact;
@@ -676,7 +686,7 @@ function tripal_contact_preprocess_tripal_contact_relationships(&$variables) {
 }
 
 /*
- * 
+ *
  */
 function tripal_contact_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == "chado_contact_node_form") {

+ 187 - 257
tripal_contact/tripal_contact.views_default.inc

@@ -7,272 +7,202 @@
 function tripal_contact_views_default_views() {
   $views = array();
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  $view = tripal_contact_defaultview_admin_contacts();
+  $views[$view->name] = $view;
+
+  return $views;
+}
 
-  // Main default view
-  $view = new view;
-  $view->name = 'contact_listing';
-  $view->description = 'A listing of chado contacts';
-  $view->tag = 'chado default';
+/**
+ *
+ */
+function tripal_contact_defaultview_admin_contacts() {
+
+  $view = new view();
+  $view->name = 'tripal_contact_admin_contacts';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'contact';
+  $view->human_name = 'Contact Admin';
   $view->core = 6;
-  $view->api_version = '2';
-  $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Contacts';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'name' => 'name',
+    'name_1' => 'name_1',
+    'description' => 'description',
+  );
+  $handler->display->display_options['style_options']['default'] = 'name';
+  $handler->display->display_options['style_options']['info'] = array(
     'name' => array(
-      'label' => 'Name',
-      '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,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'contact',
-      'field' => 'name',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'name_1' => array(
-      'label' => 'Type',
-      '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,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_1',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-    'description' => array(
-      'label' => 'Description',
-      '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,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'contact',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all contacts matching the entered criteria. If you leave a any of the criteria blank then the contacts will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all contacts will be listed.',
-    ),
-    'type_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'type_id_op',
-        'identifier' => 'type_id',
-        'label' => 'Type',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'type_id',
-      'table' => 'contact',
-      'field' => 'type_id',
-      'relationship' => 'none',
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'name' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'name_op',
-        'identifier' => 'name',
-        'label' => 'Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'name',
-      'table' => 'contact',
-      'field' => 'name',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
     'description' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'description_op',
-        'identifier' => 'description',
-        'label' => 'Description Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'description',
-      'table' => 'contact',
-      'field' => 'description',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Contacts');
-  $handler->override_option('header', 'Click "Show" to see a list of all contacts matching the entered criteria. If you leave a any of the criteria blank then the contacts will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all contacts will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No contacts match the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'name' => 'name',
-      'name_1' => 'name_1',
-      'description' => 'description',
-    ),
-    'info' => array(
-      'name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'name_1' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'description' => array(
-        'sortable' => 0,
-        'separator' => '',
-      ),
+      'sortable' => 0,
+      'separator' => '',
     ),
-    'default' => 'name',
-  ));
+  );
+  /* Header: Global: Action Links */
+  $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['table'] = 'views';
+  $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
+  $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
+  $handler->display->display_options['header']['action_links_area']['link-1'] = array(
+    'label-1' => 'Add Contact',
+    'path-1' => 'node/add/tripal-contact',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-2'] = array(
+    'label-2' => '',
+    'path-2' => '',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-3'] = array(
+    'label-3' => '',
+    'path-3' => '',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-4'] = array(
+    'label-4' => '',
+    'path-4' => '',
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No contacts match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Relationship: Contact: Contact => Node */
+  $handler->display->display_options['relationships']['contact_id']['id'] = 'contact_id';
+  $handler->display->display_options['relationships']['contact_id']['table'] = 'chado_contact';
+  $handler->display->display_options['relationships']['contact_id']['field'] = 'contact_id';
+  /* Field: Content: Nid */
+  $handler->display->display_options['fields']['nid']['id'] = 'nid';
+  $handler->display->display_options['fields']['nid']['table'] = 'node';
+  $handler->display->display_options['fields']['nid']['field'] = 'nid';
+  $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
+  /* Field: Chado Contact: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'contact';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name_1']['id'] = 'name_1';
+  $handler->display->display_options['fields']['name_1']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name_1']['field'] = 'name';
+  $handler->display->display_options['fields']['name_1']['label'] = 'Type';
+  /* Field: Chado Contact: Description */
+  $handler->display->display_options['fields']['description']['id'] = 'description';
+  $handler->display->display_options['fields']['description']['table'] = 'contact';
+  $handler->display->display_options['fields']['description']['field'] = 'description';
+  /* Field: Content: Delete link */
+  $handler->display->display_options['fields']['delete_node']['id'] = 'delete_node';
+  $handler->display->display_options['fields']['delete_node']['table'] = 'views_entity_node';
+  $handler->display->display_options['fields']['delete_node']['field'] = 'delete_node';
+  $handler->display->display_options['fields']['delete_node']['relationship'] = 'contact_id';
+  /* Field: Content: Edit link */
+  $handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
+  $handler->display->display_options['fields']['edit_node']['table'] = 'views_entity_node';
+  $handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
+  $handler->display->display_options['fields']['edit_node']['relationship'] = 'contact_id';
+  $handler->display->display_options['fields']['edit_node']['exclude'] = TRUE;
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['label'] = '';
+  $handler->display->display_options['fields']['nothing']['alter']['text'] = '[edit_node]  [delete_node]';
+  $handler->display->display_options['fields']['nothing']['element_label_colon'] = FALSE;
+  /* Filter criterion: Chado Contact: Type Id */
+  $handler->display->display_options['filters']['type_id']['id'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['table'] = 'contact';
+  $handler->display->display_options['filters']['type_id']['field'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['value'] = 'All';
+  $handler->display->display_options['filters']['type_id']['group'] = '0';
+  $handler->display->display_options['filters']['type_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['operator_id'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['label'] = 'Type';
+  $handler->display->display_options['filters']['type_id']['expose']['operator'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['identifier'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Contact: Name */
+  $handler->display->display_options['filters']['name']['id'] = 'name';
+  $handler->display->display_options['filters']['name']['table'] = 'contact';
+  $handler->display->display_options['filters']['name']['field'] = 'name';
+  $handler->display->display_options['filters']['name']['operator'] = 'contains';
+  $handler->display->display_options['filters']['name']['group'] = '0';
+  $handler->display->display_options['filters']['name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['label'] = 'Name Contains';
+  $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
+  $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Contact: Description */
+  $handler->display->display_options['filters']['description']['id'] = 'description';
+  $handler->display->display_options['filters']['description']['table'] = 'contact';
+  $handler->display->display_options['filters']['description']['field'] = 'description';
+  $handler->display->display_options['filters']['description']['operator'] = 'contains';
+  $handler->display->display_options['filters']['description']['group'] = '0';
+  $handler->display->display_options['filters']['description']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['description']['expose']['operator_id'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['label'] = 'Description Contains';
+  $handler->display->display_options['filters']['description']['expose']['operator'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['identifier'] = 'description';
+  $handler->display->display_options['filters']['description']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /** MANUALLY ADD since filter handler no exporting correctly */
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/contacts');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Contacts',
-    'description' => 'Contacts can be persons, institutes, groups, or organizations.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_contact/contacts';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Contacts';
+  $handler->display->display_options['menu']['description'] = 'Contacts can be persons, institutes, groups, or organizations.';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['name'] = 'management';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
 
-  return $views;
-}
+  /** MANUALLY ADD since filter handler no exporting correctly
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+  */
+  return $view;
+}