From 0c182914d9d1d6b8a1f3bf8903ce3f3175e8bffe Mon Sep 17 00:00:00 2001 From: Gogs Date: Wed, 16 Jun 2021 22:40:17 +0200 Subject: [PATCH] Typeratings --- controllers/ExamMemberRankQuestion.php | 5 ++ controllers/ExamTyperatingQuestion.php | 22 +++++++ .../examtyperatingquestion/_list_toolbar.htm | 23 +++++++ .../examtyperatingquestion/config_form.yaml | 10 +++ .../examtyperatingquestion/config_list.yaml | 12 ++++ controllers/examtyperatingquestion/create.htm | 56 ++++++++++++++++ controllers/examtyperatingquestion/index.htm | 1 + .../examtyperatingquestion/preview.htm | 25 ++++++++ controllers/examtyperatingquestion/update.htm | 64 +++++++++++++++++++ lang/en/lang.php | 2 + models/ExamTyperatingQuestion.php | 37 +++++++++++ models/exammemberrankquestion/columns.yaml | 6 +- models/examtyperatingquestion/columns.yaml | 21 ++++++ models/examtyperatingquestion/fields.yaml | 29 +++++++++ plugin.yaml | 8 +++ 15 files changed, 319 insertions(+), 2 deletions(-) create mode 100644 controllers/ExamTyperatingQuestion.php create mode 100644 controllers/examtyperatingquestion/_list_toolbar.htm create mode 100644 controllers/examtyperatingquestion/config_form.yaml create mode 100644 controllers/examtyperatingquestion/config_list.yaml create mode 100644 controllers/examtyperatingquestion/create.htm create mode 100644 controllers/examtyperatingquestion/index.htm create mode 100644 controllers/examtyperatingquestion/preview.htm create mode 100644 controllers/examtyperatingquestion/update.htm create mode 100644 models/ExamTyperatingQuestion.php create mode 100644 models/examtyperatingquestion/columns.yaml create mode 100644 models/examtyperatingquestion/fields.yaml diff --git a/controllers/ExamMemberRankQuestion.php b/controllers/ExamMemberRankQuestion.php index 6d6dc41..e8d0a1b 100644 --- a/controllers/ExamMemberRankQuestion.php +++ b/controllers/ExamMemberRankQuestion.php @@ -14,4 +14,9 @@ class ExamMemberRankQuestion extends Controller { parent::__construct(); } + + public function listExtendQuery($query) + { + $query->where('member_rank_id', '<>', null); + } } diff --git a/controllers/ExamTyperatingQuestion.php b/controllers/ExamTyperatingQuestion.php new file mode 100644 index 0000000..826469c --- /dev/null +++ b/controllers/ExamTyperatingQuestion.php @@ -0,0 +1,22 @@ +where('typerating_id', '<>', null); + } +} diff --git a/controllers/examtyperatingquestion/_list_toolbar.htm b/controllers/examtyperatingquestion/_list_toolbar.htm new file mode 100644 index 0000000..852a529 --- /dev/null +++ b/controllers/examtyperatingquestion/_list_toolbar.htm @@ -0,0 +1,23 @@ +
+ + +
diff --git a/controllers/examtyperatingquestion/config_form.yaml b/controllers/examtyperatingquestion/config_form.yaml new file mode 100644 index 0000000..712e025 --- /dev/null +++ b/controllers/examtyperatingquestion/config_form.yaml @@ -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 diff --git a/controllers/examtyperatingquestion/config_list.yaml b/controllers/examtyperatingquestion/config_list.yaml new file mode 100644 index 0000000..4497c71 --- /dev/null +++ b/controllers/examtyperatingquestion/config_list.yaml @@ -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' diff --git a/controllers/examtyperatingquestion/create.htm b/controllers/examtyperatingquestion/create.htm new file mode 100644 index 0000000..ac964d2 --- /dev/null +++ b/controllers/examtyperatingquestion/create.htm @@ -0,0 +1,56 @@ + + + + +fatalError): ?> + + +'layout']) ?> + +
formRender() ?>
+ +
+
+ + + + + + +
+
+ + + + +

fatalError)) ?>

+

+ +

+ diff --git a/controllers/examtyperatingquestion/index.htm b/controllers/examtyperatingquestion/index.htm new file mode 100644 index 0000000..ea43a36 --- /dev/null +++ b/controllers/examtyperatingquestion/index.htm @@ -0,0 +1 @@ +listRender() ?> diff --git a/controllers/examtyperatingquestion/preview.htm b/controllers/examtyperatingquestion/preview.htm new file mode 100644 index 0000000..c376273 --- /dev/null +++ b/controllers/examtyperatingquestion/preview.htm @@ -0,0 +1,25 @@ + + + + +fatalError): ?> + +
formRenderPreview() ?>
+ + +

fatalError) ?>

+ + +

+ + + +

diff --git a/controllers/examtyperatingquestion/update.htm b/controllers/examtyperatingquestion/update.htm new file mode 100644 index 0000000..bafa560 --- /dev/null +++ b/controllers/examtyperatingquestion/update.htm @@ -0,0 +1,64 @@ + + + + +fatalError): ?> + + +'layout']) ?> + +
formRender() ?>
+ +
+
+ + + + + + + + +
+
+ + + +

fatalError)) ?>

+

+ +

+ diff --git a/lang/en/lang.php b/lang/en/lang.php index 38afd57..4c9de24 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -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', diff --git a/models/ExamTyperatingQuestion.php b/models/ExamTyperatingQuestion.php new file mode 100644 index 0000000..1df7d8a --- /dev/null +++ b/models/ExamTyperatingQuestion.php @@ -0,0 +1,37 @@ + 'required', + 'in_use' => 'required', + 'mandatory' => 'required', + 'text' => 'required', + ]; + + public $belongsTo = [ + 'typerating' => 'GermanAirlinesVa\Schooling\Models\Typerating', + ]; +} diff --git a/models/exammemberrankquestion/columns.yaml b/models/exammemberrankquestion/columns.yaml index dd041de..9b40a58 100644 --- a/models/exammemberrankquestion/columns.yaml +++ b/models/exammemberrankquestion/columns.yaml @@ -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 diff --git a/models/examtyperatingquestion/columns.yaml b/models/examtyperatingquestion/columns.yaml new file mode 100644 index 0000000..5dc4c44 --- /dev/null +++ b/models/examtyperatingquestion/columns.yaml @@ -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 diff --git a/models/examtyperatingquestion/fields.yaml b/models/examtyperatingquestion/fields.yaml new file mode 100644 index 0000000..1988501 --- /dev/null +++ b/models/examtyperatingquestion/fields.yaml @@ -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 diff --git a/plugin.yaml b/plugin.yaml index 84ae124..6b4b3e6 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -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'