Compare commits
No commits in common. "839f50a836feb2c6fbb205289e15b0ebeb84b46f" and "a4564af3095cf4bccdb24417dd9762ccaba6b538" have entirely different histories.
839f50a836
...
a4564af309
@ -1,6 +1,5 @@
|
|||||||
<?php namespace GermanAirlinesVa\Schooling;
|
<?php namespace GermanAirlinesVa\Schooling;
|
||||||
|
|
||||||
use Config;
|
|
||||||
use System\Classes\PluginBase;
|
use System\Classes\PluginBase;
|
||||||
|
|
||||||
class Plugin extends PluginBase
|
class Plugin extends PluginBase
|
||||||
@ -12,12 +11,4 @@ class Plugin extends PluginBase
|
|||||||
public function registerSettings()
|
public function registerSettings()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot()
|
|
||||||
{
|
|
||||||
Config::set(
|
|
||||||
'database.connections.germanairlinesva_schooling',
|
|
||||||
Config::get('germanairlinesva.schooling::connection')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
# Relations
|
|
||||||
|
|
||||||
## Typerating
|
|
||||||
|
|
||||||
- HasMany AircraftTypes (External DB)
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
'connection' => [
|
|
||||||
'driver' => 'mysql',
|
|
||||||
'url' => env('DATABASE_URL'),
|
|
||||||
'host' => env('DB_HOST', '127.0.0.1'),
|
|
||||||
'port' => env('DB_PORT', '3306'),
|
|
||||||
'database' => 'germanairlinesva_schooling',
|
|
||||||
'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'),
|
|
||||||
])
|
|
||||||
: [],
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?php namespace GermanAirlinesVa\Schooling\Controllers;
|
|
||||||
|
|
||||||
use Backend\Classes\Controller;
|
|
||||||
use BackendMenu;
|
|
||||||
|
|
||||||
class Typerating 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
<div data-control="toolbar">
|
|
||||||
<a href="<?= Backend::url('germanairlinesva/schooling/typerating/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>
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
name: Typerating
|
|
||||||
form: $/germanairlinesva/schooling/models/typerating/fields.yaml
|
|
||||||
modelClass: GermanAirlinesVa\Schooling\Models\Typerating
|
|
||||||
defaultRedirect: germanairlinesva/schooling/typerating
|
|
||||||
create:
|
|
||||||
redirect: 'germanairlinesva/schooling/typerating/update/:id'
|
|
||||||
redirectClose: germanairlinesva/schooling/typerating
|
|
||||||
update:
|
|
||||||
redirect: germanairlinesva/schooling/typerating
|
|
||||||
redirectClose: germanairlinesva/schooling/typerating
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
list: $/germanairlinesva/schooling/models/typerating/columns.yaml
|
|
||||||
modelClass: GermanAirlinesVa\Schooling\Models\Typerating
|
|
||||||
title: Typerating
|
|
||||||
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/schooling/typerating/update/:id'
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
<?php Block::put('breadcrumb') ?>
|
|
||||||
<ul>
|
|
||||||
<li><a href="<?= Backend::url('germanairlinesva/schooling/typerating') ?>">Typerating</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/schooling/typerating') ?>"
|
|
||||||
><?= 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/schooling/typerating') ?>" class="btn btn-default"
|
|
||||||
><?= e(trans('backend::lang.form.return_to_list')) ?></a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<?php endif ?>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
<?= $this->listRender() ?>
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
<?php Block::put('breadcrumb') ?>
|
|
||||||
<ul>
|
|
||||||
<li><a href="<?= Backend::url('germanairlinesva/schooling/typerating') ?>">Typerating</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/schooling/typerating') ?>" class="btn btn-default oc-icon-chevron-left">
|
|
||||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
<?php Block::put('breadcrumb') ?>
|
|
||||||
<ul>
|
|
||||||
<li><a href="<?= Backend::url('germanairlinesva/schooling/typerating') ?>">Typerating</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/schooling/typerating') ?>"
|
|
||||||
><?= 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/schooling/typerating') ?>" class="btn btn-default"
|
|
||||||
><?= e(trans('backend::lang.form.return_to_list')) ?></a
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<?php endif ?>
|
|
||||||
@ -1,14 +1,6 @@
|
|||||||
<?php return [
|
<?php return [
|
||||||
'plugin' => [
|
'plugin' => [
|
||||||
'name' => 'GA Schooling',
|
'name' => 'Schooling',
|
||||||
'description' => '',
|
'description' => '',
|
||||||
],
|
],
|
||||||
'typeratings' => [
|
|
||||||
'name' => 'Typerating Name',
|
|
||||||
'price' => 'Price for exam',
|
|
||||||
],
|
|
||||||
'menu' => [
|
|
||||||
'main' => 'GA Schooling',
|
|
||||||
'typeratings' => 'Typeratings',
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
<?php namespace GermanAirlinesVa\Schooling\Models;
|
|
||||||
|
|
||||||
use Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model
|
|
||||||
*/
|
|
||||||
class Typerating 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 = 'typeratings';
|
|
||||||
protected $connection = 'germanairlinesva_schooling';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array Validation rules
|
|
||||||
*/
|
|
||||||
public $rules = ['name' => 'required', 'price' => 'required'];
|
|
||||||
|
|
||||||
public $hasMany = [
|
|
||||||
'aircraft_types' => 'GermanAirlinesVa\Fleet',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
columns:
|
|
||||||
id:
|
|
||||||
label: id
|
|
||||||
type: text
|
|
||||||
name:
|
|
||||||
label: name
|
|
||||||
type: text
|
|
||||||
price:
|
|
||||||
label: price
|
|
||||||
type: number
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fields:
|
|
||||||
name:
|
|
||||||
label: 'germanairlinesva.schooling::lang.typeratings.name'
|
|
||||||
span: auto
|
|
||||||
required: 1
|
|
||||||
type: text
|
|
||||||
price:
|
|
||||||
label: 'germanairlinesva.schooling::lang.typeratings.price'
|
|
||||||
span: auto
|
|
||||||
required: 1
|
|
||||||
type: number
|
|
||||||
10
plugin.yaml
10
plugin.yaml
@ -4,13 +4,3 @@ plugin:
|
|||||||
author: 'German Airlines Va'
|
author: 'German Airlines Va'
|
||||||
icon: oc-icon-university
|
icon: oc-icon-university
|
||||||
homepage: ''
|
homepage: ''
|
||||||
navigation:
|
|
||||||
main-menu-item:
|
|
||||||
label: 'germanairlinesva.schooling::lang.menu.main'
|
|
||||||
url: /
|
|
||||||
icon: icon-university
|
|
||||||
sideMenu:
|
|
||||||
side-menu-item:
|
|
||||||
label: 'germanairlinesva.schooling::lang.menu.typeratings'
|
|
||||||
url: germanairlinesva/schooling/typerating
|
|
||||||
icon: icon-plane
|
|
||||||
|
|||||||
@ -1,31 +0,0 @@
|
|||||||
<?php namespace GermanAirlinesVa\Schooling\Updates;
|
|
||||||
|
|
||||||
use Schema;
|
|
||||||
use October\Rain\Database\Updates\Migration;
|
|
||||||
|
|
||||||
class BuilderTableCreateTyperatings extends Migration
|
|
||||||
{
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::connection('germanairlinesva_schooling')->create('typeratings', function ($table) {
|
|
||||||
$table->engine = 'InnoDB';
|
|
||||||
$table->bigIncrements('id')->unsigned();
|
|
||||||
$table->string('name');
|
|
||||||
$table->integer('price');
|
|
||||||
});
|
|
||||||
|
|
||||||
Schema::connection('germanairlinesva_fleet')->table('aircraft_types', function ($table) {
|
|
||||||
$table
|
|
||||||
->foreign('typerating_id')
|
|
||||||
->references('id')
|
|
||||||
->on('germanairlinesva_schooling.typeratings');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::connection('germanairlinesva_schooling')->disableForeignKeyConstraints();
|
|
||||||
Schema::connection('germanairlinesva_schooling')->dropIfExists('typeratings');
|
|
||||||
Schema::connection('germanairlinesva_schooling')->enableForeignKeyConstraints();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,2 @@
|
|||||||
1.0.1:
|
1.0.1:
|
||||||
- 'Initialize plugin.'
|
- Initialize plugin.
|
||||||
1.0.2:
|
|
||||||
- 'Created table typeratings'
|
|
||||||
- builder_table_create_typeratings.php
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user