ソースを参照

Added default field description for chado tables

Lacey Sanderson 12 年 前
コミット
cb8f31dcdf

+ 2 - 3
tripal_views/tripal_views.api.inc

@@ -381,12 +381,11 @@ function tripal_views_get_integration_array_for_chado_table($table_name, $base_t
     'table' => $table_name,
     'type' => 'chado',
     'name' => ucwords(str_replace('_', ' ', $table_name)),
-    'description' => ($schema['description']) ? $schema['description'] : ' ',
+    'description' => (!empty($schema['description'])) ? $schema['description'] : ' ',
     'priority' => 10,
     'base_table' => $base_table,
     'fields' => array(),
   );
-
   // Add fields
   if (!isset($schema['fields'])) {
     $schema['fields'] = array();
@@ -400,7 +399,7 @@ function tripal_views_get_integration_array_for_chado_table($table_name, $base_t
         'name' => $field_name,
         'title' => ucwords(str_replace('_', ' ', $field_name)),
         'type' => $field_schema['type'],
-        'description' => ($field_schema['description']) ? $field_schema['description'] : ' ',
+        'description' => ($field_schema['description']) ? $field_schema['description'] : ucwords(str_replace('_', ' ', $field_name)),
         'handlers' => array(),
         'joins' => array()
       );

+ 4 - 3
tripal_views/tripal_views_integration.inc

@@ -375,14 +375,15 @@ function tripal_views_integration_form(&$form_state, $setup_id = NULL) {
     '#description' => '(Optional). Provide any details regarding this setup you would like. This '.
                       'description will appear when selecting a type for a new Drupal View',
     '#required' => FALSE,
+    '#default_value' => (isset($setup_obj->comment)) ? $setup_obj->comment : '',
   );
 
   // we need a div block where the table fields will get put when the
   // AHAH callback is made
   $form['view_setup_table'] = array(
-     '#type' => 'item',
-       '#prefix' => '<div id="table-rows-div">',
-       '#suffix' => '</div>',
+    '#type' => 'item',
+    '#prefix' => '<div id="table-rows-div">',
+    '#suffix' => '</div>',
   );