Browse Source

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Lacey Sanderson 11 years ago
parent
commit
3a502937ef

+ 32 - 6
tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -47,7 +47,7 @@ function tripal_analysis_node_info() {
  */
 function chado_analysis_form($node, &$form_state) {
   $form = array();
-
+  
   // Default values can come in the following ways:
   //
   // 1) as elements of the $node object.  This occurs when editing an existing analysis
@@ -86,6 +86,8 @@ function chado_analysis_form($node, &$form_state) {
     $sourceuri      = $analysis->sourceuri;
     $timeexecuted   = $analysis->timeexecuted;
     $description    = $analysis->description;
+    $analysis_type  = $node->type;
+    
 
     // set the analysis_id in the form
     $form['analysis_id'] = array(
@@ -107,6 +109,7 @@ function chado_analysis_form($node, &$form_state) {
     $description    = $form_state['values']['description'];
     $d_removed      = $form_state['values']['removed'];
     $num_new        = $form_state['values']['num_new'] ? $form_state['values']['num_new'] : 0;
+    $analysis_type  = $form_state['values']['analysis_type'];
   }
   // if we are re building the form from after submission (from ajax call) then
   // the values are in the $form_state['input'] array
@@ -122,6 +125,7 @@ function chado_analysis_form($node, &$form_state) {
     $description    = $form_state['input']['description'];
     $d_removed      = $form_state['input']['removed'];
     $num_new        = $form_state['input']['num_new'] ? $form_state['input']['num_new'] : 0;
+    $analysis_type  = $form_state['input']['analysis_type'];
   }
 
   $form['title']= array(
@@ -224,11 +228,30 @@ function chado_analysis_form($node, &$form_state) {
        for collection of the source data and performing the analysis'),
   );
 
-
-  $exclude = array();
-  $include = array();
-
-
+  /*
+  // get node types from analysis extension modules
+  $sql = "SELECT modulename FROM {tripal_analysis}";
+  $modules = db_query($sql);  
+  $node_types = array();
+  $node_types['chado_analysis'] = 'Analysis';
+  foreach($modules as $module) {
+    $mtypes = call_user_func($module->modulename . "_node_info");
+    foreach ($mtypes as $mtypename => $mtype) {
+      $node_types[$mtypename] = $mtype['name'];
+    }
+  }
+  
+  if (count($node_types) > 0) {
+    $form['analysis_type'] = array(
+      '#title'         => t('Analysis Type'),
+      '#type'          => t('select'),
+      '#description'   => t("You can change this analysis type to be any other analysis type currently supported by Tripal.  Simply change this value and click 'Save'.  Then click 'Edit' again to supply additional values."),
+      '#required'      => TRUE,
+      '#default_value' => $analysis_type,
+      '#options'       => $node_types,
+    );
+  } */
+  
   // Properties Form
   // ----------------------------------
   $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the analysis_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
@@ -671,6 +694,8 @@ function tripal_analysis_node_presave($node) {
     if ($name) {
       $node->title = $name;
     }
+    // reset the type 
+    //$node->type = $node->analysis_type;
   }
   else if (property_exists($node, 'analysis')) {
     $name           = $node->analysis->name;
@@ -682,5 +707,6 @@ function tripal_analysis_node_presave($node) {
     if ($name) {
       $node->title = $name;
     }
+    //$node->type = $node->analysis_type;
   }
 }

+ 1 - 1
tripal_analysis/tripal_analysis.info

@@ -3,7 +3,7 @@ description = Supports the companalyses tables of Chado by providing pages for v
 core = 7.x
 project = tripal_analysis
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/chado/tripal_analysis/configuration
 
 dependencies[] = tripal_core

+ 1 - 1
tripal_bulk_loader/tripal_bulk_loader.info

@@ -3,7 +3,7 @@ description = Supports the construction of templates for customizable uploading
 core = 7.x
 project = tripal_bulk_loader
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_contact/tripal_contact.info

@@ -3,7 +3,7 @@ description = Supports the contact tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal_contact
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_core/tripal_core.info

@@ -3,7 +3,7 @@ description = Provides support for all Tripal modules and includes the Tripal AP
 core = 7.x
 project = tripal_core
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal
 
 stylesheets[all][] = theme/css/tripal.css

+ 9 - 11
tripal_cv/includes/tripal_cv.cvterm_form.inc

@@ -330,17 +330,15 @@ function tripal_cv_cvterm_add_form_validate($form, &$form_state) {
  */
 function tripal_cv_cvterm_edit_form_submit($form, &$form_state) {
 
-  $cv_id = array_key_exists('cv_id', $form_state['values']) ? $form_state['values']['cv_id'] : '';
-  $name = array_key_exists('name', $form_state['values']) ? $form_state['values']['name'] : '';
-  $definition = array_key_exists('definition', $form_state['values']) ? $form_state['values']['definition'] : '';
-  $is_relationship = array_key_exists('is_relationship', $form_state['values']) ? $form_state['values']['is_relationship'] : '';
-  $is_obsolete = array_key_exists('is_obsolete', $form_state['values']) ? $form_state['values']['is_obsolete'] : '';
-  $cvterm_id = array_key_exists('cvterm_id', $form_state['values']) ? $form_state['values']['cvterm_id'] : '';
-
-  $db_id = array_key_exists('db_id', $form_state['values']) ? $form_state['values']['db_id'] : '';
-  $accession = array_key_exists('accession', $form_state['values']) ? $form_state['values']['accession'] : '';
-
-  $op    = array_key_exists('op', $form_state['values'])         ? trim($form_state['values']['op']) : '';
+  $cv_id           = array_key_exists('cv_id', $form_state['values'])           ? trim($form_state['values']['cv_id']) : '';
+  $name            = array_key_exists('name', $form_state['values'])            ? trim($form_state['values']['name']) : '';
+  $definition      = array_key_exists('definition', $form_state['values'])      ? trim($form_state['values']['definition']) : '';
+  $is_relationship = array_key_exists('is_relationship', $form_state['values']) ? trim($form_state['values']['is_relationship']) : '';
+  $is_obsolete     = array_key_exists('is_obsolete', $form_state['values'])     ? trim($form_state['values']['is_obsolete']) : '';
+  $cvterm_id       = array_key_exists('cvterm_id', $form_state['values'])       ? trim($form_state['values']['cvterm_id']) : '';
+  $db_id           = array_key_exists('db_id', $form_state['values'])           ? trim($form_state['values']['db_id']) : '';
+  $accession       = array_key_exists('accession', $form_state['values'])       ? trim($form_state['values']['accession']) : '';
+  $op              = array_key_exists('op', $form_state['values'])              ? trim($form_state['values']['op']) : '';
 
 
   $step = $form_state['storage']['step'];

+ 1 - 1
tripal_cv/tripal_cv.info

@@ -3,7 +3,7 @@ description = Supports the Controlled Vocabulary (CV) tables of Chado by providi
 core = 7.x
 project = tripal_cv
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/chado/tripal_cv
 
 dependencies[] = tripal_core

+ 1 - 1
tripal_db/tripal_db.info

@@ -3,7 +3,7 @@ description = Supports the database cross-reference tables of Chado by providing
 core = 7.x
 project = tripal_db
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/chado/tripal_db
 
 dependencies[] = tripal_core

+ 16 - 4
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -595,12 +595,24 @@ function chado_feature_delete($node) {
 
   // Remove data from feature tables of chado database.  This will
   // cause a cascade delete and remove all data in referencing tables
-  // for this feature
+  // for this feature. However, we need t specifically delete from the
+  // featureloc table because the box() PLSQL function calls another
+  // function that does not reference the 'chado' schema and causes an error
+  // the chado_query function can handle this problem so we specificall delete
+  // from that table to prevent the error. The same problem exists for the
+  // frange.featuregroup table
+  $previous_db = chado_set_active('chado') ;
+  db_query("DELETE FROM frange.featuregroup WHERE subject_id = :feature_id", array(':feature_id' => $feature_id));
+  db_query("DELETE FROM frange.featuregroup WHERE object_id = :feature_id", array(':feature_id' => $feature_id));
+  db_query("DELETE FROM frange.featuregroup WHERE group_id = :feature_id", array(':feature_id' => $feature_id));
+  db_query("DELETE FROM frange.featuregroup WHERE srcfeature_id = :feature_id", array(':feature_id' => $feature_id));
+  chado_set_active($previous_db);
+  
+  chado_query("DELETE FROM {featureloc} WHERE feature_id = :feature_id", array(':feature_id' => $feature_id));
+  chado_query("DELETE FROM {featureloc} WHERE srcfeature_id = :feature_id", array(':feature_id' => $feature_id));
   chado_query("DELETE FROM {feature} WHERE feature_id = :feature_id", array(':feature_id' => $feature_id));
 
-  drupal_set_message(t("The feature and all associated data were removed from") .
-  "chado");
-
+  drupal_set_message(t("The feature and all associated data were removed"));
 }
 
 /**

+ 1 - 1
tripal_feature/tripal_feature.info

@@ -3,7 +3,7 @@ description = Supports the sequence (feature) tables of Chado by providing pages
 core = 7.x
 project = tripal_feature
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 stylesheets[all][] = theme/css/tripal_feature.css
 scripts[]          = theme/js/tripal_feature.js

+ 1 - 1
tripal_featuremap/tripal_featuremap.info

@@ -3,7 +3,7 @@ description = Supports the map tables of Chado by providing pages for viewing an
 core = 7.x
 project = tripal_featuremap
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_genetic/tripal_genetic.info

@@ -3,7 +3,7 @@ description = Supports the genetic tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal_genetic
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_library/tripal_library.info

@@ -3,7 +3,7 @@ description = Supports the library tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal_library
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_natural_diversity/tripal_natural_diversity.info

@@ -3,7 +3,7 @@ description = Supports the natural diversity (ND) tables of Chado by providing p
 core = 7.x
 project = tripal_natural_diversity
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_organism/tripal_organism.info

@@ -3,7 +3,7 @@ description = Supports the organism tables of Chado by providing pages for viewi
 core = 7.x
 project = tripal_organism
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/chado/tripal_organism
 
 stylesheets[all][] = theme/css/tripal_organism.css

+ 1 - 1
tripal_phenotype/tripal_phenotype.info

@@ -3,7 +3,7 @@ description = Supports the phenotype tables of Chado by providing pages for view
 core = 7.x
 project = tripal_phenotype
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_project/tripal_project.info

@@ -3,7 +3,7 @@ description = Supports the project tables of Chado by providing pages for viewin
 core = 7.x
 project = tripal_project
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/chado/tripal_project
 
 dependencies[] = tripal_core

+ 3 - 9
tripal_pub/includes/importers/tripal_pub.AGL.inc

@@ -449,13 +449,7 @@ function tripal_pub_AGL_range($yazc, $search_str, $start, $num_to_retrieve, $tot
   for($i = $start; $i < $start + $num_to_retrieve; $i++) {
     // retrieve the XML results
     $pub_xml = yaz_record($yazc, $i + 1, 'xml; charset=marc-8,utf-8');
-    
-    // the XML is encoded twice, one to convert UTF-8 characters to 
-    // unicode HTML entities and second with URL encoding. We must
-    // reverse the encoding
-    //$pub_xml = urldecode($pub_xml);
-    //$pub_xml = mb_convert_encoding($pub_xml, 'UTF-8', 'HTML-ENTITIES');
-    
+
     // parse the pub XML
     $pub     = tripal_pub_AGL_parse_pubxml($pub_xml);
     $pubs[]  = $pub;
@@ -906,8 +900,8 @@ function tripal_pub_AGL_parse_pubxml($pub_xml) {
     $pub['Authors'] = $pub['Author List'];
   }
 
-  // for Title, Abstract, Athors, convert the html entity and remove special unicode chars that are not meant for display
-  $pub['Title'] =preg_replace( '/[\p{So}]/u', '', mb_convert_encoding($pub['Title'], 'UTF-8', 'HTML-ENTITIES'));
+  // for Title, Abstract, Authors, convert the html entity and remove special unicode chars that are not meant for display
+  $pub['Title'] = preg_replace( '/[\p{So}]/u', '', mb_convert_encoding($pub['Title'], 'UTF-8', 'HTML-ENTITIES'));
   if (key_exists('Abstract', $pub)) {
     $pub['Abstract'] =preg_replace( '/[\p{So}]/u', '',mb_convert_encoding($pub['Abstract'], 'UTF-8', 'HTML-ENTITIES'));
   }

+ 1 - 1
tripal_pub/tripal_pub.info

@@ -3,7 +3,7 @@ description = Supports the pub (publication) tables of Chado by providing pages
 core = 7.x
 project = tripal_pub
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 stylesheets[all][] = theme/css/tripal_pub.css
 

+ 1 - 1
tripal_stock/tripal_stock.info

@@ -3,7 +3,7 @@ description = Supports the stock tables of Chado by providing pages for viewing,
 core = 7.x
 project = tripal_stock
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 1 - 1
tripal_views/tripal_views.info

@@ -3,7 +3,7 @@ description = Integrates all Chado tables with Drupal Views and provides basic s
 core = 7.x
 project = tripal_core
 package = Tripal
-version = 7.x-2.0a
+version = 7.x-2.0.1a
 configure = admin/tripal/views-integration
 
 files[] = views/handlers/tripal_views_handler_filter_textarea.inc