Merge branch 'feature-76464/reworking-use-of-controller-viewdata' into cis40_2026-02_rc

This commit is contained in:
Harald Bamberger
2026-04-23 14:20:19 +02:00
36 changed files with 683 additions and 638 deletions
@@ -42,14 +42,6 @@ export const AbgabetoolAssistenz = {
stg_kz_prop: {
default: null
},
viewData: {
type: Object,
required: true,
default: () => ({name: '', uid: ''}),
validator(value) {
return value && value.uid // && value.name -> extensive viewData use only for cis4 onwards
}
}
},
data() {
return {
@@ -31,16 +31,6 @@ export const AbgabetoolMitarbeiter = {
old_abgabe_beurteilung_link: Vue.computed(() => this.old_abgabe_beurteilung_link)
}
},
props: {
viewData: {
type: Object,
required: true,
default: () => ({name: '', uid: ''}),
validator(value) {
return value && value.uid // && value.name -> extensive viewData use only for cis4 onwards
}
}
},
data() {
return {
tableData: null,
@@ -3,6 +3,7 @@ import ApiAbgabe from '../../../api/factory/abgabe.js'
import BsModal from "../../Bootstrap/Modal.js";
import FhcOverlay from "../../Overlay/FhcOverlay.js";
import { getDateStyleClass} from "./getDateStyleClass.js";
import ApiAuthinfo from "../../../api/factory/authinfo.js";
export const AbgabetoolStudent = {
name: "AbgabetoolStudent",
@@ -24,14 +25,6 @@ export const AbgabetoolStudent = {
student_uid_prop: {
default: null
},
viewData: {
type: Object,
required: true,
default: () => ({uid: ''}),
validator(value) {
return value && value.uid
}
}
},
data() {
return {
@@ -44,9 +37,18 @@ export const AbgabetoolStudent = {
detail: null,
projektarbeiten: null,
selectedProjektarbeit: null,
moodle_link: null
moodle_link: null,
uid: null,
};
},
computed: {
isViewMode() {
return this.student_uid !== this.uid
},
student_uid() {
return this.student_uid_prop || this.uid || null
}
},
methods: {
checkQualityGatesStrict(termine) {
let qgate1Passed = false
@@ -258,18 +260,11 @@ export const AbgabetoolStudent = {
},
handleDownloadBeurteilung2(projektarbeit) {
window.open(projektarbeit.beurteilung2)
}
},
watch: {
},
computed: {
isViewMode() {
return this.student_uid !== this.viewData.uid
},
student_uid() {
return this.student_uid_prop || this.viewData?.uid || null
}
async fetchAuthUID() {
const authIdResponse = await this.$api.call(ApiAuthinfo.getAuthUID());
this.uid = authIdResponse.data.uid;
},
},
async created() {
this.phrasenPromise = this.$p.loadCategory(['abgabetool', 'global'])
@@ -302,6 +297,8 @@ export const AbgabetoolStudent = {
}).catch(e => {
this.loading = false
})
await this.fetchAuthUID();
},
mounted() {
this.setupMounted()
@@ -10,14 +10,6 @@ export const DeadlineOverview = {
person_uid_prop: {
default: null
},
viewData: {
type: Object,
required: true,
default: () => ({name: '', uid: ''}),
validator(value) {
return value && value.name && value.uid
}
}
},
data() {
return {
+5 -4
View File
@@ -11,7 +11,6 @@ export default {
FhcCalendar
},
props: {
viewData: Object, // NOTE(chris): this is inherited from router-view
propsViewData: Object
},
data() {
@@ -20,12 +19,13 @@ export default {
studiensemester_start: null,
studiensemester_ende: null,
uid: null,
lv: null
lv: null,
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
};
},
computed:{
currentDay() {
return this.propsViewData?.focus_date || luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
return this.propsViewData?.focus_date || luxon.DateTime.now().setZone(this.timezone).toISODate();
},
currentMode() {
return this.propsViewData?.mode || DEFAULT_MODE_LVPLAN;
@@ -34,7 +34,7 @@ export default {
if (!this.studiensemester_start || !this.studiensemester_ende || !this.uid)
return false;
const opts = { zone: FHC_JS_DATA_STORAGE_OBJECT.timezone };
const opts = { zone: this.timezone };
const start = luxon.DateTime
.fromISO(this.studiensemester_start, opts)
.toUnixInteger();
@@ -114,6 +114,7 @@ export default {
<fhc-calendar
ref="calendar"
v-model:lv="lv"
:timezone="timezone"
:get-promise-func="getPromiseFunc"
:date="currentDay"
:mode="currentMode"
@@ -11,7 +11,6 @@ export default {
FhcCalendar
},
props: {
viewData: Object, // NOTE(chris): this is inherited from router-view
propsViewData: Object
},
data() {
@@ -21,13 +20,14 @@ export default {
studiensemester_ende: null,
uid: null,
isMitarbeiter: false,
isStudent: false
isStudent: false,
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
};
},
computed:{
currentDay() {
if (!this.propsViewData?.focus_date || isNaN(new Date(this.propsViewData?.focus_date)))
return luxon.DateTime.now().setZone(FHC_JS_DATA_STORAGE_OBJECT.timezone).toISODate();
return luxon.DateTime.now().setZone(this.timezone).toISODate();
return this.propsViewData?.focus_date;
},
currentMode() {
@@ -47,7 +47,7 @@ export default {
return;
}
const opts = { zone: FHC_JS_DATA_STORAGE_OBJECT.timezone };
const opts = { zone: this.timezone };
const start = luxon.DateTime
.fromISO(this.studiensemester_start, opts)
.toUnixInteger();
@@ -102,16 +102,18 @@ export default {
this.$api.call(ApiLvPlan.eventsPersonal(start.toISODate(), end.toISODate())),
this.$api.call(ApiLvPlan.getLvPlanReservierungen(start.toISODate(), end.toISODate()))
];
}
},
async fetchAuthInfo() {
const authInfoResponse = await this.$api.call(ApiAuthinfo.getAuthInfo());
const authInfo = authInfoResponse.data;
this.uid = authInfo.uid;
this.isMitarbeiter = authInfo.isMitarbeiter;
this.isStudent = authInfo.isStudent;
},
},
created() {
this.$api
.call(ApiAuthinfo.getAuthInfo())
.then(res => {
this.uid = res.data.uid;
this.isMitarbeiter = res.data.isMitarbeiter;
this.isStudent = res.data.isStudent;
});
async created() {
await this.fetchAuthInfo();
},
template: /*html*/`
<div class="cis-lvplan-personal d-flex flex-column h-100">
@@ -123,7 +125,9 @@ export default {
</h2>
<hr>
<fhc-calendar
v-if="timezone"
ref="calendar"
:timezone="timezone"
:get-promise-func="getPromiseFunc"
:date="currentDay"
:mode="currentMode"
+197 -183
View File
@@ -9,196 +9,209 @@ import ApiAuthinfo from "../../../api/factory/authinfo.js";
export const DEFAULT_MODE_LVPLAN = "Week";
export default {
name: "OtherLvPlan",
components: {
FormForm,
FormInput,
FhcCalendar,
},
props: {
viewData: Object,
propsViewData: Object,
},
data() {
return {
localProps: {},
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
isOtherPersonMitarbeiter: false,
isOtherPersonStudent: false,
currentStgBezeichnung: null,
listVerband: [],
listGroup: [],
rangeIntervalFirst: null,
otherPersonData: {
fullName: "",
photo: "",
},
};
},
computed: {
currentDay() {
if (
!this.propsViewData?.focus_date ||
isNaN(new Date(this.propsViewData?.focus_date))
)
return luxon.DateTime.now().setZone(this.viewData.timezone).toISODate();
return this.propsViewData?.focus_date;
},
currentMode() {
if (
!this.propsViewData?.mode ||
!["day", "week", "month"].includes(
this.propsViewData?.mode.toLowerCase(),
)
)
return DEFAULT_MODE_LVPLAN;
return this.propsViewData?.mode;
},
downloadLinks() {
if (
!this.studiensemester_start ||
!this.studiensemester_ende ||
!this.propsViewData.otherUid
)
return false;
name: "OtherLvPlan",
components: {
FormForm,
FormInput,
FhcCalendar,
},
props: {
propsViewData: Object,
},
data() {
return {
localProps: {},
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
isOtherPersonMitarbeiter: false,
isOtherPersonStudent: false,
currentStgBezeichnung: null,
listVerband: [],
listGroup: [],
rangeIntervalFirst: null,
otherPersonData: {
fullName: "",
photo: "",
},
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
};
},
computed: {
currentDay() {
if (
!this.propsViewData?.focus_date ||
isNaN(new Date(this.propsViewData?.focus_date))
)
return luxon.DateTime.now().setZone(this.timezone).toISODate();
return this.propsViewData?.focus_date;
},
currentMode() {
if (
!this.propsViewData?.mode ||
!["day", "week", "month"].includes(
this.propsViewData?.mode.toLowerCase(),
)
)
return DEFAULT_MODE_LVPLAN;
return this.propsViewData?.mode;
},
downloadLinks() {
if (
!this.studiensemester_start ||
!this.studiensemester_ende ||
!this.propsViewData.otherUid
)
return false;
const type = this.isOtherPersonStudent
? "student"
: this.isOtherPersonMitarbeiter
? "lektor"
: null;
const type = this.isOtherPersonStudent
? "student"
: this.isOtherPersonMitarbeiter
? "lektor"
: null;
if (!type) return;
if (!type) return;
const opts = { zone: this.viewData.timezone };
const start = luxon.DateTime.fromISO(
this.studiensemester_start,
opts,
).toUnixInteger();
const ende = luxon.DateTime.fromISO(
this.studiensemester_ende,
opts,
).toUnixInteger();
const opts = { zone: this.timezone };
const start = luxon.DateTime.fromISO(
this.studiensemester_start,
opts,
).toUnixInteger();
const ende = luxon.DateTime.fromISO(
this.studiensemester_ende,
opts,
).toUnixInteger();
const download_link =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
"cis/private/lvplan/stpl_kalender.php" +
"?type=" +
type +
"&pers_uid=" +
this.propsViewData.otherUid +
"&begin=" +
start +
"&ende=" +
ende;
const download_link =
FHC_JS_DATA_STORAGE_OBJECT.app_root +
"cis/private/lvplan/stpl_kalender.php" +
"?type=" +
type +
"&pers_uid=" +
this.propsViewData.otherUid +
"&begin=" +
start +
"&ende=" +
ende;
return [
{
title: "excel",
icon: "fa-solid fa-file-excel",
link: download_link + "&format=excel",
},
{
title: "csv",
icon: "fa-solid fa-file-csv",
link: download_link + "&format=csv",
},
{
title: "ical1",
icon: "fa-regular fa-calendar",
link: download_link + "&format=ical&version=1&target=ical",
},
{
title: "ical2",
icon: "fa-regular fa-calendar",
link: download_link + "&format=ical&version=2&target=ical",
},
];
},
get_image_base64_src: function () {
if (!this.otherPersonData.photo?.length) {
return "";
}
return "data:image/jpeg;base64," + this.otherPersonData.photo;
},
},
watch: {
"propsViewData.otherUid": {
handler() {
this.$router.go();
},
},
},
methods: {
handleChangeDate(day, newMode) {
return this.handleChangeMode(newMode, day);
},
handleChangeMode(newMode, day) {
const mode = newMode[0].toUpperCase() + newMode.slice(1);
const focus_date = day.toISODate();
return [
{
title: "excel",
icon: "fa-solid fa-file-excel",
link: download_link + "&format=excel",
},
{
title: "csv",
icon: "fa-solid fa-file-csv",
link: download_link + "&format=csv",
},
{
title: "ical1",
icon: "fa-regular fa-calendar",
link: download_link + "&format=ical&version=1&target=ical",
},
{
title: "ical2",
icon: "fa-regular fa-calendar",
link: download_link + "&format=ical&version=2&target=ical",
},
];
},
get_image_base64_src: function () {
if (!this.otherPersonData.photo?.length) {
return "";
}
return "data:image/jpeg;base64," + this.otherPersonData.photo;
},
},
watch: {
"propsViewData.otherUid": {
handler() {
this.$router.go();
},
},
},
methods: {
handleChangeDate(day, newMode) {
return this.handleChangeMode(newMode, day);
},
handleChangeMode(newMode, day) {
const mode = newMode[0].toUpperCase() + newMode.slice(1);
const focus_date = day.toISODate();
this.$router.push({
name: "OtherLvPlan",
params: {
mode,
focus_date,
},
});
},
updateRange(rangeInterval) {
this.$api
.call(
ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf("week").toISODate(),
),
)
.then((res) => {
this.studiensemester_kurzbz = res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
},
getPromiseFunc(start, end) {
return [
this.$api.call(
ApiLvPlan.eventsPersonal(
start.toISODate(),
end.toISODate(),
this.propsViewData.otherUid,
),
),
this.$api.call(
ApiLvPlan.getLvPlanReservierungen(
start.toISODate(),
end.toISODate(),
this.propsViewData.otherUid,
),
),
];
},
},
async created() {
const authInfoResponse = await this.$api.call(ApiAuthinfo.getAuthInfo());
const authId = authInfoResponse.data.uid;
if (authId === this.propsViewData.otherUid) {
this.$router.push({ name: "MyLvPlan" });
}
this.$router.push({
name: "OtherLvPlan",
params: {
mode,
focus_date,
},
});
},
updateRange(rangeInterval) {
this.$api
.call(
ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf("week").toISODate(),
),
)
.then((res) => {
this.studiensemester_kurzbz =
res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
},
getPromiseFunc(start, end) {
return [
this.$api.call(
ApiLvPlan.eventsPersonal(
start.toISODate(),
end.toISODate(),
this.propsViewData.otherUid,
),
),
this.$api.call(
ApiLvPlan.getLvPlanReservierungen(
start.toISODate(),
end.toISODate(),
this.propsViewData.otherUid,
),
),
];
},
async fetchViewData() {
const viewDataResponse = await this.$api.call(
ApiOtherLvPlan.getOtherLvPlanViewData(
this.propsViewData.otherUid,
),
);
const userDataResponse = await this.$api.call(
ApiOtherLvPlan.getBasicUserAttributesForLvPlanDisplay(
this.propsViewData.otherUid,
),
);
const viewData = viewDataResponse.data;
const userData = userDataResponse.data;
this.isOtherPersonMitarbeiter = !!userData.is_mitarbeiter;
this.isOtherPersonStudent = !!userData.is_student;
this.otherPersonData.fullName = userData.vorname + " " + userData.nachname;
this.otherPersonData.photo = userData.foto;
},
template: `
this.isOtherPersonMitarbeiter =
!!viewData?.user_data?.is_mitarbeiter;
this.isOtherPersonStudent = !!viewData?.user_data?.is_student;
this.otherPersonData.fullName =
viewData?.user_data?.vorname +
" " +
viewData?.user_data?.nachname;
this.otherPersonData.photo = viewData?.user_data?.foto;
},
async redirectToMyLvPlanIfAuthUid() {
const authInfoResponse = await this.$api.call(
ApiAuthinfo.getAuthInfo(),
);
const authId = authInfoResponse.data.uid;
if (authId === this.propsViewData.otherUid) {
this.$router.push({ name: "MyLvPlan" });
}
},
},
async created() {
await this.redirectToMyLvPlanIfAuthUid();
await this.fetchViewData();
},
template: `
<div class="d-flex flex-column h-100">
<h2>
<div class="d-flex flex-row justify-content-between align-items-center">
@@ -215,8 +228,9 @@ export default {
</h2>
<hr>
<fhc-calendar
v-if="timezone"
ref="calendar"
:timezone="viewData.timezone"
:timezone="timezone"
:get-promise-func="getPromiseFunc"
:date="currentDay"
:mode="currentMode"
+55 -50
View File
@@ -3,6 +3,7 @@ import FormInput from '../../Form/Input.js';
import FhcCalendar from "../../Calendar/LvPlan.js";
import ApiLvPlan from '../.././../api/factory/lvPlan.js';
import ApiStgOrgLvPlan from '../.././../api/factory/stgOrgLvPlan.js';
import ApiAuthinfo from '../../../api/factory/authinfo.js';
export const DEFAULT_MODE_LVPLAN = 'Week';
@@ -15,7 +16,6 @@ export default {
FhcCalendar,
},
props: {
viewData: Object,
propsViewData: Object
},
data() {
@@ -38,7 +38,8 @@ export default {
listSem: [1,2,3,4,5,6,7,8,9,10],
listVerband: [],
listGroup: [],
rangeIntervalFirst: null
rangeIntervalFirst: null,
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
};
},
computed: {
@@ -50,7 +51,7 @@ export default {
},
currentDay() {
if (!this.propsViewData?.focus_date || isNaN(new Date(this.propsViewData?.focus_date)))
return luxon.DateTime.now().setZone(this.viewData.timezone).toISODate();
return luxon.DateTime.now().setZone(this.timezone).toISODate();
return this.propsViewData?.focus_date;
},
currentMode() {
@@ -70,7 +71,7 @@ export default {
return;
}
const opts = { zone: this.viewData.timezone };
const opts = { zone: this.timezone };
const start = luxon.DateTime
.fromISO(this.studiensemester_start, opts)
.toUnixInteger();
@@ -139,7 +140,7 @@ export default {
params,
});
this.$refs['calendar'].resetEventLoader();
this.$refs['calendar']?.resetEventLoader();
},
loadListSem(){
if(!this.listSem)
@@ -209,24 +210,26 @@ export default {
this.$api.call(ApiLvPlan.eventsStgOrg(start, end, this.formData.stgkz, this.formData.sem, this.formData.verband, this.formData.gruppe))
];
},
async fetchAuthInfo() {
const authInfoResponse = await this.$api.call(ApiAuthinfo.getAuthInfo());
const authInfo = authInfoResponse.data;
this.uid = authInfo.uid;
this.isMitarbeiter = authInfo.isMitarbeiter;
this.isStudent = authInfo.isStudent;
},
async fetchViewData() {
const viewDataResponse = await this.$api.call(ApiStgOrgLvPlan.getStgOrgLvPlanViewData());
const viewData = viewDataResponse.data;
this.listStg = viewData.studiengaenge;
},
},
created(){
this.$api
.call(ApiAuthinfo.getAuthInfo())
.then(res => {
this.uid = res.data.uid;
this.isMitarbeiter = res.data.isMitarbeiter;
this.isStudent = res.data.isStudent;
});
async created(){
await this.fetchAuthInfo();
await this.fetchViewData();
this.$api
.call(ApiLvPlan.getStudiengaenge())
.then(result => {
this. listStg = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
if(this.propsViewData) {
if (this.propsViewData) {
this.formData.stgkz = this.propsViewData.stgkz ? this.propsViewData.stgkz: null;
this.formData.sem = this.propsViewData.sem ? this.propsViewData.sem: null;
this.formData.verband = this.propsViewData.verband ? this.propsViewData.verband: null;
@@ -309,37 +312,39 @@ export default {
</form-form>
</div>
<fhc-calendar
v-show="propsViewData && propsViewData.stgkz"
ref="calendar"
v-model:lv="formData"
:timezone="viewData.timezone"
:get-promise-func="getPromiseFunc"
:date="currentDay"
:mode="currentMode"
@update:date="handleChangeDate"
@update:mode="handleChangeMode"
@update:range="updateRange"
class="responsive-calendar"
>
<div
v-if="downloadLinks"
class="d-flex gap-1 justify-items-start"
<template v-if="timezone">
<fhc-calendar
v-if="propsViewData && propsViewData.stgkz"
ref="calendar"
v-model:lv="formData"
:timezone="timezone"
:get-promise-func="getPromiseFunc"
:date="currentDay"
:mode="currentMode"
@update:date="handleChangeDate"
@update:mode="handleChangeMode"
@update:range="updateRange"
class="responsive-calendar"
>
<div
v-if="downloadLinks"
class="d-flex gap-1 justify-items-start"
>
<div v-for="{ title, icon, link } in downloadLinks">
<a
:href="link"
:aria-label="title"
class="py-1 btn btn-outline-secondary"
>
<div class="d-flex flex-column">
<i aria-hidden="true" :class="icon"></i>
<span style="font-size:.5rem">{{ title }}</span>
</div>
</a>
<div v-for="{ title, icon, link } in downloadLinks">
<a
:href="link"
:aria-label="title"
class="py-1 btn btn-outline-secondary"
>
<div class="d-flex flex-column">
<i aria-hidden="true" :class="icon"></i>
<span style="font-size:.5rem">{{ title }}</span>
</div>
</a>
</div>
</div>
</div>
</fhc-calendar>
</fhc-calendar>
</template>
</div>
`,
@@ -105,7 +105,6 @@ export default {
},
],
},
quickLinks: [],
betriebsmittel_table_options: {
persistenceID: "filterTableMaProfilBetriebsmittel",
persistence: {
@@ -299,6 +298,11 @@ export default {
}
};
},
quickLinks() {
let quickLinks = [];
//
return quickLinks;
},
},
created() {
@@ -1,11 +1,11 @@
import {CoreFilterCmpt} from "../../../components/filter/Filter.js";
import { CoreFilterCmpt } from "../../../components/filter/Filter.js";
import Mailverteiler from "./ProfilComponents/Mailverteiler.js";
import RoleInformation from "./ProfilComponents/RoleInformation.js";
import ProfilEmails from "./ProfilComponents/ProfilEmails.js";
import ProfilInformation from "./ProfilComponents/ProfilInformation.js";
import QuickLinks from "./ProfilComponents/QuickLinks.js";
import { dateFilter } from '../../../tabulator/filters/Dates.js';
import { dateFilter } from "../../../tabulator/filters/Dates.js";
export default {
components: {
@@ -20,11 +20,11 @@ export default {
data() {
return {
collapseIconFunktionen: true,
preloadedPhrasen:{},
preloadedPhrasen: {},
funktionen_table_options: {
persistenceID: "filterTableMaViewProfilFunktionen",
persistence: {
columns: false
columns: false,
},
minHeight: 300,
layout: "fitColumns",
@@ -35,62 +35,68 @@ export default {
//? option when wanting to hide the collapsed list
{
title:
"<i id='collapseIconFunktionen' role='button' class='fa-solid fa-angle-down '></i>",
title: "<i id='collapseIconFunktionen' role='button' class='fa-solid fa-angle-down '></i>",
field: "collapse",
headerSort: false,
headerFilter: false,
formatter: "responsiveCollapse",
maxWidth: 40,
headerClick: this.collapseFunction,
visible: true
visible: true,
},
{
title: Vue.computed(() => this.$p.t('ui/bezeichnung')),
title: Vue.computed(() => this.$p.t("ui/bezeichnung")),
field: "Bezeichnung",
headerFilter: true,
minWidth: 200,
visible: true
visible: true,
},
{
title: Vue.computed(() => this.$p.t('lehre/organisationseinheit')),
title: Vue.computed(() =>
this.$p.t("lehre/organisationseinheit"),
),
field: "Organisationseinheit",
headerFilter: true,
minWidth: 200,
visible: true
visible: true,
},
{
title: Vue.computed(() => this.$p.t('global/gueltigVon')),
title: Vue.computed(() =>
this.$p.t("global/gueltigVon"),
),
field: "Gültig_von",
headerFilterFunc: 'dates',
headerFilterFunc: "dates",
headerFilter: dateFilter,
resizable: true,
minWidth: 200,
visible: true,
formatter:"datetime",
formatterParams: this.datetimeFormatterParams()
formatter: "datetime",
formatterParams: this.datetimeFormatterParams(),
},
{
title: Vue.computed(() => this.$p.t('global/gueltigBis')),
title: Vue.computed(() =>
this.$p.t("global/gueltigBis"),
),
field: "Gültig_bis",
headerFilterFunc: 'dates',
headerFilterFunc: "dates",
headerFilter: dateFilter,
resizable: true,
minWidth: 200,
visible: true,
formatter:"datetime",
formatterParams: this.datetimeFormatterParams()
formatter: "datetime",
formatterParams: this.datetimeFormatterParams(),
},
{
title: Vue.computed(() => this.$p.t('profil/wochenstunden')),
title: Vue.computed(() =>
this.$p.t("profil/wochenstunden"),
),
field: "Wochenstunden",
headerFilter: true,
minWidth: 200,
visible: true
visible: true,
},
],
},
quickLinks: [],
};
},
@@ -100,42 +106,51 @@ export default {
funktionenTableBuilt: function () {
this.$refs.funktionenTable.tabulator.setData(this.data.funktionen);
},
datetimeFormatterParams: function() {
datetimeFormatterParams: function () {
const params = {
inputFormat:"yyyy-MM-dd",
outputFormat:"dd.MM.yyyy",
invalidPlaceholder:"(invalid date)",
timezone:FHC_JS_DATA_STORAGE_OBJECT.timezone
inputFormat: "yyyy-MM-dd",
outputFormat: "dd.MM.yyyy",
invalidPlaceholder: "(invalid date)",
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
};
return params;
}
},
},
watch: {
'data.funktionen'(newVal) {
if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setData(newVal);
"data.funktionen"(newVal) {
if (this.$refs.funktionenTable)
this.$refs.funktionenTable.tabulator.setData(newVal);
},
"language.value"(newVal) {
// reevaluates computed phrasen
if (this.$refs.funktionenTable)
this.$refs.funktionenTable.tabulator.setColumns(
this.funktionen_table_options.columns,
);
},
'language.value'(newVal) { // reevaluates computed phrasen
if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setColumns(this.funktionen_table_options.columns)
}
},
computed: {
getTelefonValue() {
if(this.data.standort_telefon?.kontakt) {
return this.data.standort_telefon.kontakt + " " + this.data.telefonklappe
} else if(this.data.standort_telefon) {
return this.data.standort_telefon + " " + this.data.telefonklappe
if (this.data.standort_telefon?.kontakt) {
return (
this.data.standort_telefon.kontakt +
" " +
this.data.telefonklappe
);
} else if (this.data.standort_telefon) {
return (
this.data.standort_telefon + " " + this.data.telefonklappe
);
} else {
return this.data.telefonklappe
return this.data.telefonklappe;
}
},
fotoStatus() {
return this.data?.fotoStatus ?? null;
},
personEmails() {
return this.data?.emails ? this.data.emails : [];
},
profilInformation() {
if (!this.data) {
return {};
@@ -152,59 +167,69 @@ export default {
foto: this.data.foto,
};
},
roleInformation() {
if (!this.data) {
return {};
}
return {
geburtsdatum: {
label: `${this.$p.t('profil','Geburtsdatum')}`,
value: this.data.gebdatum
label: `${this.$p.t("profil", "Geburtsdatum")}`,
value: this.data.gebdatum,
},
geburtsort: {
label: `${this.$p.t('profil','Geburtsort')}`,
value: this.data.gebort
label: `${this.$p.t("profil", "Geburtsort")}`,
value: this.data.gebort,
},
personenkennzeichen: {
label: `${this.$p.t('profil','Kurzzeichen')}`,
value: this.data.kurzbz
label: `${this.$p.t("profil", "Kurzzeichen")}`,
value: this.data.kurzbz,
},
telefon: {
label: `${this.$p.t('profil','Telefon')}`,
value: this.getTelefonValue
label: `${this.$p.t("profil", "Telefon")}`,
value: this.getTelefonValue,
},
office: {
label: `${this.$p.t('profil','Büro')}`,
value: this.data.ort_kurzbz
}
label: `${this.$p.t("profil", "Büro")}`,
value: this.data.ort_kurzbz,
},
};
},
},
created(){
this.$p.loadCategory(["ui", "lehre", "global", "profil"]).then(() => {
this.preloadedPhrasen.bezeichnungPhrase = this.$p.t('ui/bezeichnung');
this.preloadedPhrasen.organisationseinheitPhrase = this.$p.t('lehre/organisationseinheit');
this.preloadedPhrasen.gueltigVonPhrase = this.$p.t('global/gueltigVon');
this.preloadedPhrasen.gueltigBisPhrase = this.$p.t('global/gueltigBis');
this.preloadedPhrasen.wochenstundenPhrase = this.$p.t('profil/wochenstunden');
this.preloadedPhrasen.loaded = true;
});
if (this.$props.permissions["basis/other_lv_plan"]) {
this.quickLinks.push(
{
quickLinks() {
let quickLinks = [];
if (
this.$props.permissions &&
this.$props.permissions["basis/other_lv_plan"]
) {
quickLinks.push({
icon: "fa-calendar-days",
phrase: "lehre/stundenplan",
action: () => {
this.$router.push({
name: "OtherLvPlan",
params: { otherUid: this.$props.data.username },
})
name: "OtherLvPlan",
params: { otherUid: this.$props.data.username },
});
},
}
});
}
return quickLinks;
},
},
created() {
this.$p.loadCategory(["ui", "lehre", "global", "profil"]).then(() => {
this.preloadedPhrasen.bezeichnungPhrase =
this.$p.t("ui/bezeichnung");
this.preloadedPhrasen.organisationseinheitPhrase = this.$p.t(
"lehre/organisationseinheit",
);
}
this.preloadedPhrasen.gueltigVonPhrase =
this.$p.t("global/gueltigVon");
this.preloadedPhrasen.gueltigBisPhrase =
this.$p.t("global/gueltigBis");
this.preloadedPhrasen.wochenstundenPhrase = this.$p.t(
"profil/wochenstunden",
);
this.preloadedPhrasen.loaded = true;
});
},
template: /*html*/ `
+20 -17
View File
@@ -48,9 +48,6 @@ export const Profil = {
type: String,
required: false,
},
viewData: {
type: Object,
},
},
data() {
return {
@@ -62,7 +59,9 @@ export const Profil = {
data: null,
// notfound is null by default, but contains an UID if no user exists with that UID
notFoundUID: null,
isEditable: this.viewData.editable ?? false,
isEditable: false,
authPermissions: null,
calendarSyncUrls: [],
};
},
provide() {
@@ -143,6 +142,8 @@ export const Profil = {
},
methods: {
async load() {
await this.fetchViewData();
// fetch profilUpdateStates to provide them to children components
await this.$api
.call(ApiProfilUpdate.getStatus())
@@ -161,18 +162,20 @@ export const Profil = {
.catch((error) => {
console.error(error);
});
},
async fetchViewData() {
let viewDataResult = await this.$api.call(
ApiProfil.getProfilViewData(this.$route.params.uid ?? null),
);
this.$api
.call(ApiProfil.profilViewData(this.$route.params.uid ?? null))
.then((response) => response.data)
.then((data) => {
this.view = data?.profil_data.view;
this.data = data?.profil_data.data;
this.isEditable = data?.editable ?? false;
})
.catch((error) => {
console.error(error);
});
const data = viewDataResult.data;
if (!data) return;
this.view = data.profil_data.view;
this.isEditable = data.profil_data.editable;
this.data = data.profil_data.data;
this.calendarSyncUrls = data.calendar_sync_urls ?? [];
this.authPermissions = data.permissions;
},
zustellAdressenCount() {
if (!this.data || !this.data.adressen) {
@@ -408,8 +411,8 @@ export const Profil = {
:is="view"
:data="data"
:editData="filteredEditData"
:permissions="$props.viewData.permissions"
:calendarSyncUrls="$props.viewData.calendarSyncUrls"></component>
:permissions="authPermissions"
:calendarSyncUrls="calendarSyncUrls"></component>
</div>
</div>`,
};
@@ -97,7 +97,6 @@ export default {
},
],
},
quickLinks: [],
};
},
@@ -244,6 +243,11 @@ export default {
}
};
},
quickLinks() {
let quickLinks = [];
//
return quickLinks;
},
},
created() {
// preload phrasen
@@ -14,14 +14,14 @@ export default {
},
props: ["data", "permissions"],
data() {
return {
quickLinks: [],
};
return {};
},
provide() {
return {
studiengang_kz: Vue.computed({ get: () => this.data.studiengang_kz }),
}
studiengang_kz: Vue.computed({
get: () => this.data.studiengang_kz,
}),
};
},
computed: {
fotoStatus() {
@@ -43,65 +43,61 @@ export default {
foto: this.data.foto,
};
},
personEmails() {
return this.data?.emails ? this.data.emails : [];
},
roleInformation() {
if (!this.data) {
return {};
}
return {
geburtsdatum: {
label: `${this.$p.t('profil','Geburtsdatum')}`,
value: this.data.gebdatum
label: `${this.$p.t("profil", "Geburtsdatum")}`,
value: this.data.gebdatum,
},
geburtsort: {
label: `${this.$p.t('profil','Geburtsort')}`,
value: this.data.gebort
label: `${this.$p.t("profil", "Geburtsort")}`,
value: this.data.gebort,
},
personenkennzeichen: {
label: `${this.$p.t('person','personenkennzeichen')}`,
value: this.data.personenkennzeichen
label: `${this.$p.t("person", "personenkennzeichen")}`,
value: this.data.personenkennzeichen,
},
studiengang: {
label: `${this.$p.t('lehre','studiengang')}`,
value: this.data.studiengang
label: `${this.$p.t("lehre", "studiengang")}`,
value: this.data.studiengang,
},
semester: {
label: `${this.$p.t('lehre','semester')}`,
value: this.data.semester
label: `${this.$p.t("lehre", "semester")}`,
value: this.data.semester,
},
verband: {
label: `${this.$p.t('lehre','lehrverband')}`,
value: this.data.verband
label: `${this.$p.t("lehre", "lehrverband")}`,
value: this.data.verband,
},
gruppe: {
label: `${this.$p.t('lehre','gruppe')}`,
value: this.data.gruppe.trim()
}
label: `${this.$p.t("lehre", "gruppe")}`,
value: this.data.gruppe.trim(),
},
};
},
},
methods: {},
created() {
if (this.$props.permissions["basis/other_lv_plan"]) {
this.quickLinks.push(
{
quickLinks() {
let quickLinks = [];
if (this.$props.permissions && this.$props.permissions["basis/other_lv_plan"]) {
quickLinks.push({
icon: "fa-calendar-days",
phrase: "lehre/stundenplan",
action: () => {
this.$router.push({
name: "OtherLvPlan",
params: { otherUid: this.$props.data.username },
})
name: "OtherLvPlan",
params: { otherUid: this.$props.data.username },
});
},
}
);
}
});
}
return quickLinks;
},
},
template: /*html*/ `
@@ -3,9 +3,6 @@ import VueDatePicker from '../../vueDatepicker.js.php';
import ApiOrt from '../../../api/factory/ort.js'
export const Raumsuche = {
name: "Raumsuche",
props: {
},
components: {
VueDatePicker,
CoreFilterCmpt,
+16 -11
View File
@@ -2,6 +2,7 @@ import DashboardSection from "./Section.js";
import DashboardWidgetPicker from "./Widget/Picker.js";
import ObjectUtils from "../../helpers/ObjectUtils.js";
import ApiDashboard from '../../api/factory/cis/dashboard.js';
import ApiDashboardWidget from '../../api/factory/dashboard/widget.js';
import ApiDashboardUser from '../../api/factory/dashboard/user.js';
@@ -17,26 +18,22 @@ export default {
required: true,
default: 'CIS'
},
viewData: {
type: Object,
required: true,
validator(value) {
return value && value.name
}
}
},
data() {
return {
widgets: [],
originalWidgets: {},
widgetsSetup: null,
editMode: false
editMode: false,
timezone: null,
userFirstName: null,
}
},
provide() {
return {
editMode: Vue.computed(() => this.editMode),
widgetsSetup: Vue.computed(() => this.widgetsSetup)
widgetsSetup: Vue.computed(() => this.widgetsSetup),
timezone: this.timezone
}
},
methods: {
@@ -123,11 +120,19 @@ export default {
this.widgets = this.widgets.filter(widget => widget.id != id);
})
.catch(this.$fhcAlert.handleSystemError);
},
async fetchViewData() {
let viewDataResult = await this.$api.call(ApiDashboard.getViewData());
const viewData = viewDataResult.data;
this.timezone = viewData?.timezone;
this.userFirstName = viewData?.name;
}
},
created() {
async created() {
this.$p.loadCategory('dashboard');
await this.fetchViewData();
this.$api
.call(ApiDashboardWidget.listAllowed(this.dashboard))
.then(res => {
@@ -161,7 +166,7 @@ export default {
template: /* html */`
<div class="core-dashboard">
<h3>
{{ $p.t('global/personalGreeting', [ viewData?.name ]) }}
{{ userFirstName ? $p.t('global/personalGreeting', [ userFirstName ]) : '' }}
<button
class="btn ms-2"
aria-label="edit dashboard"