Types refactor and localization

This commit is contained in:
Gogs 2021-06-03 22:15:32 +02:00
parent 126e966792
commit a665efb204
13 changed files with 123 additions and 73 deletions

View File

@ -27,7 +27,3 @@
## General
- Remove design phase database connection in Schema and Model
## AircraftTypes
- Form Localization

View File

@ -3,7 +3,7 @@
use Backend\Classes\Controller;
use BackendMenu;
class AircraftTypes extends Controller
class AircraftType extends Controller
{
public $implement = ['Backend\Behaviors\ListController', 'Backend\Behaviors\FormController'];

View File

@ -1,5 +1,5 @@
<div data-control="toolbar">
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes/create') ?>" class="btn btn-primary oc-icon-plus"
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype/create') ?>" class="btn btn-primary oc-icon-plus"
><?= e(trans('backend::lang.form.create')) ?></a
>
<button

View File

@ -0,0 +1,10 @@
name: Aircraft Type
form: $/germanairlinesva/fleet/models/aircrafttype/fields.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftType
defaultRedirect: germanairlinesva/fleet/aircrafttype
create:
redirect: 'germanairlinesva/fleet/aircrafttype/update/:id'
redirectClose: germanairlinesva/fleet/aircrafttype
update:
redirect: germanairlinesva/fleet/aircrafttype
redirectClose: germanairlinesva/fleet/aircrafttype

View File

@ -1,6 +1,6 @@
list: $/germanairlinesva/fleet/models/aircrafttype/columns.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftType
title: AircraftTypes
title: Aircraft Types
noRecordsMessage: 'backend::lang.list.no_records'
showSetup: true
showCheckboxes: true
@ -9,4 +9,4 @@ toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
recordUrl: 'germanairlinesva/fleet/aircrafttypes/update/:id'
recordUrl: 'germanairlinesva/fleet/aircrafttype/update/:id'

View File

@ -1,6 +1,6 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</a></li>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>">Aircraft Types</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
@ -35,7 +35,7 @@
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?>
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>"
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>"
><?= e(trans('backend::lang.form.cancel')) ?></a
>
</span>
@ -47,7 +47,7 @@
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p>
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>" class="btn btn-default"
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>" class="btn btn-default"
><?= e(trans('backend::lang.form.return_to_list')) ?></a
>
</p>

View File

@ -1,6 +1,6 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</a></li>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>">Aircraft Types</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
@ -14,7 +14,7 @@
<?php endif ?>
<p>
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>" class="btn btn-default oc-icon-chevron-left">
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>" class="btn btn-default oc-icon-chevron-left">
<?= e(trans('backend::lang.form.return_to_list')) ?>
</a>
</p>

View File

@ -1,6 +1,6 @@
<?php Block::put('breadcrumb') ?>
<ul>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</a></li>
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>">Aircraft Types</a></li>
<li><?= e($this->pageTitle) ?></li>
</ul>
<?php Block::endPut() ?>
@ -44,7 +44,7 @@
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?>
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>"
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>"
><?= e(trans('backend::lang.form.cancel')) ?></a
>
</span>
@ -55,7 +55,7 @@
<?php else: ?>
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
<p>
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>" class="btn btn-default"
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttype') ?>" class="btn btn-default"
><?= e(trans('backend::lang.form.return_to_list')) ?></a
>
</p>

View File

@ -1,10 +0,0 @@
name: AircraftTypes
form: $/germanairlinesva/fleet/models/aircrafttype/fields.yaml
modelClass: GermanAirlinesVa\Fleet\Models\AircraftType
defaultRedirect: germanairlinesva/fleet/aircrafttypes
create:
redirect: 'germanairlinesva/fleet/aircrafttypes/update/:id'
redirectClose: germanairlinesva/fleet/aircrafttypes
update:
redirect: germanairlinesva/fleet/aircrafttypes
redirectClose: germanairlinesva/fleet/aircrafttypes

View File

@ -17,6 +17,36 @@
'aircraft_type_groups' => [
'comment' => 'Comment Identifying Aircraft Type Group',
],
'aircraft_types' => [
'tabs' => [
'operational' => 'Operational',
'informational' => 'Informational',
'weights' => 'Weights',
],
'aircraft_manufacturer' => 'Aircraft Manufacturer',
'typerating_id' => 'Typerating',
'only_charter' => 'True if Type is Charter Exclusive',
'type' => 'Aircraft Type Specifier',
'simbrief_type' => 'Aircraft Type Specifier for SimBrief',
'aircraft_type_groups' => 'Aircraft Type Group',
'dom' => 'Dry Operating Mass (kg)',
'mpld' => 'Max Payload (kg)',
'mzfm' => 'Max Zero Fuel Mass (kg)',
'fuel_capacity' => 'Fuel Capacity (kg)',
'mtom' => 'Maximum Takeoff Mass (kg)',
'mlam' => 'Maximum Landing Mass (kg)',
'description' => 'Aircraft Type Description',
'wingspan' => 'Aircraft Wingspan (m)',
'length' => 'Aircraft Length (m)',
'cruise_speed' => 'Aircraft Cruise Speed (kph)',
'range' => 'Aircraft Maximum Range (km)',
'engines' => 'Engines Installed',
'max_fl' => 'Maximum Altitude (ft)',
'capacity_flight_crew' => 'Strenght of Flight Crew',
'capacity_cabin_crew' => 'Strength of Cabin Crew',
'capacity_passengers' => 'Maximum Amount of Passengers',
'capacity_cargo' => 'Maximum amount of Cargo (kg)',
],
'menu' => [
'main' => 'GA Fleet',
'manufacturers' => 'Aircraft Manufacturers',

View File

@ -24,7 +24,31 @@ class AircraftType extends Model
/**
* @var array Validation rules
*/
public $rules = [];
public $rules = [
'aircraft_manufacturer' => 'required',
'typerating_id' => 'required',
'only_charter' => 'required',
'type' => 'required',
'simbrief_type' => 'required',
'aircraft_type_groups' => 'required',
'dom' => 'required',
'mpld' => 'required',
'mzfm' => 'required',
'fuel_capacity' => 'required',
'mtom' => 'required',
'mlam' => 'required',
'description' => 'required',
'wingspan' => 'required',
'length' => 'required',
'cruise_speed' => 'required',
'range' => 'required',
'engines' => 'required',
'max_fl' => 'required',
'capacity_flight_crew' => 'required',
'capacity_cabin_crew' => 'required',
'capacity_passengers' => 'required',
'capacity_cargo' => 'required',
];
public $belongsTo = [
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',

View File

@ -1,145 +1,145 @@
tabs:
fields:
aircraft_manufacturer:
label: Manufacturer
label: 'germanairlinesva.fleet::lang.aircraft_types.aircraft_manufacturer'
nameFrom: name
descriptionFrom: description
span: auto
required: 1
type: relation
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
typerating_id:
label: Typerating
label: 'germanairlinesva.fleet::lang.aircraft_types.typerating_id'
span: auto
required: 1
type: number
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
only_charter:
label: 'Charter Only'
label: 'germanairlinesva.fleet::lang.aircraft_types.only_charter'
span: auto
required: 1
type: switch
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
type:
label: Type
label: 'germanairlinesva.fleet::lang.aircraft_types.type'
span: auto
required: 1
type: text
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
simbrief_type:
label: 'SimBrief Type'
label: 'germanairlinesva.fleet::lang.aircraft_types.simbrief_type'
span: auto
required: 1
type: text
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
aircraft_type_groups:
label: 'Aircraft Type Groups'
label: 'germanairlinesva.fleet::lang.aircraft_types.aircraft_type_groups'
nameFrom: comment
descriptionFrom: description
span: auto
required: 1
type: relation
tab: Operational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.operational'
dom:
label: DOM
label: 'germanairlinesva.fleet::lang.aircraft_types.dom'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
mpld:
label: 'Max Payload'
label: 'germanairlinesva.fleet::lang.aircraft_types.mpld'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
mzfm:
label: 'Max ZFM'
label: 'germanairlinesva.fleet::lang.aircraft_types.mzfm'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
fuel_capacity:
label: 'Fuel Capacity'
label: 'germanairlinesva.fleet::lang.aircraft_types.fuel_capacity'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
mtom:
label: 'Max TOM'
label: 'germanairlinesva.fleet::lang.aircraft_types.mtom'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
mlam:
label: 'Max LAM'
label: 'germanairlinesva.fleet::lang.aircraft_types.mlam'
span: auto
required: 1
type: number
tab: Weights
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.weights'
description:
label: Description
label: 'germanairlinesva.fleet::lang.aircraft_types.description'
size: large
span: auto
required: 1
type: richeditor
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
wingspan:
label: Wingspan
label: 'germanairlinesva.fleet::lang.aircraft_types.wingspan'
span: auto
required: 1
type: text
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
length:
label: Length
label: 'germanairlinesva.fleet::lang.aircraft_types.length'
span: auto
required: 1
type: text
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
cruise_speed:
label: 'Cruise Speed'
label: 'germanairlinesva.fleet::lang.aircraft_types.cruise_speed'
span: auto
required: 1
type: text
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
range:
label: Range
label: 'germanairlinesva.fleet::lang.aircraft_types.range'
span: auto
required: 1
type: text
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
engines:
label: Engines
label: 'germanairlinesva.fleet::lang.aircraft_types.engines'
span: auto
required: 1
type: text
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
max_fl:
label: 'Max FL'
label: 'germanairlinesva.fleet::lang.aircraft_types.max_fl'
span: auto
required: 1
type: number
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
capacity_flight_crew:
label: 'Flight Crew'
label: 'germanairlinesva.fleet::lang.aircraft_types.capacity_flight_crew'
span: auto
required: 1
type: number
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
capacity_cabin_crew:
label: 'Cabin Crew'
label: 'germanairlinesva.fleet::lang.aircraft_types.capacity_cabin_crew'
span: auto
required: 1
type: number
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
capacity_passengers:
label: Passengers
label: 'germanairlinesva.fleet::lang.aircraft_types.capacity_passengers'
span: auto
required: 1
type: number
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'
capacity_cargo:
label: Cargo
label: 'germanairlinesva.fleet::lang.aircraft_types.capacity_cargo'
span: auto
required: 1
type: number
tab: Informational
tab: 'germanairlinesva.fleet::lang.aircraft_types.tabs.informational'