noten sort & capitalization fix across all uses in Stv & LV-VW: Projektarbeit, Projektbetreuer, Pruefung, Abschlusspruefung & Noten (Stv & LV-VW)

This commit is contained in:
Johann Hoffmann
2026-10-01 19:16:11 +02:00
parent f3d031ab16
commit 8f1ab2ac47
15 changed files with 37 additions and 22 deletions
@@ -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);
@@ -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);
@@ -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);
@@ -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);
+15 -1
View File
@@ -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);
}
+3
View File
@@ -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
+3
View File
@@ -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
@@ -749,7 +749,7 @@ export default {
:key="note.note"
:value="note.note"
>
{{note.bezeichnung}}
{{$capitalize(note.bezeichnung)}}
</option>
</form-input>
</div>
@@ -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) {
@@ -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) {
@@ -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';
@@ -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);
},
@@ -439,7 +439,7 @@ export default {
:key="note.note"
:value="note.note"
>
{{note.bezeichnung}}
{{$capitalize(note.bezeichnung)}}
</option>
</form-input>
<div class="col-4">
@@ -530,7 +530,7 @@ export default {
:key="note.note"
:value="note.note"
>
{{note.bezeichnung}}
{{$capitalize(note.bezeichnung)}}
</option>
</form-input>
</div>
@@ -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) }}
</option>
</form-input>