diff --git a/public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js
index dfbfa17b3..83788f611 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/MultiStatus.js
@@ -8,11 +8,8 @@ export default {
modelValue: Object,
},
template: `
-
-
-
-
-
+
+
`
}
\ No newline at end of file
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js
index 915594473..0c1cb6e60 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js
@@ -3,6 +3,7 @@ import BsModal from "../../../../Bootstrap/Modal.js";
import FormForm from '../../../../Form/Form.js';
import FormInput from '../../../../Form/Input.js';
import FormValidation from '../../../../Form/Validation.js';
+import StatusModal from '../Status/Modal.js';
export default{
components: {
@@ -11,6 +12,7 @@ export default{
FormForm,
FormInput,
FormValidation,
+ StatusModal
},
inject: {
defaultSemester: {
@@ -426,7 +428,8 @@ export default{
},
methods: {
actionNewStatus() {
- this.statusNew = true;
+ this.$refs.test.open(this.modelValue);
+ /*this.statusNew = true;
this.resetModal();
this.statusData.status_kurzbz = 'Interessent';
this.statusData.studiensemester_kurzbz = this.defaultSemester;
@@ -435,10 +438,11 @@ export default{
this.statusData.bestaetigtam = this.getDefaultDate();
this.statusData.name = this.modelValue.vorname + ' ' + this.modelValue.nachname;
this.$refs.statusData.clearValidation();
- this.$refs.statusModal.show();
+ this.$refs.statusModal.show();*/
},
- actionEditStatus(status, stdsem, ausbildungssemester){
- this.statusNew = false;
+ actionEditStatus(status, stdsem, ausbildungssemester) {
+ this.$refs.test.open(this.modelValue, status, stdsem, ausbildungssemester);
+ /*this.statusNew = false;
this.statusId = {
'prestudent_id': this.modelValue.prestudent_id,
'status_kurzbz': status,
@@ -450,7 +454,7 @@ export default{
this.$refs.statusData.clearValidation();
this.$refs.statusModal.show();
}
- });
+ });*/
},
actionDeleteStatus(status, stdsem, ausbildungssemester){
this.statusId = {
@@ -1051,6 +1055,7 @@ export default{
template: `
+
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js
new file mode 100644
index 000000000..5c9f5594c
--- /dev/null
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js
@@ -0,0 +1,334 @@
+import BsModal from "../../../../Bootstrap/Modal.js";
+import CoreForm from '../../../../Form/Form.js';
+import FormValidation from '../../../../Form/Validation.js';
+import FormInput from '../../../../Form/Input.js';
+
+export default{
+ components: {
+ BsModal,
+ CoreForm,
+ FormValidation,
+ FormInput
+ },
+ inject: {
+ defaultSemester: {
+ from: 'defaultSemester',
+ },
+ hasPrestudentstatusPermission: {
+ from: 'hasPrestudentstatusPermission',
+ default: false
+ },
+ lists: {
+ from: 'lists'
+ },
+ $reloadList: {
+ from: '$reloadList',
+ required: true
+ }
+ },
+ emit: [
+ 'saved'
+ ],
+ props: {
+ meldestichtag: {
+ type: Date,
+ required: true
+ }
+ },
+ data() {
+ return {
+ prestudent: {},
+ orig_datum: null,
+ statusNew: true,
+ statusId: {},
+ formData: {},
+ listStudienplaene: [],
+ listStatusgruende: [],
+ // TODO(chris): IMPLEMENT!
+ maxSem: Array.from({ length: 11 }, (_, index) => index),
+ };
+ },
+ computed: {
+ bisLocked() {
+ // TODO(chris): special right
+ if (this.statusNew)
+ return false;
+
+ if (!this.orig_datum || !this.meldestichtag)
+ return true;
+
+ return this.orig_datum < this.meldestichtag;
+ },
+ isStatusBeforeStudent() {
+ let isStatusStudent = ['Student', 'Absolvent', 'Diplomand'];
+ return !isStatusStudent.includes(this.formData.status_kurzbz);
+ },
+ gruende() {
+ return this.listStatusgruende.filter(grund => grund.status_kurzbz == this.formData.status_kurzbz);
+ }
+ },
+ methods: {
+ open(prestudent, status_kurzbz, studiensemester_kurzbz, ausbildungssemester) {
+ this.$refs.modal.hide();
+ this.prestudent = prestudent;
+ if (!status_kurzbz && !studiensemester_kurzbz && !ausbildungssemester) {
+ this.statusNew = true;
+ this.statusId = prestudent.prestudent_id;
+ this.formData = {
+ status_kurzbz: 'Interessent',
+ studiensemester_kurzbz: this.defaultSemester,
+ ausbildungssemester: 1,
+ datum: new Date(),
+ bestaetigtam: new Date(),
+ bewerbung_abgeschicktamum: null,
+ studienplan_id: null,
+ anmerkung: null,
+ rt_stufe: null,
+ statusgrund_id: null
+ };
+ this.orig_datum = null;
+ this.$refs.form.clearValidation();
+ this.$refs.modal.show();
+ } else {
+ this.statusId = {
+ prestudent_id: prestudent.prestudent_id,
+ status_kurzbz,
+ studiensemester_kurzbz,
+ ausbildungssemester
+ };
+ this.$fhcApi
+ .post('api/frontend/v1/stv/status/loadStatus/', this.statusId)
+ .then(result => {
+ this.statusNew = false;
+ this.formData = result.data;
+ this.orig_datum = new Date(result.data.datum);
+ this.$refs.form.clearValidation();
+ this.$refs.modal.show();
+ })
+ .catch(this.$fhcAlert.handleSystemError);
+ }
+ },
+ insertStatus() {
+ this.$refs.form
+ .post(
+ 'api/frontend/v1/stv/status/insertStatus/' + this.statusId,
+ this.formData
+ )
+ .then(result => {
+ this.$reloadList();
+ this.emit('saved');
+ this.$refs.modal.hide();
+ })
+ .catch(this.$fhcAlert.handleSystemError);
+ },
+ editStatus() {
+ this.$refs.form
+ .post(
+ 'api/frontend/v1/stv/status/updateStatus/' + this.statusId.join('/'),
+ this.formData
+ )
+ .then(result => {
+ this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
+ this.$reloadList();
+ this.emit('saved');
+ this.$refs.modal.hide();
+ })
+ .catch(this.$fhcAlert.handleSystemError);
+ }
+ },
+ created() {
+ // TODO(chris): reload studienpläne on prestudent change
+ this.$fhcApi
+ .get('api/frontend/v1/stv/prestudent/getStudienplaene/' + this.prestudent.prestudent_id)
+ .then(result => result.data)
+ .then(result => {
+ this.listStudienplaene = result;
+ })
+ .catch(this.$fhcAlert.handleSystemError);
+ this.$fhcApi
+ .get('api/frontend/v1/stv/status/getStatusgruende/')
+ .then(result => result.data)
+ .then(result => {
+ this.listStatusgruende = result;
+ })
+ .catch(this.$fhcAlert.handleSystemError);
+ },
+ template: `
+
+
+ TODO: {{ $p.t('lehre', statusNew ? 'status_new' : 'status_edit', prestudent) }}
+
+
+
+
+
+
+
+ {{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrund')}}
+
+
+ {{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrundSemester')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `
+};
\ No newline at end of file