mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-19 13:09:27 +00:00
refactor detail Header, relaod array if semester changed, show no status if no status, phrase
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class DetailHeader extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getSemesterStati' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getSemesterStati($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$result = $this->PrestudentstatusModel->getAllPrestudentstatiWithStudiensemester($prestudent_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,4 +34,10 @@ export default {
|
||||
url: 'api/frontend/v1/vertraege/vertraege/getLeitungOrg/' + oekurzbz,
|
||||
};
|
||||
},
|
||||
getSemesterStati(prestudent_id){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/detailheader/DetailHeader/getSemesterStati/' + prestudent_id,
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -7,6 +7,9 @@ export default {
|
||||
from: 'configDomain',
|
||||
default: 'technikum-wien.at'
|
||||
},
|
||||
currentSemester: {
|
||||
from: 'currentSemester',
|
||||
},
|
||||
},
|
||||
props: {
|
||||
headerData: {
|
||||
@@ -51,6 +54,10 @@ export default {
|
||||
console.error("Error loading department data:", error);
|
||||
});
|
||||
}
|
||||
|
||||
if(this.headerData){
|
||||
this.getSemesterStati(this.headerData[0].prestudent_id);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
person_id: {
|
||||
@@ -65,12 +72,27 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
currentSemester: {
|
||||
handler(newVal) {
|
||||
if (newVal) {
|
||||
if(!this.semesterStati.some(item => item.studiensemester_kurzbz === this.currentSemester)) {
|
||||
this.noCurrentStatus = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.noCurrentStatus = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
headerDataMa: {},
|
||||
departmentData: {},
|
||||
leitungData: {},
|
||||
noCurrentStatus: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -109,6 +131,14 @@ export default {
|
||||
} else {
|
||||
return 'data:image/jpeg;base64,' + foto;
|
||||
}
|
||||
},
|
||||
getSemesterStati(prestudent_id){
|
||||
return this.$api
|
||||
.call(ApiDetailHeader.getSemesterStati(prestudent_id))
|
||||
.then(result => {
|
||||
this.semesterStati = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -149,11 +179,11 @@ export default {
|
||||
{{headerData[0].person_id}}
|
||||
<strong class="text-muted">| {{$p.t('lehre', 'studiengang')}} </strong>
|
||||
{{headerData[0].stg_bezeichnung}} ({{headerData[0].studiengang}})
|
||||
<strong v-if="headerData[0].semester" class="text-muted"> | {{$p.t('lehre', 'semester')}} </strong>
|
||||
<strong v-if="headerData[0].semester != null" class="text-muted"> | {{$p.t('lehre', 'semester')}} </strong>
|
||||
{{headerData[0].semester}}
|
||||
<strong v-if="headerData[0].verband" class="text-muted"> | {{$p.t('lehre', 'verband')}}</strong>
|
||||
{{headerData[0].verband}}
|
||||
<strong v-if="headerData[0].gruppe" class="text-muted"> | {{$p.t('lehre', 'gruppe')}} </strong>
|
||||
<strong v-if="headerData[0].gruppe !== ' ' && headerData[0].gruppe != null" class="text-muted"> | {{$p.t('lehre', 'gruppe')}} </strong>
|
||||
{{headerData[0].gruppe}}
|
||||
</h5>
|
||||
|
||||
@@ -162,12 +192,16 @@ export default {
|
||||
<span>
|
||||
<a :href="'mailto:'+headerData[0]?.mail_intern">{{headerData[0].mail_intern}}</a>
|
||||
</span>
|
||||
<strong v-if="headerData[0].statusofsemester" class="text-muted"> | Status </strong>
|
||||
{{headerData[0].statusofsemester}}
|
||||
<strong class="text-muted"> | Status </strong>
|
||||
<span v-if="noCurrentStatus">
|
||||
<strong class="text-danger">{{$p.t('lehre', 'textNoStatus')}}</strong>
|
||||
</span>
|
||||
<span v-else>
|
||||
{{headerData[0].statusofsemester}}
|
||||
</span>
|
||||
<strong class="text-muted"> | {{$p.t('person', 'matrikelnummer')}} </strong>
|
||||
{{headerData[0].matr_nr}}
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -422,6 +422,12 @@ export default {
|
||||
this.$refs.searchbar.abort();
|
||||
this.$refs.searchbar.hideresult();
|
||||
},
|
||||
handleReloadStudent(students){
|
||||
this.$refs.stvList.updateUrl(
|
||||
ApiStv.students.uid(students[0].uid,'CURRENT_SEMESTER'),
|
||||
true
|
||||
);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.url_studiensemester_kurzbz) {
|
||||
@@ -629,7 +635,7 @@ export default {
|
||||
<stv-list ref="stvList" v-model:selected="selected" :studiengang-kz="studiengangKz" :studiensemester-kurzbz="studiensemesterKurzbz"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details ref="details" :students="selected"></stv-details>
|
||||
<stv-details ref="details" :students="selected" @reloadStudent:students="handleReloadStudent"></stv-details>
|
||||
</template>
|
||||
</vertical-split>
|
||||
</main>
|
||||
|
||||
@@ -8,6 +8,11 @@ import ApiStvApp from '../../../api/factory/stv/app.js';
|
||||
|
||||
export default {
|
||||
name: "DetailsPrestudent",
|
||||
inject: {
|
||||
currentSemester: {
|
||||
from: 'currentSemester',
|
||||
},
|
||||
},
|
||||
components: {
|
||||
FhcTabs,
|
||||
FhcHeader
|
||||
@@ -21,6 +26,9 @@ export default {
|
||||
props: {
|
||||
students: Array
|
||||
},
|
||||
emits: [
|
||||
'reloadStudent:students'
|
||||
],
|
||||
computed: {
|
||||
appRoot() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root;
|
||||
@@ -39,13 +47,30 @@ export default {
|
||||
return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid));
|
||||
}
|
||||
return Object.fromEntries(Object.entries(this.configStudents).filter(([ , value ]) => !value.showOnlyWithUid && !value.showOnlyWithUid));
|
||||
}
|
||||
},
|
||||
/* studiensemester(){
|
||||
if(this.students)
|
||||
return this.students.query_studiensemester_kurzbz;
|
||||
else
|
||||
return null;
|
||||
//return this.students?[0].query_studiensemester_kurzbz || null;
|
||||
},*/
|
||||
},
|
||||
watch: {
|
||||
'$p.user_language.value'(n, o) {
|
||||
if (n !== o && o !== undefined)
|
||||
this.loadConfig();
|
||||
},
|
||||
currentSemester(newVal) {
|
||||
if (
|
||||
this.students &&
|
||||
this.students.length > 0 &&
|
||||
newVal !== this.students[0].query_studiensemester_kurzbz
|
||||
) {
|
||||
this.$emit('reloadStudent:students', this.students);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
loadConfig() {
|
||||
@@ -65,7 +90,7 @@ export default {
|
||||
reload() {
|
||||
if (this.$refs.tabs?.$refs?.current?.reload)
|
||||
this.$refs.tabs.$refs.current.reload();
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadConfig();
|
||||
|
||||
@@ -56144,6 +56144,26 @@ I have been informed that I am under no obligation to consent to the transmissio
|
||||
)
|
||||
),
|
||||
// ### Refactor Messages END
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'textNoStatus',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Kein Status',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'No status',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user