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
f5f2a6e02c
44 changed files with 518 additions and 273 deletions
  1. 24 17
      tripal_analysis/includes/tripal_analysis.chado_node.inc
  2. 3 2
      tripal_analysis/theme/tripal_analysis/tripal_analysis_base.tpl.php
  3. 42 0
      tripal_analysis/tripal_analysis.install
  4. 24 20
      tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc
  5. 1 2
      tripal_bulk_loader/tripal_bulk_loader.install
  6. 26 18
      tripal_contact/includes/tripal_contact.chado_node.inc
  7. 3 2
      tripal_contact/theme/tripal_contact/tripal_contact_base.tpl.php
  8. 1 2
      tripal_contact/tripal_contact.install
  9. 2 1
      tripal_core/api/tripal_core.chado_nodes.dbxrefs.api.inc
  10. 3 3
      tripal_core/api/tripal_core.chado_nodes.relationships.api.inc
  11. 1 1
      tripal_core/api/tripal_core.tripal.api.inc
  12. 3 3
      tripal_core/theme/css/tripal.css
  13. 24 17
      tripal_example/includes/tripal_example.chado_node.inc
  14. 25 18
      tripal_feature/includes/tripal_feature.chado_node.inc
  15. 1 1
      tripal_feature/includes/tripal_feature.seq_extract.inc
  16. 3 2
      tripal_feature/theme/tripal_feature/tripal_feature_base.tpl.php
  17. 4 1
      tripal_feature/theme/tripal_feature/tripal_feature_properties.tpl.php
  18. 8 8
      tripal_feature/theme/tripal_feature/tripal_feature_relationships.tpl.php
  19. 1 1
      tripal_feature/theme/tripal_feature/tripal_feature_terms.tpl.php
  20. 1 1
      tripal_feature/theme/tripal_organism/tripal_organism_feature_counts.tpl.php
  21. 42 0
      tripal_feature/tripal_feature.install
  22. 23 23
      tripal_featuremap/includes/tripal_featuremap.chado_node.inc
  23. 3 2
      tripal_featuremap/theme/tripal_featuremap/tripal_featuremap_base.tpl.php
  24. 24 17
      tripal_library/includes/tripal_library.chado_node.inc
  25. 3 2
      tripal_library/theme/tripal_library/tripal_library_base.tpl.php
  26. 37 2
      tripal_library/tripal_library.install
  27. 24 17
      tripal_organism/includes/tripal_organism.chado_node.inc
  28. 3 2
      tripal_organism/theme/tripal_organism/tripal_organism_base.tpl.php
  29. 39 3
      tripal_organism/tripal_organism.install
  30. 1 1
      tripal_phenotype/tripal_phenotype.views_default.inc
  31. 24 17
      tripal_project/includes/tripal_project.chado_node.inc
  32. 3 2
      tripal_project/theme/tripal_project/tripal_project_base.tpl.php
  33. 1 2
      tripal_project/tripal_project.install
  34. 24 18
      tripal_pub/includes/tripal_pub.chado_node.inc
  35. 9 4
      tripal_pub/theme/tripal_pub/pub_types/conference_proceedings.inc
  36. 9 4
      tripal_pub/theme/tripal_pub/pub_types/journal_article.inc
  37. 9 4
      tripal_pub/theme/tripal_pub/pub_types/patent.inc
  38. 3 2
      tripal_pub/theme/tripal_pub/tripal_pub_base.tpl.php
  39. 1 2
      tripal_pub/tripal_pub.install
  40. 2 1
      tripal_stock/theme/tripal_stock/tripal_stock_base.tpl.php
  41. 1 1
      tripal_stock/theme/tripal_stock/tripal_stock_properties.tpl.php
  42. 8 8
      tripal_stock/theme/tripal_stock/tripal_stock_relationships.tpl.php
  43. 24 17
      tripal_stock/tripal_stock.module
  44. 1 2
      tripal_views/tripal_views.install

+ 24 - 17
tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -570,28 +570,35 @@ function chado_analysis_load($nodes) {
  */
  */
 function chado_analysis_node_access($node, $op, $account) {
 function chado_analysis_node_access($node, $op, $account) {
 
 
-  if ($op == 'create') {
-    if (!user_access('create chado_analysis content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_analysis content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_analysis') {
+    if ($op == 'create') {
+      if (!user_access('create chado_analysis content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_analysis content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_analysis content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_analysis content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_analysis content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_analysis content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 3 - 2
tripal_analysis/theme/tripal_analysis/tripal_analysis_base.tpl.php

@@ -21,7 +21,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Analysis Name',
     'data' => 'Analysis Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $analysis->name
   $analysis->name
 );
 );
@@ -71,7 +72,7 @@ $rows[] = array(
 ); 
 ); 
 
 
 // allow site admins to see the analysis ID
 // allow site admins to see the analysis ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Analysis ID
   // Analysis ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 42 - 0
tripal_analysis/tripal_analysis.install

@@ -251,3 +251,45 @@ function tripal_analysis_add_mview_analysis_organism() {
   tripal_add_mview($view_name, 'tripal_analysis', $schema, $sql, $comment);
   tripal_add_mview($view_name, 'tripal_analysis', $schema, $sql, $comment);
 }
 }
 
 
+/**
+ * This is the required update for tripal_organism when upgrading from Drupal core API 6.x.
+ *
+ */
+function tripal_analysis_update_7200() {
+
+  // During the upgrade from D6 to D7 the vocabulary terms assigned to organisms were
+  // copied to the field_data_taxonomyextra table rather than to the correct
+  // field_data_taxonomy_vocabulary_[vid] table. We'll move them.
+  $vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE name = 'Analysis'")->fetchField();
+  if ($vid) {
+    try {
+      // first move from the field_data_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_data_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_data_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_data_taxonomyextra WHERE bundle = 'chado_analysis'";
+      db_query($sql);
+
+      // next move from the field_revision_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_revision_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_revision_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_revision_taxonomyextra WHERE bundle = 'chado_analysis'";
+      db_query($sql);
+    }
+    catch (\PDOException $e) {
+      $error = $e->getMessage();
+      throw new DrupalUpdateException('Could not move organism taxonomy terms: '. $error);
+    }
+  }
+}

+ 24 - 20
tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc

@@ -333,29 +333,33 @@ function tripal_bulk_loader_update($node) {
  * @ingroup tripal_bulk_loader
  * @ingroup tripal_bulk_loader
  */
  */
 function tripal_bulk_loader_node_access($node, $op, $account) {
 function tripal_bulk_loader_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create tripal_bulk_loader', $account)) {
-      return NODE_ACCESS_DENY;
-    }
-    return NODE_ACCESS_ALLOW;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit tripal_bulk_loader', $account)) {
-      return NODE_ACCESS_DENY;
+  
+  if($node_type == 'tripal_bulk_loader') {
+    if ($op == 'create') {
+      if (!user_access('create tripal_bulk_loader', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-    return NODE_ACCESS_ALLOW;
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete tripal_bulk_loader', $account)) {
-      return NODE_ACCESS_DENY;
+    if ($op == 'update') {
+      if (!user_access('edit tripal_bulk_loader', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-    return NODE_ACCESS_ALLOW;
-  }
-  if ($op == 'view') {
-    if (!user_access('access tripal_bulk_loader', $account)) {
-      return NODE_ACCESS_DENY;
+    if ($op == 'delete') {
+      if (!user_access('delete tripal_bulk_loader', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access tripal_bulk_loader', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-    return NODE_ACCESS_ALLOW;
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NODE_ACCESS_IGNORE;
 }
 }

+ 1 - 2
tripal_bulk_loader/tripal_bulk_loader.install

@@ -247,9 +247,8 @@ function tripal_bulk_loader_update_6152() {
  * Update to 7.x-2.0
  * Update to 7.x-2.0
  * -Cast tripal_bulk_loader.template_id to int field
  * -Cast tripal_bulk_loader.template_id to int field
  *
  *
- * @ingroup tripal_bulk_loader
  */
  */
-function tripal_bulk_loader_update_7201() {
+function tripal_bulk_loader_update_7200() {
 
 
   db_change_field(
   db_change_field(
     'tripal_bulk_loader',
     'tripal_bulk_loader',

+ 26 - 18
tripal_contact/includes/tripal_contact.chado_node.inc

@@ -308,29 +308,37 @@ function chado_contact_validate($node, $form, &$form_state) {
  * @ingroup tripal_contact
  * @ingroup tripal_contact
  */
  */
 function chado_contact_node_access($node, $op, $account ) {
 function chado_contact_node_access($node, $op, $account ) {
-  if ($op == 'create') {
-    if (!user_access('create chado_contact content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-
-  if ($op == 'update') {
-    if (!user_access('edit chado_contact content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_contact') {
+    if ($op == 'create') {
+      if (!user_access('create chado_contact content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_contact content', $account)) {
-      return FALSE;
+  
+    if ($op == 'update') {
+      if (!user_access('edit chado_contact content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_contact content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_contact content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_contact content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
   }
   }
-  return NULL;
+  return NODE_ACCESS_IGNORE;
 }
 }
 
 
 
 

+ 3 - 2
tripal_contact/theme/tripal_contact/tripal_contact_base.tpl.php

@@ -20,7 +20,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Name',
     'data' => 'Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $contact->name,
   $contact->name,
 );
 );
@@ -33,7 +34,7 @@ $rows[] = array(
   $contact->type_id->name,
   $contact->type_id->name,
 );
 );
 // allow site admins to see the contact ID
 // allow site admins to see the contact ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Pub ID
   // Pub ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 1 - 2
tripal_contact/tripal_contact.install

@@ -226,9 +226,8 @@ function tripal_contact_add_custom_tables(){
 /**
 /**
  * This is the required update for tripal_contact when upgrading from Drupal core API 6.x.
  * This is the required update for tripal_contact when upgrading from Drupal core API 6.x.
  *
  *
- * @ingroup tripal_contact
  */
  */
-function tripal_contact_update_7000() {
+function tripal_contact_update_7200() {
 
 
   // add the new contact_relationship_types vocabulary
   // add the new contact_relationship_types vocabulary
   // We cannot use the Tripal API calls in the 7000 update 
   // We cannot use the Tripal API calls in the 7000 update 

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

@@ -279,7 +279,7 @@ function chado_add_node_form_dbxrefs(&$form, &$form_state, $details) {
 
 
       $form['addtl_dbxrefs']['dbxref_table'][$dbxref->db_id][$version]['dbxref_version'] = array(
       $form['addtl_dbxrefs']['dbxref_table'][$dbxref->db_id][$version]['dbxref_version'] = array(
         '#type' => 'markup',
         '#type' => 'markup',
-        '#markup' => $dbxref->version
+        '#markup' => $dbxref->version,
       );
       );
 
 
       $form['addtl_dbxrefs']['dbxref_table'][$dbxref->db_id][$version]['dbxref_accession'] = array(
       $form['addtl_dbxrefs']['dbxref_table'][$dbxref->db_id][$version]['dbxref_accession'] = array(
@@ -337,6 +337,7 @@ function chado_add_node_form_dbxrefs(&$form, &$form_state, $details) {
 
 
   $form['addtl_dbxrefs']['dbxref_table']['new']['dbxref_version'] = array(
   $form['addtl_dbxrefs']['dbxref_table']['new']['dbxref_version'] = array(
     '#type' => 'textfield',
     '#type' => 'textfield',
+    '#size' => 10,
   );
   );
 
 
   // add button
   // add button

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

@@ -438,7 +438,7 @@ function chado_add_node_form_relationships(&$form, &$form_state, $details) {
 
 
   $form['relationships']['relationship_table']['new']['object_name'] = array(
   $form['relationships']['relationship_table']['new']['object_name'] = array(
     '#type' => 'textfield',
     '#type' => 'textfield',
-    '#autocomplete_path' => 'tripal_ajax/relationship_nodeform/'.$details['base_table'].'/'.$details['base_name_field'].'/name_to_id'
+    '#autocomplete_path' => 'tripal_ajax/relationship_nodeform/' . $details['base_table'] . '/' . $details['base_name_field'].'/name_to_id'
   );
   );
 
 
   $form['relationships']['relationship_table']['new']['object_is_current'] = array(
   $form['relationships']['relationship_table']['new']['object_is_current'] = array(
@@ -453,12 +453,12 @@ function chado_add_node_form_relationships(&$form, &$form_state, $details) {
 
 
   $form['relationships']['relationship_table']['new']['subject_name'] = array(
   $form['relationships']['relationship_table']['new']['subject_name'] = array(
     '#type' => 'textfield',
     '#type' => 'textfield',
-    '#autocomplete_path' => 'tripal_ajax/relationship_nodeform/'.$details['base_table'].'/'.$details['base_name_field'].'/name_to_id'
+    '#autocomplete_path' => 'tripal_ajax/relationship_nodeform/' . $details['base_table'] . '/' . $details['base_name_field'].'/name_to_id'
   );
   );
 
 
   $form['relationships']['relationship_table']['new']['subject_is_current'] = array(
   $form['relationships']['relationship_table']['new']['subject_is_current'] = array(
     '#type' => 'checkbox',
     '#type' => 'checkbox',
-    '#title' => t('Current '.$details['nodetype']),
+    '#title' => t('Current ' . $details['nodetype']),
   );
   );
 
 
   $form['relationships']['relationship_table']['new']['rank'] = array(
   $form['relationships']['relationship_table']['new']['rank'] = array(

+ 1 - 1
tripal_core/api/tripal_core.tripal.api.inc

@@ -132,7 +132,7 @@ function tripal_set_message($message, $importance = TRIPAL_INFO, $options = arra
 
 
   // Only show the message to the administrator user (uid=1)
   // Only show the message to the administrator user (uid=1)
   // thus if the current user is not the administrator then return nothing
   // thus if the current user is not the administrator then return nothing
-  if ($user->uid > 1) {
+  if (!user_access('administer tripal')) {
     return '';
     return '';
   }
   }
 
 

+ 3 - 3
tripal_core/theme/css/tripal.css

@@ -213,12 +213,12 @@ div.messages.tripal-site-admin-only{
 }
 }
 
 
 .tripal-site-admin-message {
 .tripal-site-admin-message {
-   padding: 15px 10px 10px 70px;
-   font-style: italic;
+  padding: 15px 10px 10px 70px;
+  font-style: italic;
 }
 }
 
 
 .tripal-site-admin-only-table-row {
 .tripal-site-admin-only-table-row {
   background-color: #cce3ff;
   background-color: #cce3ff;
-  border: 1px solid #7DA1D4;
+  /* border: 1px solid #7DA1D4; */
   color: black;
   color: black;
 }
 }

+ 24 - 17
tripal_example/includes/tripal_example.chado_node.inc

@@ -61,28 +61,35 @@ function tripal_example_node_info() {
  * by other modules.
  * by other modules.
  */
  */
 function chado_example_node_access($node, $op, $account) {
 function chado_example_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_example content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_example content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_example') {
+    if ($op == 'create') {
+      if (!user_access('create chado_example content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_example content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_example content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_example content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_example content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_example content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
   }
   }
-  return NULL;
+  return NODE_ACCESS_IGNORE;
 }
 }
 
 
 /**
 /**

+ 25 - 18
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -344,29 +344,36 @@ function chado_feature_validate($node, $form, &$form_state) {
  * @ingroup tripal_feature
  * @ingroup tripal_feature
  */
  */
 function chado_feature_node_access($node, $op, $account) {
 function chado_feature_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_feature content', $account)) {
-      return FALSE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
+  }
+  
+  if($node_type == 'chado_feature') {
+    if ($op == 'create') {
+      if (!user_access('create chado_feature content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-    return TRUE;
-  }
-
-  if ($op == 'update') {
-    if (!user_access('edit chado_feature content', $account)) {
-      return FALSE;
+  
+    if ($op == 'update') {
+      if (!user_access('edit chado_feature content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_feature content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_feature content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_feature content', $account)) {
-      return FALSE;
+    if ($op == 'view') {
+      if (!user_access('access chado_feature content', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
   }
   }
-  return NULL;
+  return NODE_ACCESS_IGNORE;
 }
 }
 
 
 /**
 /**

+ 1 - 1
tripal_feature/includes/tripal_feature.seq_extract.inc

@@ -44,7 +44,7 @@ function tripal_feature_seq_extract_page() {
 
 
   // generate the search form
   // generate the search form
   $output .= '';
   $output .= '';
-  if (user_access('access administration pages')) {
+  if (user_access('administer tripal')) {
     $output .= tripal_set_message("Administrators, the " . 
     $output .= tripal_set_message("Administrators, the " . 
         l('organism_feature_count', 'admin/tripal/schema/mviews') . " and " .
         l('organism_feature_count', 'admin/tripal/schema/mviews') . " and " .
         l('analysis_organism', 'admin/tripal/schema/mviews') . " materialized
         l('analysis_organism', 'admin/tripal/schema/mviews') . " materialized

+ 3 - 2
tripal_feature/theme/tripal_feature/tripal_feature_base.tpl.php

@@ -20,7 +20,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Name',
     'data' => 'Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $feature->name
   $feature->name
 );
 );
@@ -63,7 +64,7 @@ if($feature->seqlen > 0) {
   );
   );
 }
 }
 // allow site admins to see the feature ID
 // allow site admins to see the feature ID
-if (user_access('access administration pages')) { 
+if (user_access('administer tripal')) { 
   // Feature ID
   // Feature ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 4 - 1
tripal_feature/theme/tripal_feature/tripal_feature_properties.tpl.php

@@ -21,7 +21,10 @@ if(count($properties) > 0){
   foreach ($properties as $property){
   foreach ($properties as $property){
     $property = tripal_core_expand_chado_vars($property,'field','featureprop.value');
     $property = tripal_core_expand_chado_vars($property,'field','featureprop.value');
     $rows[] = array(
     $rows[] = array(
-      ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
+      array(
+        'data' => ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
+        'width' => '20%'
+      ),
       urldecode($property->value)
       urldecode($property->value)
     );
     );
   }
   }

+ 8 - 8
tripal_feature/theme/tripal_feature/tripal_feature_relationships.tpl.php

@@ -54,10 +54,10 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
         }
         }
         $rows[] = array(
         $rows[] = array(
-          $feature_name, 
-          $object->record->object_id->uniquename,
-          $organism_name,
-          $object->record->object_id->type_id->name,
+          array('data' => $feature_name, 'width' => '30%'), 
+          array('data' => $object->record->object_id->uniquename, 'width' => '30%'),
+          array('data' => $organism_name, 'width' => '30%'),
+          array('data' => $object->record->object_id->type_id->name, 'width' => '10%'),
         ); 
         ); 
        } 
        } 
        // the $table array contains the headers and rows array as well as other
        // the $table array contains the headers and rows array as well as other
@@ -112,10 +112,10 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
         }
         }
         $rows[] = array(
         $rows[] = array(
-          $feature_name, 
-          $subject->record->subject_id->uniquename,
-          $organism_name,
-          $subject->record->subject_id->type_id->name,
+          array('data' => $feature_name, 'width' => '30%'),
+          array('data' =>$subject->record->subject_id->uniquename, 'width' => '30%'),
+          array('data' =>$organism_name, 'width' => '30%'),
+          array('data' =>$subject->record->subject_id->type_id->name, 'width' => '10%'),
         ); 
         ); 
        } 
        } 
        // the $table array contains the headers and rows array as well as other
        // the $table array contains the headers and rows array as well as other

+ 1 - 1
tripal_feature/theme/tripal_feature/tripal_feature_terms.tpl.php

@@ -42,7 +42,7 @@ if (count($s_terms) > 0) { ?>
       } 
       } 
       
       
       $rows[] = array(
       $rows[] = array(
-        $accession,
+        array('data' => $accession, 'width' => '15%'),
         $term->cvterm_id->name
         $term->cvterm_id->name
       );
       );
     } 
     } 

+ 1 - 1
tripal_feature/theme/tripal_organism/tripal_organism_feature_counts.tpl.php

@@ -71,7 +71,7 @@ if ($enabled) {
     <img class="tripal_cv_chart" id="tripal_feature_cv_chart_<?php print $organism->organism_id?>" src="" border="0"><?php 
     <img class="tripal_cv_chart" id="tripal_feature_cv_chart_<?php print $organism->organism_id?>" src="" border="0"><?php 
    } 
    } 
    else { 
    else { 
-    if (user_access('access administration pages')) { ?>
+    if (user_access('administer tripal')) { ?>
       <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php 
       <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php 
       print tripal_set_message("
       print tripal_set_message("
          Administrators, to view the feature type report:
          Administrators, to view the feature type report:

+ 42 - 0
tripal_feature/tripal_feature.install

@@ -211,3 +211,45 @@ function tripal_feature_add_organism_count_mview() {
 
 
   tripal_add_mview($view_name, 'tripal_feature', $schema, $sql, $comment);
   tripal_add_mview($view_name, 'tripal_feature', $schema, $sql, $comment);
 }
 }
+
+/**
+ * This is the required update for tripal_feature when upgrading from Drupal core API 6.x.
+ * This update may take some time to complete.
+ */
+function tripal_feature_update_7200() {
+  // During the upgrade from D6 to D7 the vocabulary terms assigned to features were 
+  // copied to the field_data_taxonomyextra table rather than to the correct
+  // field_data_taxonomy_vocabulary_[vid] table. We'll move them. 
+  $vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE name = 'Feature Type'")->fetchField();
+  if ($vid) {
+    try {
+      // first move from the field_data_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_data_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_data_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_data_taxonomyextra WHERE bundle = 'chado_feature'";
+      db_query($sql);
+      
+      // next move from the field_revision_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_revision_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_revision_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_revision_taxonomyextra WHERE bundle = 'chado_feature'";
+      db_query($sql);
+    }
+    catch (\PDOException $e) {
+      $error = $e->getMessage();
+      throw new DrupalUpdateException('Could not move feature taxonomy terms: '. $error);
+    }
+  }
+}

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

@@ -221,35 +221,35 @@ function chado_featuremap_validate($node, $form, &$form_state) {
  * @ingroup tripal_featuremap
  * @ingroup tripal_featuremap
  */
  */
 function chado_featuremap_node_access($node, $op, $account) {
 function chado_featuremap_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_featuremap content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-
-  if ($op == 'update') {
-    if (!user_access('edit any chado_featuremap content', $account) &&
-    !user_access('edit own chado_featuremap content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_featuremap') {
+    if ($op == 'create') {
+      if (!user_access('create chado_featuremap', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-    if (user_access('edit own chado_featuremap content', $account) &&
-    $account->uid != $node->uid) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_featuremap', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-
-  if ($op == 'delete') {
-    if (!user_access('delete any chado_featuremap content', $account) &&
-    !user_access('delete own chado_featuremap content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_featuremap', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-    if (user_access('delete own chado_featuremap content', $account) &&
-    $account->uid != $node->uid) {
-      return FALSE;
+    if ($op == 'view') {
+      if (!user_access('access chado_featuremap', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 3 - 2
tripal_featuremap/theme/tripal_featuremap/tripal_featuremap_base.tpl.php

@@ -24,7 +24,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Map Name',
     'data' => 'Map Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $featuremap->name
   $featuremap->name
 );
 );
@@ -37,7 +38,7 @@ $rows[] = array(
   $featuremap->unittype_id->name
   $featuremap->unittype_id->name
 );
 );
 // allow site admins to see the feature ID
 // allow site admins to see the feature ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Feature Map ID
   // Feature Map ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 24 - 17
tripal_library/includes/tripal_library.chado_node.inc

@@ -441,28 +441,35 @@ function chado_library_delete(&$node) {
  * @ingroup tripal_library
  * @ingroup tripal_library
  */
  */
 function chado_library_node_access($node, $op, $account) {
 function chado_library_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_library content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_library content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_library') {
+    if ($op == 'create') {
+      if (!user_access('create chado_library', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_library content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_library', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_library content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_library', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_library', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 3 - 2
tripal_library/theme/tripal_library/tripal_library_base.tpl.php

@@ -25,7 +25,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Library Name',
     'data' => 'Library Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $library->name
   $library->name
 );
 );
@@ -62,7 +63,7 @@ $rows[] = array(
 );
 );
 
 
 // allow site admins to see the library ID
 // allow site admins to see the library ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Library ID
   // Library ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 37 - 2
tripal_library/tripal_library.install

@@ -239,9 +239,8 @@ function tripal_library_add_cvterms() {
 /**
 /**
  * This is the required update for tripal_library when upgrading from Drupal core API 6.x.
  * This is the required update for tripal_library when upgrading from Drupal core API 6.x.
  *
  *
- * @ingroup tripal_library
  */
  */
-function tripal_library_update_7000() {
+function tripal_library_update_7200() {
 
 
   // the library types were formerly in a vocabulary named 'tripal_library_types'.
   // the library types were formerly in a vocabulary named 'tripal_library_types'.
   // rename that to just be 'library_type'. We cannot use the Tripal API calls 
   // rename that to just be 'library_type'. We cannot use the Tripal API calls 
@@ -312,4 +311,40 @@ function tripal_library_update_7000() {
     $error = $e->getMessage();
     $error = $e->getMessage();
     throw new DrupalUpdateException('Failed to change library_description property type to the library_property CV and update the name: '. $error);
     throw new DrupalUpdateException('Failed to change library_description property type to the library_property CV and update the name: '. $error);
   }
   }
+  
+  // During the upgrade from D6 to D7 the vocabulary terms assigned to libraries were
+  // copied to the field_data_taxonomyextra table rather than to the correct
+  // field_data_taxonomy_vocabulary_[vid] table. We'll move them.
+  $vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE name = 'Library'")->fetchField();
+  if ($vid) {
+    try {
+      // first move from the field_data_taxonomyextra table
+      $sql = "
+      INSERT INTO {field_data_taxonomy_vocabulary_$vid}
+      (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_data_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_data_taxonomyextra WHERE bundle = 'chado_library'";
+      db_query($sql);
+  
+      // next move from the field_revision_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_revision_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_revision_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_revision_taxonomyextra WHERE bundle = 'chado_library'";
+      db_query($sql);
+    }
+    catch (\PDOException $e) {
+      $error = $e->getMessage();
+      throw new DrupalUpdateException('Could not move library taxonomy terms: '. $error);
+    }
+  }
 }
 }

+ 24 - 17
tripal_organism/includes/tripal_organism.chado_node.inc

@@ -62,28 +62,35 @@ function tripal_organism_node_info() {
  * @ingroup tripal_organism
  * @ingroup tripal_organism
  */
  */
 function chado_organism_node_access($node, $op, $account) {
 function chado_organism_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_organism content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_organism content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_organism') {
+    if ($op == 'create') {
+      if (!user_access('create chado_organism', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_organism content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_organism', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_organism content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_organism', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_organism', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 3 - 2
tripal_organism/theme/tripal_organism/tripal_organism_base.tpl.php

@@ -29,7 +29,8 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Genus', 
     'data' => 'Genus', 
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   '<i>' . $organism->genus . '</i>'
   '<i>' . $organism->genus . '</i>'
 );
 );
@@ -62,7 +63,7 @@ $rows[] = array(
 );
 );
 
 
 // allow site admins to see the organism ID
 // allow site admins to see the organism ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Organism ID
   // Organism ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 39 - 3
tripal_organism/tripal_organism.install

@@ -127,9 +127,8 @@ function tripal_organism_add_cvterms() {
 /**
 /**
  * This is the required update for tripal_organism when upgrading from Drupal core API 6.x.
  * This is the required update for tripal_organism when upgrading from Drupal core API 6.x.
  *
  *
- * @ingroup tripal_organism
  */
  */
-function tripal_organism_update_7000() {
+function tripal_organism_update_7200() {
 
 
   // add the new organism_property vocabulary
   // add the new organism_property vocabulary
   // We cannot use the Tripal API calls in the 7000 update 
   // We cannot use the Tripal API calls in the 7000 update 
@@ -148,4 +147,41 @@ function tripal_organism_update_7000() {
     $error = $e->getMessage();
     $error = $e->getMessage();
     throw new DrupalUpdateException('Failed to add organism_property vocabulary: '. $error);
     throw new DrupalUpdateException('Failed to add organism_property vocabulary: '. $error);
   }
   }
-}
+  
+
+  // During the upgrade from D6 to D7 the vocabulary terms assigned to organisms were
+  // copied to the field_data_taxonomyextra table rather than to the correct
+  // field_data_taxonomy_vocabulary_[vid] table. We'll move them.
+  $vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE name = 'Organism'")->fetchField();
+  if ($vid) {
+    try {
+      // first move from the field_data_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_data_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_data_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_data_taxonomyextra WHERE bundle = 'chado_organism'";
+      db_query($sql);
+
+      // next move from the field_revision_taxonomyextra table
+      $sql = "
+        INSERT INTO {field_revision_taxonomy_vocabulary_$vid}
+          (entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomy_vocabulary_" . $vid. "_tid)
+        (SELECT entity_type, bundle, deleted, entity_id, revision_id, language, delta, taxonomyextra_tid
+         FROM field_revision_taxonomyextra
+         WHERE bundle = 'chado_feature')
+      ";
+      db_query($sql);
+      $sql = "DELETE FROM field_revision_taxonomyextra WHERE bundle = 'chado_organism'";
+      db_query($sql);
+    }
+    catch (\PDOException $e) {
+      $error = $e->getMessage();
+      throw new DrupalUpdateException('Could not move organism taxonomy terms: '. $error);
+    }
+  }
+}

+ 1 - 1
tripal_phenotype/tripal_phenotype.views_default.inc

@@ -41,7 +41,7 @@ function tripal_phenotype_defaultview_admin_phenotypes() {
   $handler->display->display_options['title'] = 'Phenotypes';
   $handler->display->display_options['title'] = 'Phenotypes';
   $handler->display->display_options['use_more_always'] = FALSE;
   $handler->display->display_options['use_more_always'] = FALSE;
   $handler->display->display_options['access']['type'] = 'perm';
   $handler->display->display_options['access']['type'] = 'perm';
-  $handler->display->display_options['access']['perm'] = 'access administration pages';
+  $handler->display->display_options['access']['perm'] = 'administer tripal';
   $handler->display->display_options['cache']['type'] = 'none';
   $handler->display->display_options['cache']['type'] = 'none';
   $handler->display->display_options['query']['type'] = 'views_query';
   $handler->display->display_options['query']['type'] = 'views_query';
   $handler->display->display_options['exposed_form']['type'] = 'basic';
   $handler->display->display_options['exposed_form']['type'] = 'basic';

+ 24 - 17
tripal_project/includes/tripal_project.chado_node.inc

@@ -427,28 +427,35 @@ function chado_project_load($nodes) {
  */
  */
 function chado_project_node_access($node, $op, $account) {
 function chado_project_node_access($node, $op, $account) {
 
 
-  if ($op == 'create') {
-    if (!user_access('create chado_projects content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_projects content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_project') {
+    if ($op == 'create') {
+      if (!user_access('create chado_project', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_projects content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_project', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_projects content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_project', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_project', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 3 - 2
tripal_project/theme/tripal_project/tripal_project_base.tpl.php

@@ -41,12 +41,13 @@ $rows = array();
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Project Name',
     'data' => 'Project Name',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $project->name
   $project->name
 );
 );
 // allow site admins to see the feature ID
 // allow site admins to see the feature ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Project ID
   // Project ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 1 - 2
tripal_project/tripal_project.install

@@ -129,9 +129,8 @@ function tripal_project_add_cvterms() {
 /**
 /**
  * This is the required update for tripal_project when upgrading from Drupal core API 6.x.
  * This is the required update for tripal_project when upgrading from Drupal core API 6.x.
  *
  *
- * @ingroup tripal_project
  */
  */
-function tripal_project_update_7000() {
+function tripal_project_update_7200() {
   
   
   // add the project_property CV
   // add the project_property CV
   try {
   try {

+ 24 - 18
tripal_pub/includes/tripal_pub.chado_node.inc

@@ -528,29 +528,35 @@ function chado_pub_validate_check_duplicate($title, $pyear, $series_name, $cvter
  * @ingroup tripal_pub
  * @ingroup tripal_pub
  */
  */
 function chado_pub_node_access($node, $op, $account) {
 function chado_pub_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_pub content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-
-  if ($op == 'update') {
-    if (!user_access('edit chado_pub content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_pub') {
+    if ($op == 'create') {
+      if (!user_access('create chado_pub', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_pub content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_pub', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_pub content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_pub', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_pub', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 9 - 4
tripal_pub/theme/tripal_pub/pub_types/conference_proceedings.inc

@@ -26,7 +26,8 @@ else {
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Title',
     'data' => 'Title',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $title,
   $title,
 );
 );
@@ -96,14 +97,18 @@ $rows[] = array(
   htmlspecialchars($citation->value)
   htmlspecialchars($citation->value)
 );
 );
 // allow site admins to see the pub ID
 // allow site admins to see the pub ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Pub ID
   // Pub ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(
       'data' => 'Pub ID',
       'data' => 'Pub ID',
-      'header' => TRUE
+      'header' => TRUE,
+      'class' => 'tripal-site-admin-only-table-row',
+    ),
+    array(
+      'data' => $pub->pub_id,
+      'class' => 'tripal-site-admin-only-table-row',
     ),
     ),
-    $pub->pub_id
   );
   );
 }
 }
 // Is Obsolete Row
 // Is Obsolete Row

+ 9 - 4
tripal_pub/theme/tripal_pub/pub_types/journal_article.inc

@@ -26,7 +26,8 @@ else {
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Title',
     'data' => 'Title',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $title,
   $title,
 );
 );
@@ -96,14 +97,18 @@ $rows[] = array(
   htmlspecialchars($citation->value)
   htmlspecialchars($citation->value)
 );
 );
 // allow site admins to see the pub ID
 // allow site admins to see the pub ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Pub ID
   // Pub ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(
       'data' => 'Pub ID',
       'data' => 'Pub ID',
-      'header' => TRUE
+      'header' => TRUE,
+      'class' => 'tripal-site-admin-only-table-row',
+    ),
+    array(
+      'data' => $pub->pub_id,
+      'class' => 'tripal-site-admin-only-table-row',
     ),
     ),
-    $pub->pub_id
   );
   );
 }
 }
 // Is Obsolete Row
 // Is Obsolete Row

+ 9 - 4
tripal_pub/theme/tripal_pub/pub_types/patent.inc

@@ -26,7 +26,8 @@ else {
 $rows[] = array(
 $rows[] = array(
   array(
   array(
     'data' => 'Title',
     'data' => 'Title',
-    'header' => TRUE
+    'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $title,
   $title,
 );
 );
@@ -72,14 +73,18 @@ $rows[] = array(
   htmlspecialchars($citation->value)
   htmlspecialchars($citation->value)
 );
 );
 // allow site admins to see the pub ID
 // allow site admins to see the pub ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // Pub ID
   // Pub ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(
       'data' => 'Pub ID',
       'data' => 'Pub ID',
-      'header' => TRUE
+      'header' => TRUE,
+      'class' => 'tripal-site-admin-only-table-row',
+    ),
+    array(
+      'data' => $pub->pub_id,
+      'class' => 'tripal-site-admin-only-table-row',
     ),
     ),
-    $pub->pub_id
   );
   );
 }
 }
 // Is Obsolete Row
 // Is Obsolete Row

+ 3 - 2
tripal_pub/theme/tripal_pub/tripal_pub_base.tpl.php

@@ -129,7 +129,8 @@ else {
   $rows[] = array(
   $rows[] = array(
     array(
     array(
       'data' => 'Title',
       'data' => 'Title',
-      'header' => TRUE
+      'header' => TRUE,
+      'width' => '20%',
     ),
     ),
     $title,
     $title,
   );
   );
@@ -199,7 +200,7 @@ else {
     htmlspecialchars($citation->value)
     htmlspecialchars($citation->value)
   );
   );
   // allow site admins to see the pub ID
   // allow site admins to see the pub ID
-  if (user_access('access administration pages')) {
+  if (user_access('administer tripal')) {
     // Pub ID
     // Pub ID
     $rows[] = array(
     $rows[] = array(
       array(
       array(

+ 1 - 2
tripal_pub/tripal_pub.install

@@ -243,9 +243,8 @@ function tripal_pub_add_cvterms() {
 /**
 /**
  * This is the required update for tripal_contact when upgrading from Drupal core API 6.x.
  * This is the required update for tripal_contact when upgrading from Drupal core API 6.x.
  *
  *
- * @ingroup tripal_pub
  */
  */
-function tripal_pub_update_7000() {
+function tripal_pub_update_7200() {
 
 
   // add the new pub_relationship_types vocabulary
   // add the new pub_relationship_types vocabulary
   // We cannot use the Tripal API calls in the 7000 update 
   // We cannot use the Tripal API calls in the 7000 update 

+ 2 - 1
tripal_stock/theme/tripal_stock/tripal_stock_base.tpl.php

@@ -27,6 +27,7 @@ $rows[] = array(
   array(
   array(
     'data' => 'Name',
     'data' => 'Name',
     'header' => TRUE,
     'header' => TRUE,
+    'width' => '20%',
   ),
   ),
   $stock->name
   $stock->name
 );
 );
@@ -60,7 +61,7 @@ $rows[] = array(
   $organism
   $organism
 );
 );
 // allow site admins to see the stock ID
 // allow site admins to see the stock ID
-if (user_access('access administration pages')) {
+if (user_access('administer tripal')) {
   // stock ID
   // stock ID
   $rows[] = array(
   $rows[] = array(
     array(
     array(

+ 1 - 1
tripal_stock/theme/tripal_stock/tripal_stock_properties.tpl.php

@@ -36,7 +36,7 @@ if(count($properties) > 0){
   foreach ($properties as $property){
   foreach ($properties as $property){
     $property = tripal_core_expand_chado_vars($property,'field','stockprop.value');
     $property = tripal_core_expand_chado_vars($property,'field','stockprop.value');
     $rows[] = array(
     $rows[] = array(
-      ucfirst(preg_replace('/_/', ' ', $property->type_id->name)),
+      array('data' => ucfirst(preg_replace('/_/', ' ', $property->type_id->name)), 'width' => '20%'),
       urldecode($property->value)
       urldecode($property->value)
     );
     );
   }
   }

+ 8 - 8
tripal_stock/theme/tripal_stock/tripal_stock_relationships.tpl.php

@@ -54,10 +54,10 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
         }
         }
         $rows[] = array(
         $rows[] = array(
-          $stock_name, 
-          $object->record->object_id->uniquename,
-          $organism_name,
-          $object->record->object_id->type_id->name,
+          array('data' => $stock_name, 'width' => '30%'),
+          array('data' => $object->record->object_id->uniquename, 'width' => '30%'),
+          array('data' => $organism_name, 'width' => '30%'),
+          array('data' => $object->record->object_id->type_id->name, 'width' => '10%'),
         ); 
         ); 
        } 
        } 
        // the $table array contains the headers and rows array as well as other
        // the $table array contains the headers and rows array as well as other
@@ -112,10 +112,10 @@ if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
           $organism_name = l("<i>" . $organism->genus . " " . $organism->species . "</i>", "node/" . $organism->nid, array('html' => TRUE));
         }
         }
         $rows[] = array(
         $rows[] = array(
-          $stock_name, 
-          $subject->record->subject_id->uniquename,
-          $organism_name,
-          $subject->record->subject_id->type_id->name,
+          array('data' => $stock_name, 'width' => '30%'),
+          array('data' => $subject->record->subject_id->uniquename, 'width' => '30%'),
+          array('data' => $organism_name, 'width' => '30%'),
+          array('data' =>$subject->record->subject_id->type_id->name, 'width' => '10%'),
         ); 
         ); 
        } 
        } 
        // the $table array contains the headers and rows array as well as other
        // the $table array contains the headers and rows array as well as other

+ 24 - 17
tripal_stock/tripal_stock.module

@@ -178,28 +178,35 @@ function tripal_stock_permission() {
  * @ingroup tripal_stock
  * @ingroup tripal_stock
  */
  */
 function chado_stock_node_access($node, $op, $account) {
 function chado_stock_node_access($node, $op, $account) {
-  if ($op == 'create') {
-    if (!user_access('create chado_stock content', $account)) {
-      return FALSE;
-    }
-    return TRUE;
+  $node_type = $node;
+  if (is_object($node)) {
+    $node_type = $node->type;
   }
   }
-  if ($op == 'update') {
-    if (!user_access('edit chado_stock content', $account)) {
-      return FALSE;
+  
+  if($node_type == 'chado_stock') {
+    if ($op == 'create') {
+      if (!user_access('create chado_stock', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+      return NODE_ACCESS_ALLOW;
     }
     }
-  }
-  if ($op == 'delete') {
-    if (!user_access('delete chado_stock content', $account)) {
-      return FALSE;
+    if ($op == 'update') {
+      if (!user_access('edit chado_stock', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
-  }
-  if ($op == 'view') {
-    if (!user_access('access chado_stock content', $account)) {
-      return FALSE;
+    if ($op == 'delete') {
+      if (!user_access('delete chado_stock', $account)) {
+        return NODE_ACCESS_DENY;
+      }
+    }
+    if ($op == 'view') {
+      if (!user_access('access chado_stock', $account)) {
+        return NODE_ACCESS_DENY;
+      }
     }
     }
+    return NODE_ACCESS_IGNORE;
   }
   }
-  return NULL;
 }
 }
 
 
 /**
 /**

+ 1 - 2
tripal_views/tripal_views.install

@@ -133,9 +133,8 @@ function tripal_views_update_6040() {
  *   - Add relationship_only field to tripal_views_join
  *   - Add relationship_only field to tripal_views_join
  *   - Add relationship_handler field to tripal_views_join
  *   - Add relationship_handler field to tripal_views_join
  *
  *
- * @ingroup tripal_views
  */
  */
-function tripal_views_update_7020() {
+function tripal_views_update_7200() {
 
 
   // Add relationship_handler to tripal_views_join
   // Add relationship_handler to tripal_views_join
   db_add_field(
   db_add_field(