Bläddra i källkod

Fixed merge conflict and changed 'Details' to 'Overview' on node pages

Stephen Ficklin 11 år sedan
förälder
incheckning
34b866f276

+ 1 - 1
tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -596,7 +596,7 @@ function tripal_analysis_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_analysis_base'] = array(
           '#markup' => theme('tripal_analysis_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_analysis_properties'] = array(

+ 1 - 1
tripal_contact/includes/tripal_contact.chado_node.inc

@@ -555,7 +555,7 @@ function tripal_contact_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_contact_base'] = array(
           '#markup' => theme('tripal_contact_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_contact_properties'] = array(

+ 1 - 1
tripal_contact/tripal_contact.module

@@ -191,7 +191,7 @@ function tripal_contact_block_view($delta = '') {
     $block = array();
     switch ($delta) {
       case 'contbase':
-        $block['subject'] = t('Details');
+        $block['subject'] = t('Overview');
         $block['content'] = array(
           '#theme' => 'tripal_contact_base',
           '#nodes' => $node,

+ 1 - 1
tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc

@@ -150,7 +150,7 @@ function chado_node_additional_dbxrefs_form(&$form, &$form_state, $details) {
       remove a database reference, click the remove button. ' . $details['additional_instructions']),
     '#prefix' => "<div id='addtl-dbxrefs-fieldset'>",
     '#suffix' => '</div>',
-    '#weight'      => 10
+    '#weight'      => 9
   );
 
   // this form element is a tree, so that we don't puke all of the values into then node variable

+ 3 - 3
tripal_core/api/tripal_core.chado_nodes.properties.api.inc

@@ -511,7 +511,7 @@ function chado_node_properties_form(&$form, &$form_state, $details) {
       To add additional properties to the drop down. ' . $details['additional_instructions']),
     '#prefix' => "<div id='properties-fieldset'>",
     '#suffix' => '</div>',
-    '#weight'      => 10
+    '#weight'      => 8
   );
 
   // this form element is a tree, so that we don't puke all of the values into then node variable
@@ -685,7 +685,8 @@ function chado_node_properties_form(&$form, &$form_state, $details) {
   );
 
   $form['properties']['property_table']['new']['value'] = array(
-    '#type' => 'textfield',
+    '#type' => 'textarea',
+    '#rows' => 1,
   );
 
   // add button
@@ -883,7 +884,6 @@ function theme_chado_node_properties_form_table($variables) {
   $header = array(
     'type' => t('Type'),
     'value' => t('Value'),
-    'rank' => t('Rank'),
     'property_action' => t('Actions'),
   );
 

+ 0 - 1
tripal_core/api/tripal_core.chado_nodes.relationships.api.inc

@@ -671,7 +671,6 @@ function theme_chado_node_relationships_form_table($variables) {
     'object_name' => t('Object ' . $details['base_name_field']),
     'type_name' => t('Type'),
     'subject_name' => t('Subject ' . $details['base_name_field']),
-    'rank' => t('Rank'),
     'rel_action' => t('Action')
   );
 

+ 1 - 1
tripal_example/includes/tripal_example.chado_node.inc

@@ -581,7 +581,7 @@ function tripal_example_node_view($node, $view_mode, $langcode) {
         //$node->content['tripal_example_base'] = array(
         //  '#markup' => theme('tripal_example_base', array('node' => $node)),
         //  '#tripal_toc_id'    => 'base',
-        //  '#tripal_toc_title' => 'Details',
+        //  '#tripal_toc_title' => 'Overview',
         //  '#weight' => -100,
         //);
         // we can add other templates as well.

+ 62 - 3
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -90,7 +90,7 @@ function chado_feature_form($node, &$form_state) {
     if (!$synonyms) {
       $options = array('return_array' => 1);
       $feature = tripal_core_expand_chado_vars($feature, 'table', 'feature_synonym', $options);
-      $feature_synonyms = $feature->feature_synonym;
+      $feature_synonyms = (isset($feature->feature_synonym)) ? $feature->feature_synonym : array();
       foreach ($feature_synonyms as $index => $synonym) {
         $synonyms .= $synonym->synonym_id->name . "\n";
       }
@@ -103,7 +103,7 @@ function chado_feature_form($node, &$form_state) {
   }
   // if we are re constructing the form from a failed validation or ajax callback
   // then use the $form_state['values'] values
-  if (array_key_exists('values', $form_state)) {
+  if (array_key_exists('values', $form_state) and isset($form_state['values']['uniquename'])) {
     $uniquename   = $form_state['values']['uniquename'];
     $fname        = $form_state['values']['fname'];
     $feature_type = $form_state['values']['feature_type'];
@@ -210,6 +210,28 @@ function chado_feature_form($node, &$form_state) {
     '#default_value' => $checked,
     '#description' => t('Check this box if this sequence should be retired'),
   );
+
+  // PROPERTIES FORM
+  //---------------------------------------------
+  $details = array(
+    'property_table' => 'featureprop',      // the name of the prop table
+    'base_foreign_key' => 'feature_id',     // the name of the key in your base chado table
+    'base_key_value' => $feature_id,        // the value of feature_id for this record
+    'cv_name' => 'feature_property'         // the cv.name of the cv governing featureprop.type_id
+  );
+  // Adds the form elements to your current form
+  chado_node_properties_form($form, $form_state, $details);
+
+  // ADDITIONAL DBXREFS FORM
+  //---------------------------------------------
+  $details = array(
+    'linking_table' => 'feature_dbxref',  // the name of the _dbxref table
+    'base_foreign_key' => 'feature_id',   // the name of the key in your base chado table
+    'base_key_value' => $feature_id       // the value of feature_id for this record
+  );
+  // Adds the form elements to your current form
+  chado_node_additional_dbxrefs_form($form, $form_state, $details);
+
   return $form;
 }
 
@@ -409,6 +431,24 @@ function chado_feature_insert($node) {
 
     // add the genbank accession and synonyms
     chado_feature_add_synonyms($node->synonyms, $feature_id);
+
+    // * Properties Form *
+    $details = array(
+      'property_table' => 'featureprop',   // the name of the prop table
+      'base_table' => 'feature',           // the name of your chado base table
+      'foreignkey_name' => 'feature_id',   // the name of the key in your base table
+      'foreignkey_value' => $feature_id    // the value of the feature_id key
+    );
+    chado_node_properties_form_update_properties($node, $details);
+
+    // * Additional DBxrefs Form *
+    $details = array(
+      'linking_table' => 'feature_dbxref',   // the name of your _dbxref table
+      'foreignkey_name' => 'feature_id',     // the name of the key in your base table
+      'foreignkey_value' => $feature_id      // the value of the feature_id key
+    );
+    chado_node_additional_dbxrefs_form_update_dbxrefs($node, $details);
+
   }
   else {
     $feature_id = $node->feature_id;
@@ -475,6 +515,24 @@ function chado_feature_update($node) {
 
     // add the genbank synonyms
     chado_feature_add_synonyms($node->synonyms, $feature_id);
+
+    // * Properties Form *
+    $details = array(
+      'property_table' => 'featureprop',   // the name of the prop table
+      'base_table' => 'feature',           // the name of your chado base table
+      'foreignkey_name' => 'feature_id',   // the name of the key in your base table
+      'foreignkey_value' => $feature_id    // the value of the feature_id key
+    );
+    chado_node_properties_form_update_properties($node, $details);
+
+    // * Additional DBxrefs Form *
+    $details = array(
+      'linking_table' => 'feature_dbxref',   // the name of your _dbxref table
+      'foreignkey_name' => 'feature_id',     // the name of the key in your base table
+      'foreignkey_value' => $feature_id      // the value of the feature_id key
+    );
+    chado_node_additional_dbxrefs_form_update_dbxrefs($node, $details);
+
   }
   else {
     drupal_set_message(t('Unable to update feature.'), 'warning');
@@ -660,6 +718,7 @@ function tripal_feature_node_presave($node) {
         $ftype = tripal_core_chado_select('cv', array('name'), $values);
         $type = $ftype[0]->name;
       }
+     
       $values = array('organism_id' => $organism_id);
       $organism = tripal_core_chado_select('organism', array('genus', 'species'), $values);
       $node->title = "$name, $uname ($type) " . $organism[0]->genus . ' ' . $organism[0]->species;
@@ -786,7 +845,7 @@ function tripal_feature_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_feature_base'] = array(
           '#markup' => theme('tripal_feature_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_feature_featurepos'] = array(

+ 1 - 1
tripal_featuremap/includes/tripal_featuremap.chado_node.inc

@@ -450,7 +450,7 @@ function tripal_featuremap_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_featuremap_base'] = array(
           '#markup' => theme('tripal_featuremap_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_featuremap_featurepos'] = array(

+ 1 - 1
tripal_library/includes/tripal_library.chado_node.inc

@@ -430,7 +430,7 @@ function tripal_library_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_library_base'] = array(
           '#markup' => theme('tripal_library_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_library_properties'] = array(

+ 1 - 1
tripal_organism/includes/tripal_organism.chado_node.inc

@@ -475,7 +475,7 @@ function tripal_organism_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_organism_base'] = array(
           '#markup'  => theme('tripal_organism_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
       }

+ 1 - 1
tripal_project/includes/tripal_project.chado_node.inc

@@ -466,7 +466,7 @@ function tripal_project_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_project_base'] = array(
           '#markup' => theme('tripal_project_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_project_contact'] = array(

+ 1 - 1
tripal_pub/includes/tripal_pub.chado_node.inc

@@ -985,7 +985,7 @@ function tripal_pub_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_pub_base'] = array(
           '#markup' => theme('tripal_pub_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_pub_featuremaps'] = array(

+ 1 - 1
tripal_stock/includes/tripal_stock.chado_node.inc

@@ -867,7 +867,7 @@ function tripal_stock_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_stock_base'] = array(
           '#markup' => theme('tripal_stock_base', array('node' => $node)),
           '#tripal_toc_id'    => 'base',
-          '#tripal_toc_title' => 'Details',
+          '#tripal_toc_title' => 'Overview',
           '#weight' => -100,
         );
         $node->content['tripal_stock_collections'] = array(