Move Animal birthdate, sex, castrated, and nickname fields to new Individual fieldset. Make sex field optional.

This commit is contained in:
Michael Stenta 2017-10-16 08:02:20 -04:00
parent cc534563ad
commit c79cc63c59
3 changed files with 50 additions and 19 deletions

View File

@ -43,7 +43,7 @@ function farm_livestock_field_default_field_instances() {
'display_label' => 1,
),
'type' => 'options_onoff',
'weight' => -5,
'weight' => 12,
),
);
@ -77,7 +77,7 @@ function farm_livestock_field_default_field_instances() {
'size' => 60,
),
'type' => 'taxonomy_autocomplete',
'weight' => -7,
'weight' => -8,
),
);
@ -111,7 +111,7 @@ function farm_livestock_field_default_field_instances() {
'size' => 60,
),
'type' => 'text_textfield',
'weight' => 9,
'weight' => 13,
),
);
@ -133,7 +133,7 @@ function farm_livestock_field_default_field_instances() {
'entity_type' => 'farm_asset',
'field_name' => 'field_farm_animal_sex',
'label' => 'Sex',
'required' => 1,
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
@ -142,7 +142,7 @@ function farm_livestock_field_default_field_instances() {
'module' => 'options',
'settings' => array(),
'type' => 'options_select',
'weight' => -6,
'weight' => 11,
),
);
@ -175,7 +175,7 @@ function farm_livestock_field_default_field_instances() {
'module' => 'field_collection',
'settings' => array(),
'type' => 'field_collection_embed',
'weight' => 8,
'weight' => 13,
),
);
@ -209,7 +209,7 @@ function farm_livestock_field_default_field_instances() {
'size' => 60,
),
'type' => 'taxonomy_autocomplete',
'weight' => -8,
'weight' => -9,
),
);
@ -240,7 +240,7 @@ function farm_livestock_field_default_field_instances() {
'label' => 'Date of birth',
'required' => 0,
'settings' => array(
'default_value' => 'now',
'default_value' => 'blank',
'default_value2' => 'same',
'default_value_code' => '',
'default_value_code2' => '',
@ -253,13 +253,13 @@ function farm_livestock_field_default_field_instances() {
'increment' => 15,
'input_format' => 'M j Y - g:i:sa',
'input_format_custom' => '',
'label_position' => 'above',
'label_position' => 'within',
'no_fieldset' => 1,
'text_parts' => array(),
'year_range' => '-10:+3',
),
'type' => 'date_select',
'weight' => -9,
'weight' => 10,
),
);

View File

@ -137,13 +137,11 @@ function farm_livestock_field_group_info() {
'label' => 'General',
'weight' => '1',
'children' => array(
0 => 'field_farm_animal_castrated',
1 => 'field_farm_animal_group',
2 => 'field_farm_animal_sex',
3 => 'field_farm_animal_type',
4 => 'field_farm_date',
5 => 'field_farm_description',
6 => 'name',
0 => 'field_farm_animal_group',
1 => 'field_farm_animal_type',
2 => 'field_farm_description',
3 => 'name',
4 => 'group_farm_individual',
),
'format_type' => 'field_group_easy_responsive_tabs_nav_item',
'format_settings' => array(
@ -202,8 +200,7 @@ function farm_livestock_field_group_info() {
'label' => 'Identification',
'weight' => '2',
'children' => array(
0 => 'field_farm_animal_nicknames',
1 => 'field_farm_animal_tag',
0 => 'field_farm_animal_tag',
),
'format_type' => 'field_group_easy_responsive_tabs_nav_item',
'format_settings' => array(
@ -216,6 +213,38 @@ function farm_livestock_field_group_info() {
);
$field_groups['group_farm_id|farm_asset|animal|form'] = $field_group;
$field_group = new stdClass();
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
$field_group->api_version = 1;
$field_group->identifier = 'group_farm_individual|farm_asset|animal|form';
$field_group->group_name = 'group_farm_individual';
$field_group->entity_type = 'farm_asset';
$field_group->bundle = 'animal';
$field_group->mode = 'form';
$field_group->parent_name = 'group_farm_general';
$field_group->data = array(
'label' => 'Individual',
'weight' => '-3',
'children' => array(
0 => 'field_farm_animal_castrated',
1 => 'field_farm_animal_nicknames',
2 => 'field_farm_animal_sex',
3 => 'field_farm_date',
),
'format_type' => 'fieldset',
'format_settings' => array(
'label' => 'Individual',
'instance_settings' => array(
'required_fields' => 1,
'id' => '',
'classes' => 'group-farm-individual field-group-fieldset',
'description' => 'If this record is for an individual animal, these fields can be used to provide more information. If this record is representing multiple animals, you may leave these blank, and define the animal head count using the "Inventory" field below.',
),
'formatter' => 'collapsed',
),
);
$field_groups['group_farm_individual|farm_asset|animal|form'] = $field_group;
$field_group = new stdClass();
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
$field_group->api_version = 1;
@ -377,6 +406,7 @@ function farm_livestock_field_group_info() {
t('Files');
t('General');
t('Identification');
t('Individual');
t('Inventory');
t('Lineage');
t('Movement');

View File

@ -53,6 +53,7 @@ features[field_group][] = group_farm_files|log|farm_medical|form
features[field_group][] = group_farm_general|farm_asset|animal|form
features[field_group][] = group_farm_general|log|farm_medical|form
features[field_group][] = group_farm_id|farm_asset|animal|form
features[field_group][] = group_farm_individual|farm_asset|animal|form
features[field_group][] = group_farm_inventory|log|farm_medical|form
features[field_group][] = group_farm_lineage|farm_asset|animal|form
features[field_group][] = group_farm_movement|log|farm_medical|form