diff --git a/application/controllers/CisVue/Cms.php b/application/controllers/CisVue/Cms.php index ebd81350b..69bdcc62b 100644 --- a/application/controllers/CisVue/Cms.php +++ b/application/controllers/CisVue/Cms.php @@ -60,7 +60,15 @@ class Cms extends Auth_Controller $content = current($content); - $this->load->view('CisVue/Cms/Content', ['content_id' => $content_id, 'template_kurzbz' => $content->template_kurzbz, 'version' => $version, 'sprache' => $sprache, 'sichtbar' => $sichtbar]); + $viewData = array( + 'content_id' => $content_id, + 'template_kurzbz' => $content->template_kurzbz, + 'version' => $version, + 'sichtbar' => $sichtbar + ); + + $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Content']); +// $this->load->view('CisVue/Cms/Content', ['content_id' => $content_id, 'template_kurzbz' => $content->template_kurzbz, 'version' => $version, 'sprache' => $sprache, 'sichtbar' => $sichtbar]); } /** @@ -76,7 +84,10 @@ class Cms extends Auth_Controller */ public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) { - $this->load->view('CisVue/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]); + // TODO: what are those parameters and what are they used for? + + $this->load->view('CisRouterView/CisRouterView.php', ['route' => 'News']); +// $this->load->view('CisVue/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]); } public function getRoomInformation($ort_kurzbz){ diff --git a/application/controllers/api/frontend/v1/Cis4FhcApi.php b/application/controllers/api/frontend/v1/Cis4FhcApi.php new file mode 100644 index 000000000..372e4bfaa --- /dev/null +++ b/application/controllers/api/frontend/v1/Cis4FhcApi.php @@ -0,0 +1,58 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +class Cis4FhcApi extends FHCAPI_Controller +{ + + /** + * Object initialization + */ + public function __construct() + { + parent::__construct([ + 'getViewData' => self::PERM_LOGGED, + ]); + + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * fetches ViewData + */ + public function getViewData() + { + $this->load->model('person/Person_model','PersonModel'); + $personData = getData($this->PersonModel->getByUid(getAuthUID()))[0]; + + $viewData = array( + 'uid' => getAuthUID(), + 'name' => $personData->vorname, + 'person_id' => $personData->person_id + ); + + $this->terminateWithSuccess($viewData); + } + + + +} + diff --git a/application/views/CisRouterView/CisRouterView.php b/application/views/CisRouterView/CisRouterView.php index d8990a103..137f6cc65 100644 --- a/application/views/CisRouterView/CisRouterView.php +++ b/application/views/CisRouterView/CisRouterView.php @@ -17,7 +17,8 @@ $includesArray = array( 'public/css/components/MyLv.css', 'public/css/components/FilterComponent.css', 'public/css/components/Profil.css', - 'public/css/components/FormUnderline.css' + 'public/css/components/FormUnderline.css', + 'public/css/Cis4/Cms.css', ), 'customJSs' => array( 'vendor/npm-asset/primevue/accordion/accordion.js', @@ -32,6 +33,8 @@ $includesArray = array( $this->load->view('templates/CISVUE-Header', $includesArray); ?>
> - +
load->view('templates/CISVUE-Footer', $includesArray); ?> \ No newline at end of file diff --git a/public/js/api/dashboard.js b/public/js/api/dashboard.js new file mode 100644 index 000000000..4cb90fe04 --- /dev/null +++ b/public/js/api/dashboard.js @@ -0,0 +1,6 @@ +export default { + async getViewData() { + const url = `/api/frontend/v1/Cis4FhcApi/getViewData`; + return this.$fhcApi.get(url, null, null) + }, +} \ No newline at end of file diff --git a/public/js/api/fhcapifactory.js b/public/js/api/fhcapifactory.js index de972bda7..04744409b 100644 --- a/public/js/api/fhcapifactory.js +++ b/public/js/api/fhcapifactory.js @@ -35,11 +35,13 @@ import lehre from "./lehre.js"; import addons from "./addons.js"; import studiengang from "./studiengang.js"; import menu from "./menu.js"; +import dashboard from "./dashboard"; export default { search, phrasen, navigation, + dashboard, filter, studstatus, profil, diff --git a/public/js/apps/Cis/Cms.js b/public/js/apps/Cis/Cms.js index e198cfd09..ea20b0c52 100644 --- a/public/js/apps/Cis/Cms.js +++ b/public/js/apps/Cis/Cms.js @@ -7,23 +7,23 @@ Vue.$fhcapi = fhcapifactory; import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers"; import FhcApi from "../../plugin/FhcApi"; -const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; -const router = VueRouter.createRouter({ - history: VueRouter.createWebHistory(`/${ciPath}/CisVue/Cms/`), - routes: [ - { - path: `/content/:content_id`, - name: 'Content', - component: CmsContent, - props: (route) => ({ content_id: route.params.content_id }) - }, - { - path: `/news`, - name: 'News', - component: CmsNews, - } - ] -}) +// const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; +// const router = VueRouter.createRouter({ +// history: VueRouter.createWebHistory(`/${ciPath}/CisVue/Cms/`), +// routes: [ +// { +// path: `/content/:content_id`, +// name: 'Content', +// component: CmsContent, +// props: (route) => ({ content_id: route.params.content_id }) +// }, +// { +// path: `/news`, +// name: 'News', +// component: CmsNews, +// } +// ] +// }) const app = Vue.createApp({ @@ -33,6 +33,8 @@ const app = Vue.createApp({ CmsContent, }, mounted() { + + // TODO: warum ist das hier? Content? News? document.querySelectorAll("#cms [data-confirm]").forEach((el) => { el.addEventListener("click", (evt) => { evt.preventDefault(); @@ -60,8 +62,6 @@ const app = Vue.createApp({ setScrollbarWidth(); -app.use(router); -window.cmsRouter = router; app.use(FhcApi); app.use(primevue.config.default, { zIndex: { overlay: 9999 } }); app.use(Phrasen); diff --git a/public/js/apps/Cis/LvInfo.js b/public/js/apps/Cis/LvInfo.js deleted file mode 100644 index 1764cf097..000000000 --- a/public/js/apps/Cis/LvInfo.js +++ /dev/null @@ -1,13 +0,0 @@ -import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js"; -import Phrasen from "../../plugin/Phrasen.js"; -import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers"; - -const app = Vue.createApp({ - components: { - Info - } -}) - -setScrollbarWidth(); - -app.use(Phrasen, { reload: true }).mount('#content'); \ No newline at end of file diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index e07b64b1b..8e7cc7fe9 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -5,31 +5,51 @@ import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers"; import Stundenplan from "../../components/Cis/Stundenplan/Stundenplan"; import MylvStudent from "../../components/Cis/Mylv/Student"; import Profil from "../../components/Cis/Profil/Profil"; - +import CmsNews from "../../components/Cis/Cms/News"; +import CmsContent from "../../components/Cis/Cms/Content"; +import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info"; const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; const router = VueRouter.createRouter({ history: VueRouter.createWebHistory(`/${ciPath}`), routes: [ - // { - // path: `/Cis/News`, - // name: 'Profil', - // component: Profil, - // props: true - // }, // { // path: `/Cis/Profil`, // name: 'Profil', // component: Profil, // props: true // }, + // { + // path: `/Cis/Profil/View/`, + // name: 'Profil', + // component: Profil, + // props: true + // }, + { + path: `/CisVue/Cms/Content/:content_id`, + name: 'Content', + component: CmsContent, + props: true + }, + { + path: `/CisVue/Cms/News`, + name: 'News', + component: CmsNews, + props: true + }, { path: `/Cis/MyLv`, name: 'MyLv', component: MylvStudent, props: true }, + { + path: `/Cis/MyLv/Info/:studien_semester/:lehrveranstaltung_id`, + name: 'LvInfo', + component: Info, + props: true + }, { path: `/Cis/Stundenplan/:lv_id?`, name: 'Stundenplan', @@ -39,39 +59,24 @@ const router = VueRouter.createRouter({ path: `/`, name: 'FhcDashboard', component: FhcDashboard, - props: {dashboard: 'CIS'} + props: {dashboard: 'CIS'}, }, { - path: '/:catchAll(.*)', - redirect: {name: 'FhcDashboard'}, - props: true - } + path: `/Cis4`, + name: 'Cis4', + component: FhcDashboard, + props: {dashboard: 'CIS'}, + }, + // only use the catchAll route if every cis4 Route is being handled in vue router, currently Profil is being + // codeigniter routed + // { + // path: '/:catchAll(.*)', + // redirect: {name: 'FhcDashboard'}, + // props: true + // } ] }) -router.beforeEach((to, from) => { - console.log('from', from) - console.log('to', to) - -}) - -router.beforeResolve(async to => { - // TODO: check if necessary viewData params have been provided - // if (to.meta.requiresCamera) { - // try { - // await askForCameraPermission() - // } catch (error) { - // if (error instanceof NotAllowedError) { - // // ... handle the error and then cancel the navigation - // return false - // } else { - // // unexpected error, cancel the navigation and pass the error to the global handler - // throw error - // } - // } - // } -}) - const app = Vue.createApp({ name: 'FhcApp', data: () => ({ @@ -85,19 +90,21 @@ const app = Vue.createApp({ }, handleClick(event) { const target = event.target.closest('a'); - // TODO: handle case of is internalRoute but not defined in vue router + if (target && this.isInternalRoute(target.href)) { - event.preventDefault(); // Prevent browser navigation + const path = new URL(target.href).pathname const base = this.$router.options.history.base const route = path.replace(base, '') || '/' - + + // let click event propagate normally if we dont route internally + const res = this.$router.resolve(route) + if(!res?.matched?.length) return + + event.preventDefault(); // Prevent browser navigation this.$router.push(route); } }, - tryCis4Navigate(e) { - this.$router.push({name: e.detail}); - }, getInitialRoute() { const el = document.getElementById('fhccontent') const r = el?.getAttribute('route') @@ -106,9 +113,9 @@ const app = Vue.createApp({ } }, mounted() { - // window.addEventListener('beforeunload', this.beforeUnloadListener) document.addEventListener('click', this.handleClick); - window.addEventListener('fhcnavigate', this.tryCis4Navigate); + + // TODO: handle required property content_id this.$router.push({name: this.getInitialRoute()}); }, beforeUnmount() { @@ -116,9 +123,9 @@ const app = Vue.createApp({ }, }); +// kind of a bandaid for bad css on some pages to avoid horizontal scroll setScrollbarWidth(); app.use(router); -window.fhcVueRouter = router app.use(FhcApi); app.use(primevue.config.default, { zIndex: { diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js index 1973e99ac..c383920ca 100644 --- a/public/js/components/Cis/Cms/Content.js +++ b/public/js/components/Cis/Cms/Content.js @@ -6,7 +6,7 @@ export default { props: { content_id: { type: [Number, String], - required: true, + required: true }, version: { type: [String, Number], diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 144d3b068..de1889059 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,4 +1,4 @@ -import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; +import {CoreFilterCmpt} from "../../../components/filter/Filter.js"; import EditProfil from "./ProfilModal/EditProfil.js"; import Adresse from "./ProfilComponents/Adresse.js"; import Kontakt from "./ProfilComponents/Kontakt.js"; @@ -11,475 +11,409 @@ import RoleInformation from "./ProfilComponents/RoleInformation.js"; import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; export default { - components: { - CoreFilterCmpt, - EditProfil, - Adresse, - Kontakt, - FetchProfilUpdates, - AusweisStatus, - Mailverteiler, - QuickLinks, - ProfilEmails, - RoleInformation, - ProfilInformation, - }, + components: { + CoreFilterCmpt, + EditProfil, + Adresse, + Kontakt, + FetchProfilUpdates, + AusweisStatus, + Mailverteiler, + QuickLinks, + ProfilEmails, + RoleInformation, + ProfilInformation, + }, - inject: ["sortProfilUpdates", "collapseFunction"], + inject: ["sortProfilUpdates", "collapseFunction"], - data() { - return { - showModal: false, - editDataFilter: null, + data() { + return { + showModal: false, + editDataFilter: null, - // tabulator options - funktionen_table_options: { - height: 300, - layout: "fitColumns", - responsiveLayout: "collapse", - responsiveLayoutCollapseUseFormatters: false, - responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [ - { - Bezeichnung: "", - Organisationseinheit: "", - Gültig_von: "", - Gültig_bis: "", - Wochenstunden: "", - }, - ], - columns: [ - { - title: - "", - field: "collapse", - headerSort: false, - headerFilter: false, - formatter: "responsiveCollapse", - maxWidth: 40, - headerClick: this.collapseFunction, - }, - { - title: "Bezeichnung", - field: "Bezeichnung", - headerFilter: true, - minWidth: 200, - }, - { - title: "Organisationseinheit", - field: "Organisationseinheit", - headerFilter: true, - minWidth: 200, - }, - { - title: "Gültig_von", - field: "Gültig_von", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Gültig_bis", - field: "Gültig_bis", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Wochenstunden", - field: "Wochenstunden", - headerFilter: true, - minWidth: 200, - }, - ], - }, + // tabulator options + funktionen_table_options: { + height: 300, + layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Bezeichnung", + field: "Bezeichnung", + headerFilter: true, + minWidth: 200, + }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + minWidth: 200, + }, + { + title: "Gültig_von", + field: "Gültig_von", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Gültig_bis", + field: "Gültig_bis", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + minWidth: 200, + }, + ], + }, - betriebsmittel_table_options: { - height: 300, - layout: "fitColumns", - responsiveLayout: "collapse", - responsiveLayoutCollapseUseFormatters: false, - responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], - columns: [ - { - title: - "", - field: "collapse", - headerSort: false, - headerFilter: false, - formatter: "responsiveCollapse", - maxWidth: 40, - headerClick: this.collapseFunction, - }, - { - title: "Betriebsmittel", - field: "betriebsmittel", - headerFilter: true, - minWidth: 200, - }, - { - title: "Nummer", - field: "Nummer", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Ausgegeben_am", - field: "Ausgegeben_am", - headerFilter: true, - minWidth: 200, - }, - ], - }, - }; - }, + betriebsmittel_table_options: { + height: 300, + layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, + data: [{betriebsmittel: "", Nummer: "", Ausgegeben_am: ""}], + columns: [ + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Betriebsmittel", + field: "betriebsmittel", + headerFilter: true, + minWidth: 200, + }, + { + title: "Nummer", + field: "Nummer", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Ausgegeben_am", + field: "Ausgegeben_am", + headerFilter: true, + minWidth: 200, + }, + ], + }, + }; + }, - props: { - data: Object, - editData: Object, - }, + props: { + data: Object, + editData: Object, + }, - methods: { - betriebsmittelTableBuilt: function () { - this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - }, - funktionenTableBuilt: function () { - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - }, - hideEditProfilModal: function () { - //? checks the editModal component property result, if the user made a successful request or not - if (this.$refs.editModal.result) { - this.$fhcApi.factory.profilUpdate.selectProfilRequest() - .then((request) => { - if (!request.error && request) { - this.data.profilUpdates = request.data; - this.data.profilUpdates.sort(this.sortProfilUpdates); - } else { - console.error("Error when fetching profile updates: " + res.data); - } - }) - .catch((err) => { - console.error(err); - }); - } else { - // when modal was closed without submitting request - } - this.showModal = false; - this.editDataFilter = null; - }, + methods: { + betriebsmittelTableBuilt: function () { + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + }, + funktionenTableBuilt: function () { + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }, + hideEditProfilModal: function () { + //? checks the editModal component property result, if the user made a successful request or not + if (this.$refs.editModal.result) { + this.$fhcApi.factory.profilUpdate.selectProfilRequest() + .then((request) => { + if (!request.error && request) { + this.data.profilUpdates = request.data; + this.data.profilUpdates.sort(this.sortProfilUpdates); + } else { + console.error("Error when fetching profile updates: " + res.data); + } + }) + .catch((err) => { + console.error(err); + }); + } else { + // when modal was closed without submitting request + } + this.showModal = false; + this.editDataFilter = null; + }, - showEditProfilModal(view) { - if (view) { - this.editDataFilter = view; - } + showEditProfilModal(view) { + if (view) { + this.editDataFilter = view; + } - this.showModal = true; - Vue.nextTick(() => { - this.$refs.editModal.show(); - }); + this.showModal = true; + Vue.nextTick(() => { + this.$refs.editModal.show(); + }); - // after a state change, wait for the DOM updates to complete - }, + // after a state change, wait for the DOM updates to complete + }, - fetchProfilUpdates: function () { - this.$fhcApi.factory.profilUpdate.selectProfilRequest().then((res) => { - if (!res.error && res) { - this.data.profilUpdates = res.data?.length - ? res.data.sort(this.sortProfilUpdates) - : null; - } - }); - }, - }, + fetchProfilUpdates: function () { + this.$fhcApi.factory.profilUpdate.selectProfilRequest().then((res) => { + if (!res.error && res) { + this.data.profilUpdates = res.data?.length + ? res.data.sort(this.sortProfilUpdates) + : null; + } + }); + }, + }, - computed: { - editable() { - return this.data?.editAllowed ?? false; - }, - filteredEditData() { - return this.editDataFilter - ? this.editData.data[this.editDataFilter] - : this.editData; - }, - profilInformation() { - if (!this.data) { - return {}; - } + computed: { + editable() { + return this.data?.editAllowed ?? false; + }, + filteredEditData() { + return this.editDataFilter + ? this.editData.data[this.editDataFilter] + : this.editData; + }, + profilInformation() { + if (!this.data) { + return {}; + } - return { - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Postnomen: this.data.postnomen, - foto_sperre: this.data.foto_sperre, - foto: this.data.foto, - }; - }, + return { + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, + foto_sperre: this.data.foto_sperre, + foto: this.data.foto, + }; + }, - roleInformation() { - if (!this.data) { - return {}; - } + roleInformation() { + if (!this.data) { + return {}; + } - return { - [`${this.$p.t('profil','Geburtsdatum')}`]: this.data.gebdatum, - [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, - [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, - [`${this.$p.t('profil', 'Telefon')}`]: - (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), - [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, - }; - }, - }, + return { + [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, + [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, + [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, + [`${this.$p.t('profil', 'Telefon')}`]: + (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), + [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + }; + }, + }, - created() { - //? sorts the profil Updates: pending -> accepted -> rejected - this.data.profilUpdates?.sort(this.sortProfilUpdates); - - }, - mounted(){ - - }, + created() { + //? sorts the profil Updates: pending -> accepted -> rejected + this.data.profilUpdates?.sort(this.sortProfilUpdates); - template: /*html*/ ` -
- + }, + mounted() { + + }, + + template: /*html*/ ` +
-
-
- - + +
- -
-
--> - - - -
-
- -
-
- -
-
- - -
-
- - - -
- - - - -
- - - - - - -
- -
-
-
- - - - - -
-
-
- - -
- - - - - -
-
- - - - - -
- -
-
-
- - -
-
- - -
-
- - - -
-
-
-
+
-
- -
-
- - - -
-
-
+
{{$p.t('ui','bearbeiten')}}
-
-
- - -
-
- - - -
-
-
-
- -
-
- {{$p.t('profil','privateAdressen')}} -
-
-
-
- -
-
- - -
-
-
-
-
-
- - - -
-
- -
- - -
- - - - - -
- -
- - - -
- +
- -
- - -
- - - - - - - - -
-
-
+ + +
+ + + +
+
+
+
+ + +
-
{{$p.t('ui','bearbeiten')}}
-
- +
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+ {{$p.t('profil','privateKontakte')}} +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+ {{$p.t('profil','privateAdressen')}} +
+
+
+
+
+
+ +
+
+
+
+
+
- -
+
+
+
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ +
+
+
- -
- - - -
+
+
- - -
+ +
- -
-
- +
+
+
+ - -
-
-
-
+
+
+
+
+ `, }; diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 29938bcf1..b062b7708 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -1,4 +1,4 @@ -import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; +import {CoreFilterCmpt} from "../../../components/filter/Filter.js"; import Mailverteiler from "./ProfilComponents/Mailverteiler.js"; import QuickLinks from "./ProfilComponents/QuickLinks.js"; import RoleInformation from "./ProfilComponents/RoleInformation.js"; @@ -6,280 +6,219 @@ import ProfilEmails from "./ProfilComponents/ProfilEmails.js"; import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; export default { - components: { - CoreFilterCmpt, - Mailverteiler, - QuickLinks, - RoleInformation, - ProfilEmails, - ProfilInformation, - }, - inject: ["collapseFunction"], - data() { - return { - collapseIconFunktionen: true, + components: { + CoreFilterCmpt, + Mailverteiler, + QuickLinks, + RoleInformation, + ProfilEmails, + ProfilInformation, + }, + inject: ["collapseFunction"], + data() { + return { + collapseIconFunktionen: true, - funktionen_table_options: { - height: 300, - layout: "fitColumns", - responsiveLayout: "collapse", - responsiveLayoutCollapseUseFormatters: false, - responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [ - { - Bezeichnung: "", - Organisationseinheit: "", - Gültig_von: "", - Gültig_bis: "", - Wochenstunden: "", - }, - ], - columns: [ - //? option when wanting to hide the collapsed list + funktionen_table_options: { + height: 300, + layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + //? option when wanting to hide the collapsed list - { - title: - "", - field: "collapse", - headerSort: false, - headerFilter: false, - formatter: "responsiveCollapse", - maxWidth: 40, - headerClick: this.collapseFunction, - }, - { - title: "Bezeichnung", - field: "Bezeichnung", - headerFilter: true, - minWidth: 200, - }, - { - title: "Organisationseinheit", - field: "Organisationseinheit", - headerFilter: true, - minWidth: 200, - }, - { - title: "Gültig_von", - field: "Gültig_von", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Gültig_bis", - field: "Gültig_bis", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Wochenstunden", - field: "Wochenstunden", - headerFilter: true, - minWidth: 200, - }, - ], - }, - }; - }, + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Bezeichnung", + field: "Bezeichnung", + headerFilter: true, + minWidth: 200, + }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + minWidth: 200, + }, + { + title: "Gültig_von", + field: "Gültig_von", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Gültig_bis", + field: "Gültig_bis", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + minWidth: 200, + }, + ], + }, + }; + }, - //? this is the prop passed to the dynamic component with the custom data of the view - props: ["data"], - methods: { - funktionenTableBuilt: function () { - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - }, - }, + //? this is the prop passed to the dynamic component with the custom data of the view + props: ["data"], + methods: { + funktionenTableBuilt: function () { + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }, + }, - computed: { - editable() { - return this.data?.editAllowed ?? false; - }, - - personEmails() { - return this.data?.emails ? this.data.emails : []; - }, + computed: { + editable() { + return this.data?.editAllowed ?? false; + }, - profilInformation() { - if (!this.data) { - return {}; - } + personEmails() { + return this.data?.emails ? this.data.emails : []; + }, - return { - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Postnomen: this.data.postnomen, - foto_sperre: this.data.foto_sperre, - foto: this.data.foto, - }; - }, + profilInformation() { + if (!this.data) { + return {}; + } - roleInformation() { - if (!this.data) { - return {}; - } + return { + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, + foto_sperre: this.data.foto_sperre, + foto: this.data.foto, + }; + }, - return { - [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, - [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, - [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, - [`${this.$p.t('profil', 'Telefon')}`]: - (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), - [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, - }; - }, - }, + roleInformation() { + if (!this.data) { + return {}; + } - template: /*html*/ ` + return { + [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, + [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, + [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, + [`${this.$p.t('profil', 'Telefon')}`]: + (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), + [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + }; + }, + }, -
+ template: /*html*/ ` + +
-
- - - - - -
- - - - - - +
+ + + + +
+ + + +
+ +
- - - - -
-
-
- - - - -
+
+ + +
- - - - - - + -
- -
+
+
-
- - - - -
- - +
+ + +
+
- - -
- - - - +
+ + +
- -
- - - - - + -
- - - - - - -
- - - - - - - - - -
- - -
- -
- - - -
- - -
- - -
- - - + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + -
-
- - - - - + +
-
- - -
- - - - - - - - -
- - -
- - `, + --> +
+
+ + +
+
+ +
+ +
+ +
+`, }; diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 335b606a1..fec4e3664 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -5,185 +5,142 @@ import RoleInformation from "./ProfilComponents/RoleInformation.js"; import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; export default { - data() { - return {}; - }, - components: { - QuickLinks, - Mailverteiler, - ProfilEmails, - RoleInformation, - ProfilInformation, - }, + data() { + return {}; + }, + components: { + QuickLinks, + Mailverteiler, + ProfilEmails, + RoleInformation, + ProfilInformation, + }, - props: ["data"], - methods: {}, + props: ["data"], + methods: {}, - computed: { - editable() { - return this.data?.editAllowed ?? false; - }, - profilInformation() { - if (!this.data) { - return {}; - } + computed: { + editable() { + return this.data?.editAllowed ?? false; + }, + profilInformation() { + if (!this.data) { + return {}; + } - return { - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Postnomen: this.data.postnomen, - foto_sperre: this.data.foto_sperre, - foto: this.data.foto, - }; - }, + return { + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, + foto_sperre: this.data.foto_sperre, + foto: this.data.foto, + }; + }, - personEmails() { - return this.data?.emails ? this.data.emails : []; - }, + personEmails() { + return this.data?.emails ? this.data.emails : []; + }, - roleInformation() { - if (!this.data) { - return {}; - } + roleInformation() { + if (!this.data) { + return {}; + } - return { - Geburtsdatum: this.data.gebdatum, - Geburtsort: this.data.gebort, - Personenkennzeichen: this.data.personenkennzeichen, - Studiengang: this.data.studiengang, - Semester: this.data.semester, - Verband: this.data.verband, - Gruppe: this.data.gruppe.trim(), - }; - }, - }, + return { + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + Personenkennzeichen: this.data.personenkennzeichen, + Studiengang: this.data.studiengang, + Semester: this.data.semester, + Verband: this.data.verband, + Gruppe: this.data.gruppe.trim(), + }; + }, + }, - mounted() {}, + mounted() { + }, - template: /*html*/ ` + template: /*html*/ ` -
+
-
- - - - - -
- - - - - - +
+ + + + +
+ + + +
+ +
- - - -
-
-
- - - -
+
+ +
- - - + -
- -
-
-
- - - - -
- - -
- - -
- - - -
- -
- - - - -
- - - - - - -
- - -
- - -
- - - - - - - - - - - -
- -
- - - - - - -
- -
- - -
- - - - -
- - -
- +
+
+
+ + +
+
+ +
+
+ +
+
+ + +
+ + +
+ +
+ +
+ + + + + +
+
+ + +
+ +
+ +
+ +
+ +
`, }; diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 6fb7dfe48..b1219cad6 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -7,22 +7,32 @@ export default { DashboardSection, DashboardWidgetPicker }, - props: [ - "dashboard", - "viewDataString" - ], + props: { + dashboard: { + type: String, + required: true, + default: 'CIS' + }, + viewData: { + type: Object, + required: true, + default: () => ({name: '', uid: ''}), + validator(value) { + return value && value.name && value.uid + } + } + }, data() { return { sections: [], widgets: null, - viewData: JSON.parse(this.viewDataString ?? '{}'), - editMode: false + editMode: false, + viewDataInternal: this.viewData } }, provide() { return { editMode: Vue.computed(()=>this.editMode), - viewData: Vue.computed(()=>Vue.reactive(this.viewData)), } }, computed: { @@ -151,10 +161,16 @@ export default { } }).catch(err => console.error('ERROR:', err)); }, + async beforeMount() { + if(!this.viewData.name || !this.viewData.uid) { + const res = await this.$fhcApi.factory.dashboard.getViewData() + this.viewDataInternal = res.data + } + }, template: `

- {{ $p.t('global/personalGreeting', [ viewData?.name ]) }} + {{ $p.t('global/personalGreeting', [ viewDataInternal?.name ]) }}