diff --git a/controllers/AircraftTypeGroups.php b/controllers/AircraftTypeGroups.php
new file mode 100644
index 0000000..d35aba7
--- /dev/null
+++ b/controllers/AircraftTypeGroups.php
@@ -0,0 +1,17 @@
+
+ = e(trans('backend::lang.form.create')) ?>
+
+ = e(trans('backend::lang.list.delete_selected')) ?>
+
+
diff --git a/controllers/aircrafttypegroups/config_form.yaml b/controllers/aircrafttypegroups/config_form.yaml
new file mode 100644
index 0000000..f8c6829
--- /dev/null
+++ b/controllers/aircrafttypegroups/config_form.yaml
@@ -0,0 +1,10 @@
+name: AircraftTypeGroups
+form: $/germanairlinesva/fleet/models/aircrafttypegroup/fields.yaml
+modelClass: GermanAirlinesVa\Fleet\Models\AircraftTypeGroup
+defaultRedirect: germanairlinesva/fleet/aircrafttypegroups
+create:
+ redirect: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
+ redirectClose: germanairlinesva/fleet/aircrafttypegroups
+update:
+ redirect: germanairlinesva/fleet/aircrafttypegroups
+ redirectClose: germanairlinesva/fleet/aircrafttypegroups
diff --git a/controllers/aircrafttypegroups/config_list.yaml b/controllers/aircrafttypegroups/config_list.yaml
new file mode 100644
index 0000000..0cca711
--- /dev/null
+++ b/controllers/aircrafttypegroups/config_list.yaml
@@ -0,0 +1,12 @@
+list: $/germanairlinesva/fleet/models/aircrafttypegroup/columns.yaml
+modelClass: GermanAirlinesVa\Fleet\Models\AircraftTypeGroup
+title: AircraftTypeGroups
+noRecordsMessage: 'backend::lang.list.no_records'
+showSetup: true
+showCheckboxes: true
+recordsPerPage: 20
+toolbar:
+ buttons: list_toolbar
+ search:
+ prompt: 'backend::lang.list.search_prompt'
+recordUrl: 'germanairlinesva/fleet/aircrafttypegroups/update/:id'
diff --git a/controllers/aircrafttypegroups/create.htm b/controllers/aircrafttypegroups/create.htm
new file mode 100644
index 0000000..34eca1a
--- /dev/null
+++ b/controllers/aircrafttypegroups/create.htm
@@ -0,0 +1,46 @@
+
+
+
+
+fatalError): ?>
+
+ = Form::open(['class' => 'layout']) ?>
+
+
+ = $this->formRender() ?>
+
+
+
+
+ = Form::close() ?>
+
+
+ = e(trans($this->fatalError)) ?>
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
\ No newline at end of file
diff --git a/controllers/aircrafttypegroups/index.htm b/controllers/aircrafttypegroups/index.htm
new file mode 100644
index 0000000..ea43a36
--- /dev/null
+++ b/controllers/aircrafttypegroups/index.htm
@@ -0,0 +1 @@
+= $this->listRender() ?>
diff --git a/controllers/aircrafttypegroups/preview.htm b/controllers/aircrafttypegroups/preview.htm
new file mode 100644
index 0000000..c8fcf6b
--- /dev/null
+++ b/controllers/aircrafttypegroups/preview.htm
@@ -0,0 +1,22 @@
+
+
+
+
+fatalError): ?>
+
+
+ = $this->formRenderPreview() ?>
+
+
+
+ = e($this->fatalError) ?>
+
+
+
+
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
+
\ No newline at end of file
diff --git a/controllers/aircrafttypegroups/update.htm b/controllers/aircrafttypegroups/update.htm
new file mode 100644
index 0000000..5d3abd8
--- /dev/null
+++ b/controllers/aircrafttypegroups/update.htm
@@ -0,0 +1,54 @@
+
+
+
+
+fatalError): ?>
+
+ = Form::open(['class' => 'layout']) ?>
+
+
+ = $this->formRender() ?>
+
+
+
+ = Form::close() ?>
+
+
+ = e(trans($this->fatalError)) ?>
+ = e(trans('backend::lang.form.return_to_list')) ?>
+
\ No newline at end of file
diff --git a/lang/en/lang.php b/lang/en/lang.php
index 9cb9e2e..9892a97 100644
--- a/lang/en/lang.php
+++ b/lang/en/lang.php
@@ -15,5 +15,6 @@
'manufacturers' => 'Aircraft Manufacturers',
'types' => 'Aircraft Types',
'aircrafts' => 'Aircrafts',
+ 'groups' => 'Aircraft Type Groups',
],
];
\ No newline at end of file
diff --git a/models/Aircraft.php b/models/Aircraft.php
index c367dc4..948c728 100644
--- a/models/Aircraft.php
+++ b/models/Aircraft.php
@@ -18,7 +18,6 @@ class Aircraft extends Model
/**
* @var string The database table used by the model.
*/
- //public $table = 'germanairlinesva_fleet_aircrafts';
public $table = 'aircrafts';
protected $connection = 'germanairlinesva_fleet';
diff --git a/models/AircraftManufacturer.php b/models/AircraftManufacturer.php
index 1476d05..9e3ee86 100644
--- a/models/AircraftManufacturer.php
+++ b/models/AircraftManufacturer.php
@@ -18,7 +18,6 @@ class AircraftManufacturer extends Model
/**
* @var string The database table used by the model.
*/
- // public $table = 'germanairlinesva_fleet_aircraft_manufacturers';
public $table = 'aircraft_manufacturers';
protected $connection = 'germanairlinesva_fleet';
diff --git a/models/AircraftType.php b/models/AircraftType.php
index 57ae90a..317b650 100644
--- a/models/AircraftType.php
+++ b/models/AircraftType.php
@@ -18,7 +18,6 @@ class AircraftType extends Model
/**
* @var string The database table used by the model.
*/
- // public $table = 'germanairlinesva_fleet_aircraft_types';
public $table = 'aircraft_types';
protected $connection = 'germanairlinesva_fleet';
@@ -31,6 +30,10 @@ class AircraftType extends Model
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
];
+ public $belongsToMany = [
+ 'aircraft_type_groups' => 'GermanAirlinesVa\Fleet\Models\AircraftTypeGroup',
+ ];
+
public $hasMany = [
'aircrafts' => 'GermanAirlinesVa\Fleet\Models\Aircraft',
];
diff --git a/models/AircraftTypeGroup.php b/models/AircraftTypeGroup.php
new file mode 100644
index 0000000..6ab4f57
--- /dev/null
+++ b/models/AircraftTypeGroup.php
@@ -0,0 +1,32 @@
+ 'GermanAirlinesVa\Fleet\Models\AircraftType',
+ ];
+}
diff --git a/models/aircrafttype/fields.yaml b/models/aircrafttype/fields.yaml
index b254cd5..38c3c4e 100644
--- a/models/aircrafttype/fields.yaml
+++ b/models/aircrafttype/fields.yaml
@@ -1,137 +1,145 @@
tabs:
- fields:
- aircraft_manufacturer:
- label: Manufacturer
- nameFrom: name
- descriptionFrom: description
- span: auto
- required: 1
- type: relation
- tab: Operational
- typerating_id:
- label: Typerating
- span: auto
- required: 1
- type: number
- tab: Operational
- only_charter:
- label: 'Charter Only'
- span: auto
- required: 1
- type: switch
- tab: Operational
- type:
- label: Type
- span: auto
- required: 1
- type: text
- tab: Operational
- simbrief_type:
- label: 'SimBrief Type'
- span: auto
- required: 1
- type: text
- tab: Operational
- dom:
- label: DOM
- span: auto
- required: 1
- type: number
- tab: Weights
- mpld:
- label: 'Max Payload'
- span: auto
- required: 1
- type: number
- tab: Weights
- mzfm:
- label: 'Max ZFM'
- span: auto
- required: 1
- type: number
- tab: Weights
- fuel_capacity:
- label: 'Fuel Capacity'
- span: auto
- required: 1
- type: number
- tab: Weights
- mtom:
- label: 'Max TOM'
- span: auto
- required: 1
- type: number
- tab: Weights
- mlam:
- label: 'Max LAM'
- span: auto
- required: 1
- type: number
- tab: Weights
- description:
- label: Description
- size: large
- span: auto
- required: 1
- type: richeditor
- tab: Informational
- wingspan:
- label: Wingspan
- span: auto
- required: 1
- type: text
- tab: Informational
- length:
- label: Length
- span: auto
- required: 1
- type: text
- tab: Informational
- cruise_speed:
- label: 'Cruise Speed'
- span: auto
- required: 1
- type: text
- tab: Informational
- range:
- label: Range
- span: auto
- required: 1
- type: text
- tab: Informational
- engines:
- label: Engines
- span: auto
- required: 1
- type: text
- tab: Informational
- max_fl:
- label: 'Max FL'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_flight_crew:
- label: 'Flight Crew'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_cabin_crew:
- label: 'Cabin Crew'
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_passengers:
- label: Passengers
- span: auto
- required: 1
- type: number
- tab: Informational
- capacity_cargo:
- label: Cargo
- span: auto
- required: 1
- type: number
- tab: Informational
+ fields:
+ aircraft_manufacturer:
+ label: Manufacturer
+ nameFrom: name
+ descriptionFrom: description
+ span: auto
+ required: 1
+ type: relation
+ tab: Operational
+ typerating_id:
+ label: Typerating
+ span: auto
+ required: 1
+ type: number
+ tab: Operational
+ only_charter:
+ label: 'Charter Only'
+ span: auto
+ required: 1
+ type: switch
+ tab: Operational
+ type:
+ label: Type
+ span: auto
+ required: 1
+ type: text
+ tab: Operational
+ simbrief_type:
+ label: 'SimBrief Type'
+ span: auto
+ required: 1
+ type: text
+ tab: Operational
+ aircraft_type_groups:
+ label: 'Aircraft Type Groups'
+ nameFrom: comment
+ descriptionFrom: description
+ span: auto
+ required: 1
+ type: relation
+ tab: Operational
+ dom:
+ label: DOM
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mpld:
+ label: 'Max Payload'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mzfm:
+ label: 'Max ZFM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ fuel_capacity:
+ label: 'Fuel Capacity'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mtom:
+ label: 'Max TOM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ mlam:
+ label: 'Max LAM'
+ span: auto
+ required: 1
+ type: number
+ tab: Weights
+ description:
+ label: Description
+ size: large
+ span: auto
+ required: 1
+ type: richeditor
+ tab: Informational
+ wingspan:
+ label: Wingspan
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ length:
+ label: Length
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ cruise_speed:
+ label: 'Cruise Speed'
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ range:
+ label: Range
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ engines:
+ label: Engines
+ span: auto
+ required: 1
+ type: text
+ tab: Informational
+ max_fl:
+ label: 'Max FL'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_flight_crew:
+ label: 'Flight Crew'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_cabin_crew:
+ label: 'Cabin Crew'
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_passengers:
+ label: Passengers
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
+ capacity_cargo:
+ label: Cargo
+ span: auto
+ required: 1
+ type: number
+ tab: Informational
diff --git a/models/aircrafttypegroup/columns.yaml b/models/aircrafttypegroup/columns.yaml
new file mode 100644
index 0000000..bc8fedc
--- /dev/null
+++ b/models/aircrafttypegroup/columns.yaml
@@ -0,0 +1,7 @@
+columns:
+ id:
+ label: id
+ type: number
+ comment:
+ label: comment
+ type: text
diff --git a/models/aircrafttypegroup/fields.yaml b/models/aircrafttypegroup/fields.yaml
new file mode 100644
index 0000000..e4804c2
--- /dev/null
+++ b/models/aircrafttypegroup/fields.yaml
@@ -0,0 +1,5 @@
+fields:
+ comment:
+ label: Comment
+ span: auto
+ type: text
diff --git a/plugin.yaml b/plugin.yaml
index 0fcf967..1a23f18 100644
--- a/plugin.yaml
+++ b/plugin.yaml
@@ -22,3 +22,7 @@ navigation:
label: 'germanairlinesva.fleet::lang.menu.aircrafts'
url: germanairlinesva/fleet/aircrafts
icon: icon-plane
+ side-menu-item4:
+ label: 'germanairlinesva.fleet::lang.menu.groups'
+ url: germanairlinesva/fleet/aircrafttypegroups
+ icon: icon-group
diff --git a/updates/builder_table_create_aircraft_manufacturers.php b/updates/builder_table_create_aircraft_manufacturers.php
index 7c0b314..e3c4c35 100644
--- a/updates/builder_table_create_aircraft_manufacturers.php
+++ b/updates/builder_table_create_aircraft_manufacturers.php
@@ -9,7 +9,6 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('aircraft_manufacturers', function ($table) {
- //Schema::create('germanairlinesva_fleet_aircraft_manufacturers', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->string('name');
@@ -21,6 +20,5 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
public function down()
{
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_manufacturers');
- //Schema::dropIfExists('germanairlinesva_fleet_aircraft_manufacturers');
}
}
diff --git a/updates/builder_table_create_aircraft_type_aircraft_type_group.php b/updates/builder_table_create_aircraft_type_aircraft_type_group.php
new file mode 100644
index 0000000..1c9d954
--- /dev/null
+++ b/updates/builder_table_create_aircraft_type_aircraft_type_group.php
@@ -0,0 +1,31 @@
+create('aircraft_type_aircraft_type_group', function ($table) {
+ $table->engine = 'InnoDB';
+ $table->bigInteger('aircraft_type_id')->unsigned();
+ $table
+ ->foreign('aircraft_type_id')
+ ->references('id')
+ ->on('aircraft_types');
+ $table->bigInteger('aircraft_type_group_id')->unsigned();
+ $table
+ ->foreign('aircraft_type_group_id')
+ ->references('id')
+ ->on('aircraft_type_groups');
+ });
+ }
+
+ public function down()
+ {
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
+ Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_aircraft_type_group');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
+ }
+}
diff --git a/updates/builder_table_create_aircraft_type_groups.php b/updates/builder_table_create_aircraft_type_groups.php
new file mode 100644
index 0000000..3416ea5
--- /dev/null
+++ b/updates/builder_table_create_aircraft_type_groups.php
@@ -0,0 +1,21 @@
+create('aircraft_type_groups', function ($table) {
+ $table->engine = 'InnoDB';
+ $table->bigIncrements('id')->unsigned();
+ $table->string('comment');
+ });
+ }
+
+ public function down()
+ {
+ Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_type_groups');
+ }
+}
diff --git a/updates/builder_table_create_aircraft_types.php b/updates/builder_table_create_aircraft_types.php
index 13b87c8..735ba38 100644
--- a/updates/builder_table_create_aircraft_types.php
+++ b/updates/builder_table_create_aircraft_types.php
@@ -9,7 +9,6 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('aircraft_types', function ($table) {
- //Schema::create('germanairlinesva_fleet_aircraft_types', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('aircraft_manufacturer_id')->unsigned();
@@ -47,7 +46,8 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
public function down()
{
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_types');
- //Schema::dropIfExists('germanairlinesva_fleet_aircraft_types');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
}
}
diff --git a/updates/builder_table_create_aircrafts copy.php b/updates/builder_table_create_aircrafts.php
similarity index 89%
rename from updates/builder_table_create_aircrafts copy.php
rename to updates/builder_table_create_aircrafts.php
index de5e086..ee2a06f 100644
--- a/updates/builder_table_create_aircrafts copy.php
+++ b/updates/builder_table_create_aircrafts.php
@@ -8,7 +8,6 @@ class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('aircrafts', function ($table) {
- //Schema::create('germanairlinesva_fleet_aircrafts', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('aircraft_type_id')->unsigned();
@@ -58,7 +57,8 @@ class BuilderTableCreateGermanAirlinesVaFleetAircrafts extends Migration
public function down()
{
+ Schema::connection('germanairlinesva_fleet')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
- //Schema::dropIfExists('germanairlinesva_fleet_aircrafts');
+ Schema::connection('germanairlinesva_fleet')->enableForeignKeyConstraints();
}
}
diff --git a/updates/version.yaml b/updates/version.yaml
index 12b6161..01c9b62 100644
--- a/updates/version.yaml
+++ b/updates/version.yaml
@@ -7,3 +7,7 @@
- builder_table_create_aircraft_types.php
- 'Created table aircrafts'
- builder_table_create_aircrafts.php
+ - 'Created table aircraft_type_groups'
+ - builder_table_create_aircraft_type_groups.php
+ - 'Created table aircraft_type_aircraft_type_group'
+ - builder_table_create_aircraft_type_aircraft_type_group.php