diff --git a/application/controllers/api/frontend/v1/stv/Abschlusspruefung.php b/application/controllers/api/frontend/v1/stv/Abschlusspruefung.php index 7c1c974e2..9767ed33a 100644 --- a/application/controllers/api/frontend/v1/stv/Abschlusspruefung.php +++ b/application/controllers/api/frontend/v1/stv/Abschlusspruefung.php @@ -261,8 +261,7 @@ class Abschlusspruefung extends FHCAPI_Controller { $this->load->model('education/Note_model', 'NoteModel'); - $this->NoteModel->addOrder('note', 'ASC'); - $result = $this->NoteModel->load(); + $result = $this->NoteModel->getAll(); if (isError($result)) { $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); diff --git a/application/controllers/api/frontend/v1/stv/Grades.php b/application/controllers/api/frontend/v1/stv/Grades.php index 128316d2b..8f25a3d5a 100644 --- a/application/controllers/api/frontend/v1/stv/Grades.php +++ b/application/controllers/api/frontend/v1/stv/Grades.php @@ -58,12 +58,9 @@ class Grades extends FHCAPI_Controller */ public function list() { - $this->load->model('codex/Note_model', 'NoteModel'); + $this->load->model('education/Note_model', 'NoteModel'); - $this->NoteModel->addOrder('notenwert', 'ASC'); - $this->NoteModel->addOrder('bezeichnung', 'ASC'); - - $result = $this->NoteModel->load(); + $result = $this->NoteModel->getAll(); $grades = $this->getDataOrTerminateWithError($result); diff --git a/application/controllers/api/frontend/v1/stv/Projektbetreuer.php b/application/controllers/api/frontend/v1/stv/Projektbetreuer.php index 904fa6167..655eb6dbf 100644 --- a/application/controllers/api/frontend/v1/stv/Projektbetreuer.php +++ b/application/controllers/api/frontend/v1/stv/Projektbetreuer.php @@ -269,7 +269,7 @@ class Projektbetreuer extends FHCAPI_Controller */ public function getNoten() { - $result = $this->NoteModel->load(); + $result = $this->NoteModel->getAll(); if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); diff --git a/application/controllers/api/frontend/v1/stv/Pruefung.php b/application/controllers/api/frontend/v1/stv/Pruefung.php index becda03ee..597254a3a 100644 --- a/application/controllers/api/frontend/v1/stv/Pruefung.php +++ b/application/controllers/api/frontend/v1/stv/Pruefung.php @@ -344,8 +344,7 @@ class Pruefung extends FHCAPI_Controller { $this->load->model('education/Note_model', 'NoteModel'); - $this->NoteModel->addOrder('note', 'ASC'); - $result = $this->NoteModel->load(); + $result = $this->NoteModel->getAll(); if (isError($result)) { $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); diff --git a/application/models/education/Note_model.php b/application/models/education/Note_model.php index 87a1501e0..eb567c81f 100644 --- a/application/models/education/Note_model.php +++ b/application/models/education/Note_model.php @@ -15,7 +15,21 @@ class Note_model extends DB_Model public function getAllActive() { $qry ="SELECT * FROM lehre.tbl_note - WHERE aktiv = true"; + WHERE aktiv = true + ORDER BY CASE WHEN note BETWEEN 1 AND 5 THEN 0 ELSE 1 END, + CASE WHEN note BETWEEN 1 AND 5 THEN note END, + bezeichnung"; + + + return $this->execReadOnlyQuery($qry); + } + + public function getAll() { + $qry ="SELECT * + FROM lehre.tbl_note + ORDER BY CASE WHEN note BETWEEN 1 AND 5 THEN 0 ELSE 1 END, + CASE WHEN note BETWEEN 1 AND 5 THEN note END, + bezeichnung"; return $this->execReadOnlyQuery($qry); } diff --git a/public/js/apps/LVVerwaltung.js b/public/js/apps/LVVerwaltung.js index b9ab52ef6..c4d06f5e9 100644 --- a/public/js/apps/LVVerwaltung.js +++ b/public/js/apps/LVVerwaltung.js @@ -1,5 +1,6 @@ import LVVerwaltung from "../components/LVVerwaltung/LVVerwaltung.js"; import Phrasen from "../plugins/Phrasen.js"; +import {capitalize} from "../helpers/StringHelpers.js"; const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; @@ -34,6 +35,8 @@ const app = Vue.createApp({ name: 'LvVwApp' }); +app.config.globalProperties.$capitalize = capitalize; + FhcApps.makeExtendable(app); app diff --git a/public/js/apps/Studentenverwaltung.js b/public/js/apps/Studentenverwaltung.js index 7687eaf90..b238c1c45 100644 --- a/public/js/apps/Studentenverwaltung.js +++ b/public/js/apps/Studentenverwaltung.js @@ -19,6 +19,7 @@ import FhcStudentenverwaltung from "../components/Stv/Studentenverwaltung.js"; import fhcapifactory from "./api/fhcapifactory.js"; import PluginsPhrasen from "../plugins/Phrasen.js"; +import {capitalize} from "../helpers/StringHelpers.js"; const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; @@ -77,6 +78,8 @@ const app = Vue.createApp({ name: 'StudVwApp' }); +app.config.globalProperties.$capitalize = capitalize; + FhcApps.makeExtendable(app); app diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js index 5d89547d7..94ca2ee26 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js @@ -749,7 +749,7 @@ export default { :key="note.note" :value="note.note" > - {{note.bezeichnung}} + {{$capitalize(note.bezeichnung)}} diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Repeater.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Repeater.js index ab7dedb3e..b786a9c7d 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Repeater.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Repeater.js @@ -38,7 +38,7 @@ export default { }, columns: [ { field: 'lv_bezeichnung', title: this.$p.t('lehre/lehrveranstaltung') }, - { field: 'note_bezeichnung', title: this.$p.t('lehre/note') }, + { field: 'note_bezeichnung', title: this.$p.t('lehre/note'), formatter: cell => this.$capitalize(cell.getValue()) }, { field: 'insertvon', title: this.$p.t('profil/mitarbeiterIn'), visible: false }, { field: 'benotungsdatum', title: this.$p.t('stv/grades_gradingdate'), visible: false, formatter: function (cell) { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Teacher.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Teacher.js index e071603dd..f154e9d95 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Teacher.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Teacher.js @@ -66,7 +66,7 @@ export default { }, columns: [ { field: 'lehrveranstaltung_bezeichnung', title: this.$p.t('lehre/lehrveranstaltung') }, - { field: 'note_bezeichnung', title: this.$p.t('lehre/note') }, + { field: 'note_bezeichnung', title: this.$p.t('lehre/note'), formatter: cell => this.$capitalize(cell.getValue()) }, { field: 'mitarbeiter_uid', title: this.$p.t('profil/mitarbeiterIn'), visible: false }, { field: 'benotungsdatum', title: this.$p.t('stv/grades_gradingdate'), visible: false, formatter: function (cell) { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js index 0f9d45883..64286c399 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js @@ -82,13 +82,13 @@ export default { tabulatorOptions() { const listPromise = this.$api .call(this.endpoint.list()) - .then(res => res.data.map(({bezeichnung: label, note: value}) => ({label, value}))); + .then(res => res.data.map(({bezeichnung, note: value}) => ({label: this.$capitalize(bezeichnung), value}))); let gradeField = { field: 'note', title: this.$p.t('lehre/note'), - formatter: cell => cell.getData().note_bezeichnung, - tooltip: (evt, cell) => cell.getData().note_bezeichnung + formatter: cell => this.$capitalize(cell.getData().note_bezeichnung), + tooltip: (evt, cell) => this.$capitalize(cell.getData().note_bezeichnung) }; if (['both', 'inline'].includes(this.config.edit)) { gradeField.editor = 'list'; diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis/Actions.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis/Actions.js index 1ffa47a30..ce242ea93 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis/Actions.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis/Actions.js @@ -100,7 +100,7 @@ export default { this.$api .call(ApiStvGrades.list()) .then(result => { - this.grades = result.data; + this.grades = result.data.map(grade => ({...grade, bezeichnung: this.$capitalize(grade.bezeichnung)})); }) .catch(this.$fhcAlert.handleSystemError); }, diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Details.js b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Details.js index e85c69938..11f91c589 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Details.js @@ -439,7 +439,7 @@ export default { :key="note.note" :value="note.note" > - {{note.bezeichnung}} + {{$capitalize(note.bezeichnung)}}
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js index 8be2d0153..14dd7c4e8 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js @@ -530,7 +530,7 @@ export default { :key="note.note" :value="note.note" > - {{note.bezeichnung}} + {{$capitalize(note.bezeichnung)}}
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Pruefung/Pruefunglist.js b/public/js/components/Stv/Studentenverwaltung/Details/Pruefung/Pruefunglist.js index 9f89a72ac..abd3d02a5 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Pruefung/Pruefunglist.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Pruefung/Pruefunglist.js @@ -80,7 +80,7 @@ export default{ }); }}, {title: "Lehrveranstaltung", field: "lehrveranstaltung_bezeichnung"}, - {title: "Note", field: "note_bezeichnung"}, + {title: "Note", field: "note_bezeichnung", formatter: cell => this.$capitalize(cell.getValue())}, {title: "Anmerkung", field: "anmerkung"}, {title: "Typ", field: "pruefungstyp_kurzbz"}, {title: "PruefungId", field: "pruefung_id", visible: false}, @@ -516,7 +516,7 @@ export default{ :value="note.note" :disabled="!note.aktiv" > - {{ note.bezeichnung }} + {{ $capitalize(note.bezeichnung) }}