diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index 345ead004..4ff260602 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -140,13 +140,16 @@ class Abgabe extends FHCAPI_Controller $projektarbeiten = getData($result); - // TODO: save access to this, array could be empty - foreach($projektarbeiten as $pa) { - $result = $this->ProjektarbeitModel->getProjektbetreuerEmail($pa->projektarbeit_id); - - // TODO: save access - $pa->email = getData($result)[0]->private_email; + if(count($projektarbeiten)) { + // TODO: save access to this, array could be empty + foreach($projektarbeiten as $pa) { + $result = $this->ProjektarbeitModel->getProjektbetreuerEmail($pa->projektarbeit_id); + + // TODO: save access + $pa->email = getData($result)[0]->private_email; + } } + $this->terminateWithSuccess(array($projektarbeiten, DOMAIN, $uid)); } diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 473e1cf67..5295050a0 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -233,6 +233,7 @@ const app = Vue.createApp({ return { // provide injectable & watchable language property language: Vue.computed(() => this.$p.user_language), renderers: Vue.computed(() => this.renderers), + isMobile: this.isMobile } }, methods: { diff --git a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js index be44b0441..e56ab90ca 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeStudentDetail.js @@ -13,9 +13,11 @@ export const AbgabeStudentDetail = { Checkbox: primevue.checkbox, Dropdown: primevue.dropdown, Textarea: primevue.textarea, + Accordion: primevue.accordion, + AccordionTab: primevue.accordiontab, VueDatePicker }, - inject: ['notenOptions'], + inject: ['notenOptions', 'isMobile'], props: { projektarbeit: { type: Object, @@ -184,6 +186,14 @@ export const AbgabeStudentDetail = { getTerminNoteBezeichnung(termin) { const noteOpt = this.notenOptions.find(opt => opt.note == termin.note) return noteOpt ? noteOpt.bezeichnung : '' + }, + getAccTabHeaderForTermin(termin) { + let tabTitle = '' + + const datumFormatted = this.formatDate(termin.datum) + tabTitle += termin.bezeichnung + ' ' + datumFormatted + + return tabTitle } }, watch: { @@ -230,79 +240,175 @@ export const AbgabeStudentDetail = {

{{projektarbeit?.betreuer}}

{{projektarbeit?.titel}}

-
-
-
{{$p.t('abgabetool/c4fixtermin')}}
-
{{$p.t('abgabetool/c4zieldatum')}}
-
{{$p.t('abgabetool/c4abgabetyp')}}
-
{{$p.t('abgabetool/c4note')}}
-
{{$p.t('abgabetool/c4upload_allowed')}}
-
{{$p.t('abgabetool/c4abgabekurzbz')}}
-
{{$p.t('abgabetool/c4abgabedatum')}}
-
- {{$p.t('abgabetool/c4fileupload')}} -
-
-
-
- - - -
-
-
- - - -
-
-
{{ termin.bezeichnung }}
-
- {{ getTerminNoteBezeichnung(termin) }} -
-
- - -
-
- -
-
- {{ termin.abgabedatum?.split("-").reverse().join(".") }} - - - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js b/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js index a63f781e9..e46f46579 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolStudent.js @@ -12,6 +12,7 @@ export const AbgabetoolStudent = { AbgabeDetail, VerticalSplit }, + inject: ['isMobile'], provide() { return { notenOptions: Vue.computed(() => this.notenOptions) @@ -41,6 +42,8 @@ export const AbgabetoolStudent = { selectedProjektarbeit: null, tableBuiltResolve: null, tableBuiltPromise: null, + dataProcessedPromise: null, + dataProcessedResolve: null, abgabeTableOptions: { minHeight: 250, index: 'projektarbeit_id', @@ -103,12 +106,20 @@ export const AbgabetoolStudent = { ], persistence: false, }, - abgabeTableEventHandlers: [{ + abgabeTableEventHandlers: [ + { event: "tableBuilt", handler: async () => { this.tableBuiltResolve() } }, + { + event: "dataProcessed", + handler: async () => { + console.log('dataProcessed event') + this.dataProcessedResolve() + } + }, { event: "cellClick", handler: async (e, cell) => { @@ -218,6 +229,10 @@ export const AbgabetoolStudent = { tableResolve(resolve) { this.tableBuiltResolve = resolve }, + dataResolve(resolve) { + console.log('dataResolve') + this.dataProcessedResolve = resolve + }, buildMailToLink(projekt) { if(projekt.mitarbeiter_uid) { // standard return 'mailto:' + projekt.mitarbeiter_uid +'@'+ this.domain @@ -228,7 +243,7 @@ export const AbgabetoolStudent = { buildBetreuer(abgabe) { return abgabe.betreuerart_beschreibung + ': ' + (abgabe.btitelpre ? abgabe.btitelpre + ' ' : '') + abgabe.bvorname + ' ' + abgabe.bnachname + (abgabe.btitelpost ? ' ' + abgabe.btitelpost : '') }, - setupData(data){ + async setupData(data){ this.projektarbeiten = data[0] this.domain = data[1] this.student_uid = data[2] @@ -259,13 +274,23 @@ export const AbgabetoolStudent = { } }) - this.$refs.abgabeTable.tabulator.setColumns(this.abgabeTableOptions.columns) + // this.$refs.abgabeTable.tabulator.setColumns(this.abgabeTableOptions.columns) this.$refs.abgabeTable.tabulator.setData(d); + await this.dataProcessedPromise - Vue.nextTick(()=>{ - this.$refs.abgabeTable?.tabulator.setColumns(this.$refs.abgabeTable?.tabulator.getColumnDefinitions()) - }) + // TODO: proper event handling cleanup + + // todo in general fix this nasty race condition + const t = this.$refs.abgabeTable.tabulator; + t.on("renderComplete", () => { + // only if container width is small enough to trigger collapse + if (t.element.offsetWidth < 600 || this.isMobile) { + t.setColumns(t.getColumnDefinitions()); + t.redraw(true) + } + }); + }, loadProjektarbeiten() { this.$api.call(ApiAbgabe.getStudentProjektarbeiten(this.student_uid_prop || this.viewData?.uid || null)) @@ -295,8 +320,9 @@ export const AbgabetoolStudent = { }, async setupMounted() { this.tableBuiltPromise = new Promise(this.tableResolve) + this.dataProcessedPromise = new Promise(this.dataResolve) await this.tableBuiltPromise - + // this.$refs.abgabeTable.tabulator.setColumns(this.abgabeTableOptions.columns) this.loadProjektarbeiten() @@ -338,7 +364,7 @@ export const AbgabetoolStudent = { dialogClass="modal-fullscreen">