|  | @@ -237,6 +237,33 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +  // BASE ARRAYDESIGN TABLE
 | 
	
		
			
				|  |  | +  if ($table_name == 'arraydesign') {
 | 
	
		
			
				|  |  | +    $field_name = 'ncit__technology_platform';
 | 
	
		
			
				|  |  | +    $field_type = 'schema__additional_type';
 | 
	
		
			
				|  |  | +    $info[$field_name] = array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'type' => $field_type,
 | 
	
		
			
				|  |  | +      'cardinality' => 1,
 | 
	
		
			
				|  |  | +      'locked' => FALSE,
 | 
	
		
			
				|  |  | +      'storage' => array(
 | 
	
		
			
				|  |  | +        'type' => 'field_chado_storage',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    $field_name = 'efo__substrate_type';
 | 
	
		
			
				|  |  | +    $field_type = 'schema__additional_type';
 | 
	
		
			
				|  |  | +    $info[$field_name] = array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'type' => $field_type,
 | 
	
		
			
				|  |  | +      'cardinality' => 1,
 | 
	
		
			
				|  |  | +      'locked' => FALSE,
 | 
	
		
			
				|  |  | +      'storage' => array(
 | 
	
		
			
				|  |  | +        'type' => 'field_chado_storage',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // BASE ORGANISM_ID
 | 
	
		
			
				|  |  |    if ($table_name != 'organism' and
 | 
	
	
		
			
				|  | @@ -268,6 +295,19 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  if ($table_name == 'arraydesign') {
 | 
	
		
			
				|  |  | +    $field_name = 'efo__array_manufacturer';
 | 
	
		
			
				|  |  | +    $field_type = 'local__contact';
 | 
	
		
			
				|  |  | +    $info[$field_name] = array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'type' => $field_type,
 | 
	
		
			
				|  |  | +      'cardinality' => 1,
 | 
	
		
			
				|  |  | +      'locked' => FALSE,
 | 
	
		
			
				|  |  | +      'storage' => array(
 | 
	
		
			
				|  |  | +        'type' => 'field_chado_storage',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // BASE ORGANISM_ID
 | 
	
		
			
				|  |  |    if ($table_name == 'cvterm') {
 | 
	
	
		
			
				|  | @@ -477,6 +517,27 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 | 
	
		
			
				|  |  |          'type' => 'field_chado_storage',
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +  // For the pub_id field in the base table.
 | 
	
		
			
				|  |  | +  $schema = chado_get_schema($table_name);
 | 
	
		
			
				|  |  | +  if (array_key_exists('pub_id', $schema['fields'])) {
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    // Remove the schema__publication added by the
 | 
	
		
			
				|  |  | +    // tripal_chado_bunde_instnaces_info_base function.
 | 
	
		
			
				|  |  | +    unset($info['schema__publication']);
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    $field_name = 'schema__publication_single';
 | 
	
		
			
				|  |  | +    $field_type = 'schema__publication';
 | 
	
		
			
				|  |  | +    $info[$field_name] = array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'type' => $field_type,
 | 
	
		
			
				|  |  | +      'cardinality' => 1,
 | 
	
		
			
				|  |  | +      'locked' => FALSE,
 | 
	
		
			
				|  |  | +      'storage' => array(
 | 
	
		
			
				|  |  | +        'type' => 'field_chado_storage',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  |    } 
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -1135,6 +1196,16 @@ function tripal_chado_bundle_instances_info_base(&$info, $entity_type, $bundle,
 | 
	
		
			
				|  |  |          $base_info['widget']['type'] = 'text_textfield';
 | 
	
		
			
				|  |  |          $base_info['settings']['text_processing'] = '0';
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | +      if ($column_name == 'platformtype_id') {
 | 
	
		
			
				|  |  | +        $base_info['label'] = 'Platform type';
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if ($column_name == 'substratetype_id') {
 | 
	
		
			
				|  |  | +        $base_info['label'] = 'Substrate Type';
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if ($column_name == 'manufacturer_id') {
 | 
	
		
			
				|  |  | +        $base_info['label'] = 'Manufacturer';
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      $info[$field_name] = $base_info;
 | 
	
	
		
			
				|  | @@ -1217,6 +1288,82 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +  if ($table_name == 'arraydesign') {
 | 
	
		
			
				|  |  | +    $field_name = 'ncit__technology_platform';
 | 
	
		
			
				|  |  | +    $default_vocab = '';
 | 
	
		
			
				|  |  | +    $parent_term = '';
 | 
	
		
			
				|  |  | +    $description = 'Select the platform type.';
 | 
	
		
			
				|  |  | +    $info[$field_name] =  array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'entity_type' => $entity_type,
 | 
	
		
			
				|  |  | +      'bundle' => $bundle->name,
 | 
	
		
			
				|  |  | +      'label' => 'Platform Type',
 | 
	
		
			
				|  |  | +      'description' => $description,
 | 
	
		
			
				|  |  | +      'required' => TRUE,
 | 
	
		
			
				|  |  | +      'settings' => array(
 | 
	
		
			
				|  |  | +        'auto_attach' => TRUE,
 | 
	
		
			
				|  |  | +        'chado_table' => $table_name,
 | 
	
		
			
				|  |  | +        'chado_column' => 'platformtype_id',
 | 
	
		
			
				|  |  | +        'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'vocabulary' => $default_vocab,
 | 
	
		
			
				|  |  | +        'parent_term' => $parent_term,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'NCIT',
 | 
	
		
			
				|  |  | +        'term_name' => 'Technology Platform',
 | 
	
		
			
				|  |  | +        'term_accession' => 'C45378',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'widget' => array(
 | 
	
		
			
				|  |  | +        'type' => 'schema__additional_type_widget',
 | 
	
		
			
				|  |  | +        'settings' => array(
 | 
	
		
			
				|  |  | +          'display_label' => 1,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'display' => array(
 | 
	
		
			
				|  |  | +        'default' => array(
 | 
	
		
			
				|  |  | +          'label' => 'inline',
 | 
	
		
			
				|  |  | +          'type' => 'schema__additional_type_formatter',
 | 
	
		
			
				|  |  | +          'settings' => array(),
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    $field_name = 'efo__substrate_type';
 | 
	
		
			
				|  |  | +    $default_vocab = '';
 | 
	
		
			
				|  |  | +    $parent_term = '';
 | 
	
		
			
				|  |  | +    $description = 'Select the substrate type.';
 | 
	
		
			
				|  |  | +    $info[$field_name] =  array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'entity_type' => $entity_type,
 | 
	
		
			
				|  |  | +      'bundle' => $bundle->name,
 | 
	
		
			
				|  |  | +      'label' => 'Substrate Type',
 | 
	
		
			
				|  |  | +      'description' => $description,
 | 
	
		
			
				|  |  | +      'required' => FALSE,
 | 
	
		
			
				|  |  | +      'settings' => array(
 | 
	
		
			
				|  |  | +        'auto_attach' => TRUE,
 | 
	
		
			
				|  |  | +        'chado_table' => $table_name,
 | 
	
		
			
				|  |  | +        'chado_column' => 'substratetype_id',
 | 
	
		
			
				|  |  | +        'base_table' => $table_name,
 | 
	
		
			
				|  |  | +        'vocabulary' => $default_vocab,
 | 
	
		
			
				|  |  | +        'parent_term' => $parent_term,
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'EFO',
 | 
	
		
			
				|  |  | +        'term_name' => 'substrate type',
 | 
	
		
			
				|  |  | +        'term_accession' => '0005522',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'widget' => array(
 | 
	
		
			
				|  |  | +        'type' => 'schema__additional_type_widget',
 | 
	
		
			
				|  |  | +        'settings' => array(
 | 
	
		
			
				|  |  | +          'display_label' => 1,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'display' => array(
 | 
	
		
			
				|  |  | +        'default' => array(
 | 
	
		
			
				|  |  | +          'label' => 'inline',
 | 
	
		
			
				|  |  | +          'type' => 'schema__additional_type_formatter',
 | 
	
		
			
				|  |  | +          'settings' => array(),
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // BASE ORGANISM_ID
 | 
	
		
			
				|  |  |      if ($table_name != 'organism' and
 | 
	
	
		
			
				|  | @@ -1271,7 +1418,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |        'entity_type' => $entity_type,
 | 
	
		
			
				|  |  |        'bundle' => $bundle->name,
 | 
	
		
			
				|  |  |        'label' => 'Contact',
 | 
	
		
			
				|  |  | -      'description' => 'An indviddual or organization that serves as a contact for this record.',
 | 
	
		
			
				|  |  | +      'description' => 'An indvidual or organization that serves as a contact for this record.',
 | 
	
		
			
				|  |  |        'required' => FALSE,
 | 
	
		
			
				|  |  |        'settings' => array(
 | 
	
		
			
				|  |  |          'auto_attach' => FALSE,
 | 
	
	
		
			
				|  | @@ -1294,6 +1441,40 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +  if ($table_name == 'arraydesign') {
 | 
	
		
			
				|  |  | +    $field_name = 'efo__array_manufacturer';
 | 
	
		
			
				|  |  | +    $field_type = 'local__contact';
 | 
	
		
			
				|  |  | +    $info[$field_name] = array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'entity_type' => $entity_type,
 | 
	
		
			
				|  |  | +      'bundle' => $bundle->name,
 | 
	
		
			
				|  |  | +      'label' => 'Manufacturer',
 | 
	
		
			
				|  |  | +      'description' => 'A manufacturer\'s contact details',
 | 
	
		
			
				|  |  | +      'required' => TRUE,
 | 
	
		
			
				|  |  | +      'settings' => array(
 | 
	
		
			
				|  |  | +        'auto_attach' => FALSE,
 | 
	
		
			
				|  |  | +        'chado_table' => 'arraydesign',
 | 
	
		
			
				|  |  | +        'chado_column' => 'manufacturer_id',
 | 
	
		
			
				|  |  | +        'base_table' => 'arraydesign',
 | 
	
		
			
				|  |  | +        'term_vocabulary' => 'EFO',
 | 
	
		
			
				|  |  | +        'term_name' => 'aarray manufacturer',
 | 
	
		
			
				|  |  | +        'term_accession' => '0001728',
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'widget' => array(
 | 
	
		
			
				|  |  | +        'type' => 'local__contact_widget',
 | 
	
		
			
				|  |  | +        'settings' => array(
 | 
	
		
			
				|  |  | +          'display_label' => 1,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'display' => array(
 | 
	
		
			
				|  |  | +        'default' => array(
 | 
	
		
			
				|  |  | +          'label' => 'inline',
 | 
	
		
			
				|  |  | +          'type' => 'local__contact_formatter',
 | 
	
		
			
				|  |  | +          'settings' => array(),
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // BASE CVTERM
 | 
	
		
			
				|  |  |    if ($table_name == 'cvterm') {
 | 
	
	
		
			
				|  | @@ -1718,7 +1899,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    // PROTOCOL FIELD
 | 
	
		
			
				|  |  | -   if ($table_name != 'protocol' and
 | 
	
		
			
				|  |  | +  if ($table_name != 'protocol' and
 | 
	
		
			
				|  |  |      (array_key_exists('protocol_id', $schema['fields']))) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      $field_name = 'sep__protocol';
 | 
	
	
		
			
				|  | @@ -1756,6 +1937,43 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |        ),
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    } 
 | 
	
		
			
				|  |  | +  // pub_id field in table.
 | 
	
		
			
				|  |  | +  $schema = chado_get_schema($table_name);
 | 
	
		
			
				|  |  | +  if (array_key_exists('pub_id', $schema['fields'])) {
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    // Remove the schema__publication added by the 
 | 
	
		
			
				|  |  | +    // tripal_chado_bunde_instnaces_info_base function.
 | 
	
		
			
				|  |  | +    unset($info['schema__publication']);
 | 
	
		
			
				|  |  | +      
 | 
	
		
			
				|  |  | +    $field_name = 'schema__publication_single';
 | 
	
		
			
				|  |  | +    $info[$field_name] =  array(
 | 
	
		
			
				|  |  | +      'field_name' => $field_name,
 | 
	
		
			
				|  |  | +      'entity_type' => $entity_type,
 | 
	
		
			
				|  |  | +      'bundle' => $bundle->name,
 | 
	
		
			
				|  |  | +      'label' => 'Publication',
 | 
	
		
			
				|  |  | +      'description' => 'This record has been referenced or is sourced from these publications.',
 | 
	
		
			
				|  |  | +      'required' => FALSE,
 | 
	
		
			
				|  |  | +      'settings' => array(
 | 
	
		
			
				|  |  | +        'auto_attach' => TRUE,
 | 
	
		
			
				|  |  | +        'chado_table' => $table_name,
 | 
	
		
			
				|  |  | +        'chado_column' => 'pub_id',
 | 
	
		
			
				|  |  | +        'base_table' => $table_name,
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'widget' => array(
 | 
	
		
			
				|  |  | +        'type' => 'schema__publication_widget',
 | 
	
		
			
				|  |  | +        'settings' => array(
 | 
	
		
			
				|  |  | +          'display_label' => 1,
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +      'display' => array(
 | 
	
		
			
				|  |  | +        'default' => array(
 | 
	
		
			
				|  |  | +          'label' => 'hidden',
 | 
	
		
			
				|  |  | +          'type' => 'schema__publication_formatter',
 | 
	
		
			
				|  |  | +          'settings' => array(),
 | 
	
		
			
				|  |  | +        ),
 | 
	
		
			
				|  |  | +      ),
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  | +  } 
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -2194,7 +2412,6 @@ function tripal_chado_bundle_instances_info_linker(&$info, $entity_type, $bundle
 | 
	
		
			
				|  |  |      );
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    // PUBLICATIONS
 | 
	
		
			
				|  |  |    $pub_table = $table_name . '_pub';
 | 
	
		
			
				|  |  |    if (chado_table_exists($pub_table)) {
 |