Selaa lähdekoodia

Merge branch '7.x-3.x' of github.com:tripal/tripal into 7.x-3.x

Stephen Ficklin 8 vuotta sitten
vanhempi
commit
7716a79d11
23 muutettua tiedostoa jossa 55 lisäystä ja 46 poistoa
  1. 3 4
      tripal/includes/TripalFields/TripalField.inc
  2. 1 1
      tripal/includes/TripalFields/rdfs__type/rdfs__type.inc
  3. 31 21
      tripal/includes/tripal.fields.inc
  4. 1 1
      tripal_chado/includes/TripalFields/ChadoField.inc
  5. 1 1
      tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc
  6. 1 1
      tripal_chado/includes/TripalFields/data__accession/data__accession.inc
  7. 1 1
      tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc
  8. 1 1
      tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc
  9. 1 1
      tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc
  10. 1 1
      tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc
  11. 1 1
      tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc
  12. 1 1
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc
  13. 1 1
      tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc
  14. 1 1
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc
  15. 1 1
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc
  16. 1 1
      tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype.inc
  17. 1 1
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc
  18. 1 1
      tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name.inc
  19. 1 1
      tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc
  20. 1 1
      tripal_chado/includes/TripalFields/so__cds/so__cds.inc
  21. 1 1
      tripal_chado/includes/TripalFields/so__genotype/so__genotype.inc
  22. 1 1
      tripal_chado/includes/TripalFields/so__transcript/so__transcript.inc
  23. 1 1
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon.inc

+ 3 - 4
tripal/includes/TripalFields/TripalField.inc

@@ -41,10 +41,9 @@ class TripalField {
     'term_name' => 'Thing',
     // The unique ID (i.e. accession) of the term.
     'term_accession' => 'Thing',
-    // Set to TRUE if the site admin is allowed to change the term
-    // type. This will create form elements when editing the field instance
-    // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    // Set to TRUE if the site admin is not allowed to change the term
+    // type, otherwise the admin can change the term mapped to a field.
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal/includes/TripalFields/rdfs__type/rdfs__type.inc

@@ -72,4 +72,4 @@ class rdfs__type extends TripalField {
 
   }
 
-}
+}

+ 31 - 21
tripal/includes/tripal.fields.inc

@@ -406,13 +406,19 @@ function tripal_field_instance_settings_form_process($element, &$form_state, $fo
     'empty' => '',
   );
 
+  $description = t('All fields attached to a Tripal-based content type must
+        be associated with a controlled vocabulary term.  Please use caution
+        when changing the term for this field as other sites may expect this term
+        when querying web services.');
+  if (array_key_exists('term_fixed', $instance['settings']) and $instance['settings']['term_fixed']) {
+    $description = t('All fields attached to a Tripal-based content type must
+        be associated with a controlled vocabulary term. This field mapping is
+        required and cannot be changed');
+  }
   $element['field_term'] = array(
     '#type' => 'fieldset',
     '#title' => 'Controlled Vocabulary Term',
-    '#description' => t('All fields attached to a Tripal-based content type must
-        be associated with a controlled vocabulary term.  Please use caution
-        when changing the term for this field as other sites may expect this term
-        when querying web services.'),
+    '#description' => $description,
     '#prefix' => '<div id = "tripal-field-term-fieldset">',
     '#suffix' => '</div>',
   );
@@ -433,23 +439,27 @@ function tripal_field_instance_settings_form_process($element, &$form_state, $fo
     '#title' => 'Current Term',
     '#markup' => theme_table($table),
   );
-  $element['field_term']['new_name'] = array(
-    '#type' => 'textfield',
-    '#title' => 'Change the term',
-    // TODO: This autocomplete path should not use Chado.
-    '#autocomplete_path' => "admin/tripal/storage/chado/auto_name/cvterm/",
-  );
-  $element['field_term']['select_button'] = array(
-    '#type' => 'button',
-    '#value' => t('Lookup Term'),
-    '#name' => 'select_cvterm',
-    '#ajax' => array(
-      'callback' => "tripal_fields_select_term_form_ajax_callback",
-      'wrapper' => "tripal-field-term-fieldset",
-      'effect' => 'fade',
-      'method' => 'replace'
-    ),
-  );
+
+  // If this field mapping is fixed then don't let the user change it.
+  if (!array_key_exists('term_fixed', $instance['settings']) or $instance['settings']['term_fixed'] != TRUE) {
+    $element['field_term']['new_name'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Change the term',
+      // TODO: This autocomplete path should not use Chado.
+      '#autocomplete_path' => "admin/tripal/storage/chado/auto_name/cvterm/",
+    );
+    $element['field_term']['select_button'] = array(
+      '#type' => 'button',
+      '#value' => t('Lookup Term'),
+      '#name' => 'select_cvterm',
+      '#ajax' => array(
+        'callback' => "tripal_fields_select_term_form_ajax_callback",
+        'wrapper' => "tripal-field-term-fieldset",
+        'effect' => 'fade',
+        'method' => 'replace'
+      ),
+    );
+  }
 
   // If a new term name has been specified by the user then give some extra
   // fields to clarify the term.

+ 1 - 1
tripal_chado/includes/TripalFields/ChadoField.inc

@@ -35,7 +35,7 @@ class ChadoField extends TripalField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
     // The table in Chado that the instance maps to.
     'chado_table' => '',
     // The primary key column of hte table in Dhado.

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__contact/chado_linker__contact.inc

@@ -35,7 +35,7 @@ class chado_linker__contact extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
 

+ 1 - 1
tripal_chado/includes/TripalFields/data__accession/data__accession.inc

@@ -35,7 +35,7 @@ class data__accession extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/data__protein_sequence/data__protein_sequence.inc

@@ -34,7 +34,7 @@ class data__protein_sequence extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc

@@ -34,7 +34,7 @@ class data__sequence extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_checksum/data__sequence_checksum.inc

@@ -34,7 +34,7 @@ class data__sequence_checksum extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_coordinates/data__sequence_coordinates.inc

@@ -34,7 +34,7 @@ class data__sequence_coordinates extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/data__sequence_length/data__sequence_length.inc

@@ -35,7 +35,7 @@ class data__sequence_length extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc

@@ -39,7 +39,7 @@ class go__gene_expression extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/obi__organism/obi__organism.inc

@@ -25,7 +25,7 @@ class obi__organism extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
     // The format for display of the organism.
     'field_display_string' => '<i>[organism.genus] [organism.species]</i>',
   );

+ 1 - 1
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc

@@ -34,7 +34,7 @@ class ogi__location_on_map extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc

@@ -36,7 +36,7 @@ class sbo__database_cross_reference extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__phenotype/sbo__phenotype.inc

@@ -36,7 +36,7 @@ class sbo__phenotype extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -34,7 +34,7 @@ class sbo__relationship extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/schema__alternate_name/schema__alternate_name.inc

@@ -34,7 +34,7 @@ class schema__alternate_name extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc

@@ -35,7 +35,7 @@ class schema__publication extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
 

+ 1 - 1
tripal_chado/includes/TripalFields/so__cds/so__cds.inc

@@ -34,7 +34,7 @@ class so__cds extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/so__genotype/so__genotype.inc

@@ -35,7 +35,7 @@ class so__genotype extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/so__transcript/so__transcript.inc

@@ -34,7 +34,7 @@ class so__transcript extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.

+ 1 - 1
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon.inc

@@ -34,7 +34,7 @@ class taxrank__infraspecific_taxon extends ChadoField {
     // Set to TRUE if the site admin is allowed to change the term
     // type. This will create form elements when editing the field instance
     // to allow the site admin to change the term settings above.
-    'term_fixed' => TRUE,
+    'term_fixed' => FALSE,
   );
 
   // The default widget for this field.