diff --git a/application/controllers/api/frontend/v1/stv/Projektarbeit.php b/application/controllers/api/frontend/v1/stv/Projektarbeit.php index 1f1035c98..d26d6a10c 100644 --- a/application/controllers/api/frontend/v1/stv/Projektarbeit.php +++ b/application/controllers/api/frontend/v1/stv/Projektarbeit.php @@ -287,10 +287,7 @@ class Projektarbeit extends FHCAPI_Controller */ public function getNoten() { - $this->NoteModel->addOrder('notenwert', 'ASC'); - $this->NoteModel->addOrder('bezeichnung', 'ASC'); - - $result = $this->NoteModel->load(); + $result = $this->NoteModel->getAllActive(); if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index 1c272a501..05605d8c7 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -211,7 +211,7 @@ export const AbgabetoolAssistenz = { {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4orgformv2'))), field: 'orgform', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: false}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4projekttyp'))), field: 'projekttyp_kurzbz', formatter: this.centeredTextFormatter, minWidth: 150, visible: false}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4stg'))), field: 'stg', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: false}, - {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4note'))), field: 'note_bez', headerFilter: true, visible: false, minWidth: 200, formatter: this.centeredTextFormatter}, + {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4note'))), field: 'note_bez', headerFilter: true, sorter: this.notenSorter, visible: false, minWidth: 200, formatter: this.centeredTextFormatter}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4sem'))), field: 'studiensemester_kurzbz', headerFilter: true, visible: false, formatter: this.centeredTextFormatter, minWidth: 100}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4titel'))), field: 'titel', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerv2'))), field: 'erstbetreuer', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false}, @@ -433,6 +433,7 @@ export const AbgabetoolAssistenz = { if (!val) return ''; return val?.bezeichnung ?? this.notenOptions?.find(n => n.note == val)?.bezeichnung ?? val; }, + sorter: this.notenSorterFlat, minWidth: 100, tooltip: false, headerFilter: this.notenHeaderFilterEditor, @@ -521,6 +522,18 @@ export const AbgabetoolAssistenz = { }; }, methods: { + notenSorterFlat(a, b, aRow, bRow, column, dir, sorterParams) { + // flat table has their own sort since the field is called sligthly different in that context + // since note would be bestanden/nicht bestanden and that hardly needs sorting + const aData = aRow.getData() + const bData = bRow.getData() + return aData.pa_note - bData.pa_note + }, + notenSorter(a, b, aRow, bRow, column, dir, sorterParams) { + const aData = aRow.getData() + const bData = bRow.getData() + return aData.note - bData.note + }, notenHeaderFilterEditor(cell, onRendered, success, cancel, editorParams) { if (!this.notenOptions) return; @@ -1785,7 +1798,8 @@ export const AbgabetoolAssistenz = { if(this.notenOptions && projekt.note) { const opt = this.notenOptions.find(n => n.note == projekt.note) - // TODO: mehrsprachig englisch + // TODO: mehrsprachig englisch -> nevermind the english field in + // notenoption->bezeichnung_mehrsprachig is ALWAYS german projekt.note_bez = opt.bezeichnung } diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js index 7c90a6fd0..1839ee059 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js @@ -145,7 +145,7 @@ export const AbgabetoolMitarbeiter = { {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4orgformv2'))), field: 'orgform', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: false}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4projekttyp'))), field: 'projekttyp_kurzbz', formatter: this.centeredTextFormatter, minWidth: 100,visible: true}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4stg'))), field: 'stg', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 50, visible: true}, - {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4note'))), field: 'note_bez', headerFilter: true, visible: false, minWidth: 200, formatter: this.centeredTextFormatter}, + {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4note'))), field: 'note_bez', headerFilter: true, visible: false, sorter: this.notenSorter, minWidth: 200, formatter: this.centeredTextFormatter}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4sem'))), field: 'studiensemester_kurzbz', headerFilter: true, formatter: this.centeredTextFormatter, visible: true, minWidth: 100}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4titel'))), field: 'titel', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, width: 500, visible: true}, {title: Vue.computed(() => this.$capitalize(this.$p.t('abgabetool/c4erstbetreuerv2'))), field: 'betreuer_full_name', headerFilter: true, formatter: this.centeredTextFormatter, minWidth: 100, visible: false}, @@ -264,6 +264,11 @@ export const AbgabetoolMitarbeiter = { ]}; }, methods: { + notenSorter(a, b, aRow, bRow, column, dir, sorterParams) { + const aData = aRow.getData() + const bData = bRow.getData() + return aData.note - bData.note + }, async openBenotung(type, link) { if(type === 'new') { window.open(link, '_blank') @@ -1209,14 +1214,19 @@ export const AbgabetoolMitarbeiter = { return (projekt.typ + projekt.kurzbz)?.toUpperCase() }, setupData(data){ - - this.domain = data[1] this.projektarbeiten = data[0]?.retval?.map(projekt => { this.checkAbgabetermineProjektarbeit(projekt) projekt.selectable = projekt.betreuerart_kurzbz !== 'Zweitbegutachter' + if(this.notenOptions && projekt.note) { + const opt = this.notenOptions.find(n => n.note == projekt.note) + // TODO: mehrsprachig englisch -> nevermind the english field in + // notenoption->bezeichnung_mehrsprachig is ALWAYS german + projekt.note_bez = opt?.bezeichnung + } + return { ...projekt, details: {