diff --git a/application/controllers/components/stv/Config.php b/application/controllers/components/stv/Config.php index a0fd4f53a..efc93e3d8 100644 --- a/application/controllers/components/stv/Config.php +++ b/application/controllers/components/stv/Config.php @@ -23,6 +23,10 @@ class Config extends FHC_Controller 'title' => 'Kontakt', 'component' => './Stv/Studentenverwaltung/Details/Kontakt.js' ]; + $result['noten'] = [ + 'title' => 'Noten', + 'component' => './Stv/Studentenverwaltung/Details/Noten.js' + ]; $result['notizen'] = [ 'title' => 'Notizen', 'component' => './Stv/Studentenverwaltung/Details/Notizen.js' diff --git a/application/controllers/components/stv/Noten.php b/application/controllers/components/stv/Noten.php new file mode 100644 index 000000000..6ba5863c5 --- /dev/null +++ b/application/controllers/components/stv/Noten.php @@ -0,0 +1,43 @@ + 'student/noten:r' + ]); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + } + + public function getZeugnis($prestudent_id) + { + $this->load->model('crm/Student_model', 'StudentModel'); + $this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); + + $result = $this->StudentModel->loadWhere([ + 'prestudent_id' => $prestudent_id + ]); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + return $this->outputJson($result); + } + if (!hasData($result)) + return $this->outputJsonSuccess(null); + + $student_uid = current(getData($result))->student_uid; + + $studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell'); + + $result = $this->ZeugnisnoteModel->getZeugnisnoten($student_uid, $studiensemester_kurzbz); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + + return $this->outputJson($result); + } +} diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css index 85601381a..f845adc43 100644 --- a/public/css/Studentenverwaltung.css +++ b/public/css/Studentenverwaltung.css @@ -1,5 +1,7 @@ @import './components/searchbar.css'; @import './components/verticalsplit.css'; +@import './components/FilterComponent.css'; +@import './components/Tabs.css'; @import './components/Notiz.css'; html { diff --git a/public/css/Tabulator5.css b/public/css/Tabulator5.css index a9a79a6d8..2c7fa9117 100644 --- a/public/css/Tabulator5.css +++ b/public/css/Tabulator5.css @@ -41,3 +41,9 @@ .tabulator { font-size: 1rem; } + +.tabulator-row.tabulator-selectable:focus { + box-shadow: 0 0 0 .24rem rgba(13,110,253,.25); + z-index: 1; + outline: 0; +} diff --git a/public/css/components/Tabs.css b/public/css/components/Tabs.css new file mode 100644 index 000000000..7127869f0 --- /dev/null +++ b/public/css/components/Tabs.css @@ -0,0 +1,16 @@ +.nav-item.nav-link:focus { + box-shadow: 0 0 0 .24rem rgba(13,110,253,.25); + z-index: 1; + outline: 0; + position: relative; +} +.nav-item.nav-link:focus::after { + content: ""; + display: block; + position: absolute; + left: -.5rem; + right: -.5rem; + top: calc(100% + 1px); + background: white; + height: .25rem; +} diff --git a/public/js/components/Form/Upload/Image.js b/public/js/components/Form/Upload/Image.js index 99128f9c5..270108ace 100644 --- a/public/js/components/Form/Upload/Image.js +++ b/public/js/components/Form/Upload/Image.js @@ -46,7 +46,7 @@ export default { diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index 3f723fdab..74e54cfe8 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -15,6 +15,12 @@ export default { return FHC_JS_DATA_STORAGE_OBJECT.app_root; } }, + methods: { + reload() { + if (this.$refs.tabs?.$refs?.current?.reload) + this.$refs.tabs.$refs.current.reload(); + } + }, template: `
@@ -24,11 +30,11 @@ export default {
profilbild
-

{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}} +

{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}}

- - + +
` }; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Details.js b/public/js/components/Stv/Studentenverwaltung/Details/Details.js index 9d824e142..ebbd68dd2 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Details.js @@ -299,7 +299,7 @@ export default {
- +
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten.js new file mode 100644 index 000000000..8e8269ee5 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten.js @@ -0,0 +1,19 @@ +import NotenZeugnis from './Noten/Zeugnis.js'; + +export default { + components: { + NotenZeugnis + }, + props: { + modelValue: Object + }, + methods: { + reload() { + this.$refs.zeugnis.$refs.table.reloadTable(); + } + }, + template: ` +
+ +
` +}; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js new file mode 100644 index 000000000..8dcc52d96 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Noten/Zeugnis.js @@ -0,0 +1,72 @@ +import {CoreFilterCmpt} from "../../../../filter/Filter.js"; +import {CoreRESTClient} from '../../../../../RESTClient.js'; + +export default { + components: { + CoreFilterCmpt + }, + props: { + student: Object + }, + data() { + return { + validStudent: true, + tabulatorEvents: [] + }; + }, + computed: { + ajaxURL() { + return CoreRESTClient._generateRouterURI('components/stv/Noten/getZeugnis/' + this.student.prestudent_id); + }, + tabulatorOptions() { + return { + ajaxURL: this.ajaxURL, + ajaxResponse: (url, params, response) => { + if (!response.retval) + this.validStudent = false; + else + this.validStudent = true; + return response.retval || []; + }, + columns: [ + { field: 'zeugnis', title: 'Zeugnis', formatter: 'tickCross' }, + { field: 'lehrveranstaltung_bezeichnung', title: 'Lehrveranstaltung' }, + { field: 'note_bezeichnung', title: 'Note' }, + { field: 'uebernahmedatum', title: 'Übernahmedatum', visible: false }, + { field: 'benotungsdatum', title: 'Benotungsdatum', visible: false }, + { field: 'benotungsdatum-iso', title: 'Benotungsdatum ISO', visible: false }, + { field: 'studiensemester_kurzbz', title: 'Studiensemester', visible: false }, + { field: 'note', title: 'Note Numerisch', visible: false }, + { field: 'lehrveranstaltung_id', title: 'Lehrveranstaltung ID', visible: false }, + { field: 'studiengang', title: 'Studiengang', visible: false }, + { field: 'studiengang_kz', title: 'Studiengang Kennzahl', visible: false }, + { field: 'studiengang_lv', title: 'StudiengangLV', visible: false }, + { field: 'studiengang_kz_lv', title: 'Studiengang_kzLV', visible: false }, + { field: 'semester_lv', title: 'SemesterLV', visible: false }, + { field: 'ects_lv', title: 'ECTS', visible: false }, + { field: 'lehrform', title: 'Lehrform', visible: false }, + { field: 'kurzbz', title: 'Kurzbz', visible: false }, + { field: 'punkte', title: 'Punkte', visible: false }, + { field: 'lehrveranstaltung_bezeichnung_english', title: 'Englisch', visible: false } + ], + layout: 'fitDataStretch', + height: '100%', + persistence: true + }; + } + }, + template: ` +
+
Kein Student
+ + +
` +}; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/List.js b/public/js/components/Stv/Studentenverwaltung/List.js index 6b262560f..f3e1b1bc0 100644 --- a/public/js/components/Stv/Studentenverwaltung/List.js +++ b/public/js/components/Stv/Studentenverwaltung/List.js @@ -60,11 +60,11 @@ export default { {title:"GeburtsdatumISO", field:"geburtsdatum_iso", visible:false}, ], - layout: 'fitDataFill', + layout: 'fitDataStretch', layoutColumnsOnNewData: false, - height: 'auto', + height: '100%', selectable: true, - // TODO(chris): select only one? selectMultiple with click? + selectableRangeMode: 'click', index: 'prestudent_id', persistence: true }, @@ -126,7 +126,12 @@ export default { case 'Enter': case 'Space': e.preventDefault(); - this.$refs.table.tabulator.rowManager.findRow(this.focusObj).component.toggleSelect(); + const e2 = new Event('click', e); + e2.altKey = e.altKey; + e2.ctrlKey = e.ctrlKey; + e2.shiftKey = e.shiftKey; + this.focusObj.dispatchEvent(e2); + //row.component.toggleSelect(); break; case 'ArrowUp': e.preventDefault(); @@ -159,6 +164,9 @@ export default { } }, onFocus(e) { // TODO(chris): this should be in the filter component + if (e.target.classList.contains('tablulator-container')) { + this.focusObj = this.changeFocus(e.target, e.target.querySelector('.tabulator-row')); + } if (e.target.classList.contains('tabulator-tableholder')) { this.focusObj = this.changeFocus(e.target, e.target.querySelector('.tabulator-row')); } @@ -167,20 +175,21 @@ export default { // TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component // TODO(chris): filter component column chooser has no accessibilty features template: ` -
- - +
+
+ + +
` }; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/List/New.js b/public/js/components/Stv/Studentenverwaltung/List/New.js index d62f92dd3..7bba76e51 100644 --- a/public/js/components/Stv/Studentenverwaltung/List/New.js +++ b/public/js/components/Stv/Studentenverwaltung/List/New.js @@ -150,27 +150,28 @@ export default { }); }, loadStudienplaene() { - CoreRESTClient - .post('components/stv/studienplan/get', { - studiengang_kz: this.formDataStg, - studiensemester_kurzbz: this.formDataSem, - ausbildungssemester: this.formData.ausbildungssemester, - orgform_kurzbz: this.formData.orgform_kurzbz - }) - .then(result => CoreRESTClient.getData(result.data) || []) - .then(result => { - this.studienplaene = result; - if (this.formData.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData.studienplan_id).length) - this.formData.studienplan_id = ''; - }) - .catch(error => { - if (error.code == 'ERR_BAD_REQUEST') { - return this.studienplaene = []; - } - // NOTE(chris): repeat request - if (error.code != "ERR_CANCELED") - window.setTimeout(this.loadStudienplaene, 100); - }) + if (this.formDataStg) + CoreRESTClient + .post('components/stv/studienplan/get', { + studiengang_kz: this.formDataStg, + studiensemester_kurzbz: this.formDataSem, + ausbildungssemester: this.formData.ausbildungssemester, + orgform_kurzbz: this.formData.orgform_kurzbz + }) + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.studienplaene = result; + if (this.formData.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData.studienplan_id).length) + this.formData.studienplan_id = ''; + }) + .catch(error => { + if (error.code == 'ERR_BAD_REQUEST') { + return this.studienplaene = []; + } + // NOTE(chris): repeat request + if (error.code != "ERR_CANCELED") + window.setTimeout(this.loadStudienplaene, 100); + }) }, changeAddressNation(e) { if (this.formData['geburtsnation'] == this.formData['address']['nation']) @@ -280,7 +281,7 @@ export default { - +