Typeratings
This commit is contained in:
parent
80b4516de4
commit
0c182914d9
@ -14,4 +14,9 @@ class ExamMemberRankQuestion extends Controller
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function listExtendQuery($query)
|
||||
{
|
||||
$query->where('member_rank_id', '<>', null);
|
||||
}
|
||||
}
|
||||
|
||||
22
controllers/ExamTyperatingQuestion.php
Normal file
22
controllers/ExamTyperatingQuestion.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php namespace GermanAirlinesVa\Schooling\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class ExamTyperatingQuestion 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();
|
||||
}
|
||||
|
||||
public function listExtendQuery($query)
|
||||
{
|
||||
$query->where('typerating_id', '<>', null);
|
||||
}
|
||||
}
|
||||
23
controllers/examtyperatingquestion/_list_toolbar.htm
Normal file
23
controllers/examtyperatingquestion/_list_toolbar.htm
Normal file
@ -0,0 +1,23 @@
|
||||
<div data-control="toolbar">
|
||||
<a
|
||||
href="<?= Backend::url('germanairlinesva/schooling/examtyperatingquestion/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/examtyperatingquestion/config_form.yaml
Normal file
10
controllers/examtyperatingquestion/config_form.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
name: Exam Typerating Question
|
||||
form: $/germanairlinesva/schooling/models/examtyperatingquestion/fields.yaml
|
||||
modelClass: GermanAirlinesVa\Schooling\Models\ExamTyperatingQuestion
|
||||
defaultRedirect: germanairlinesva/schooling/examtyperatingquestion
|
||||
create:
|
||||
redirect: 'germanairlinesva/schooling/examtyperatingquestion/update/:id'
|
||||
redirectClose: germanairlinesva/schooling/examtyperatingquestion
|
||||
update:
|
||||
redirect: germanairlinesva/schooling/examtyperatingquestion
|
||||
redirectClose: germanairlinesva/schooling/examtyperatingquestion
|
||||
12
controllers/examtyperatingquestion/config_list.yaml
Normal file
12
controllers/examtyperatingquestion/config_list.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
list: $/germanairlinesva/schooling/models/examtyperatingquestion/columns.yaml
|
||||
modelClass: GermanAirlinesVa\Schooling\Models\ExamTyperatingQuestion
|
||||
title: Exam Typerating Questions
|
||||
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/examtyperatingquestion/update/:id'
|
||||
56
controllers/examtyperatingquestion/create.htm
Normal file
56
controllers/examtyperatingquestion/create.htm
Normal file
@ -0,0 +1,56 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?= Backend::url('germanairlinesva/schooling/examtyperatingquestion') ?>">Exam Typerating Questions</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/examtyperatingquestion') ?>"
|
||||
><?= 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/examtyperatingquestion') ?>" class="btn btn-default"
|
||||
><?= e(trans('backend::lang.form.return_to_list')) ?></a
|
||||
>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
1
controllers/examtyperatingquestion/index.htm
Normal file
1
controllers/examtyperatingquestion/index.htm
Normal file
@ -0,0 +1 @@
|
||||
<?= $this->listRender() ?>
|
||||
25
controllers/examtyperatingquestion/preview.htm
Normal file
25
controllers/examtyperatingquestion/preview.htm
Normal file
@ -0,0 +1,25 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?= Backend::url('germanairlinesva/schooling/examtyperatingquestion') ?>">Exam Typerating Questions</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/examtyperatingquestion') ?>"
|
||||
class="btn btn-default oc-icon-chevron-left"
|
||||
>
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
64
controllers/examtyperatingquestion/update.htm
Normal file
64
controllers/examtyperatingquestion/update.htm
Normal file
@ -0,0 +1,64 @@
|
||||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?= Backend::url('germanairlinesva/schooling/examtyperatingquestion') ?>">Exam Typerating Questions</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/examtyperatingquestion') ?>"
|
||||
><?= 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/examtyperatingquestion') ?>" class="btn btn-default"
|
||||
><?= e(trans('backend::lang.form.return_to_list')) ?></a
|
||||
>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
@ -11,6 +11,8 @@
|
||||
'main' => 'GA Schooling',
|
||||
'typeratings' => 'Typeratings',
|
||||
'rank' => 'Member Ranks',
|
||||
'exam_question_rank' => 'Exam Member Rank Questions',
|
||||
'exam_question_typerating' => 'Exam Typerating Questions',
|
||||
],
|
||||
'permissions' => [
|
||||
'tab' => 'German Airlines VA - Schooling',
|
||||
|
||||
37
models/ExamTyperatingQuestion.php
Normal file
37
models/ExamTyperatingQuestion.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php namespace GermanAirlinesVa\Schooling\Models;
|
||||
|
||||
use Model;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class ExamTyperatingQuestion 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 = 'exam_questions';
|
||||
protected $connection = 'germanairlinesva_schooling';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [
|
||||
'typerating' => 'required',
|
||||
'in_use' => 'required',
|
||||
'mandatory' => 'required',
|
||||
'text' => 'required',
|
||||
];
|
||||
|
||||
public $belongsTo = [
|
||||
'typerating' => 'GermanAirlinesVa\Schooling\Models\Typerating',
|
||||
];
|
||||
}
|
||||
@ -2,9 +2,11 @@ columns:
|
||||
id:
|
||||
label: id
|
||||
type: text
|
||||
member_rank_id:
|
||||
label: member_rank_id
|
||||
member_rank:
|
||||
label: member_rank
|
||||
relation: member_rank
|
||||
type: text
|
||||
valueFrom: name
|
||||
in_use:
|
||||
label: in_use
|
||||
type: text
|
||||
|
||||
21
models/examtyperatingquestion/columns.yaml
Normal file
21
models/examtyperatingquestion/columns.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
columns:
|
||||
id:
|
||||
label: id
|
||||
type: text
|
||||
typerating:
|
||||
label: typerating
|
||||
type: text
|
||||
relation: typerating
|
||||
valueFrom: name
|
||||
in_use:
|
||||
label: in_use
|
||||
type: text
|
||||
mandatory:
|
||||
label: mandatory
|
||||
type: text
|
||||
text:
|
||||
label: text
|
||||
type: text
|
||||
picture:
|
||||
label: picture
|
||||
type: text
|
||||
29
models/examtyperatingquestion/fields.yaml
Normal file
29
models/examtyperatingquestion/fields.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
fields:
|
||||
typerating:
|
||||
label: 'germanairlinesva.schooling::lang.exam_question.typerating'
|
||||
nameFrom: name
|
||||
descriptionFrom: description
|
||||
span: auto
|
||||
required: 1
|
||||
type: relation
|
||||
in_use:
|
||||
label: 'germanairlinesva.schooling::lang.exam_question.in_use'
|
||||
span: auto
|
||||
required: 1
|
||||
type: switch
|
||||
mandatory:
|
||||
label: 'germanairlinesva.schooling::lang.exam_question.mandatory'
|
||||
span: auto
|
||||
required: 1
|
||||
type: switch
|
||||
text:
|
||||
label: 'germanairlinesva.schooling::lang.exam_question.text'
|
||||
size: large
|
||||
span: auto
|
||||
required: 1
|
||||
type: richeditor
|
||||
picture:
|
||||
label: 'germanairlinesva.schooling::lang.exam_question.picture'
|
||||
mode: file
|
||||
span: auto
|
||||
type: mediafinder
|
||||
@ -20,6 +20,14 @@ navigation:
|
||||
label: 'germanairlinesva.schooling::lang.menu.rank'
|
||||
url: germanairlinesva/schooling/memberRank
|
||||
icon: icon-signal
|
||||
side-menu-item3:
|
||||
label: 'germanairlinesva.schooling::lang.menu.exam_question_rank'
|
||||
url: germanairlinesva/schooling/exammemberrankquestion
|
||||
icon: icon-question
|
||||
side-menu-item4:
|
||||
label: 'germanairlinesva.schooling::lang.menu.exam_question_typerating'
|
||||
url: germanairlinesva/schooling/examtyperatingquestion
|
||||
icon: icon-question
|
||||
permissions:
|
||||
schooling:
|
||||
tab: 'germanairlinesva.schooling::lang.permissions.tab'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user