Pārlūkot izejas kodu

Added an email term for contacts

Stephen Ficklin 7 gadi atpakaļ
vecāks
revīzija
85d98bdce0

+ 1 - 1
tripal/includes/TripalImporter.inc

@@ -533,7 +533,7 @@ class TripalImporter {
     $this->total_items = $total_items;
   }
   /**
-   * Adds to the count of the total number of items that have been handle.d
+   * Adds to the count of the total number of items that have been handled.
    * @param unknown $num_handled
    */
   protected function addItemsHandled($num_handled) {

+ 14 - 1
tripal/includes/tripal.entity.inc

@@ -380,7 +380,7 @@ function tripal_field_property_get($entity, array $options, $field_name, $entity
           $curr_val = (boolean) $curr_val;
         }
       }
-      
+
       // Only add the current value if it's not empty.
       if (!empty(trim($curr_val))) {
         $values[$delta] = $curr_val;
@@ -420,6 +420,18 @@ function tripal_entity_access($op, $entity = NULL, $account = NULL, $entity_type
   if (!isset($account)) {
     $account = $user;
   }
+
+  if (!$entity_type) {
+    $entity_type = $entity->type;
+  }
+
+  // See if other modules want to adust permissions.
+  $results = module_invoke_all($entity_type . '_access', $entity, $op, $account);
+  drupal_debug($results);
+  if (in_array(TRUE, $results)) {
+    return TRUE;
+  }
+
   switch ($op) {
     case 'create':
       return user_access('create ' . $bundle_name, $account);
@@ -430,6 +442,7 @@ function tripal_entity_access($op, $entity = NULL, $account = NULL, $entity_type
     case 'delete':
       return user_access('delete ' . $bundle_name, $account);
   }
+
   return FALSE;
 }
 

+ 3 - 1
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -1341,7 +1341,9 @@ class GFF3Importer extends TripalImporter {
   }
 
   /**
-   * Load the cvterms for a feature. Assumes there is a dbxref.accession matching a cvterm.name
+   * Load the cvterms for a feature.
+   *
+   * Assumes there is a dbxref.accession matching a cvterm.name
    *
    * @param $feature
    * @param $dbxrefs

+ 1 - 0
tripal_chado/includes/loaders/tripal_chado.taxonomy_importer.inc

@@ -216,6 +216,7 @@ function tripal_chado_ncbi_taxonomy_import($job_id) {
                   tripal_chado_taxonomy_add_organism_property($organism->organism_id, 'genbank_common_name', $name, $name_ranks[$type]);
                   break;
                 case 'Synonym':
+                case 'GenbankSynonym':
                   tripal_chado_taxonomy_add_organism_property($organism->organism_id, 'synonym', $name, $name_ranks[$type]);
                   break;
                 case 'CommonName':

+ 1 - 0
tripal_chado/includes/tripal_chado.fields.inc

@@ -958,6 +958,7 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
     if ($table_name == 'project' and $column_name == 'description') {
       $base_info['label'] = 'Short Description';
     }
+
     $info[$field_name] = $base_info;
   }
 }

+ 7 - 0
tripal_chado/includes/tripal_chado.semweb.inc

@@ -307,6 +307,13 @@ function tripal_chado_populate_vocab_SIO() {
     'definition' => 'A vocabulary is a collection of terms.',
   ));
   tripal_associate_chado_semweb_term('cvterm', 'cv_id', $term);
+
+  $term = tripal_insert_cvterm(array(
+    'id' => 'SIO:001323',
+    'name' => 'email address',
+    'cv_name' => 'SIO',
+    'definition' => 'an email address is an identifier to send mail to particular electronic mailbox.',
+  ));
 }
 
 /**

+ 18 - 0
tripal_chado/tripal_chado.install

@@ -1239,4 +1239,22 @@ function tripal_chado_update_7315() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not perform update: '. $error);
   }
+}
+
+/**
+ * Adds the email term for potential use with contact properties.
+ */
+function tripal_chado_update_7316() {
+  try {
+    $term = tripal_insert_cvterm(array(
+      'id' => 'SIO:001323',
+      'name' => 'email address',
+      'cv_name' => 'SIO',
+      'definition' => 'an email address is an identifier to send mail to particular electronic mailbox.',
+    ));
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Could not perform update: '. $error);
+  }
 }