Issue #3092756: Add quantity fields to medical logs

This commit is contained in:
Michael Stenta 2020-04-21 14:46:28 -04:00
parent 81daf61664
commit ff88327dac
3 changed files with 78 additions and 10 deletions

View File

@ -1061,7 +1061,7 @@ function farm_livestock_field_default_field_instances() {
'module' => 'file', 'module' => 'file',
'settings' => array(), 'settings' => array(),
'type' => 'file_table', 'type' => 'file_table',
'weight' => 8, 'weight' => 10,
), ),
), ),
'entity_type' => 'log', 'entity_type' => 'log',
@ -1138,7 +1138,7 @@ function farm_livestock_field_default_field_instances() {
'colorbox_node_style_first' => 'large', 'colorbox_node_style_first' => 'large',
), ),
'type' => 'colorbox', 'type' => 'colorbox',
'weight' => 7, 'weight' => 9,
), ),
), ),
'entity_type' => 'log', 'entity_type' => 'log',
@ -1182,7 +1182,7 @@ function farm_livestock_field_default_field_instances() {
'view_mode' => 'full', 'view_mode' => 'full',
), ),
'type' => 'field_collection_fields', 'type' => 'field_collection_fields',
'weight' => 2, 'weight' => 4,
), ),
), ),
'entity_type' => 'log', 'entity_type' => 'log',
@ -1280,7 +1280,7 @@ function farm_livestock_field_default_field_instances() {
'view_mode' => 'full', 'view_mode' => 'full',
), ),
'type' => 'field_collection_fields', 'type' => 'field_collection_fields',
'weight' => 1, 'weight' => 2,
), ),
), ),
'entity_type' => 'log', 'entity_type' => 'log',
@ -1329,7 +1329,40 @@ function farm_livestock_field_default_field_instances() {
'rows' => 5, 'rows' => 5,
), ),
'type' => 'text_textarea', 'type' => 'text_textarea',
'weight' => 2, 'weight' => -6,
),
);
// Exported field_instance: 'log-farm_medical-field_farm_quantity'.
$field_instances['log-farm_medical-field_farm_quantity'] = array(
'bundle' => 'farm_medical',
'default_value' => NULL,
'deleted' => 0,
'description' => 'Optionally, use this quantity field to record an observed quantity.',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'field_collection',
'settings' => array(
'view_mode' => 'full',
),
'type' => 'field_collection_fields',
'weight' => 3,
),
),
'entity_type' => 'log',
'field_name' => 'field_farm_quantity',
'label' => 'Quantity',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'field_collection',
'settings' => array(),
'type' => 'field_collection_embed',
'weight' => 14,
), ),
); );
@ -1398,8 +1431,10 @@ function farm_livestock_field_default_field_instances() {
t('Nickname(s)'); t('Nickname(s)');
t('Notes'); t('Notes');
t('Optionally assign this task to one or more people.'); t('Optionally assign this task to one or more people.');
t('Optionally, use this quantity field to record an observed quantity.');
t('Parent(s)'); t('Parent(s)');
t('Photos'); t('Photos');
t('Quantity');
t('Reference the animals that were born. Alternatively, if you just want to increase the head count of another animal record, add an inventory adjustment below.'); t('Reference the animals that were born. Alternatively, if you just want to increase the head count of another animal record, add an inventory adjustment below.');
t('Sex'); t('Sex');
t('Species/breed'); t('Species/breed');

View File

@ -50,7 +50,7 @@ function farm_livestock_field_group_info() {
$field_group->parent_name = 'group_farm_general'; $field_group->parent_name = 'group_farm_general';
$field_group->data = array( $field_group->data = array(
'label' => 'Assignment', 'label' => 'Assignment',
'weight' => '5', 'weight' => '-3',
'children' => array( 'children' => array(
0 => 'field_farm_log_owner', 0 => 'field_farm_log_owner',
), ),
@ -108,7 +108,7 @@ function farm_livestock_field_group_info() {
$field_group->parent_name = 'group_farm_general'; $field_group->parent_name = 'group_farm_general';
$field_group->data = array( $field_group->data = array(
'label' => 'Category', 'label' => 'Category',
'weight' => '4', 'weight' => '-4',
'children' => array( 'children' => array(
0 => 'field_farm_log_category', 0 => 'field_farm_log_category',
), ),
@ -220,7 +220,7 @@ function farm_livestock_field_group_info() {
$field_group->parent_name = 'group_farm_tabs'; $field_group->parent_name = 'group_farm_tabs';
$field_group->data = array( $field_group->data = array(
'label' => 'Files', 'label' => 'Files',
'weight' => '5', 'weight' => '6',
'children' => array( 'children' => array(
0 => 'field_farm_files', 0 => 'field_farm_files',
1 => 'field_farm_images', 1 => 'field_farm_images',
@ -458,7 +458,7 @@ function farm_livestock_field_group_info() {
$field_group->parent_name = 'group_farm_tabs'; $field_group->parent_name = 'group_farm_tabs';
$field_group->data = array( $field_group->data = array(
'label' => 'Inventory', 'label' => 'Inventory',
'weight' => '4', 'weight' => '5',
'children' => array( 'children' => array(
0 => 'field_farm_inventory', 0 => 'field_farm_inventory',
), ),
@ -537,7 +537,7 @@ function farm_livestock_field_group_info() {
$field_group->parent_name = 'group_farm_tabs'; $field_group->parent_name = 'group_farm_tabs';
$field_group->data = array( $field_group->data = array(
'label' => 'Location', 'label' => 'Location',
'weight' => '2', 'weight' => '1',
'children' => array( 'children' => array(
0 => 'field_farm_movement', 0 => 'field_farm_movement',
), ),
@ -578,6 +578,34 @@ function farm_livestock_field_group_info() {
); );
$field_groups['group_farm_mother|log|farm_birth|form'] = $field_group; $field_groups['group_farm_mother|log|farm_birth|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_quantity|log|farm_medical|form';
$field_group->group_name = 'group_farm_quantity';
$field_group->entity_type = 'log';
$field_group->bundle = 'farm_medical';
$field_group->mode = 'form';
$field_group->parent_name = 'group_farm_tabs';
$field_group->data = array(
'label' => 'Quantity',
'weight' => '4',
'children' => array(
0 => 'field_farm_quantity',
),
'format_type' => 'fieldset',
'format_settings' => array(
'formatter' => 'collapsible',
'instance_settings' => array(
'description' => '',
'classes' => 'group-farm-quantity field-group-fieldset',
'required_fields' => 1,
'id' => '',
),
),
);
$field_groups['group_farm_quantity|log|farm_medical|form'] = $field_group;
$field_group = new stdClass(); $field_group = new stdClass();
$field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
$field_group->api_version = 1; $field_group->api_version = 1;
@ -673,6 +701,7 @@ function farm_livestock_field_group_info() {
1 => 'group_farm_general', 1 => 'group_farm_general',
2 => 'group_farm_inventory', 2 => 'group_farm_inventory',
3 => 'group_farm_location', 3 => 'group_farm_location',
4 => 'group_farm_quantity',
), ),
'format_type' => 'field_group_easy_responsive_tabs_nav', 'format_type' => 'field_group_easy_responsive_tabs_nav',
'format_settings' => array( 'format_settings' => array(
@ -708,6 +737,7 @@ function farm_livestock_field_group_info() {
t('Lineage'); t('Lineage');
t('Location'); t('Location');
t('Mother'); t('Mother');
t('Quantity');
t('Tabs'); t('Tabs');
return $field_groups; return $field_groups;

View File

@ -20,6 +20,7 @@ dependencies[] = farm_map
dependencies[] = farm_map_geofield dependencies[] = farm_map_geofield
dependencies[] = farm_map_kml dependencies[] = farm_map_kml
dependencies[] = farm_movement dependencies[] = farm_movement
dependencies[] = farm_quantity
dependencies[] = farm_quantity_log dependencies[] = farm_quantity_log
dependencies[] = farm_term dependencies[] = farm_term
dependencies[] = features dependencies[] = features
@ -76,6 +77,7 @@ features[field_group][] = group_farm_lineage|farm_asset|animal|form
features[field_group][] = group_farm_location|log|farm_birth|form features[field_group][] = group_farm_location|log|farm_birth|form
features[field_group][] = group_farm_location|log|farm_medical|form features[field_group][] = group_farm_location|log|farm_medical|form
features[field_group][] = group_farm_mother|log|farm_birth|form features[field_group][] = group_farm_mother|log|farm_birth|form
features[field_group][] = group_farm_quantity|log|farm_medical|form
features[field_group][] = group_farm_tabs|farm_asset|animal|form features[field_group][] = group_farm_tabs|farm_asset|animal|form
features[field_group][] = group_farm_tabs|log|farm_birth|form features[field_group][] = group_farm_tabs|log|farm_birth|form
features[field_group][] = group_farm_tabs|log|farm_medical|form features[field_group][] = group_farm_tabs|log|farm_medical|form
@ -115,6 +117,7 @@ features[field_instance][] = log-farm_medical-field_farm_log_category
features[field_instance][] = log-farm_medical-field_farm_log_owner features[field_instance][] = log-farm_medical-field_farm_log_owner
features[field_instance][] = log-farm_medical-field_farm_movement features[field_instance][] = log-farm_medical-field_farm_movement
features[field_instance][] = log-farm_medical-field_farm_notes features[field_instance][] = log-farm_medical-field_farm_notes
features[field_instance][] = log-farm_medical-field_farm_quantity
features[field_instance][] = log-farm_medical-field_farm_vet features[field_instance][] = log-farm_medical-field_farm_vet
features[log_type][] = farm_birth features[log_type][] = farm_birth
features[log_type][] = farm_medical features[log_type][] = farm_medical