clean install

This commit is contained in:
2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 changed files with 3555714 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
id: animal
label: Animal
description: ''
workflow: asset_default
new_revision: true

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
- farm_id_tag
id: brand
label: Brand
bundles:
- animal

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
- farm_id_tag
id: ear_tag
label: Ear tag
bundles:
- animal

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
- farm_id_tag
id: leg_band
label: Leg band
bundles:
- animal

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
- farm_id_tag
id: tattoo
label: Tattoo
bundles:
- animal

View File

@@ -0,0 +1,60 @@
langcode: en
status: true
dependencies:
config:
- asset.type.animal
- core.entity_view_mode.asset.map_popup
module:
- options
- text
id: asset.animal.map_popup
targetEntityType: asset
bundle: animal
mode: map_popup
content:
animal_type:
label: inline
type: entity_reference_label
weight: 1
settings:
link: false
region: content
third_party_settings: { }
flag:
label: inline
type: list_default
weight: 0
region: content
settings: { }
third_party_settings: { }
location:
type: entity_reference_label
weight: 3
region: content
label: inline
settings:
link: true
third_party_settings: { }
notes:
label: inline
type: text_default
weight: 2
region: content
settings: { }
third_party_settings: { }
hidden:
birthdate: true
data: true
file: true
geometry: true
id_tag: true
image: true
intrinsic_geometry: true
is_castrated: true
is_fixed: true
is_location: true
nickname: true
parent: true
sex: true
status: true
uid: true

View File

@@ -0,0 +1,11 @@
langcode: en
status: true
dependencies:
enforced:
module:
- farm_animal
id: asset_animal
color: orange
conditions:
asset_type:
- animal

View File

@@ -0,0 +1,9 @@
name: Animal asset
description: Adds an Animal asset type.
type: module
package: farmOS Assets
core_version_requirement: ^10
dependencies:
- farm:asset
- farm:farm_animal_type
- farm:farm_entity

View File

@@ -0,0 +1,92 @@
<?php
namespace Drupal\farm_animal\Plugin\Asset\AssetType;
use Drupal\farm_entity\Plugin\Asset\AssetType\FarmAssetType;
/**
* Provides the animal asset type.
*
* @AssetType(
* id = "animal",
* label = @Translation("Animal"),
* )
*/
class Animal extends FarmAssetType {
/**
* {@inheritdoc}
*/
public function buildFieldDefinitions() {
$fields = parent::buildFieldDefinitions();
$field_info = [
'animal_type' => [
'type' => 'entity_reference',
'label' => $this->t('Species/breed'),
'description' => $this->t("Enter this animal asset's species/breed."),
'target_type' => 'taxonomy_term',
'target_bundle' => 'animal_type',
'auto_create' => TRUE,
'required' => TRUE,
'weight' => [
'form' => -90,
'view' => -50,
],
],
'birthdate' => [
'type' => 'timestamp',
'label' => $this->t('Birthdate'),
'weight' => [
'form' => 15,
'view' => -35,
],
],
'is_castrated' => [
'type' => 'boolean',
'label' => $this->t('Castrated'),
'description' => $this->t('Has this animal been castrated?'),
'weight' => [
'form' => 26,
],
'view_display_options' => [
'label' => 'inline',
'type' => 'hideable_boolean',
'settings' => [
'format' => 'default',
'format_custom_false' => '',
'format_custom_true' => '',
'hide_if_false' => TRUE,
],
'weight' => -25,
],
],
'nickname' => [
'type' => 'string',
'label' => $this->t('Nicknames'),
'description' => $this->t('List any nicknames of this animal.'),
'multiple' => TRUE,
'weight' => [
'form' => 10,
'view' => -40,
],
],
'sex' => [
'type' => 'list_string',
'label' => $this->t('Sex'),
'allowed_values' => [
'F' => $this->t('Female'),
'M' => $this->t('Male'),
],
'weight' => [
'form' => 20,
'view' => -30,
],
],
];
foreach ($field_info as $name => $info) {
$fields[$name] = $this->farmFieldFactory->bundleFieldDefinition($info);
}
return $fields;
}
}