Forms, Menu, DB

This commit is contained in:
Gogs 2021-06-03 10:06:09 +02:00
parent f4bff143a2
commit 42a9e2c8c7
11 changed files with 205 additions and 37 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# TODO
- Type Creat Form localization
- Remove design phase databaase connection in Schema and Model

View File

@ -1,13 +1,18 @@
<?php return [
'plugin' => [
'name' => 'Fleet',
'description' => '',
],
'aircraft' => [
'manufacturers' => [
'name' => 'Name',
'link' => 'Link',
'history' => 'History',
'plugin' => [
'name' => 'Fleet',
'description' => '',
],
],
];
'aircraft' => [
'manufacturers' => [
'name' => 'Name',
'link' => 'Link',
'history' => 'History',
],
],
'menu' => [
'main' => 'GA Fleet',
'manufacturers' => 'Aircraft Manufacturers',
'types' => 'Aircraft Types',
],
];

View File

@ -18,7 +18,9 @@ class AircraftManufacturer extends Model
/**
* @var string The database table used by the model.
*/
public $table = 'germanairlinesva_fleet_aircraft_manufacturers';
// public $table = 'germanairlinesva_fleet_aircraft_manufacturers';
public $table = 'aircraft_manufacturers';
protected $connection = 'germanairlinesva_fleet';
/**
* @var array Validation rules

View File

@ -18,7 +18,9 @@ class AircraftType extends Model
/**
* @var string The database table used by the model.
*/
public $table = 'germanairlinesva_fleet_aircraft_types';
// public $table = 'germanairlinesva_fleet_aircraft_types';
public $table = 'aircraft_types';
protected $connection = 'germanairlinesva_fleet';
/**
* @var array Validation rules

View File

@ -2,13 +2,16 @@ fields:
name:
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.name'
span: auto
required: 1
type: text
link:
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.link'
span: auto
required: 1
type: text
history:
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.history'
size: ''
size: large
span: auto
type: textarea
required: 1
type: richeditor

View File

@ -8,6 +8,9 @@ columns:
typerating_id:
label: typerating_id
type: number
only_charter:
label: only_charter
type: text
type:
label: type
type: text

View File

@ -1,7 +1,141 @@
fields:
aircraft_manufacturer:
label: Relation
nameFrom: name
descriptionFrom: description
span: auto
type: relation
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'
options:
'No': 'no'
'Yes': 'yes'
showSearch: true
span: auto
required: 1
type: dropdown
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

View File

@ -1,7 +0,0 @@
fields:
manufacturer:
label: Relation
nameFrom: name
descriptionFrom: description
span: auto
type: relation

View File

@ -4,3 +4,17 @@ plugin:
author: 'German Airlines VA'
icon: oc-icon-plane
homepage: ''
navigation:
main-menu-item:
label: 'germanairlinesva.fleet::lang.menu.main'
url: /
icon: icon-plane
sideMenu:
side-menu-item:
label: 'germanairlinesva.fleet::lang.menu.manufacturers'
url: /germanairlinesva/fleet/aircraftmanufacturers
icon: icon-wrench
side-menu-item2:
label: 'germanairlinesva.fleet::lang.menu.types'
url: germanairlinesva/fleet/aircrafttypes
icon: icon-paper-plane

View File

@ -8,8 +8,8 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('ga_aircraft_manufacturers', function ($table) {
//Schema::create('ga_aircraft_manufacturers', function ($table) {
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');
@ -20,7 +20,7 @@ class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
public function down()
{
Schema::connection('germanairlinesva_fleet')->dropIfExists('ga_aircraft_manufacturers');
//Schema::dropIfExists('ga_aircraft_manufacturers');
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_manufacturers');
//Schema::dropIfExists('germanairlinesva_fleet_aircraft_manufacturers');
}
}

View File

@ -8,12 +8,20 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_fleet')->create('ga_aircraft_types', function ($table) {
//Schema::create('ga_aircraft_types', function ($table) {
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();
$table
->foreign('aircraft_manufacturer_id')
->references('id')
->on('aircraft_manufacturers');
$table->bigInteger('typerating_id')->unsigned();
//$table
// ->foreign('typerating_manufacturer_id')
// ->references('id')
// ->on('typeratings');
$table->enum('only_charter', ['yes', 'no']);
$table->string('type');
$table->text('description');
@ -39,7 +47,7 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
public function down()
{
Schema::connection('germanairlinesva_fleet')->dropIfExists('ga_aircraft_types');
//Schema::dropIfExists('ga_aircraft_types');
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircraft_types');
//Schema::dropIfExists('germanairlinesva_fleet_aircraft_types');
}
}