mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Studierendenverwaltung Projektarbeit: added phrases, only necessary Projektarbeit properties are set when saving
This commit is contained in:
@@ -217,23 +217,25 @@ export default {
|
||||
getPreparedFormData() {
|
||||
let preparedFormData = JSON.parse(JSON.stringify(this.formData)); // deep copy
|
||||
|
||||
// set firma Id
|
||||
if (preparedFormData.firma)
|
||||
preparedFormData.firma_id = preparedFormData.firma.firma_id;
|
||||
else
|
||||
preparedFormData.firma_id = null;
|
||||
|
||||
// delete "helper" fields
|
||||
if (preparedFormData.projektarbeit_id == null) delete(preparedFormData.projektarbeit_id);
|
||||
if (preparedFormData.firma) preparedFormData.firma_id = preparedFormData.firma.firma_id;
|
||||
delete(preparedFormData.firma);
|
||||
delete(preparedFormData.firma_name);
|
||||
delete(preparedFormData.lehrveranstaltung_id);
|
||||
|
||||
return preparedFormData;
|
||||
}
|
||||
//~ setDefaultFormData() {
|
||||
//~ this.resetForm();
|
||||
//~ },
|
||||
},
|
||||
template: `
|
||||
<form-form v-if="!this.student.length" ref="formDetails" @submit.prevent>
|
||||
|
||||
<legend>{{this.$p.t('global','details')}}</legend>
|
||||
<legend>Details</legend>
|
||||
<p v-if="statusNew">[{{$p.t('ui', 'neu')}}]</p>
|
||||
|
||||
<div class="row mb-3">
|
||||
@@ -242,8 +244,7 @@ export default {
|
||||
type="text"
|
||||
name="titel"
|
||||
:label="$p.t('projektarbeit', 'titel')"
|
||||
v-model="formData.titel"
|
||||
>
|
||||
v-model="formData.titel">
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
@@ -272,7 +273,7 @@ export default {
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="stv-details-projektarbeit-typ"
|
||||
:label="$p.t('global', 'typ')"
|
||||
:label="$p.t('projektarbeit', 'typ')"
|
||||
type="select"
|
||||
v-model="formData.projekttyp_kurzbz"
|
||||
name="projekttyp_kurzbz"
|
||||
@@ -326,7 +327,7 @@ export default {
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="stv-details-projektarbeit-le"
|
||||
:label="$p.t('global', 'lvTeil')"
|
||||
:label="$p.t('projektarbeit', 'lvTeil')"
|
||||
type="select"
|
||||
v-model="formData.lehreinheit_id"
|
||||
name="lehreinheit_id"
|
||||
@@ -370,7 +371,7 @@ export default {
|
||||
<div class="row mb-3 align-items-center">
|
||||
<form-input
|
||||
container-class="col-8 stv-details-projektarbeit-gesperrtbis"
|
||||
:label="$p.t('projektarbeit', 'gesperrtbis')"
|
||||
:label="$p.t('projektarbeit', 'gesperrtBis')"
|
||||
type="DatePicker"
|
||||
v-model="formData.gesperrtbis"
|
||||
auto-apply
|
||||
@@ -413,7 +414,7 @@ export default {
|
||||
container-class="form-check stv-details-projektarbeit-final"
|
||||
type="checkbox"
|
||||
name="final"
|
||||
:label="$p.t('projektarbeit','final')"
|
||||
label="final"
|
||||
v-model="formData.final"
|
||||
>
|
||||
</form-input>
|
||||
|
||||
+42
-24
@@ -4,7 +4,6 @@ import FormForm from '../../../../Form/Form.js';
|
||||
import FormInput from '../../../../Form/Input.js';
|
||||
import PvAutoComplete from "../../../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js";
|
||||
|
||||
|
||||
import ApiStvProjektarbeit from '../../../../../api/factory/stv/projektarbeit.js';
|
||||
import ProjektarbeitDetails from "./Details.js";
|
||||
import Projektbetreuer from "./Projektbetreuer.js";
|
||||
@@ -30,11 +29,11 @@ export default {
|
||||
$reloadList: {
|
||||
from: '$reloadList',
|
||||
required: true
|
||||
},
|
||||
isBerechtigtDocAndOdt: {
|
||||
from: 'hasPermissionOutputformat',
|
||||
default: false
|
||||
}
|
||||
//~ isBerechtigtDocAndOdt: {
|
||||
//~ from: 'hasPermissionOutputformat',
|
||||
//~ default: false
|
||||
//~ }
|
||||
},
|
||||
computed: {
|
||||
//~ studentUids() {
|
||||
@@ -44,16 +43,16 @@ export default {
|
||||
//~ }
|
||||
//~ return this.student.map(e => e.uid);
|
||||
//~ },
|
||||
studentKzs(){
|
||||
if (this.student.uid)
|
||||
{
|
||||
return [this.student.studiengang_kz];
|
||||
}
|
||||
return this.student.map(e => e.studiengang_kz);
|
||||
},
|
||||
stg_kz(){
|
||||
return this.studentKzs.length > 0 ? this.studentKzs.length[0] : null;
|
||||
}
|
||||
//~ studentKzs(){
|
||||
//~ if (this.student.uid)
|
||||
//~ {
|
||||
//~ return [this.student.studiengang_kz];
|
||||
//~ }
|
||||
//~ return this.student.map(e => e.studiengang_kz);
|
||||
//~ },
|
||||
//~ stg_kz(){
|
||||
//~ return this.studentKzs.length > 0 ? this.studentKzs.length[0] : null;
|
||||
//~ }
|
||||
},
|
||||
props: {
|
||||
student: Object
|
||||
@@ -220,19 +219,38 @@ export default {
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'ui']);
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'ui', 'projektarbeit']);
|
||||
|
||||
|
||||
let cm = this.$refs.table.tabulator.columnManager;
|
||||
|
||||
//~ cm.getColumnByField('vorsitz_nachname').component.updateDefinition({
|
||||
//~ title: this.$p.t('abschlusspruefung', 'vorsitz_header')
|
||||
//~ });
|
||||
/*
|
||||
cm.getColumnByField('actions').component.updateDefinition({
|
||||
title: this.$p.t('global', 'aktionen')
|
||||
});
|
||||
*/
|
||||
cm.getColumnByField('projekttyp_kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'typ')
|
||||
});
|
||||
cm.getColumnByField('titel').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'titel')
|
||||
});
|
||||
cm.getColumnByField('beginn').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'beginn')
|
||||
});
|
||||
cm.getColumnByField('ende').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'ende')
|
||||
});
|
||||
cm.getColumnByField('freigegeben').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'freigegeben')
|
||||
});
|
||||
cm.getColumnByField('gesperrtbis').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'gesperrtBis')
|
||||
});
|
||||
cm.getColumnByField('themenbereich').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'themenbereich')
|
||||
});
|
||||
cm.getColumnByField('anmerkung').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'anmerkung')
|
||||
});
|
||||
cm.getColumnByField('firma_id').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'firmaId')
|
||||
});
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
+14
-14
@@ -128,7 +128,7 @@ export default {
|
||||
.call(ApiStvProjektbetreuer.getDefaultStundensaetze(person_id, this.studiensemester_kurzbz))
|
||||
.then(result => {
|
||||
this.resetForm();
|
||||
let projektbetreuerListe = this.$refs.table.tabulator.getData();
|
||||
let projektbetreuerListe = this.$refs.projektbetreuerTable.tabulator.getData();
|
||||
const idx = projektbetreuerListe.findIndex(
|
||||
betr =>
|
||||
betr.person_id === person_id &&
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
return this.deleteProjektbetreuer(projektarbeit_id, person_id, betreuerart_kurzbz)
|
||||
})
|
||||
.then(result => {
|
||||
this.$refs.table.tabulator.deleteRow(betreuer_id);
|
||||
this.$refs.projektbetreuerTable.tabulator.deleteRow(betreuer_id);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
@@ -192,12 +192,12 @@ export default {
|
||||
this.$api
|
||||
.call(ApiStvProjektbetreuer.getProjektbetreuer(projektarbeit_id))
|
||||
.then(result => {
|
||||
this.$refs.table.tabulator.setData(this.addIds(result.data));
|
||||
this.$refs.projektbetreuerTable.tabulator.setData(this.addIds(result.data));
|
||||
this.resetForm();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
} else {
|
||||
this.$refs.table.tabulator.setData([]);
|
||||
this.$refs.projektbetreuerTable.tabulator.setData([]);
|
||||
this.resetForm();
|
||||
}
|
||||
},
|
||||
@@ -206,9 +206,9 @@ export default {
|
||||
|
||||
if (typeof this.formData.betreuer_id == 'undefined') {
|
||||
this.formData.betreuer_id = this.getNewBetreuerId();
|
||||
this.$refs.table.tabulator.addData(this.addAutoCompleteBetreuerToFormData(this.formData));
|
||||
this.$refs.projektbetreuerTable.tabulator.addData(this.addAutoCompleteBetreuerToFormData(this.formData));
|
||||
} else {
|
||||
this.$refs.table.tabulator.updateData([this.formData]);
|
||||
this.$refs.projektbetreuerTable.tabulator.updateData([this.formData]);
|
||||
this.statusNew = true;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ export default {
|
||||
saveProjektbetreuer(projektarbeit_id) {
|
||||
this.confirmProjektbetreuer();
|
||||
return this.$refs.formProjektbetreuer.call(
|
||||
ApiStvProjektbetreuer.saveProjektbetreuer(projektarbeit_id, this.$refs.table.tabulator.getData())
|
||||
ApiStvProjektbetreuer.saveProjektbetreuer(projektarbeit_id, this.$refs.projektbetreuerTable.tabulator.getData())
|
||||
);
|
||||
},
|
||||
deleteProjektbetreuer(projektarbeit_id, person_id, betreuerart_kurzbz) {
|
||||
@@ -252,7 +252,7 @@ export default {
|
||||
});
|
||||
},
|
||||
validateProjektbetreuer() {
|
||||
let alleBetreuer = this.$refs.table.tabulator.getData();
|
||||
let alleBetreuer = this.$refs.projektbetreuerTable.tabulator.getData();
|
||||
|
||||
if (this.betreuerFormOpened) {
|
||||
alleBetreuer.push(this.addAutoCompleteBetreuerToFormData(this.formData));
|
||||
@@ -315,7 +315,7 @@ export default {
|
||||
getNewBetreuerId() {
|
||||
let max = 0;
|
||||
|
||||
for (const betreuer of this.$refs.table.tabulator.getData()) {
|
||||
for (const betreuer of this.$refs.projektbetreuerTable.tabulator.getData()) {
|
||||
if (betreuer.betreuer_id > max) max = betreuer.betreuer_id;
|
||||
}
|
||||
|
||||
@@ -332,23 +332,23 @@ export default {
|
||||
return false;
|
||||
},
|
||||
reload() {
|
||||
this.$refs.table.reloadTable();
|
||||
this.$refs.projektbetreuerTable.reloadTable();
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details-projektbetreuer h-100 pb-3">
|
||||
|
||||
<legend>{{this.$p.t('stv','betreuer')}}</legend>
|
||||
<legend>{{this.$p.t('projektarbeit','betreuer')}}</legend>
|
||||
<!-- <p v-if="statusNew">[{{$p.t('ui', 'neu')}}]</p> -->
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
ref="projektbetreuerTable"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
new-btn-show
|
||||
:new-btn-label="this.$p.t('stv', 'betreuer')"
|
||||
:new-btn-label="this.$p.t('projektarbeit', 'betreuer')"
|
||||
@click:new="actionNewProjektbetreuer"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
@@ -372,7 +372,7 @@ export default {
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="col-6 stv-details-projektbetreuer-betreuerart"
|
||||
:label="$p.t('global', 'betreuer')"
|
||||
:label="$p.t('projektarbeit', 'betreuer')"
|
||||
type="select"
|
||||
v-model="formData.betreuerart_kurzbz"
|
||||
name="betreuerart_kurzbz"
|
||||
|
||||
Reference in New Issue
Block a user