add uid@DOMAIN to emails result for prestudent and student, mergedperson render student only results, add searchresult_inaktiv css class to inactive users

This commit is contained in:
Harald Bamberger
2025-07-14 15:16:21 +02:00
parent a1fe2e1b4b
commit 3ed2bb4d78
3 changed files with 47 additions and 10 deletions
+8 -5
View File
@@ -197,11 +197,12 @@ $config['student'] = [
"s.matrikelnr",
"p.person_id",
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"(s.student_uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url"
AS photo_url",
"b.aktiv"
],
'resultjoin' => "
JOIN public.tbl_student s USING (student_uid)
@@ -220,7 +221,8 @@ $config['studentcis']['resultfields'] = [
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url"
AS photo_url",
"b.aktiv"
];
$config['prestudent'] = [
@@ -311,7 +313,7 @@ $config['prestudent'] = [
"p.person_id",
"b.uid",
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"(b.uid || '@" . DOMAIN . "') || ARRAY( SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp = 'email' AND person_id=p.person_id ) AS email",
"CASE
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
@@ -334,7 +336,8 @@ $config['prestudent'] = [
LIMIT 1
),
sg.orgform_kurzbz
) AS orgform"
) AS orgform",
"b.aktiv"
],
'resultjoin' => "
LEFT JOIN public.tbl_prestudent ps USING (prestudent_id)
@@ -107,7 +107,15 @@ export default {
},
defaultactionstudent: {
type: "link",
action: data => this.$fhcApi.getUri('/studentenverwaltung/prestudent/' + data.prestudent_id)
action: data => {
if (data.prestudent_id) {
return this.$fhcApi.getUri('/studentenverwaltung/prestudent/' + data.prestudent_id);
} else if (data.uid) {
return this.$fhcApi.getUri('/studentenverwaltung/student/' + data.uid);
} else {
return this.$fhcApi.getUri('/studentenverwaltung/person/' + data.person_id);
}
}
},
childactions: []
}
@@ -45,7 +45,26 @@ export default {
].includes(item.type)) || null;
},
students() {
const students = this.res.list.filter(item => item.type == 'prestudent');
const students = this.res.list.filter(item => [
'student',
'prestudent',
'studentcis',
'studentStv'
].includes(item.type))
.filter((item, idx, arr) => {
if (item.type === 'prestudent') {
return true;
}
let prestudentwithsameuidexists = arr.some(tmpitem => {
return tmpitem.uid === item.uid && tmpitem.type === 'prestudent';
});
if (prestudentwithsameuidexists) {
return false;
}
return true;
});
return students.length ? students : null;
},
emails() {
@@ -54,11 +73,15 @@ export default {
},
telurl() {
return 'tel:' + this.employee?.phone;
},
inaktiv() {
return this.res.list.some(item => item?.aktiv === false);
}
},
template: `
<template-frame
class="searchbar-result-mergedperson"
:class="(inaktiv) ? 'searchbar_inaktiv' : ''"
:res="person"
:actions="actions"
:title="person.name"
@@ -145,19 +168,22 @@ export default {
<template v-if="mode == 'simple'">
{{ student.studiengang_kz }}
</template>
<template v-else>
<template v-else-if="student.status && student.stg_kuerzel">
{{ student.status }} ({{ student.stg_kuerzel }})
</template>
<template v-else>
{{ $p.t('person/student') }}
</template>
</template-action>
</div>
</div>
<div class="searchbar_tablerow">
<div v-if="student.bezeichnung" class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label ps-3">{{ $p.t('lehre/studiengang') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ student.bezeichnung }} {{ student.orgform ? '(' + student.orgform + ')' : '' }}
</div>
</div>
<div class="searchbar_tablerow">
<div v-if="student.prestudent_id" class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label ps-3">{{ $p.t('search/result_prestudent_id') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ student.prestudent_id }}