AC Form
This commit is contained in:
parent
42a9e2c8c7
commit
9fdfe9dfb1
34
README.md
34
README.md
@ -1,4 +1,32 @@
|
|||||||
# TODO
|
# Relations
|
||||||
|
|
||||||
- Type Creat Form localization
|
## AircraftManufacturers
|
||||||
- Remove design phase databaase connection in Schema and Model
|
|
||||||
|
- HasMany AircraftType
|
||||||
|
|
||||||
|
## AircraftTypes
|
||||||
|
|
||||||
|
- BelongsTo AircraftManufacturers
|
||||||
|
- **TODO** BelongsTo Typeratings (External DB)
|
||||||
|
- HasMany Aircrafts
|
||||||
|
|
||||||
|
## Aircrafts
|
||||||
|
|
||||||
|
- BelongsTo AircraftTypes
|
||||||
|
- **TODO** BelongsTo Airports (External DB, Multiple)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Todo
|
||||||
|
|
||||||
|
## General
|
||||||
|
|
||||||
|
- Remove design phase database connection in Schema and Model
|
||||||
|
|
||||||
|
## AircraftTypes
|
||||||
|
|
||||||
|
- Form Localization
|
||||||
|
|
||||||
|
## Aircrafts
|
||||||
|
|
||||||
|
- Form Localization
|
||||||
|
|||||||
17
controllers/Aircrafts.php
Normal file
17
controllers/Aircrafts.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php namespace GermanAirlinesVa\Fleet\Controllers;
|
||||||
|
|
||||||
|
use Backend\Classes\Controller;
|
||||||
|
use BackendMenu;
|
||||||
|
|
||||||
|
class Aircrafts extends Controller
|
||||||
|
{
|
||||||
|
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
|
||||||
|
|
||||||
|
public $listConfig = 'config_list.yaml';
|
||||||
|
public $formConfig = 'config_form.yaml';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
}
|
||||||
18
controllers/aircrafts/_list_toolbar.htm
Normal file
18
controllers/aircrafts/_list_toolbar.htm
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<div data-control="toolbar">
|
||||||
|
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafts/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
|
||||||
|
<button
|
||||||
|
class="btn btn-default oc-icon-trash-o"
|
||||||
|
disabled="disabled"
|
||||||
|
onclick="$(this).data('request-data', {
|
||||||
|
checked: $('.control-list').listWidget('getChecked')
|
||||||
|
})"
|
||||||
|
data-request="onDelete"
|
||||||
|
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
|
||||||
|
data-trigger-action="enable"
|
||||||
|
data-trigger=".control-list input[type=checkbox]"
|
||||||
|
data-trigger-condition="checked"
|
||||||
|
data-request-success="$(this).prop('disabled', true)"
|
||||||
|
data-stripe-load-indicator>
|
||||||
|
<?= e(trans('backend::lang.list.delete_selected')) ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
10
controllers/aircrafts/config_form.yaml
Normal file
10
controllers/aircrafts/config_form.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
name: Aircrafts
|
||||||
|
form: $/germanairlinesva/fleet/models/aircraft/fields.yaml
|
||||||
|
modelClass: GermanAirlinesVa\Fleet\Models\Aircraft
|
||||||
|
defaultRedirect: germanairlinesva/fleet/aircrafts
|
||||||
|
create:
|
||||||
|
redirect: 'germanairlinesva/fleet/aircrafts/update/:id'
|
||||||
|
redirectClose: germanairlinesva/fleet/aircrafts
|
||||||
|
update:
|
||||||
|
redirect: germanairlinesva/fleet/aircrafts
|
||||||
|
redirectClose: germanairlinesva/fleet/aircrafts
|
||||||
12
controllers/aircrafts/config_list.yaml
Normal file
12
controllers/aircrafts/config_list.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
list: $/germanairlinesva/fleet/models/aircraft/columns.yaml
|
||||||
|
modelClass: GermanAirlinesVa\Fleet\Models\Aircraft
|
||||||
|
title: Aircrafts
|
||||||
|
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/aircrafts/update/:id'
|
||||||
46
controllers/aircrafts/create.htm
Normal file
46
controllers/aircrafts/create.htm
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>">Aircrafts</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<?= Form::open(['class' => 'layout']) ?>
|
||||||
|
|
||||||
|
<div class="layout-row">
|
||||||
|
<?= $this->formRender() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-buttons">
|
||||||
|
<div class="loading-indicator-container">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
data-request="onSave"
|
||||||
|
data-hotkey="ctrl+s, cmd+s"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-primary">
|
||||||
|
<?= e(trans('backend::lang.form.create')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="close:1"
|
||||||
|
data-hotkey="ctrl+enter, cmd+enter"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-default">
|
||||||
|
<?= e(trans('backend::lang.form.create_and_close')) ?>
|
||||||
|
</button>
|
||||||
|
<span class="btn-text">
|
||||||
|
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?= Form::close() ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||||
|
<p><a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||||
|
<?php endif ?>
|
||||||
1
controllers/aircrafts/index.htm
Normal file
1
controllers/aircrafts/index.htm
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?= $this->listRender() ?>
|
||||||
22
controllers/aircrafts/preview.htm
Normal file
22
controllers/aircrafts/preview.htm
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>">Aircrafts</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<div class="form-preview">
|
||||||
|
<?= $this->formRenderPreview() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||||
|
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
54
controllers/aircrafts/update.htm
Normal file
54
controllers/aircrafts/update.htm
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php Block::put('breadcrumb') ?>
|
||||||
|
<ul>
|
||||||
|
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>">Aircrafts</a></li>
|
||||||
|
<li><?= e($this->pageTitle) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?php Block::endPut() ?>
|
||||||
|
|
||||||
|
<?php if (!$this->fatalError): ?>
|
||||||
|
|
||||||
|
<?= Form::open(['class' => 'layout']) ?>
|
||||||
|
|
||||||
|
<div class="layout-row">
|
||||||
|
<?= $this->formRender() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-buttons">
|
||||||
|
<div class="loading-indicator-container">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="redirect:0"
|
||||||
|
data-hotkey="ctrl+s, cmd+s"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-primary">
|
||||||
|
<?= e(trans('backend::lang.form.save')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
data-request="onSave"
|
||||||
|
data-request-data="close:1"
|
||||||
|
data-hotkey="ctrl+enter, cmd+enter"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||||
|
class="btn btn-default">
|
||||||
|
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="oc-icon-trash-o btn-icon danger pull-right"
|
||||||
|
data-request="onDelete"
|
||||||
|
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
|
||||||
|
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<span class="btn-text">
|
||||||
|
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= Form::close() ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||||
|
<p><a href="<?= Backend::url('germanairlinesva/fleet/aircrafts') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||||
|
<?php endif ?>
|
||||||
@ -14,5 +14,6 @@
|
|||||||
'main' => 'GA Fleet',
|
'main' => 'GA Fleet',
|
||||||
'manufacturers' => 'Aircraft Manufacturers',
|
'manufacturers' => 'Aircraft Manufacturers',
|
||||||
'types' => 'Aircraft Types',
|
'types' => 'Aircraft Types',
|
||||||
|
'aircrafts' => 'Aircrafts',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
33
models/Aircraft.php
Normal file
33
models/Aircraft.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php namespace GermanAirlinesVa\Fleet\Models;
|
||||||
|
|
||||||
|
use Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model
|
||||||
|
*/
|
||||||
|
class Aircraft extends Model
|
||||||
|
{
|
||||||
|
use \October\Rain\Database\Traits\Validation;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Disable timestamps by default.
|
||||||
|
* Remove this line if timestamps are defined in the database table.
|
||||||
|
*/
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string The database table used by the model.
|
||||||
|
*/
|
||||||
|
//public $table = 'germanairlinesva_fleet_aircrafts';
|
||||||
|
public $table = 'aircrafts';
|
||||||
|
protected $connection = 'germanairlinesva_fleet';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array Validation rules
|
||||||
|
*/
|
||||||
|
public $rules = [];
|
||||||
|
|
||||||
|
public $belongsTo = [
|
||||||
|
'aircraft_type' => 'GermanAirlinesVa\Fleet\Models\AircraftType',
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -26,4 +26,8 @@ class AircraftManufacturer extends Model
|
|||||||
* @var array Validation rules
|
* @var array Validation rules
|
||||||
*/
|
*/
|
||||||
public $rules = [];
|
public $rules = [];
|
||||||
|
|
||||||
|
public $hasMany = [
|
||||||
|
'aircraft_types' => 'GermanAirlinesVa\Fleet\Models\AircraftType',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,4 +30,8 @@ class AircraftType extends Model
|
|||||||
public $belongsTo = [
|
public $belongsTo = [
|
||||||
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public $hasMany = [
|
||||||
|
'aircrafts' => 'GermanAirlinesVa\Fleet\Models\Aircraft',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
49
models/aircraft/columns.yaml
Normal file
49
models/aircraft/columns.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
columns:
|
||||||
|
id:
|
||||||
|
label: id
|
||||||
|
type: text
|
||||||
|
aircraft_type_id:
|
||||||
|
label: aircraft_type_id
|
||||||
|
type: text
|
||||||
|
home_airport_id:
|
||||||
|
label: home_airport_id
|
||||||
|
type: text
|
||||||
|
airport_id:
|
||||||
|
label: airport_id
|
||||||
|
type: text
|
||||||
|
name:
|
||||||
|
label: name
|
||||||
|
type: text
|
||||||
|
registration:
|
||||||
|
label: registration
|
||||||
|
type: text
|
||||||
|
in_use:
|
||||||
|
label: in_use
|
||||||
|
type: text
|
||||||
|
total_miles:
|
||||||
|
label: total_miles
|
||||||
|
type: text
|
||||||
|
total_fuel:
|
||||||
|
label: total_fuel
|
||||||
|
type: text
|
||||||
|
total_flight_time:
|
||||||
|
label: total_flight_time
|
||||||
|
type: text
|
||||||
|
total_expenses:
|
||||||
|
label: total_expenses
|
||||||
|
type: text
|
||||||
|
current_check:
|
||||||
|
label: current_check
|
||||||
|
type: text
|
||||||
|
last_a_check:
|
||||||
|
label: last_a_check
|
||||||
|
type: text
|
||||||
|
last_b_check:
|
||||||
|
label: last_b_check
|
||||||
|
type: text
|
||||||
|
last_c_check:
|
||||||
|
label: last_c_check
|
||||||
|
type: text
|
||||||
|
last_d_check:
|
||||||
|
label: last_d_check
|
||||||
|
type: text
|
||||||
23
models/aircraft/fields.yaml
Normal file
23
models/aircraft/fields.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
fields:
|
||||||
|
aircraft_type:
|
||||||
|
label: Type
|
||||||
|
nameFrom: type
|
||||||
|
descriptionFrom: description
|
||||||
|
span: auto
|
||||||
|
required: 1
|
||||||
|
type: relation
|
||||||
|
registration:
|
||||||
|
label: Registration
|
||||||
|
span: auto
|
||||||
|
required: 1
|
||||||
|
type: text
|
||||||
|
name:
|
||||||
|
label: Name
|
||||||
|
span: auto
|
||||||
|
required: 1
|
||||||
|
type: text
|
||||||
|
home_airport_id:
|
||||||
|
label: 'Home Base'
|
||||||
|
span: auto
|
||||||
|
required: 1
|
||||||
|
type: number
|
||||||
@ -1,141 +1,137 @@
|
|||||||
tabs:
|
tabs:
|
||||||
fields:
|
fields:
|
||||||
aircraft_manufacturer:
|
aircraft_manufacturer:
|
||||||
label: Manufacturer
|
label: Manufacturer
|
||||||
nameFrom: name
|
nameFrom: name
|
||||||
descriptionFrom: description
|
descriptionFrom: description
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: relation
|
type: relation
|
||||||
tab: Operational
|
tab: Operational
|
||||||
typerating_id:
|
typerating_id:
|
||||||
label: Typerating
|
label: Typerating
|
||||||
span: auto
|
span: auto
|
||||||
required: 1
|
required: 1
|
||||||
type: number
|
type: number
|
||||||
tab: Operational
|
tab: Operational
|
||||||
only_charter:
|
only_charter:
|
||||||
label: 'Charter Only'
|
label: 'Charter Only'
|
||||||
options:
|
span: auto
|
||||||
'No': 'no'
|
required: 1
|
||||||
'Yes': 'yes'
|
type: switch
|
||||||
showSearch: true
|
tab: Operational
|
||||||
span: auto
|
type:
|
||||||
required: 1
|
label: Type
|
||||||
type: dropdown
|
span: auto
|
||||||
tab: Operational
|
required: 1
|
||||||
type:
|
type: text
|
||||||
label: Type
|
tab: Operational
|
||||||
span: auto
|
simbrief_type:
|
||||||
required: 1
|
label: 'SimBrief Type'
|
||||||
type: text
|
span: auto
|
||||||
tab: Operational
|
required: 1
|
||||||
simbrief_type:
|
type: text
|
||||||
label: 'SimBrief Type'
|
tab: Operational
|
||||||
span: auto
|
dom:
|
||||||
required: 1
|
label: DOM
|
||||||
type: text
|
span: auto
|
||||||
tab: Operational
|
required: 1
|
||||||
dom:
|
type: number
|
||||||
label: DOM
|
tab: Weights
|
||||||
span: auto
|
mpld:
|
||||||
required: 1
|
label: 'Max Payload'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mpld:
|
type: number
|
||||||
label: 'Max Payload'
|
tab: Weights
|
||||||
span: auto
|
mzfm:
|
||||||
required: 1
|
label: 'Max ZFM'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mzfm:
|
type: number
|
||||||
label: 'Max ZFM'
|
tab: Weights
|
||||||
span: auto
|
fuel_capacity:
|
||||||
required: 1
|
label: 'Fuel Capacity'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
fuel_capacity:
|
type: number
|
||||||
label: 'Fuel Capacity'
|
tab: Weights
|
||||||
span: auto
|
mtom:
|
||||||
required: 1
|
label: 'Max TOM'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mtom:
|
type: number
|
||||||
label: 'Max TOM'
|
tab: Weights
|
||||||
span: auto
|
mlam:
|
||||||
required: 1
|
label: 'Max LAM'
|
||||||
type: number
|
span: auto
|
||||||
tab: Weights
|
required: 1
|
||||||
mlam:
|
type: number
|
||||||
label: 'Max LAM'
|
tab: Weights
|
||||||
span: auto
|
description:
|
||||||
required: 1
|
label: Description
|
||||||
type: number
|
size: large
|
||||||
tab: Weights
|
span: auto
|
||||||
description:
|
required: 1
|
||||||
label: Description
|
type: richeditor
|
||||||
size: large
|
tab: Informational
|
||||||
span: auto
|
wingspan:
|
||||||
required: 1
|
label: Wingspan
|
||||||
type: richeditor
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
wingspan:
|
type: text
|
||||||
label: Wingspan
|
tab: Informational
|
||||||
span: auto
|
length:
|
||||||
required: 1
|
label: Length
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
length:
|
type: text
|
||||||
label: Length
|
tab: Informational
|
||||||
span: auto
|
cruise_speed:
|
||||||
required: 1
|
label: 'Cruise Speed'
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
cruise_speed:
|
type: text
|
||||||
label: 'Cruise Speed'
|
tab: Informational
|
||||||
span: auto
|
range:
|
||||||
required: 1
|
label: Range
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
range:
|
type: text
|
||||||
label: Range
|
tab: Informational
|
||||||
span: auto
|
engines:
|
||||||
required: 1
|
label: Engines
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
engines:
|
type: text
|
||||||
label: Engines
|
tab: Informational
|
||||||
span: auto
|
max_fl:
|
||||||
required: 1
|
label: 'Max FL'
|
||||||
type: text
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
max_fl:
|
type: number
|
||||||
label: 'Max FL'
|
tab: Informational
|
||||||
span: auto
|
capacity_flight_crew:
|
||||||
required: 1
|
label: 'Flight Crew'
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_flight_crew:
|
type: number
|
||||||
label: 'Flight Crew'
|
tab: Informational
|
||||||
span: auto
|
capacity_cabin_crew:
|
||||||
required: 1
|
label: 'Cabin Crew'
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_cabin_crew:
|
type: number
|
||||||
label: 'Cabin Crew'
|
tab: Informational
|
||||||
span: auto
|
capacity_passengers:
|
||||||
required: 1
|
label: Passengers
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_passengers:
|
type: number
|
||||||
label: Passengers
|
tab: Informational
|
||||||
span: auto
|
capacity_cargo:
|
||||||
required: 1
|
label: Cargo
|
||||||
type: number
|
span: auto
|
||||||
tab: Informational
|
required: 1
|
||||||
capacity_cargo:
|
type: number
|
||||||
label: Cargo
|
tab: Informational
|
||||||
span: auto
|
|
||||||
required: 1
|
|
||||||
type: number
|
|
||||||
tab: Informational
|
|
||||||
|
|||||||
@ -18,3 +18,7 @@ navigation:
|
|||||||
label: 'germanairlinesva.fleet::lang.menu.types'
|
label: 'germanairlinesva.fleet::lang.menu.types'
|
||||||
url: germanairlinesva/fleet/aircrafttypes
|
url: germanairlinesva/fleet/aircrafttypes
|
||||||
icon: icon-paper-plane
|
icon: icon-paper-plane
|
||||||
|
side-menu-item3:
|
||||||
|
label: 'germanairlinesva.fleet::lang.menu.aircrafts'
|
||||||
|
url: germanairlinesva/fleet/aircrafts
|
||||||
|
icon: icon-plane
|
||||||
|
|||||||
@ -19,10 +19,10 @@ class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
|
|||||||
->on('aircraft_manufacturers');
|
->on('aircraft_manufacturers');
|
||||||
$table->bigInteger('typerating_id')->unsigned();
|
$table->bigInteger('typerating_id')->unsigned();
|
||||||
//$table
|
//$table
|
||||||
// ->foreign('typerating_manufacturer_id')
|
// ->foreign('typerating_id')
|
||||||
// ->references('id')
|
// ->references('id')
|
||||||
// ->on('typeratings');
|
// ->on('typeratings');
|
||||||
$table->enum('only_charter', ['yes', 'no']);
|
$table->boolean('only_charter');
|
||||||
$table->string('type');
|
$table->string('type');
|
||||||
$table->text('description');
|
$table->text('description');
|
||||||
$table->string('simbrief_type');
|
$table->string('simbrief_type');
|
||||||
|
|||||||
64
updates/builder_table_create_aircrafts copy.php
Normal file
64
updates/builder_table_create_aircrafts copy.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php namespace GermanAirlinesVa\Fleet\Updates;
|
||||||
|
use DB;
|
||||||
|
use Schema;
|
||||||
|
use October\Rain\Database\Updates\Migration;
|
||||||
|
|
||||||
|
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();
|
||||||
|
$table
|
||||||
|
->foreign('aircraft_type_id')
|
||||||
|
->references('id')
|
||||||
|
->on('aircraft_types');
|
||||||
|
$table->bigInteger('home_airport_id')->unsigned();
|
||||||
|
//$table
|
||||||
|
// ->foreign('home_airport_id')
|
||||||
|
// ->references('id')
|
||||||
|
// ->on('airports');
|
||||||
|
$table
|
||||||
|
->bigInteger('airport_id')
|
||||||
|
->unsigned()
|
||||||
|
->nullable();
|
||||||
|
//$table
|
||||||
|
// ->foreign('airport_id')
|
||||||
|
// ->references('id')
|
||||||
|
// ->on('airports');
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('registration');
|
||||||
|
$table->boolean('in_use')->default(true);
|
||||||
|
$table
|
||||||
|
->double('total_miles')
|
||||||
|
->unsigned()
|
||||||
|
->default(0);
|
||||||
|
$table
|
||||||
|
->double('total_fuel')
|
||||||
|
->unsigned()
|
||||||
|
->default(0);
|
||||||
|
$table
|
||||||
|
->double('total_flight_time')
|
||||||
|
->unsigned()
|
||||||
|
->default(0);
|
||||||
|
$table
|
||||||
|
->double('total_expenses')
|
||||||
|
->unsigned()
|
||||||
|
->default(0);
|
||||||
|
$table->enum('current_check', ['a', 'b', 'c', 'd'])->nullable();
|
||||||
|
$table->datetime('last_a_check')->default(DB::raw('NOW()'));
|
||||||
|
$table->datetime('last_b_check')->default(DB::raw('NOW()'));
|
||||||
|
$table->datetime('last_c_check')->default(DB::raw('NOW()'));
|
||||||
|
$table->datetime('last_d_check')->default(DB::raw('NOW()'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::connection('germanairlinesva_fleet')->dropIfExists('aircrafts');
|
||||||
|
//Schema::dropIfExists('germanairlinesva_fleet_aircrafts');
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,3 +5,5 @@
|
|||||||
- builder_table_create_aircraft_manufacturers.php
|
- builder_table_create_aircraft_manufacturers.php
|
||||||
- 'Created table aircraft_types'
|
- 'Created table aircraft_types'
|
||||||
- builder_table_create_aircraft_types.php
|
- builder_table_create_aircraft_types.php
|
||||||
|
- 'Created table aircrafts'
|
||||||
|
- builder_table_create_aircrafts.php
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user