Initial commit
This commit is contained in:
commit
f4bff143a2
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
||||
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
||||
vendor
|
||||
11
.prettierrc
Normal file
11
.prettierrc
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": true,
|
||||
|
||||
"semi": true,
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "always",
|
||||
|
||||
"phpVersion": "7.1"
|
||||
}
|
||||
17
.vscode/settings.json
vendored
Normal file
17
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[php]":
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/vendor": true,
|
||||
"**/node_modules": true,
|
||||
"yarn.lock": true,
|
||||
"package.json": true,
|
||||
"tsconfig.json": true,
|
||||
".*": true,
|
||||
},
|
||||
}
|
||||
20
Plugin.php
Normal file
20
Plugin.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet;
|
||||
|
||||
use Config;
|
||||
use System\Classes\PluginBase;
|
||||
|
||||
class Plugin extends PluginBase
|
||||
{
|
||||
public function registerComponents()
|
||||
{
|
||||
}
|
||||
|
||||
public function registerSettings()
|
||||
{
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
Config::set('database.connections.germanairlinesva_fleet', Config::get('germanairlinesva.fleet::connection'));
|
||||
}
|
||||
}
|
||||
25
config/config.php
Normal file
25
config/config.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'connection' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => 'germanairlinesva_fleet',
|
||||
'username' => env('DB_USERNAME', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => 'InnoDB',
|
||||
'options' => extension_loaded('pdo_mysql')
|
||||
? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
])
|
||||
: [],
|
||||
],
|
||||
];
|
||||
17
controllers/AircraftManufacturers.php
Normal file
17
controllers/AircraftManufacturers.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class AircraftManufacturers 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();
|
||||
}
|
||||
}
|
||||
17
controllers/AircraftTypes.php
Normal file
17
controllers/AircraftTypes.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class AircraftTypes 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/aircraftmanufacturers/_list_toolbar.htm
Normal file
18
controllers/aircraftmanufacturers/_list_toolbar.htm
Normal file
@ -0,0 +1,18 @@
|
||||
<div data-control="toolbar">
|
||||
<a href="<?= Backend::url('germanairlinesva/fleet/aircraftmanufacturers/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/aircraftmanufacturers/config_form.yaml
Normal file
10
controllers/aircraftmanufacturers/config_form.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
name: AircraftManufacturers
|
||||
form: $/germanairlinesva/fleet/models/aircraftmanufacturer/fields.yaml
|
||||
modelClass: GermanAirlinesVa\Fleet\Models\AircraftManufacturer
|
||||
defaultRedirect: germanairlinesva/fleet/aircraftmanufacturers
|
||||
create:
|
||||
redirect: 'germanairlinesva/fleet/aircraftmanufacturers/update/:id'
|
||||
redirectClose: germanairlinesva/fleet/aircraftmanufacturers
|
||||
update:
|
||||
redirect: germanairlinesva/fleet/aircraftmanufacturers
|
||||
redirectClose: germanairlinesva/fleet/aircraftmanufacturers
|
||||
12
controllers/aircraftmanufacturers/config_list.yaml
Normal file
12
controllers/aircraftmanufacturers/config_list.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
list: $/germanairlinesva/fleet/models/aircraftmanufacturer/columns.yaml
|
||||
modelClass: GermanAirlinesVa\Fleet\Models\AircraftManufacturer
|
||||
title: AircraftManufacturers
|
||||
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/aircraftmanufacturers/update/:id'
|
||||
46
controllers/aircraftmanufacturers/create.htm
Normal file
46
controllers/aircraftmanufacturers/create.htm
Normal file
@ -0,0 +1,46 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircraftmanufacturers') ?>">AircraftManufacturers</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/aircraftmanufacturers') ?>"><?= 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/aircraftmanufacturers') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
1
controllers/aircraftmanufacturers/index.htm
Normal file
1
controllers/aircraftmanufacturers/index.htm
Normal file
@ -0,0 +1 @@
|
||||
<?= $this->listRender() ?>
|
||||
22
controllers/aircraftmanufacturers/preview.htm
Normal file
22
controllers/aircraftmanufacturers/preview.htm
Normal file
@ -0,0 +1,22 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircraftmanufacturers') ?>">AircraftManufacturers</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/aircraftmanufacturers') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
54
controllers/aircraftmanufacturers/update.htm
Normal file
54
controllers/aircraftmanufacturers/update.htm
Normal file
@ -0,0 +1,54 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircraftmanufacturers') ?>">AircraftManufacturers</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/aircraftmanufacturers') ?>"><?= 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/aircraftmanufacturers') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
18
controllers/aircrafttypes/_list_toolbar.htm
Normal file
18
controllers/aircrafttypes/_list_toolbar.htm
Normal file
@ -0,0 +1,18 @@
|
||||
<div data-control="toolbar">
|
||||
<a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes/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/aircrafttypes/config_form.yaml
Normal file
10
controllers/aircrafttypes/config_form.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
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
|
||||
12
controllers/aircrafttypes/config_list.yaml
Normal file
12
controllers/aircrafttypes/config_list.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
list: $/germanairlinesva/fleet/models/aircrafttype/columns.yaml
|
||||
modelClass: GermanAirlinesVa\Fleet\Models\AircraftType
|
||||
title: AircraftTypes
|
||||
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/aircrafttypes/update/:id'
|
||||
46
controllers/aircrafttypes/create.htm
Normal file
46
controllers/aircrafttypes/create.htm
Normal file
@ -0,0 +1,46 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</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/aircrafttypes') ?>"><?= 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/aircrafttypes') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
1
controllers/aircrafttypes/index.htm
Normal file
1
controllers/aircrafttypes/index.htm
Normal file
@ -0,0 +1 @@
|
||||
<?= $this->listRender() ?>
|
||||
22
controllers/aircrafttypes/preview.htm
Normal file
22
controllers/aircrafttypes/preview.htm
Normal file
@ -0,0 +1,22 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</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/aircrafttypes') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
54
controllers/aircrafttypes/update.htm
Normal file
54
controllers/aircrafttypes/update.htm
Normal file
@ -0,0 +1,54 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('germanairlinesva/fleet/aircrafttypes') ?>">AircraftTypes</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/aircrafttypes') ?>"><?= 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/aircrafttypes') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
13
lang/en/lang.php
Normal file
13
lang/en/lang.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php return [
|
||||
'plugin' => [
|
||||
'name' => 'Fleet',
|
||||
'description' => '',
|
||||
],
|
||||
'aircraft' => [
|
||||
'manufacturers' => [
|
||||
'name' => 'Name',
|
||||
'link' => 'Link',
|
||||
'history' => 'History',
|
||||
],
|
||||
],
|
||||
];
|
||||
27
models/AircraftManufacturer.php
Normal file
27
models/AircraftManufacturer.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Models;
|
||||
|
||||
use Model;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class AircraftManufacturer 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_aircraft_manufacturers';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [];
|
||||
}
|
||||
31
models/AircraftType.php
Normal file
31
models/AircraftType.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Models;
|
||||
|
||||
use Model;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class AircraftType 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_aircraft_types';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [];
|
||||
|
||||
public $belongsTo = [
|
||||
'aircraft_manufacturer' => 'GermanAirlinesVa\Fleet\Models\AircraftManufacturer',
|
||||
];
|
||||
}
|
||||
18
models/aircraftmanufacturer/columns.yaml
Normal file
18
models/aircraftmanufacturer/columns.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
columns:
|
||||
id:
|
||||
label: id
|
||||
type: text
|
||||
name:
|
||||
label: name
|
||||
type: text
|
||||
searchable: true
|
||||
sortable: true
|
||||
history:
|
||||
label: history
|
||||
type: text
|
||||
searchable: false
|
||||
link:
|
||||
label: link
|
||||
type: text
|
||||
searchable: false
|
||||
sortable: false
|
||||
14
models/aircraftmanufacturer/fields.yaml
Normal file
14
models/aircraftmanufacturer/fields.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
fields:
|
||||
name:
|
||||
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.name'
|
||||
span: auto
|
||||
type: text
|
||||
link:
|
||||
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.link'
|
||||
span: auto
|
||||
type: text
|
||||
history:
|
||||
label: 'germanairlinesva.fleet::lang.aircraft.manufacturers.history'
|
||||
size: ''
|
||||
span: auto
|
||||
type: textarea
|
||||
67
models/aircrafttype/columns.yaml
Normal file
67
models/aircrafttype/columns.yaml
Normal file
@ -0,0 +1,67 @@
|
||||
columns:
|
||||
id:
|
||||
label: id
|
||||
type: text
|
||||
aircraft_manufacturers_id:
|
||||
label: aircraft_manufacturers_id
|
||||
type: number
|
||||
typerating_id:
|
||||
label: typerating_id
|
||||
type: number
|
||||
type:
|
||||
label: type
|
||||
type: text
|
||||
description:
|
||||
label: description
|
||||
type: text
|
||||
simbrief_type:
|
||||
label: simbrief_type
|
||||
type: text
|
||||
wingspan:
|
||||
label: wingspan
|
||||
type: text
|
||||
length:
|
||||
label: length
|
||||
type: text
|
||||
cruise_speed:
|
||||
label: cruise_speed
|
||||
type: text
|
||||
range:
|
||||
label: range
|
||||
type: text
|
||||
engines:
|
||||
label: engines
|
||||
type: text
|
||||
dom:
|
||||
label: dom
|
||||
type: number
|
||||
mpld:
|
||||
label: mpld
|
||||
type: number
|
||||
mzfm:
|
||||
label: mzfm
|
||||
type: number
|
||||
fuel_capacity:
|
||||
label: fuel_capacity
|
||||
type: number
|
||||
mtom:
|
||||
label: mtom
|
||||
type: number
|
||||
mlam:
|
||||
label: mlam
|
||||
type: number
|
||||
max_fl:
|
||||
label: max_fl
|
||||
type: number
|
||||
capacity_flight_crew:
|
||||
label: capacity_flight_crew
|
||||
type: number
|
||||
capacity_cabin_crew:
|
||||
label: capacity_cabin_crew
|
||||
type: number
|
||||
capacity_passengers:
|
||||
label: capacity_passengers
|
||||
type: number
|
||||
capacity_cargo:
|
||||
label: capacity_cargo
|
||||
type: number
|
||||
7
models/aircrafttype/fields.yaml
Normal file
7
models/aircrafttype/fields.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
fields:
|
||||
aircraft_manufacturer:
|
||||
label: Relation
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
type: relation
|
||||
7
models/aircrafttypes/fields.yaml
Normal file
7
models/aircrafttypes/fields.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
fields:
|
||||
manufacturer:
|
||||
label: Relation
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
type: relation
|
||||
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "graphql",
|
||||
"version": "1.0.0",
|
||||
"main": "Plugin.php",
|
||||
"repository": "https://git.hofmannnet.myhome-server.de/GermanAirlines/GermanAirlinesVA-GraphQL.git",
|
||||
"author": "German Airlines VA",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-php": "^0.16.3",
|
||||
"prettier": "^2.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "prettier --write './**/*.{php,html}'"
|
||||
}
|
||||
}
|
||||
6
plugin.yaml
Normal file
6
plugin.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
plugin:
|
||||
name: 'germanairlinesva.fleet::lang.plugin.name'
|
||||
description: 'germanairlinesva.fleet::lang.plugin.description'
|
||||
author: 'German Airlines VA'
|
||||
icon: oc-icon-plane
|
||||
homepage: ''
|
||||
26
updates/builder_table_create_aircraft_manufacturers.php
Normal file
26
updates/builder_table_create_aircraft_manufacturers.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Updates;
|
||||
|
||||
use Config;
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateGermanAirlinesVaAircraftManufacturers extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('ga_aircraft_manufacturers', function ($table) {
|
||||
//Schema::create('ga_aircraft_manufacturers', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->string('name');
|
||||
$table->text('history');
|
||||
$table->string('link');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('ga_aircraft_manufacturers');
|
||||
//Schema::dropIfExists('ga_aircraft_manufacturers');
|
||||
}
|
||||
}
|
||||
45
updates/builder_table_create_aircraft_types.php
Normal file
45
updates/builder_table_create_aircraft_types.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php namespace GermanAirlinesVa\Fleet\Updates;
|
||||
|
||||
use Config;
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateGermanAirlinesVaAircraftTypes extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->create('ga_aircraft_types', function ($table) {
|
||||
//Schema::create('ga_aircraft_types', function ($table) {
|
||||
$table->engine = 'InnoDB';
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->bigInteger('aircraft_manufacturer_id')->unsigned();
|
||||
$table->bigInteger('typerating_id')->unsigned();
|
||||
$table->enum('only_charter', ['yes', 'no']);
|
||||
$table->string('type');
|
||||
$table->text('description');
|
||||
$table->string('simbrief_type');
|
||||
$table->string('wingspan');
|
||||
$table->string('length');
|
||||
$table->string('cruise_speed');
|
||||
$table->string('range');
|
||||
$table->string('engines');
|
||||
$table->integer('dom')->unsigned();
|
||||
$table->integer('mpld')->unsigned();
|
||||
$table->integer('mzfm')->unsigned();
|
||||
$table->integer('fuel_capacity')->unsigned();
|
||||
$table->integer('mtom')->unsigned();
|
||||
$table->integer('mlam')->unsigned();
|
||||
$table->integer('max_fl')->unsigned();
|
||||
$table->integer('capacity_flight_crew')->unsigned();
|
||||
$table->integer('capacity_cabin_crew')->unsigned();
|
||||
$table->integer('capacity_passengers')->unsigned();
|
||||
$table->integer('capacity_cargo')->unsigned();
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::connection('germanairlinesva_fleet')->dropIfExists('ga_aircraft_types');
|
||||
//Schema::dropIfExists('ga_aircraft_types');
|
||||
}
|
||||
}
|
||||
7
updates/version.yaml
Normal file
7
updates/version.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
1.0.1:
|
||||
- 'Initialize plugin.'
|
||||
1.0.2:
|
||||
- 'Created table aircraft_manufacturers'
|
||||
- builder_table_create_aircraft_manufacturers.php
|
||||
- 'Created table aircraft_types'
|
||||
- builder_table_create_aircraft_types.php
|
||||
52
yarn.lock
Normal file
52
yarn.lock
Normal file
@ -0,0 +1,52 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@prettier/plugin-php@^0.16.3":
|
||||
version "0.16.3"
|
||||
resolved "https://registry.yarnpkg.com/@prettier/plugin-php/-/plugin-php-0.16.3.tgz#74867210079ba3c0c3ae843029d76e25ff0aadf3"
|
||||
integrity sha512-DNidzeGpP+/wmcCAZNSHxgoAnhEosYG+no4jJRqln19e1o3Okpuir/2JMxb07VCwdG50IWjtNgVwNPVl4uj0Hg==
|
||||
dependencies:
|
||||
linguist-languages "^7.5.1"
|
||||
mem "^8.0.0"
|
||||
php-parser "3.0.2"
|
||||
|
||||
linguist-languages@^7.5.1:
|
||||
version "7.15.0"
|
||||
resolved "https://registry.yarnpkg.com/linguist-languages/-/linguist-languages-7.15.0.tgz#a93bed6b93015d8133622cb05da6296890862bfa"
|
||||
integrity sha512-qkSSNDjDDycZ2Wcw+GziNBB3nNo3ddYUInM/PL8Amgwbd9RQ/BKGj2/1d6mdxKgBFnUqZuaDbkIwkE4KUwwmtQ==
|
||||
|
||||
map-age-cleaner@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
|
||||
integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==
|
||||
dependencies:
|
||||
p-defer "^1.0.0"
|
||||
|
||||
mem@^8.0.0:
|
||||
version "8.1.1"
|
||||
resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.1.tgz#cf118b357c65ab7b7e0817bdf00c8062297c0122"
|
||||
integrity sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==
|
||||
dependencies:
|
||||
map-age-cleaner "^0.1.3"
|
||||
mimic-fn "^3.1.0"
|
||||
|
||||
mimic-fn@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74"
|
||||
integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==
|
||||
|
||||
p-defer@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
|
||||
integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
|
||||
|
||||
php-parser@3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/php-parser/-/php-parser-3.0.2.tgz#a86dbbc110e57378cba71ab4cd9b0d18f3872ac3"
|
||||
integrity sha512-a7y1+odEGsceLDLpu7oNyspZ0pK8FMWJOoim4/yd82AtnEZNLdCLZ67arnOQZ9K0lHJiSp4/7lVUpGELVxE14w==
|
||||
|
||||
prettier@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
|
||||
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
|
||||
Loading…
x
Reference in New Issue
Block a user