mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
adapt the logic of the profilUpdate feature to use constant status and topics from the database
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,8 @@ const profilApp = Vue.createApp({
|
||||
return {
|
||||
//? loading property is used for showing/hiding the loading modal
|
||||
loading: false,
|
||||
profilUpdateStates: null,
|
||||
profilUpdateTopic: null,
|
||||
view: null,
|
||||
data: null,
|
||||
// notfound is null by default, but contains an UID if no user exists with that UID
|
||||
@@ -57,6 +59,8 @@ const profilApp = Vue.createApp({
|
||||
//? use function syntax for provide so that we can access `this`
|
||||
provide() {
|
||||
return {
|
||||
profilUpdateStates: Vue.computed(() => this.profilUpdateStates),
|
||||
profilUpdateTopic: Vue.computed(() => this.profilUpdateTopic),
|
||||
setLoading: (newValue) => {
|
||||
this.loading = newValue;
|
||||
},
|
||||
@@ -236,11 +240,13 @@ const profilApp = Vue.createApp({
|
||||
view: null,
|
||||
data: {
|
||||
Personen_Informationen: {
|
||||
title: this.$p.t('profil','personenInformationen'),
|
||||
title: this.$p.t("profil", "personenInformationen"),
|
||||
topic: "Personen_informationen",
|
||||
view: null,
|
||||
data: {
|
||||
vorname: {
|
||||
title: this.$p.t('person','vorname'),
|
||||
title: this.$p.t("person", "vorname"),
|
||||
topic: this.profilUpdateTopic?.["Vorname"],
|
||||
view: "TextInputDokument",
|
||||
withFiles: true,
|
||||
data: {
|
||||
@@ -249,7 +255,8 @@ const profilApp = Vue.createApp({
|
||||
},
|
||||
},
|
||||
nachname: {
|
||||
title: this.$p.t('person','nachname'),
|
||||
title: this.$p.t("person", "nachname"),
|
||||
topic: this.profilUpdateTopic?.["Nachname"],
|
||||
view: "TextInputDokument",
|
||||
withFiles: true,
|
||||
data: {
|
||||
@@ -258,7 +265,8 @@ const profilApp = Vue.createApp({
|
||||
},
|
||||
},
|
||||
titel: {
|
||||
title: this.$p.t('global','titel'),
|
||||
title: this.$p.t("global", "titel"),
|
||||
topic: this.profilUpdateTopic?.["Titel"],
|
||||
view: "TextInputDokument",
|
||||
withFiles: true,
|
||||
data: {
|
||||
@@ -267,7 +275,8 @@ const profilApp = Vue.createApp({
|
||||
},
|
||||
},
|
||||
postnomen: {
|
||||
title: this.$p.t('profil','postnomen'),
|
||||
title: this.$p.t("profil", "postnomen"),
|
||||
topic: this.profilUpdateTopic?.["Postnomen"],
|
||||
view: "TextInputDokument",
|
||||
withFiles: true,
|
||||
data: {
|
||||
@@ -278,12 +287,14 @@ const profilApp = Vue.createApp({
|
||||
},
|
||||
},
|
||||
Private_Kontakte: {
|
||||
title: this.$p.t('profil','privateKontakte'),
|
||||
title: this.$p.t("profil", "privateKontakte"),
|
||||
topic: this.profilUpdateTopic?.["Private Kontakte"],
|
||||
data: this.data.kontakte
|
||||
?.filter((item) => {
|
||||
// excludes all contacts that are already used in pending profil update requests
|
||||
return !this.data.profilUpdates?.some(
|
||||
(update) =>
|
||||
update.status === "pending" &&
|
||||
update.status === this.profilUpdateStates["Pending"] &&
|
||||
update.requested_change?.kontakt_id === item.kontakt_id
|
||||
);
|
||||
})
|
||||
@@ -296,7 +307,8 @@ const profilApp = Vue.createApp({
|
||||
}),
|
||||
},
|
||||
Private_Adressen: {
|
||||
title: this.$p.t('profil','privateAdressen'),
|
||||
title: this.$p.t("profil", "privateAdressen"),
|
||||
topic: this.profilUpdateTopic?.["Private Adressen"],
|
||||
data: this.data.adressen
|
||||
?.filter((item) => {
|
||||
return !this.data.profilUpdates?.some((update) => {
|
||||
@@ -337,6 +349,24 @@ const profilApp = Vue.createApp({
|
||||
},
|
||||
|
||||
created() {
|
||||
// fetch profilUpdateStates to provide them to children components
|
||||
Vue.$fhcapi.ProfilUpdate.getStatus()
|
||||
.then((response) => {
|
||||
this.profilUpdateStates = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
Vue.$fhcapi.ProfilUpdate.getTopic()
|
||||
.then((response) => {
|
||||
console.log("t", response.data);
|
||||
this.profilUpdateTopic = response.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
//? uid contains the last part of the uri
|
||||
let uid = location.pathname.split("/").pop();
|
||||
|
||||
@@ -349,7 +379,7 @@ const profilApp = Vue.createApp({
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
template: `
|
||||
<div>
|
||||
|
||||
|
||||
@@ -1,97 +1,120 @@
|
||||
export default {
|
||||
//! API calls for profil update requests
|
||||
|
||||
//! API calls for profil update requests
|
||||
getStatus: function () {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/Cis/ProfilUpdate/getStatus";
|
||||
return axios.get(url);
|
||||
},
|
||||
|
||||
getProfilUpdateRequest: function(){
|
||||
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/Cis/ProfilUpdate/getAllRequests';
|
||||
return axios.get(url);
|
||||
},
|
||||
getTopic: function () {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/Cis/ProfilUpdate/getTopic";
|
||||
return axios.get(url);
|
||||
},
|
||||
|
||||
acceptProfilRequest: function(payload){
|
||||
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/Cis/ProfilUpdate/acceptProfilRequest';
|
||||
return axios.post(url,payload);
|
||||
},
|
||||
getProfilUpdateRequest: function () {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/Cis/ProfilUpdate/getAllRequests";
|
||||
return axios.get(url);
|
||||
},
|
||||
|
||||
denyProfilRequest: function(payload){
|
||||
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/Cis/ProfilUpdate/denyProfilRequest';
|
||||
return axios.post(url,payload);
|
||||
},
|
||||
acceptProfilRequest: function (payload) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/Cis/ProfilUpdate/acceptProfilRequest";
|
||||
return axios.post(url, payload);
|
||||
},
|
||||
|
||||
replaceProfilUpdateAttachment: function (dms) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/replaceProfilUpdateAttachment`;
|
||||
|
||||
return axios.post(url, dms, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
},
|
||||
denyProfilRequest: function (payload) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/Cis/ProfilUpdate/denyProfilRequest";
|
||||
return axios.post(url, payload);
|
||||
},
|
||||
|
||||
replaceProfilUpdateAttachment: function (dms) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/replaceProfilUpdateAttachment`;
|
||||
|
||||
//? new reuquests
|
||||
insertFile: function (dms,replace=null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/insertFile/${replace}`;
|
||||
|
||||
return axios.post(url, dms, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getProfilRequestFiles: function (requestID) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/getProfilRequestFiles`;
|
||||
|
||||
return axios.post(url, requestID);
|
||||
},
|
||||
|
||||
selectProfilRequest: function (uid = null, id = null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/selectProfilRequest`;
|
||||
|
||||
return axios.get(url, { uid: uid, id: id });
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
insertProfilRequest: function (topic, payload, fileID=null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/insertProfilRequest`;
|
||||
|
||||
return axios.post(url, { topic, payload, ...(fileID?{fileID:fileID}:{}) });
|
||||
},
|
||||
|
||||
updateProfilRequest: function (topic, payload, ID, fileID=null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/updateProfilRequest`;
|
||||
|
||||
return axios.post(url, { topic, payload, ID, ...(fileID?{fileID:fileID}:{}) });
|
||||
},
|
||||
|
||||
deleteProfilRequest: function (requestID) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/deleteProfilRequest`;
|
||||
|
||||
return axios.post(url, requestID);
|
||||
},
|
||||
return axios.post(url, dms, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
//? new reuquests
|
||||
insertFile: function (dms, replace = null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/insertFile/${replace}`;
|
||||
|
||||
}
|
||||
return axios.post(url, dms, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
},
|
||||
|
||||
getProfilRequestFiles: function (requestID) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/getProfilRequestFiles`;
|
||||
|
||||
return axios.post(url, requestID);
|
||||
},
|
||||
|
||||
selectProfilRequest: function (uid = null, id = null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/selectProfilRequest`;
|
||||
|
||||
return axios.get(url, { uid: uid, id: id });
|
||||
},
|
||||
|
||||
insertProfilRequest: function (topic, payload, fileID = null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/insertProfilRequest`;
|
||||
|
||||
return axios.post(url, {
|
||||
topic,
|
||||
payload,
|
||||
...(fileID ? { fileID: fileID } : {}),
|
||||
});
|
||||
},
|
||||
|
||||
updateProfilRequest: function (topic, payload, ID, fileID = null) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/updateProfilRequest`;
|
||||
|
||||
return axios.post(url, {
|
||||
topic,
|
||||
payload,
|
||||
ID,
|
||||
...(fileID ? { fileID: fileID } : {}),
|
||||
});
|
||||
},
|
||||
|
||||
deleteProfilRequest: function (requestID) {
|
||||
const url =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/deleteProfilRequest`;
|
||||
|
||||
return axios.post(url, requestID);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -8,7 +8,12 @@ export default {
|
||||
},
|
||||
},
|
||||
|
||||
inject: ["getZustellkontakteCount", "getZustelladressenCount"],
|
||||
inject: [
|
||||
"getZustellkontakteCount",
|
||||
"getZustelladressenCount",
|
||||
"profilUpdateStates",
|
||||
"profilUpdateTopic",
|
||||
],
|
||||
|
||||
emits: ["fetchUpdates"],
|
||||
|
||||
@@ -16,7 +21,7 @@ export default {
|
||||
return {
|
||||
showUpdateModal: false,
|
||||
content: null,
|
||||
editProfilTitle: this.$p.t('profil','profilBearbeiten'),
|
||||
editProfilTitle: this.$p.t("profil", "profilBearbeiten"),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -81,7 +86,7 @@ export default {
|
||||
}
|
||||
|
||||
//? adds the status information if the profil update request was rejected or accepted
|
||||
if (updateRequest.status !== this.$p.t('profilUpdate','pending')) {
|
||||
if (updateRequest.status !== this.profilUpdateStates.Pending) {
|
||||
content["status"] = updateRequest.status;
|
||||
content["status_message"] = updateRequest.status_message;
|
||||
content["status_timestamp"] = updateRequest.status_timestamp;
|
||||
@@ -114,32 +119,25 @@ export default {
|
||||
);
|
||||
},
|
||||
getView: function (topic, status) {
|
||||
if (!(status === this.$p.t('profilUpdate','pending'))) {
|
||||
if (!(status === this.profilUpdateStates.Pending)) {
|
||||
return "Status";
|
||||
}
|
||||
|
||||
switch (topic) {
|
||||
case "Private Kontakte":
|
||||
case this.profilUpdateTopic["Private Kontakte"]:
|
||||
return "EditKontakt";
|
||||
break;
|
||||
case "Add Kontakte":
|
||||
case this.profilUpdateTopic["Add Kontakt"]:
|
||||
return "EditKontakt";
|
||||
break;
|
||||
case "Delete Kontakte":
|
||||
case this.profilUpdateTopic["Delete Kontakt"]:
|
||||
return "Kontakt";
|
||||
break;
|
||||
case "Private Adressen":
|
||||
case this.profilUpdateTopic["Private Adressen"]:
|
||||
return "EditAdresse";
|
||||
break;
|
||||
case "Add Adressen":
|
||||
case this.profilUpdateTopic["Add Adresse"]:
|
||||
return "EditAdresse";
|
||||
break;
|
||||
case "Delete Adressen":
|
||||
case this.profilUpdateTopic["Delete Adresse"]:
|
||||
return "Adresse";
|
||||
break;
|
||||
default:
|
||||
return "TextInputDokument";
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -194,7 +192,7 @@ export default {
|
||||
}
|
||||
|
||||
//? adds the status information if the profil update request was rejected or accepted
|
||||
if (updateRequest.status !== this.$p.t('profilUpdate','pending')) {
|
||||
if (updateRequest.status !== this.profilUpdateStates["Pending"]) {
|
||||
content["status"] = updateRequest.status;
|
||||
content["status_message"] = updateRequest.status_message;
|
||||
content["status_timestamp"] = updateRequest.status_timestamp;
|
||||
@@ -223,8 +221,8 @@ export default {
|
||||
created() {},
|
||||
|
||||
computed: {},
|
||||
|
||||
template: /*html*/`
|
||||
|
||||
template: /*html*/ `
|
||||
<div class="card " >
|
||||
|
||||
<edit-profil v-if="showUpdateModal" ref="updateEditModal" @hideBsModal="hideEditProfilModal" :value="content" :title="editProfilTitle"></edit-profil>
|
||||
@@ -243,12 +241,12 @@ export default {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in data" :style="item.status==$p.t('profilUpdate','accepted')?'background-color:lightgreen':item.status===$p.t('profilUpdate','rejected')?'background-color:lightcoral':''">
|
||||
<tr v-for="item in data" :style="item.status==profilUpdateStates['Accepted']?'background-color:lightgreen':item.status===profilUpdateStates['Rejected']?'background-color:lightcoral':''">
|
||||
<td class="align-middle text-wrap ">{{item.topic}}</td>
|
||||
<td class="align-middle " >{{item.status}}</td>
|
||||
<td class="align-middle">{{item.status_timestamp?item.status_timestamp:item.insertamum}}</td>
|
||||
|
||||
<template v-if="item.status === $p.t('profilUpdate','pending')">
|
||||
<template v-if="item.status === profilUpdateStates['Pending']">
|
||||
<td>
|
||||
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
this.$emit("profilUpdate", this.isChanged ? this.data : null);
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
autocompleteSearch: function (event) {
|
||||
this.gemeinden = this.gemeinden.map((gemeinde) => gemeinde);
|
||||
@@ -102,7 +102,7 @@ export default {
|
||||
|
||||
template: /*html*/ `
|
||||
<div class="gy-3 row justify-content-center align-items-center">
|
||||
<pre>{{JSON.stringify(data,null,2)}}</pre>
|
||||
|
||||
<!-- warning message for too many zustellungs Adressen -->
|
||||
<div v-if="showZustellAdressenWarning" class="col-12 ">
|
||||
<div class="card bg-danger mx-2">
|
||||
|
||||
@@ -14,6 +14,7 @@ export default {
|
||||
Status,
|
||||
TextInputDokument,
|
||||
},
|
||||
inject: ["profilUpdateTopic"],
|
||||
props: {
|
||||
list: Object,
|
||||
|
||||
@@ -52,11 +53,15 @@ export default {
|
||||
methods: {
|
||||
addItem: function () {
|
||||
this.view =
|
||||
this.topic == "Private Kontakte" ? "EditKontakt" : "EditAdresse";
|
||||
this.topic == this.profilUpdateTopic["Private Kontakte"]
|
||||
? "EditKontakt"
|
||||
: "EditAdresse";
|
||||
|
||||
//? updates the topic when a Kontakt or an Address should be added
|
||||
this.topic =
|
||||
this.topic == "Private Kontakte" ? "Add Kontakte" : "Add Adressen";
|
||||
this.topic == this.profilUpdateTopic["Private Kontakte"]
|
||||
? this.profilUpdateTopic["Add Kontakt"]
|
||||
: this.profilUpdateTopic["Add Adresse"];
|
||||
this.$emit("update:topic", this.topic);
|
||||
this.breadcrumbItems.push(this.topic);
|
||||
this.$emit("update:breadcrumb", this.breadcrumbItems);
|
||||
@@ -89,16 +94,16 @@ export default {
|
||||
item.data.delete = true;
|
||||
this.$emit("update:profilUpdate", item.data);
|
||||
//? updates the topic when a Kontakt or an Address should be deleted
|
||||
this.topic = item.data.kontakt ? "Delete Kontakte" : "Delete Adressen";
|
||||
this.topic = this.profilUpdateTopic["Private Adressen"]
|
||||
? this.profilUpdateTopic["Delete Adresse"]
|
||||
: this.profilUpdateTopic["Delete Kontakt"];
|
||||
this.$emit("update:topic", this.topic);
|
||||
|
||||
this.$emit("submit");
|
||||
},
|
||||
|
||||
//TODO: REWRITE THIS TO USE PROVIDE AND INJECT
|
||||
profilUpdateEmit: function (event) {
|
||||
//? passes the updated profil information to the parent component
|
||||
|
||||
this.$emit("update:profilUpdate", event);
|
||||
},
|
||||
|
||||
@@ -108,7 +113,7 @@ export default {
|
||||
this.view = item.view;
|
||||
if (item.title) {
|
||||
//? emits the selected topic to the parent component
|
||||
this.topic = item.title;
|
||||
this.topic = item.topic;
|
||||
this.$emit("update:topic", this.topic);
|
||||
|
||||
//? emits the new item for the breadcrumb in the parent component
|
||||
|
||||
@@ -3,7 +3,6 @@ import Alert from "../../Bootstrap/Alert.js";
|
||||
import Kontakt from "../Profil/ProfilComponents/Kontakt.js";
|
||||
import Adresse from "../Profil/ProfilComponents/Adresse.js";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BsModal,
|
||||
@@ -14,12 +13,11 @@ export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
|
||||
},
|
||||
value: {
|
||||
type: Object,
|
||||
},
|
||||
setLoading:{
|
||||
setLoading: {
|
||||
type: Function,
|
||||
},
|
||||
|
||||
@@ -39,48 +37,59 @@ export default {
|
||||
return {
|
||||
data: this.value,
|
||||
loading: false,
|
||||
//? result is returned from the Promise when the modal is closed
|
||||
profilUpdateStates: {},
|
||||
result: false,
|
||||
info: null,
|
||||
files:null,
|
||||
files: null,
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDocumentLink: function(dms_id){
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/show/${dms_id}`;
|
||||
getProfilStatus: async function () {
|
||||
return (
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/show/${dms_id}`
|
||||
);
|
||||
},
|
||||
getDocumentLink: function (dms_id) {
|
||||
return (
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/show/${dms_id}`
|
||||
);
|
||||
},
|
||||
acceptRequest: function () {
|
||||
this.loading = true;
|
||||
this.setLoading(true);
|
||||
Vue.$fhcapi.ProfilUpdate.acceptProfilRequest(this.data).then((res) => {
|
||||
this.setLoading(false);
|
||||
this.loading = false;
|
||||
this.result = true;
|
||||
}).catch((e) => {
|
||||
Alert.popup(Vue.h('div',{innerHTML:e.response.data}));
|
||||
}).finally(()=>{
|
||||
this.hide();
|
||||
});
|
||||
|
||||
Vue.$fhcapi.ProfilUpdate.acceptProfilRequest(this.data)
|
||||
.then((res) => {
|
||||
this.setLoading(false);
|
||||
this.loading = false;
|
||||
this.result = true;
|
||||
})
|
||||
.catch((e) => {
|
||||
Alert.popup(Vue.h("div", { innerHTML: e.response.data }));
|
||||
})
|
||||
.finally(() => {
|
||||
this.hide();
|
||||
});
|
||||
},
|
||||
|
||||
denyRequest: async function () {
|
||||
this.loading = true;
|
||||
this.setLoading(true);
|
||||
Vue.$fhcapi.ProfilUpdate.denyProfilRequest(this.data).then((res) => {
|
||||
this.setLoading(false);
|
||||
this.loading = false;
|
||||
this.result = true;
|
||||
}).catch((e) => {
|
||||
Alert.popup(Vue.h('div',{innerHTML:e.response.data}));
|
||||
});
|
||||
Vue.$fhcapi.ProfilUpdate.denyProfilRequest(this.data)
|
||||
.then((res) => {
|
||||
this.setLoading(false);
|
||||
this.loading = false;
|
||||
this.result = true;
|
||||
})
|
||||
.catch((e) => {
|
||||
Alert.popup(Vue.h("div", { innerHTML: e.response.data }));
|
||||
});
|
||||
this.hide();
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
getComponentView: function () {
|
||||
@@ -94,10 +103,20 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
Vue.$fhcapi.ProfilUpdate.getProfilRequestFiles(this.data.profil_update_id).then((res) =>{
|
||||
this.files=res.data;
|
||||
})
|
||||
// fetching the different ProfilUpdateStates from the db
|
||||
Vue.$fhcapi.ProfilUpdate.getStatus()
|
||||
.then((result) => {
|
||||
this.profilUpdateStates = result.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
Vue.$fhcapi.ProfilUpdate.getProfilRequestFiles(
|
||||
this.data.profil_update_id
|
||||
).then((res) => {
|
||||
this.files = res.data;
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.modal = this.$refs.modalContainer.modal;
|
||||
@@ -105,7 +124,7 @@ export default {
|
||||
popup(options) {
|
||||
return BsModal.popup.bind(this)(null, options);
|
||||
},
|
||||
template: /*html*/`
|
||||
template: /*html*/ `
|
||||
|
||||
<bs-modal v-show="!loading" ref="modalContainer" v-bind="$props" body-class="" dialog-class="modal-lg" class="bootstrap-alert" backdrop="false" >
|
||||
|
||||
@@ -206,7 +225,7 @@ export default {
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="data.status === $p.t('profilUpdate','pending')" v-slot:footer>
|
||||
<template v-if="data.status === profilUpdateStates.Pending" v-slot:footer>
|
||||
<div class="form-underline flex-fill">
|
||||
<div class="form-underline-titel">{{$p.t('global','nachricht')}}</div>
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update_status LIMIT 1"))
|
||||
{
|
||||
|
||||
$qry = " CREATE TABLE public.tbl_profil_update_status (
|
||||
if (!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update_status LIMIT 1")) {
|
||||
|
||||
$qry = " CREATE TABLE public.tbl_profil_update_status (
|
||||
status_kurzbz VARCHAR(32) NOT NULL,
|
||||
beschreibung VARCHAR(256) NULL,
|
||||
bezeichnung_mehrsprachig VARCHAR(256)[] NULL,
|
||||
@@ -17,16 +16,15 @@
|
||||
('Accepted','Profil Änderungen die angenommen wurden','{Angenommen,Accepted}'),
|
||||
('Rejected','Profil Änderungen die abgelehn wurden','{Abgelehnt,Rejected}');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update_status: '.$db->db_last_error().'</strong><br>';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update_status: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_profil_update_status: table created';
|
||||
}
|
||||
}
|
||||
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update_topic LIMIT 1"))
|
||||
{
|
||||
if (!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update_topic LIMIT 1")) {
|
||||
|
||||
$qry="CREATE TABLE public.tbl_profil_update_topic (
|
||||
$qry = "CREATE TABLE public.tbl_profil_update_topic (
|
||||
topic_kurzbz VARCHAR(32) NOT NULL,
|
||||
beschreibung VARCHAR(256) NULL,
|
||||
bezeichnung_mehrsprachig VARCHAR(256)[] NULL,
|
||||
@@ -42,22 +40,21 @@
|
||||
('Titel','Titel aktualisieren','{Titel,Title}'),
|
||||
('Postnomen','Postnomen aktualisieren','{Postnomen,Post-nominal}'),
|
||||
('Private Kontakte','Kontakt aktualisieren','{\"Private Kontakte\",\"Private Contacts\"}'),
|
||||
('Kontakt löschen','Kontakt löschen','{\"Kontakt löschen\",\"Delete contact\"}'),
|
||||
('Kontakt hinzufügen','Kontakt hinzufügen','{\"Kontakt hinzufügen\",\"Add contact\"}'),
|
||||
('Delete Kontakt','Kontakt löschen','{\"Kontakt löschen\",\"Delete contact\"}'),
|
||||
('Add Kontakt','Kontakt hinzufügen','{\"Kontakt hinzufügen\",\"Add contact\"}'),
|
||||
('Private Adressen','Adresse aktualisieren','{\"Private Adressen\",\"Private Addreses\"}'),
|
||||
('Adresse löschen','Adresse löschen','{\"Adresse löschen\",\"Delete address\"}'),
|
||||
('Adresse hinzufügen','Adresse löschen','{\"Adresse hinzufügen\",\"Delete address\"}');";
|
||||
('Delete Adresse','Adresse löschen','{\"Adresse löschen\",\"Delete address\"}'),
|
||||
('Add Adresse','Adresse hinzufügen','{\"Adresse hinzufügen\",\"Delete address\"}');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update_topic: '.$db->db_last_error().'</strong><br>';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update_topic: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_profil_update_topic: table created';
|
||||
}
|
||||
}
|
||||
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update LIMIT 1"))
|
||||
{
|
||||
|
||||
$qry = "CREATE TABLE public.tbl_profil_update (
|
||||
if (!$result = @$db->db_query("SELECT 1 FROM public.tbl_profil_update LIMIT 1")) {
|
||||
|
||||
$qry = "CREATE TABLE public.tbl_profil_update (
|
||||
profil_update_id INTEGER NOT NULL,
|
||||
uid VARCHAR(32) NOT NULL,
|
||||
topic VARCHAR(32) NOT NULL,
|
||||
@@ -92,26 +89,24 @@
|
||||
GRANT SELECT, UPDATE ON public.tbl_profil_update_id_seq TO web;";
|
||||
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update: '.$db->db_last_error().'</strong><br>';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_profil_update: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_profil_update: table created';
|
||||
}
|
||||
|
||||
// adds the dms_kategorie profil_aenderung to the database
|
||||
if ($result = @$db->db_query("SELECT * FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz='profil_aenderung'")) {
|
||||
|
||||
if ($db->db_num_rows($result) == 0) {
|
||||
|
||||
$qry = "INSERT INTO campus.tbl_dms_kategorie VALUES ('profil_aenderung','Dokumente fuer Profil Aenderungen','Dokumente die Belegen ob man eine neue Adresse angemeldet hat oder seinen Namen geaendert hat','dokumente',NULL,NULL);";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>INSERT OF DMS_KATEGORIE profil_aenderung ERROR : ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_profil_update: table created';
|
||||
echo '<br>INSERT OF DMS_KATEGORIE profil_aenderung was successful';
|
||||
}
|
||||
|
||||
// adds the dms_kategorie profil_aenderung to the database
|
||||
if($result = @$db->db_query("SELECT * FROM campus.tbl_dms_kategorie WHERE kategorie_kurzbz='profil_aenderung'"))
|
||||
{
|
||||
|
||||
if($db->db_num_rows($result) == 0){
|
||||
|
||||
$qry = "INSERT INTO campus.tbl_dms_kategorie VALUES ('profil_aenderung','Dokumente fuer Profil Aenderungen','Dokumente die Belegen ob man eine neue Adresse angemeldet hat oder seinen Namen geaendert hat','dokumente',NULL,NULL);";
|
||||
}
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>INSERT OF DMS_KATEGORIE profil_aenderung ERROR : '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>INSERT OF DMS_KATEGORIE profil_aenderung was successful';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user