refactor fhcApi

This commit is contained in:
cgfhtw
2025-03-24 13:38:49 +01:00
parent f6352211f2
commit 9f06fbcf93
142 changed files with 4713 additions and 785 deletions
@@ -35,13 +35,9 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.endpoint.getAllBetriebsmittel,
ajaxParams: () => {
return {
type: this.typeId,
id: this.id
};
},
ajaxRequestFunc: () => this.$api.call(
this.endpoint.getAllBetriebsmittel(this.typeId, this.id)
),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Nummer", field: "nummer", width: 150},
@@ -221,7 +217,9 @@ export default {
.then(result => result
? betriebsmittelperson_id
: Promise.reject({handled: true}))
.then(this.endpoint.deleteBetriebsmittel)
.then(betriebsmittelperson_id => this.$api.call(
this.endpoint.deleteBetriebsmittel(betriebsmittelperson_id))
)
.then(result => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
window.scrollTo(0, 0);
@@ -234,8 +232,8 @@ export default {
this.formData.uid = this.uid;
if (this.formData.betriebsmitteltyp == 'Inventar')
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
return this.endpoint
.addNewBetriebsmittel(this.$refs.betriebsmittelData, this.id, this.formData)
return this.$refs.betriebsmittelData
.call(this.endpoint.addNewBetriebsmittel(this.id, this.formData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$refs.betriebsmittelModal.hide();
@@ -248,8 +246,11 @@ export default {
updateBetriebsmittel(betriebsmittelperson_id) {
if (this.formData.betriebsmitteltyp == 'Inventar')
this.formData.betriebsmittel_id = this.formData.inventarData?.betriebsmittel_id;
return this.endpoint
.updateBetriebsmittel(this.$refs.betriebsmittelData, betriebsmittelperson_id, this.formData)
return this.$refs.betriebsmittelData
.call(this.endpoint.updateBetriebsmittel(
betriebsmittelperson_id,
this.formData
))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$refs.betriebsmittelModal.hide();
@@ -262,8 +263,8 @@ export default {
loadBetriebsmittel(betriebsmittelperson_id) {
this.resetModal();
this.statusNew = false;
return this.endpoint
.loadBetriebsmittel(betriebsmittelperson_id)
return this.$api
.call(this.endpoint.loadBetriebsmittel(betriebsmittelperson_id))
.then(result => {
this.formData = result.data;
})
@@ -271,8 +272,8 @@ export default {
},
searchInventar(event) {
const encodedQuery = encodeURIComponent(event.query);
return this.endpoint
.loadInventarliste(encodedQuery)
return this.$api
.call(this.endpoint.loadInventarliste(encodedQuery))
.then(result => {
this.filteredInventar = result.data;
});
@@ -294,8 +295,8 @@ export default {
}
},
created() {
return this.endpoint
.getTypenBetriebsmittel()
return this.$api
.call(this.endpoint.getTypenBetriebsmittel())
.then(result => {
this.listBetriebsmitteltyp = result.data;
})
+17 -11
View File
@@ -1,6 +1,9 @@
import CalendarDate from '../../../composables/CalendarDate.js';
import LvModal from "../../../components/Cis/Mylv/LvModal.js";
import ApiStundenplan from '../../../api/factory/stundenplan.js';
import ApiAddons from '../../../api/factory/addons.js';
function ggt(m, n) {
return n == 0 ? m : ggt(n, m % n);
}
@@ -245,17 +248,20 @@ export default {
},
fetchLvMenu(event) {
if (event && event.type == 'lehreinheit') {
this.$fhcApi.factory.stundenplan.getLehreinheitStudiensemester(event.lehreinheit_id[0]).then(
res => res.data
).then(
studiensemester_kurzbz => {
this.$fhcApi.factory.addons.getLvMenu(event.lehrveranstaltung_id, studiensemester_kurzbz).then(res => {
if (res.data) {
this.lvMenu = res.data;
}
});
}
)
this.$api
.call(ApiStundenplan.getLehreinheitStudiensemester(event.lehreinheit_id[0]))
.then(res => res.data)
.then(studiensemester_kurzbz => this.$api.call(
ApiAddons.getLvMenu(
event.lehreinheit_id,
studiensemester_kurzbz
)
))
.then(res => {
if (res.data) {
this.lvMenu = res.data;
}
});
}
},
hourGridIdentifier(hour) {
+29 -25
View File
@@ -2,6 +2,8 @@ import raum_contentmittitel from './Content_types/Raum_contentmittitel.js'
import general from './Content_types/General.js'
import BsConfirm from "../../Bootstrap/Confirm.js";
import ApiCms from '../../../api/factory/cms.js';
export default {
name: "ContentComponent",
props: {
@@ -30,33 +32,35 @@ export default {
},
methods: {
fetchContent(){
return this.$fhcApi.factory.cms.content(this.content_id_internal, this.version, this.sprache, this.sichtbar).then(res => {
this.content = res.data.content;
this.content_type = res.data.type;
document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
el.addEventListener("click", (evt) => {
evt.preventDefault();
BsConfirm.popup(el.dataset.confirm)
.then(() => {
Axios.get(el.href)
.then((res) => {
// TODO(chris): check for success then show message and/or reload
location = location;
})
.catch((err) => console.error("ERROR:", err));
})
.catch(() => {
});
return this.$api
.call(ApiCms.content(this.content_id_internal, this.version, this.sprache, this.sichtbar))
.then(res => {
this.content = res.data.content;
this.content_type = res.data.type;
document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
el.addEventListener("click", (evt) => {
evt.preventDefault();
BsConfirm.popup(el.dataset.confirm)
.then(() => {
Axios.get(el.href)
.then((res) => {
// TODO(chris): check for success then show message and/or reload
location = location;
})
.catch((err) => console.error("ERROR:", err));
})
.catch(() => {
});
});
});
document.querySelectorAll("#cms [data-href]").forEach((el) => {
el.href = el.dataset.href.replace(
/^ROOT\//,
FHC_JS_DATA_STORAGE_OBJECT.app_root
);
});
});
document.querySelectorAll("#cms [data-href]").forEach((el) => {
el.href = el.dataset.href.replace(
/^ROOT\//,
FHC_JS_DATA_STORAGE_OBJECT.app_root
);
});
});
}
},
watch:{
+8 -6
View File
@@ -1,6 +1,7 @@
import BsModal from "../../Bootstrap/Modal.js";
import RaumContent from "./Content_types/Raum_contentmittitel.js";
import ApiCms from '../../../api/factory/cms.js';
export default {
@@ -34,12 +35,13 @@ export default {
// this method is always called when the modal is shown
modalShown: function(){
if(this.content_id){
this.$fhcApi.factory.cms.content(this.content_id).then(res =>{
this.content = res.data.content;
this.type = res.data.type;
})
if (this.content_id) {
this.$api
.call(ApiCms.content(this.content_id))
.then(res => {
this.content = res.data.content;
this.type = res.data.type;
});
}
},
},
+43 -39
View File
@@ -2,6 +2,8 @@ import Pagination from "../../Pagination/Pagination.js";
import StudiengangInformation from "./StudiengangInformation/StudiengangInformation.js";
import BsConfirm from "../../Bootstrap/Confirm.js";
import ApiCms from '../../../api/factory/cms.js';
export default {
name: "NewsComponent",
components: {
@@ -27,53 +29,55 @@ export default {
},
},
methods: {
fetchNews: function(){
return this.$fhcApi.factory.cms.getNews(this.page, this.page_size, this.sprache)
.then(res => res.data)
.then(result => {
this.content = result;
fetchNews() {
return this.$api
.call(ApiCms.getNews(this.page, this.page_size, this.sprache))
.then(res => res.data)
.then(result => {
this.content = result;
document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
el.addEventListener("click", (evt) => {
evt.preventDefault();
BsConfirm.popup(el.dataset.confirm)
.then(() => {
Axios.get(el.href)
.then((res) => {
// TODO(chris): check for success then show message and/or reload
location = location;
document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
el.addEventListener("click", (evt) => {
evt.preventDefault();
BsConfirm.popup(el.dataset.confirm)
.then(() => {
Axios.get(el.href)
.then((res) => {
// TODO(chris): check for success then show message and/or reload
location = location;
})
.catch((err) => console.error("ERROR:", err));
})
.catch((err) => console.error("ERROR:", err));
})
.catch(() => {
.catch(() => {
});
});
});
document.querySelectorAll("#cms [data-href]").forEach((el) => {
el.href = el.dataset.href.replace(
/^ROOT\//,
FHC_JS_DATA_STORAGE_OBJECT.app_root
);
});
});
});
document.querySelectorAll("#cms [data-href]").forEach((el) => {
el.href = el.dataset.href.replace(
/^ROOT\//,
FHC_JS_DATA_STORAGE_OBJECT.app_root
);
});
});
},
loadNewPageContent: function (data) {
this.$fhcApi.factory.cms.getNews(data.page, data.rows)
.then(res => res.data)
.then(result => {
this.content = result;
});
},
},
loadNewPageContent(data) {
this.$api
.call(ApiCms.getNews(data.page, data.rows))
.then(res => res.data)
.then(result => {
this.content = result;
});
}
},
created() {
this.fetchNews();
this.$fhcApi.factory.cms.getNewsRowCount()
.then(res => res.data)
.then(result => {
this.maxPageCount = result;
});
this.$api
.call(ApiCms.getNewsRowCount())
.then(res => res.data)
.then(result => {
this.maxPageCount = result;
});
},
template: /*html*/ `
<h2 >News</h2>
@@ -1,6 +1,8 @@
import StudiengangPerson from "./StudiengangPerson.js";
import StudiengangVertretung from "./StudiengangVertretung.js";
import ApiStudiengang from '../../../../api/factory/studiengang.js';
export default {
data(){
return{
@@ -108,13 +110,12 @@ computed:{
return `https://moodle.technikum-wien.at/course/view.php?idnumber=dl` + this.studiengang.studiengang_kz;
},
},
mounted(){
this.$fhcApi.factory.studiengang.studiengangInformation()
.then(res => res.data)
.then(studiengangInformationen => {
Object.assign(this, studiengangInformationen);
});
},
mounted() {
this.$api
.call(ApiStudiengang.studiengangInformation())
.then(res => res.data)
.then(studiengangInformationen => {
Object.assign(this, studiengangInformationen);
});
}
};
+10 -7
View File
@@ -1,6 +1,8 @@
import CisMenuEntry from "./Menu/Entry.js";
import FhcSearchbar from "../searchbar/searchbar.js";
import CisSprachen from "./Sprachen.js"
import CisSprachen from "./Sprachen.js";
import ApiCisMenu from '../../api/factory/cis/menu.js';
export default {
components: {
@@ -50,12 +52,13 @@ export default {
}
},
methods: {
fetchMenu: function(){
return this.$fhcApi.factory.menu.getMenu()
.then(res => res.data)
.then(menu => {
this.entries = menu;
})
fetchMenu() {
return this.$api
.call(ApiCisMenu.getMenu())
.then(res => res.data)
.then(menu => {
this.entries = menu;
});
},
checkSettingsVisibility: function (event) {
// hides the settings collapsible if the user clicks somewhere else
+17 -11
View File
@@ -3,6 +3,9 @@ import Alert from "../../Bootstrap/Alert.js";
import LvMenu from "./LvMenu.js"
import LvInfo from "./LvInfo.js"
import ApiStundenplan from '../../../api/factory/stundenplan.js';
import ApiAddons from '../../../api/factory/addons.js';
export default {
components: {
BsModal,
@@ -47,17 +50,20 @@ export default {
if(!this.showMenu) return;
if (this.event.type == 'lehreinheit') {
this.$fhcApi.factory.stundenplan.getLehreinheitStudiensemester(this.event.lehreinheit_id[0]).then(
res=>res.data
).then(
studiensemester_kurzbz =>{
this.$fhcApi.factory.addons.getLvMenu(this.event.lehrveranstaltung_id, studiensemester_kurzbz).then(res => {
if (res.data) {
this.menu = res.data;
}
});
}
)
this.$api
.call(ApiStundenplan.getLehreinheitStudiensemester(this.event.lehreinheit_id[0]))
.then(res => res.data)
.then(studiensemester_kurzbz => this.$api.call(
ApiAddons.getLvMenu(
this.event.lehrveranstaltung_id,
studiensemester_kurzbz
)
))
.then(res => {
if (res.data) {
this.menu = res.data;
}
});
}
},
},
+12 -7
View File
@@ -1,5 +1,8 @@
import BsModal from "../../Bootstrap/Modal.js";
import LvMenu from "./LvMenu.js";
import ApiAddons from '../../../api/factory/addons.js';
export default {
props:{
@@ -34,13 +37,15 @@ export default {
this.isMenuSelected = false;
},
showModal: function(){
if(!this.preselectedMenu){
this.$fhcApi.factory.addons.getLvMenu(this.event.lehrveranstaltung_id, this.event.studiensemester_kurzbz).then(res =>{
if(res.data){
this.menu = res.data;
}
});
}else{
if (!this.preselectedMenu) {
this.$api
.call(ApiAddons.getLvMenu(this.event.lehrveranstaltung_id, this.event.studiensemester_kurzbz))
.then(res => {
if (res.data) {
this.menu = res.data;
}
});
} else {
this.isMenuSelected = true;
}
},
@@ -3,6 +3,8 @@ import CalendarDate from "../../../composables/CalendarDate.js";
import LvModal from "../../../components/Cis/Mylv/LvModal.js";
import LvInfo from "../../../components/Cis/Mylv/LvInfo.js"
import ApiStudenplan from '../../../api/factory/stundenplan.js';
export const DEFAULT_MODE_RAUMINFO = 'Week'
const RoomInformation = {
@@ -163,8 +165,8 @@ const RoomInformation = {
// bundles the room_events and the reservierungen together into the this.events array
Promise.allSettled([
this.$fhcApi.factory.stundenplan.getRoomInfo(this.propsViewData.ort_kurzbz, this.monthFirstDay, this.monthLastDay),
this.$fhcApi.factory.stundenplan.getOrtReservierungen(this.propsViewData.ort_kurzbz, this.monthFirstDay, this.monthLastDay)
this.$api.call(ApiStudenplan.getRoomInfo(this.propsViewData.ort_kurzbz, this.monthFirstDay, this.monthLastDay)),
this.$api.call(ApiStudenplan.getOrtReservierungen(this.propsViewData.ort_kurzbz, this.monthFirstDay, this.monthLastDay))
]).then((result) => {
let promise_events = [];
result.forEach((promise_result) => {
@@ -3,6 +3,9 @@ import LvInfo from "./Lv/Info.js";
import Phrasen from "../../../../../mixins/Phrasen.js";
import LvUebersicht from "../../LvUebersicht.js";
import ApiLehre from '../../../../../api/factory/lehre.js';
import ApiAddons from '../../../../../api/factory/addons.js';
// TODO(chris): L10n
export default {
@@ -75,8 +78,9 @@ export default {
},
methods: {
fetchMenu(lehrveranstaltung_id = this.lehrveranstaltung_id, studien_semester = this.studien_semester){
return this.$fhcApi.factory.addons.getLvMenu(lehrveranstaltung_id, studien_semester)
fetchMenu(lehrveranstaltung_id = this.lehrveranstaltung_id, studien_semester = this.studien_semester) {
return this.$api
.call(ApiAddons.getLvMenu(lehrveranstaltung_id, studien_semester))
.then(res => {
this.menu = res.data;
})
@@ -139,13 +143,13 @@ export default {
this.fetchMenu(this.lehrveranstaltung_id, newValue);
}
},
created(){
this.$fhcApi.factory.lehre.getStudentPruefungen(this.lehrveranstaltung_id)
.then(res => res.data)
.then(pruefungen =>{
this.pruefungenData = pruefungen;
});
created() {
this.$api
.call(ApiLehre.getStudentPruefungen(this.lehrveranstaltung_id))
.then(res => res.data)
.then(pruefungen => {
this.pruefungenData = pruefungen;
});
},
mounted() {
this.fetchMenu(this.lehrveranstaltung_id, this.studien_semester);
@@ -1,4 +1,4 @@
import ApiLehre from '../../../../../../api/factory/lehre.js';
const infos = {};
@@ -57,7 +57,7 @@ export default {
}
},
created() {
this.$fhcApi.factory.lehre.getLvInfo(this.studien_semester, this.lehrveranstaltung_id)
this.$api.call(ApiLehre.getLvInfo(this.studien_semester, this.lehrveranstaltung_id))
.then(
res => res.data
).then(data =>{
@@ -10,6 +10,8 @@ import ProfilEmails from "./ProfilComponents/ProfilEmails.js";
import RoleInformation from "./ProfilComponents/RoleInformation.js";
import ProfilInformation from "./ProfilComponents/ProfilInformation.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
export default {
components: {
CoreFilterCmpt,
@@ -162,7 +164,8 @@ export default {
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()
this.$api
.call(ApiProfilUpdate.selectProfilRequest())
.then((request) => {
if (!request.error && request) {
this.data.profilUpdates = request.data;
@@ -195,13 +198,15 @@ export default {
},
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;
}
});
this.$api
.call(ApiProfilUpdate.selectProfilRequest())
.then((res) => {
if (!res.error && res) {
this.data.profilUpdates = res.data?.length
? res.data.sort(this.sortProfilUpdates)
: null;
}
});
},
setTableColumnTitles() { // reevaluates computed phrasen
if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns)
+17 -10
View File
@@ -4,6 +4,9 @@ import ViewStudentProfil from "./StudentViewProfil.js";
import ViewMitarbeiterProfil from "./MitarbeiterViewProfil.js";
import Loading from "../../Loader.js";
import ApiProfil from '../../../api/factory/profil.js';
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
Vue.$collapseFormatter = function (data) {
//data - an array of objects containing the column title and value for each cell
var container = document.createElement("div");
@@ -132,7 +135,8 @@ export const Profil = {
methods: {
async load() {
// fetch profilUpdateStates to provide them to children components
await this.$fhcApi.factory.profilUpdate.getStatus()
await this.$api
.call(ApiProfilUpdate.getStatus())
.then((response) => {
this.profilUpdateStates = response.data;
})
@@ -140,7 +144,8 @@ export const Profil = {
console.error(error);
});
this.$fhcApi.factory.profilUpdate.getTopic()
this.$api
.call(ApiProfilUpdate.getTopic())
.then((response) => {
this.profilUpdateTopic = response.data;
})
@@ -150,14 +155,16 @@ export const Profil = {
let uid = this.uid ?? location.pathname.split("/").pop();
this.$fhcApi.factory.profil.getView(uid).then((res) => {
if (!res.data) {
this.notFoundUID = uid;
} else {
this.view = res.data?.view;
this.data = res.data?.data;
}
});
this.$api
.call(ApiProfil.getView(uid))
.then((res) => {
if (!res.data) {
this.notFoundUID = uid;
} else {
this.view = res.data?.view;
this.data = res.data?.data;
}
});
},
zustellAdressenCount() {
if (!this.data || !this.data.adressen) {
@@ -1,4 +1,8 @@
import EditProfil from "../ProfilModal/EditProfil.js";
import ApiProfil from '../../../../api/factory/profil.js';
import ApiProfilUpdate from '../../../../api/factory/profilUpdate.js';
//? EditProfil is the modal used to edit the profil updates
export default {
components: {EditProfil},
@@ -52,11 +56,13 @@ export default {
};
const filesFromDatabase =
await this.$fhcApi.factory.profilUpdate.getProfilRequestFiles(
updateRequest.profil_update_id
).then((res) => {
return res.data;
});
await this.$api
.call(ApiProfilUpdate.getProfilRequestFiles(
updateRequest.profil_update_id
))
.then((res) => {
return res.data;
});
files = filesFromDatabase;
if (files) {
@@ -77,7 +83,7 @@ export default {
if (view === "EditAdresse") {
const isMitarbeiter = await this.$fhcApi.factory.profil.isMitarbeiter(updateRequest.uid).then((res) => res.data);
const isMitarbeiter = await this.$api.call(ApiProfil.isMitarbeiter(updateRequest.uid)).then((res) => res.data);
if (isMitarbeiter) {
content["isMitarbeiter"] = isMitarbeiter;
@@ -106,16 +112,16 @@ export default {
},
deleteRequest: function (item) {
this.$fhcApi.factory.profilUpdate.deleteProfilRequest(item.profil_update_id).then(
(res) => {
this.$api
.call(ApiProfil.deleteProfilRequest(item.profil_update_id))
.then((res) => {
if (res.data.error) {
//? open alert
console.error("error happened", res.data);
} else {
this.$emit("fetchUpdates");
}
}
);
});
},
getView: function (topic, status) {
@@ -1,3 +1,5 @@
import ApiProfil from '../../../../api/factory/profil.js';
export default {
props: {
title: {
@@ -24,10 +26,12 @@ export default {
if (!this.data) {
return;
}
this.$fhcApi.factory.profil.fotoSperre(!this.FotoSperre).then(res => {
this.FotoSperre = res.data.foto_sperre;
})
},
this.$api
.call(ApiProfil.fotoSperre(!this.FotoSperre))
.then(res => {
this.FotoSperre = res.data.foto_sperre;
});
}
},
computed: {
get_image_base64_src: function () {
@@ -3,6 +3,8 @@ import Alert from "../../../Bootstrap/Alert.js";
import EditProfilSelect from "./EditProfilSelect.js";
import Loader from "../../../Loader.js";
import ApiProfilUpdate from '../../../../api/factory/profilUpdate.js';
export default {
components: {
BsModal,
@@ -96,12 +98,13 @@ export default {
//? if an updateID is present, updateProfilRequest is called, else insertProfilRequest is called
this.editData.updateID ?
this.$fhcApi.factory.profilUpdate.updateProfilRequest(
this.topic,
this.profilUpdate,
this.editData.updateID,
this.fileID ? this.fileID[0] : null
)
this.$api
.call(ApiProfilUpdate.updateProfilRequest(
this.topic,
this.profilUpdate,
this.editData.updateID,
this.fileID ? this.fileID[0] : null
))
.then((res) => {
handleApiResponse(res);
})
@@ -112,11 +115,12 @@ export default {
this.hide();
})
:
this.$fhcApi.factory.profilUpdate.insertProfilRequest(
this.topic,
this.profilUpdate,
this.fileID ? this.fileID[0] : null
)
this.$api
.call(ApiProfilUpdate.insertProfilRequest(
this.topic,
this.profilUpdate,
this.fileID ? this.fileID[0] : null
))
.then((res) => {
handleApiResponse(res);
})
@@ -136,16 +140,20 @@ export default {
const result = this.editData.updateID
? //? updating old attachment by replacing
//* second parameter of api request insertFile checks if the file has to be replaced or not
await this.$fhcApi.factory.profilUpdate.insertFile(
formData,
this.editData.updateID
).then((res) => {
return res.data?.map((file) => file.dms_id);
})
await this.$api
.call(ApiProfilUpdate.insertFile(
formData,
this.editData.updateID
))
.then((res) => {
return res.data?.map((file) => file.dms_id);
})
: //? fresh insert of new attachment
await this.$fhcApi.factory.profilUpdate.insertFile(formData).then((res) => {
return res.data?.map((file) => file.dms_id);
});
await this.$api
.call(ApiProfilUpdate.insertFile(formData))
.then((res) => {
return res.data?.map((file) => file.dms_id);
});
return result;
} else {
//? attachment hasn't been replaced
@@ -1,3 +1,5 @@
import ApiProfil from '../../../../../api/factory/profil.js';
export default {
components: {
AutoComplete: primevue.autocomplete,
@@ -52,8 +54,8 @@ export default {
this.data.plz > 999 &&
this.data.plz < 32000
) {
this.$fhcApi.factory.profil
.getGemeinden(this.data.nation, this.data.plz)
this.$api
.call(ApiProfil.getGemeinden(this.data.nation, this.data.plz))
.then((res) => {
if (res.data.length) {
this.gemeinden = [
@@ -120,10 +122,12 @@ export default {
created() {
// get all available nationen
this.$fhcApi.factory.profil.getAllNationen().then((res)=>{
this.nationenList = res.data;
this.getGemeinde();
})
this.$api
.call(ApiProfil.getAllNationen())
.then(res => {
this.nationenList = res.data;
this.getGemeinde();
});
this.originalValue = JSON.stringify(this.data);
this.zustellAdressenCount = this.getZustelladressenCount();
@@ -1,6 +1,8 @@
import Adresse from "../../ProfilComponents/Adresse.js";
import Kontakt from "../../ProfilComponents/Kontakt.js";
import ApiProfilUpdate from '../../../../../api/factory/profilUpdate.js';
export default {
components: {
Adresse,
@@ -65,11 +67,11 @@ export default {
topic: { type: String },
},
created() {
this.$fhcApi.factory.profilUpdate.getProfilRequestFiles(this.updateID).then(
(res) => {
this.$api
.call(ApiProfilUpdate.getProfilRequestFiles(this.updateID))
.then((res) => {
this.files = res.data;
}
);
});
},
template: /*html*/ `
<div class="row">
@@ -10,6 +10,8 @@ import ProfilInformation from "./ProfilComponents/ProfilInformation.js";
import FetchProfilUpdates from "./ProfilComponents/FetchProfilUpdates.js";
import EditProfil from "./ProfilModal/EditProfil.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
export default {
components: {
CoreFilterCmpt,
@@ -114,19 +116,22 @@ export default {
);
},
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;
}
});
this.$api
.call(ApiProfilUpdate.selectProfilRequest())
.then((res) => {
if (!res.error && res) {
this.data.profilUpdates = res.data?.length
? res.data.sort(this.sortProfilUpdates)
: null;
}
});
},
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()
this.$api
.call(ApiProfilUpdate.selectProfilRequest())
.then((request) => {
if (!request.error && res) {
this.data.profilUpdates = request.data;
@@ -3,6 +3,8 @@ import Alert from "../../Bootstrap/Alert.js";
import Kontakt from "../Profil/ProfilComponents/Kontakt.js";
import Adresse from "../Profil/ProfilComponents/Adresse.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
export default {
components: {
BsModal,
@@ -62,11 +64,12 @@ export default {
handleRequest: function (type) {
this.loading = true;
this.setLoading(true);
this.$fhcApi.factory.profilUpdate[
type.toLowerCase() == "accept"
? "acceptProfilRequest"
: "denyProfilRequest"
](this.data)
this.$api
.call(ApiProfilUpdate[
type.toLowerCase() == "accept"
? "acceptProfilRequest"
: "denyProfilRequest"
](this.data))
.then((res) => {
this.result = true;
})
@@ -93,11 +96,13 @@ export default {
created() {
// only fetching the profilUpdate Attachemnts if the profilUpdate actually has attachments
if (this.value.attachment_id) {
this.$fhcApi.factory.profilUpdate.getProfilRequestFiles(
this.data.profil_update_id
).then((res) => {
this.files = res.data;
});
this.$api
.call(ApiProfilUpdate.getProfilRequestFiles(
this.data.profil_update_id
))
.then((res) => {
this.files = res.data;
});
}
},
mounted() {
@@ -3,6 +3,8 @@ import AcceptDenyUpdate from "./AcceptDenyUpdate.js";
import Alert from "../../../components/Bootstrap/Alert.js";
import Loading from "../../../components/Loader.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
const sortProfilUpdates = (ele1, ele2, thisPointer) => {
let result = 0;
if (ele1.status === thisPointer.profilUpdateStates["Pending"]) {
@@ -127,7 +129,8 @@ export default {
"acceptUpdate"
)}`,
action: (e, column) => {
this.$fhcApi.factory.profilUpdate.acceptProfilRequest(column.getData())
this.$api
.call(ApiProfilUpdate.acceptProfilRequest(column.getData()))
.then((res) => {
this.$refs.UpdatesTable.tabulator.setData();
})
@@ -143,7 +146,8 @@ export default {
"denyUpdate"
)}`,
action: (e, column) => {
this.$fhcApi.factory.profilUpdate.denyProfilRequest(column.getData())
this.$api
.call(ApiProfilUpdate.denyProfilRequest(column.getData()))
.then((res) => {
this.$refs.UpdatesTable.tabulator.setData();
})
@@ -296,7 +300,8 @@ export default {
},
methods: {
denyProfilUpdate: function (data) {
this.$fhcApi.factory.profilUpdate.denyProfilRequest(data)
this.$api
.call(ApiProfilUpdate.denyProfilRequest(data))
.then((res) => {
// block when the request was successful
})
@@ -306,7 +311,8 @@ export default {
});
},
acceptProfilUpdate: function (data) {
this.$fhcApi.factory.profilUpdate.acceptProfilRequest(data)
this.$api
.call(ApiProfilUpdate.acceptProfilRequest(data))
.then((res) => {
// block when the request was successful
})
+1 -1
View File
@@ -10,7 +10,7 @@ export default {
if(this.allActiveLanguages.some(l => l.sprache === lang))
{
const isReload = document.querySelector('[cis4Reload]')
this.$p.setLanguage(lang, this.$fhcApi)
this.$p.setLanguage(lang)
.then(res => res.data)
.then(data =>
{
@@ -4,6 +4,9 @@ import LvModal from "../Mylv/LvModal.js";
import LvInfo from "../Mylv/LvInfo.js"
import LvMenu from "../Mylv/LvMenu.js"
import ApiStundenplan from '../../../api/factory/stundenplan.js';
import ApiAuthinfo from '../../../api/factory/authinfo.js';
export const DEFAULT_MODE_STUNDENPLAN = 'Week'
const Stundenplan = {
@@ -101,7 +104,7 @@ const Stundenplan = {
},
methods:{
fetchStudiensemesterDetails: async function (date) {
return this.$fhcApi.factory.stundenplan.studiensemesterDateInterval(date);
return this.$api.call(ApiStundenplan.studiensemesterDateInterval(date));
},
convertTime: function([hour,minute]){
let date = new Date();
@@ -199,8 +202,8 @@ const Stundenplan = {
},
loadEvents: function(){
Promise.allSettled([
this.$fhcApi.factory.stundenplan.getStundenplan(this.monthFirstDay, this.monthLastDay, this.propsViewData.lv_id),
this.$fhcApi.factory.stundenplan.getStundenplanReservierungen(this.monthFirstDay, this.monthLastDay)
this.$api.call(ApiStundenplan.getStundenplan(this.monthFirstDay, this.monthLastDay, this.propsViewData.lv_id)),
this.$api.call(ApiStundenplan.getStundenplanReservierungen(this.monthFirstDay, this.monthLastDay))
]).then((result) => {
let promise_events = [];
result.forEach((promise_result) => {
@@ -232,12 +235,13 @@ const Stundenplan = {
});
},
},
created()
{
this.$fhcApi.factory.authinfo.getAuthUID().then((res) => res.data)
.then(data=>{
this.uid = data.uid;
})
created() {
this.$api
.call(ApiAuthinfo.getAuthUID())
.then(res => res.data)
.then(data => {
this.uid = data.uid;
});
this.loadEvents();
},
beforeUnmount() {
+4 -2
View File
@@ -2,6 +2,8 @@ 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';
export default {
components: {
DashboardSection,
@@ -163,8 +165,8 @@ 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()
if (!this.viewData.name || !this.viewData.uid) {
const res = await this.$api.call(ApiDashboard.getViewData());
this.viewDataInternal = res.data
}
},
@@ -1,6 +1,8 @@
import AbstractWidget from './Abstract.js';
import BaseOffcanvas from '../Base/Offcanvas.js';
import ApiAmpeln from '../../api/factory/widget/ampeln.js';
let _idcounter = 0;
export default {
@@ -76,16 +78,16 @@ export default {
// maybe we also want to reset the source (open/alle) of the displayed ampeln
},
fetchNonConfirmedActiveAmpeln() {
this.$fhcApi.factory
.ampeln.open()
this.$api
.call(ApiAmpeln.open())
.then(res => {
this.activeAmpeln = res.data;
})
.catch(error => this.$fhcAlert.handleSystemError);
},
fetchAllActiveAmpeln() {
this.$fhcApi.factory
.ampeln.all()
this.$api
.call(ApiAmpeln.all())
.then(res => {
this.allAmpeln = res.data;
})
@@ -93,8 +95,8 @@ export default {
},
async confirm(ampelId) {
this.$fhcApi.factory
.ampeln.confirm(ampelId)
this.$api
.call(ApiAmpeln.confirm(ampelId))
.then(() => {
this.$fhcAlert.alertSuccess(this.$p.t('ampeln', 'ampelBestaetigt'));
// update the ampeln by refetching them
+4 -2
View File
@@ -1,6 +1,8 @@
import AbstractWidget from './Abstract.js';
import BsModal from '../Bootstrap/Modal.js';
import ApiCms from '../../api/factory/cms.js';
const MAX_LOADED_NEWS = 30;
export default {
@@ -132,8 +134,8 @@ export default {
},
created() {
this.$emit("setConfig", false);
this.$fhcApi.factory.cms
.news(MAX_LOADED_NEWS)
this.$api
.call(ApiCms.news(MAX_LOADED_NEWS))
.then(res => res.data)
.then((news) => {
this.allNewsList = Array.from(Object.values(news));
@@ -5,6 +5,9 @@ import LvModal from '../Cis/Mylv/LvModal.js';
import ContentModal from '../Cis/Cms/ContentModal.js'
import CalendarDate from '../../composables/CalendarDate.js';
import ApiStundenplan from '../../api/factory/stundenplan.js';
import ApiOrt from '../../api/factory/ort.js';
export default {
mixins: [
Phrasen,
@@ -80,20 +83,20 @@ export default {
},
showRoomInfoModal: function(ort_kurzbz){
// getting the content_id of the ort_kurzbz
this.$fhcApi.factory.ort.getContentID(ort_kurzbz).then(res =>{
this.roomInfoContentID = res.data;
this.ort_kurzbz = ort_kurzbz;
this.$api
.call(ApiOrt.getContentID(ort_kurzbz))
.then(res => {
this.roomInfoContentID = res.data;
this.ort_kurzbz = ort_kurzbz;
// only showing the modal after vue was able to set the reactive data
Vue.nextTick(()=>{this.$refs.contentModal.show();});
}).catch(err =>{
console.err(err);
this.ort_kurzbz = null;
this.roomInfoContentID = null;
});
// only showing the modal after vue was able to set the reactive data
Vue.nextTick(() => { this.$refs.contentModal.show(); });
})
.catch(err => {
console.err(err);
this.ort_kurzbz = null;
this.roomInfoContentID = null;
});
},
showLvUebersicht: function (event){
this.selectedEvent= event;
@@ -122,8 +125,8 @@ export default {
loadEvents: function () {
Promise.allSettled([
this.$fhcApi.factory.stundenplan.getStundenplan(this.monthFirstDay, this.monthLastDay),
this.$fhcApi.factory.stundenplan.getStundenplanReservierungen(this.monthFirstDay, this.monthLastDay)
this.$api.call(ApiStundenplan.getStundenplan(this.monthFirstDay, this.monthLastDay)),
this.$api.call(ApiStundenplan.getStundenplanReservierungen(this.monthFirstDay, this.monthLastDay))
]).then((result) => {
let promise_events = [];
result.forEach((promise_result) => {
+12 -10
View File
@@ -3,6 +3,8 @@ import FormInput from "../Form/Input.js";
import BsModal from "../Bootstrap/Modal.js";
import AbstractWidget from './Abstract.js';
import ApiBookmark from '../../api/factory/widget/bookmark.js';
export default {
name: "WidgetsUrl",
mixins: [AbstractWidget],
@@ -62,12 +64,12 @@ export default {
event.preventDefault();
if(!this.bookmark_id || !this.url_input || !this.title_input) return;
this.$fhcApi.factory.bookmark
.update({
this.$api
.call(ApiBookmark.update({
bookmark_id: this.bookmark_id,
title: this.title_input,
url: this.url_input,
})
}))
.then((res) => res.data)
.then((result) => {
this.$fhcAlert.alertInfo(this.$p.t("bookmark", "bookmarkUpdated"));
@@ -92,12 +94,12 @@ export default {
// early return if validation failed
if (!this.isValidationSuccessfull()) return;
this.$fhcApi.factory.bookmark
.insert({
this.$api
.call(ApiBookmark.insert({
tag: this.config.tag,
title: this.title_input,
url: this.url_input,
})
}))
.then((res) => res.data)
.then((result) => {
this.$fhcAlert.alertInfo(this.$p.t("bookmark", "bookmarkAdded"));
@@ -124,8 +126,8 @@ export default {
return !Object.values(this.validation).some(value => value === true);
},
async fetchBookmarks() {
await this.$fhcApi.factory.bookmark
.getBookmarks()
await this.$api
.call(ApiBookmark.getBookmarks())
.then((res) => res.data)
.then((result) => {
this.shared = result;
@@ -138,8 +140,8 @@ export default {
// early return if the confirm dialog was not confirmed
if (!isConfirmed) return;
this.$fhcApi.factory.bookmark
.delete(bookmark_id)
this.$api
.call(ApiBookmark.delete(bookmark_id))
.then((res) => res.data)
.then((result) => {
this.$fhcAlert.alertInfo(this.$p.t("bookmark", "bookmarkDeleted"));
+18 -2
View File
@@ -42,7 +42,9 @@ export default {
return a;
}, {});
},
/* Depricated Code start */
factory() {
console.warn('<form>.factory is deprecated! Use <form>.call() instead.');
const factory = Object.create(Object.getPrototypeOf(this.$fhcApi.factory), Object.getOwnPropertyDescriptors(this.$fhcApi.factory));
factory.$fhcApi = {
get: this.get,
@@ -51,6 +53,7 @@ export default {
};
return factory;
}
/* Depricated Code end */
},
methods: {
get(...args) {
@@ -59,7 +62,12 @@ export default {
else
args.unshift(this);
return this.$fhcApi.get(...args);
/* Depricated Code start */
if (!this.$api)
return this.$fhcApi.get(...args);
/* Depricated Code end */
return this.$api.get(...args);
},
post(...args) {
if (typeof args[0] == 'object' && args[0].clearValidation && args[0].setFeedback)
@@ -67,7 +75,15 @@ export default {
else
args.unshift(this);
return this.$fhcApi.post(...args);
/* Depricated Code start */
if (!this.$api)
return this.$fhcApi.post(...args);
/* Depricated Code end */
return this.$api.post(...args);
},
call(factory, overwriteconfig) {
return this.$api.call(factory, overwriteconfig, this);
},
_sendFeedbackToInput(inputs, feedback, valid) {
if (inputs.length) {
+15 -8
View File
@@ -48,7 +48,7 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.endpoint.getNotizen,
ajaxRequestFunc: () => this.$api.call(this.endpoint.getNotizen(this.id, this.typeId)),
ajaxParams: () => {
return {
id: this.id,
@@ -338,7 +338,8 @@ export default {
this.$refs.formNotiz.clearValidation();
return this.endpoint.addNewNotiz(this.$refs.formNotiz, this.id, formData)
return this.$refs.formNotiz
.call(this.endpoint.addNewNotiz(this.id, formData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.resetFormData();
@@ -353,7 +354,8 @@ export default {
});
},
deleteNotiz(notiz_id) {
return this.endpoint.deleteNotiz(notiz_id, this.typeId, this.id)
return this.$api
.call(this.endpoint.deleteNotiz(notiz_id, this.typeId, this.id))
.then(result => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
this.reload();
@@ -365,7 +367,8 @@ export default {
});
},
loadNotiz(notiz_id) {
return this.endpoint.loadNotiz(notiz_id)
return this.$api
.call(this.endpoint.loadNotiz(notiz_id))
.then(result => {
this.notizData = result.data;
this.notizData.typeId = this.typeId;
@@ -375,7 +378,8 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
},
loadDocEntries(notiz_id) {
return this.endpoint.loadDokumente(notiz_id)
return this.$api
.call(this.endpoint.loadDokumente(notiz_id))
.then(
result => {
this.notizData.anhang = result.data;
@@ -389,7 +393,8 @@ export default {
Object.entries(this.notizData.anhang).forEach(([k, v]) => formData.append(k, v));
this.$refs.formNotiz.clearValidation();
return this.endpoint.updateNotiz(this.$refs.formNotiz, notiz_id, formData)
return this.$refs.formNotiz
.call(this.endpoint.updateNotiz(notiz_id, formData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.resetFormData();
@@ -426,14 +431,16 @@ export default {
};
},
getUid() {
return this.endpoint.getUid()
return this.$api
.call(this.endpoint.getUid())
.then(result => {
this.notizData.intVerfasser = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
search(event) {
return this.endpoint.getMitarbeiter(event.query)
return this.$api
.call(this.endpoint.getMitarbeiter(event.query))
.then(result => {
this.filteredMitarbeiter = result.data.retval;
});
@@ -3,6 +3,8 @@ import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
import ApiStudstatusAbmeldung from '../../../api/factory/studstatus/abmeldung.js';
var _uuid = 0;
export default {
@@ -43,8 +45,8 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
return this.$api
.call(ApiStudstatusAbmeldung.getDetails(this.studierendenantragId, this.prestudentId))
.then(result => {
this.data = result.data;
if (this.data.status) {
@@ -70,12 +72,12 @@ export default {
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.$refs.form
.call(ApiStudstatusAbmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
))
.then(result => {
if (result.data === true)
@@ -111,10 +113,7 @@ export default {
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.cancel(
this.data.studierendenantrag_id
)
this.$refs.form.call(ApiStudstatusAbmeldung.cancel(this.data.studierendenantrag_id))
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data;
@@ -3,6 +3,9 @@ import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
import ApiStudstatusAbmeldung from '../../../api/factory/studstatus/abmeldung.js';
import ApiCheckperson from '../../../api/factory/checkperson.js';
var _uuid = 0;
export default {
@@ -45,8 +48,8 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
return this.$api
.call(ApiStudstatusAbmeldung.getDetails(this.studierendenantragId, this.prestudentId))
.then(result => {
this.data = result.data;
if (this.data.status) {
@@ -71,21 +74,22 @@ export default {
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.$refs.form
.call(ApiStudstatusAbmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
))
.then(result => {
if(this.unrulyInternal) {
this.$fhcApi.factory.checkperson.updatePersonUnrulyStatus(this.data.person_id, true).then(
(res)=> {
if(res?.meta?.status === "success") {
if (this.unrulyInternal) {
this.$api
.call(ApiCheckperson.updatePersonUnrulyStatus(this.data.person_id, true))
.then(res => {
if (res?.meta?.status === "success") {
this.$fhcAlert.alertSuccess(this.$p.t('studierendenantrag', 'antrag_unruly_updated'))
}
})
});
}
if (result.data === true)
@@ -3,6 +3,7 @@ import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
import ApiStudstatusUnterbrechung from '../../../api/factory/studstatus/unterbrechung.js';
export default {
components: {
@@ -72,8 +73,11 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.unterbrechung.getDetails(this.studierendenantragId, this.prestudentId)
return this.$api
.call(ApiStudstatusUnterbrechung.getDetails(
this.studierendenantragId,
this.prestudentId
))
.then(
result => {
this.data = result.data;
@@ -99,14 +103,14 @@ export default {
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.create(
this.$refs.form
.call(ApiStudstatusUnterbrechung.create(
this.stsem !== null && this.data.studiensemester[this.stsem].studiensemester_kurzbz,
this.data.prestudent_id,
this.data.grund,
this.stsem !== null && this.currentWiedereinstieg,
this.attachment
)
))
.then(result => {
if (Number.isInteger(result.data))
document.location += "/" + result.data;
@@ -141,10 +145,10 @@ export default {
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.cancel(
this.$refs.form
.call(ApiStudstatusUnterbrechung.cancel(
this.data.studierendenantrag_id
)
))
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/unterbrechung\/([0-9]*)\/[0-9]*[\/]?$/, 'unterbrechung/$1') + "/" + result.data;
@@ -2,6 +2,7 @@ import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import ApiStudstatusWiederholung from '../../../api/factory/studstatus/wiederholung.js';
export default {
components: {
@@ -49,10 +50,10 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.wiederholung.getDetails(
return this.$api
.call(ApiStudstatusWiederholung.getDetails(
this.prestudentId
)
))
.then(result => {
this.data = result.data;
if (!this.data.status || this.data.status == 'ErsteAufforderungVersandt' || this.data.status == 'ZweiteAufforderungVersandt') {
@@ -87,11 +88,11 @@ export default {
});
this.saving = true;
this.$refs.form.factory
.studstatus.wiederholung[func](
this.$refs.form
.call(ApiStudstatusWiederholung[func](
this.data.prestudent_id,
this.data.studiensemester_kurzbz
)
))
.then(result => {
if (result.data === true)
document.location += "";
@@ -6,6 +6,9 @@ import LvPopup from './Leitung/LvPopup.js';
import BsAlert from '../Bootstrap/Alert.js';
import FhcLoader from '../Loader.js';
import ApiStudstatusLeitung from '../../api/factory/studstatus/leitung.js';
import ApiStudstatusAbmeldung from '../../api/factory/studstatus/abmeldung.js';
export default {
components: {
LeitungHeader,
@@ -39,8 +42,8 @@ export default {
},
methods: {
loadFilter() {
this.$fhcApi.factory
.studstatus.leitung.getStgs()
this.$api
.call(ApiStudstatusLeitung.getStgs())
.then(result => this.stgs = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
@@ -98,8 +101,8 @@ export default {
}
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.approve(oks)
this
._singleOrMultiApiCall(oks, ApiStudstatusLeitung.approve)
.then(this.showResults);
}
},
@@ -130,37 +133,38 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.reject(gruende)
this
._singleOrMultiApiCall(gruende, ApiStudstatusLeitung.reject)
.then(this.showResults);
}
},
actionReopen(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.reopen(gruende)
this
._singleOrMultiApiCall(antraege, ApiStudstatusLeitung.reopen)
.then(this.showResults);
},
actionPause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.pause(antraege)
this
._singleOrMultiApiCall(antraege, ApiStudstatusLeitung.pause)
.then(this.showResults);
},
actionUnpause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.unpause(antraege)
this
._singleOrMultiApiCall(antraege, ApiStudstatusLeitung.unpause)
.then(this.showResults);
},
actionObject(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.object(antraege)
this
._singleOrMultiApiCall(antraege, ApiStudstatusLeitung.object)
.then(this.showResults);
},
actionoObjectionDeny(evt, gruende) {
@@ -189,24 +193,35 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.denyObjection(gruende)
this
._singleOrMultiApiCall(gruende, ApiStudstatusLeitung.denyObjection)
.then(this.showResults);
}
},
actionObjectionApprove(evt, gruende) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.approveObjection(antraege)
this
._singleOrMultiApiCall(antraege, ApiStudstatusLeitung.approveObjection)
.then(this.showResults);
},
actionCancel(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.abmeldung.cancel(antraege)
.then(this.showResults);
if (Array.isArray(antraege)) {
Promise
.allSettled(
antraege.map(antrag => this.$api.call(
ApiStudstatusAbmeldung.cancel(antrag.studierendenantrag_id),
{ errorHeader: '#' + antrag.studierendenantrag_id }
))
)
.then(this.showResults);
} else {
this.$api
.call(ApiStudstatusAbmeldung.cancel(antraege))
.then(this.showResults);
}
},
showResults(results) {
let fulfilled = results.filter(res => res.status == 'fulfilled');
@@ -214,6 +229,16 @@ export default {
//fulfilled.forEach(a => this.$fhcAlert.alertDefault('success', '#' + a.value.data, 'Approved, ...'));
if (fulfilled.length)
this.reload();
},
_singleOrMultiApiCall(antraege, endpoint) {
if (Array.isArray(antraege)) {
return Promise
.allSettled(antraege.map(antrag => this.$api.call(
endpoint(antrag),
{ errorHeader: '#' + antrag.studierendenantrag_id }
)));
}
return this.$api.call(endpoint(antraege));
}
},
created() {
@@ -1,6 +1,8 @@
import BsAlert from '../../../Bootstrap/Alert.js';
import BsModal from '../../../Bootstrap/Modal.js';
import ApiStudstatusLeitung from '../../../../api/factory/studstatus/leitung.js';
export default {
components: {
BsModal,
@@ -47,8 +49,11 @@ export default {
}
this.abortController = new AbortController();
this.$fhcApi.factory
.studstatus.leitung.getPrestudents(evt.query, this.abortController.signal)
this.$api
.call(ApiStudstatusLeitung.getPrestudents(evt.query), {
signal: this.abortController.signal,
timeout: 30000
})
.then(result => {
this.data = result.data;
this.abortController = null;
@@ -1,6 +1,8 @@
import BsAlert from '../../Bootstrap/Alert.js';
import {CoreFetchCmpt} from "../../Fetch.js";
import ApiStudstatusWiederholung from '../../../api/factory/studstatus/wiederholung.js';
export default {
components: {
CoreFetchCmpt
@@ -45,8 +47,8 @@ export default {
loadlvs() {
if (!this.antragId)
return new Promise(() => {});
return this.$fhcApi.factory
.studstatus.wiederholung.getLvs(this.antragId);
return this.$api
.call(ApiStudstatusWiederholung.getLvs(this.antragId));
},
submit(result) {
this.result = [result, this.check];
@@ -3,6 +3,8 @@ import {CoreFetchCmpt} from '../../Fetch.js';
import LvPopup from './LvPopup.js';
import { dateFilter } from '../../../tabulator/filters/Dates.js';
import ApiStudstatusLeitung from '../../../api/factory/studstatus/leitung.js';
export default {
components: {
BsModal,
@@ -50,12 +52,12 @@ export default {
getHistory() {
if (this.lastHistoryClickedId === null)
return null;
return this.$fhcApi.factory
.studstatus.leitung.getHistory(this.lastHistoryClickedId)
return this.$api
.call(ApiStudstatusLeitung.getHistory(this.lastHistoryClickedId))
.then(res => {
this.historyData = res.data.sort((a, b) => a.insertamum > b.insertamum);
})
.catch(this.$fhcApi.handleSystemError);
.catch(this.$fhcAlert.handleSystemError);
},
getHistoryStatus(data, index) {
if (data.insertvon == 'Studienabbruch')
@@ -112,7 +114,8 @@ export default {
height: '65vh',
layout: "fitDataFill",
ajaxURL: '/' + (this.filter || ''),
ajaxRequestFunc: this.$fhcApi.factory.studstatus.leitung.getAntraege,
ajaxRequestFunc: url => this.$api.call(ApiStudstatusLeitung.getAntraege(url)),
ajaxResponse: (url, params, response) => response.data,
persistence: { // NOTE(chris): do not store column titles
sort: true, //persist column sorting
filter: true, //persist filters
@@ -1,5 +1,7 @@
import StudierendenantragStatus from './Status.js';
import ApiStudstatusWiederholung from '../../api/factory/studstatus/wiederholung.js';
export default {
components: {
StudierendenantragStatus
@@ -56,8 +58,11 @@ export default {
anmerkung: lv.antrag_anmerkung || "",
studiensemester_kurzbz: this.lvs2sem
}));
this.$fhcApi.factory
.studstatus.wiederholung.saveLvs(forbiddenLvs, mandatoryLvs)
this.$api
.call(ApiStudstatusWiederholung.saveLvs(
forbiddenLvs,
mandatoryLvs
))
.then(response => {
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
this.statusCode = response.data[0].studierendenantrag_statustyp_kurzbz;
@@ -78,8 +83,9 @@ export default {
mounted() {
this.$p
.loadCategory(['ui', 'lehre', 'studierendenantrag', 'global'])
.then(() => this.antragId)
.then(this.$fhcApi.factory.studstatus.wiederholung.getLvs)
.then(() => this.$api.call(
ApiStudstatusWiederholung.getLvs(this.antragId)
))
.then(result => {
let res = {};
for (var k in result.data) {
+45 -21
View File
@@ -22,6 +22,9 @@ import StvList from "./Studentenverwaltung/List.js";
import StvDetails from "./Studentenverwaltung/Details.js";
import StvStudiensemester from "./Studentenverwaltung/Studiensemester.js";
import ApiSearchbar from "../../api/factory/searchbar.js";
import ApiStv from "../../api/factory/stv.js";
export default {
components: {
@@ -109,7 +112,9 @@ export default {
methods: {
onSelectVerband({link, studiengang_kz}) {
this.studiengangKz = studiengang_kz;
this.$refs.stvList.updateUrl(this.$fhcApi.factory.stv.students.verband(link));
this.$refs.stvList.updateUrl(
ApiStv.students.verband(link)
);
},
studiensemesterChanged(v) {
this.studiensemesterKurzbz = v;
@@ -118,54 +123,64 @@ export default {
},
reloadList() {
this.$refs.stvList.reload();
},
searchfunction(params) {
return this.$api.call(ApiSearchbar.search(params));
}
},
created() {
this.$fhcApi
.get('api/frontend/v1/stv/address/getNations')
this.$api
.call(ApiStv.kontakt.address.getNations())
.then(result => {
this.lists.nations = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getSprachen')
this.$api
.call(ApiStv.lists.getSprachen())
.then(result => {
this.lists.sprachen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getGeschlechter')
this.$api
.call(ApiStv.lists.getGeschlechter())
.then(result => {
this.lists.geschlechter = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getAusbildungen')
this.$api
.call(ApiStv.lists.getAusbildungen())
.then(result => {
this.lists.ausbildungen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getStgs')
this.$api
.call(ApiStv.lists.getStgs())
.then(result => {
this.lists.stgs = result.data;
this.lists.active_stgs = this.lists.stgs.filter(stg => stg.aktiv);
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getOrgforms')
this.$api
.call(ApiStv.lists.getOrgforms())
.then(result => {
this.lists.orgforms = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.factory.stv.konto.getBuchungstypen()
this.$api
.call(ApiStv.konto.getBuchungstypen())
.then(result => {
this.lists.buchungstypen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.get('api/frontend/v1/stv/lists/getStudiensemester')
this.$api
.call(ApiStv.lists.getStudiensemester())
.then(result => {
this.lists.studiensemester = result.data;
this.lists.studiensemester_desc = result.data.toReversed();
@@ -174,11 +189,20 @@ export default {
},
mounted() {
if (this.$route.params.id) {
this.$refs.stvList.updateUrl(this.$fhcApi.factory.stv.students.uid(this.$route.params.id), true);
this.$refs.stvList.updateUrl(
ApiStv.students.uid(this.$route.params.id),
true
);
} else if (this.$route.params.prestudent_id) {
this.$refs.stvList.updateUrl(this.$fhcApi.factory.stv.students.prestudent(this.$route.params.prestudent_id), true);
this.$refs.stvList.updateUrl(
ApiStv.students.prestudent(this.$route.params.prestudent_id),
true
);
} else if (this.$route.params.person_id) {
this.$refs.stvList.updateUrl(this.$fhcApi.factory.stv.students.person(this.$route.params.person_id), true);
this.$refs.stvList.updateUrl(
ApiStv.students.person(this.$route.params.person_id),
true
);
}
},
@@ -187,7 +211,7 @@ export default {
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-4 col-lg-3 col-xl-2 me-0 px-3" :href="stvRoot">FHC 4.0</a>
<button class="navbar-toggler d-md-none m-1 collapsed" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" :aria-label="$p.t('ui/toggle_nav')"><span class="navbar-toggler-icon"></span></button>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="$fhcApi.factory.search.search" class="searchbar w-100"></core-searchbar>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction" class="searchbar w-100"></core-searchbar>
</header>
<div class="container-fluid overflow-hidden">
<div class="row h-100">
@@ -1,5 +1,7 @@
import FhcTabs from "../../Tabs.js";
import ApiStvApp from '../../../api/factory/stv/app.js';
// TODO(chris): alt & title
// TODO(chris): phrasen
@@ -39,14 +41,14 @@ export default {
}
},
created() {
this.$fhcApi
.factory.stv.configStudent()
this.$api
.call(ApiStvApp.configStudent())
.then(result => {
this.configStudent = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.factory.stv.configStudents()
this.$api
.call(ApiStvApp.configStudents())
.then(result => {
this.configStudents = result.data;
})
@@ -5,6 +5,9 @@ import FormInput from '../../../../Form/Input.js';
import PvAutoComplete from "../../../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js";
import AbschlusspruefungDropdown from "./AbschlusspruefungDropdown.js";
import ApiStudiengang from '../../../../../api/factory/studiengang.js';
import ApiStvAbschlusspruefung from '../../../../../api/factory/stv/abschlusspruefung.js';
export default {
components: {
CoreFilterCmpt,
@@ -57,12 +60,7 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.abschlusspruefung.getAbschlusspruefung,
ajaxParams: () => {
return {
id: this.student.uid
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvAbschlusspruefung.getAbschlusspruefung(this.student.uid)),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "vorsitz", field: "vorsitz_nachname"},
@@ -272,9 +270,10 @@ export default {
methods: {
getStudiengangByKz(){
this.stgInfo = { typ: '', oe_kurzbz: '' };
this.$fhcApi.factory.studiengang.getStudiengangByKz(this.stg_kz)
.then(result => this.stgInfo = result.data)
.catch(this.$fhcAlert.handleSystemError);
this.api
.call(ApiStudiengang.getStudiengangByKz(this.stg_kz))
.then(result => this.stgInfo = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
actionNewAbschlusspruefung() {
this.resetForm();
@@ -303,7 +302,8 @@ export default {
formData: this.formData
};
return this.$fhcApi.factory.stv.abschlusspruefung.addNewAbschlusspruefung(this.$refs.formFinalExam, dataToSend)
return this.$refs.formFinalExam
.call(ApiStvAbschlusspruefung.addNewAbschlusspruefung(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('finalexamModal');
@@ -321,7 +321,8 @@ export default {
this.$refs.table.reloadTable();
},
loadAbschlusspruefung(abschlusspruefung_id) {
return this.$fhcApi.factory.stv.abschlusspruefung.loadAbschlusspruefung(abschlusspruefung_id)
return this.$api
.call(ApiStvAbschlusspruefung.loadAbschlusspruefung(abschlusspruefung_id))
.then(result => {
this.formData = result.data;
//TODO(Manu) check if cisRoot is okay
@@ -335,7 +336,8 @@ export default {
id: abschlusspruefung_id,
formData: this.formData
};
return this.$fhcApi.factory.stv.abschlusspruefung.updateAbschlusspruefung(this.$refs.formFinalExam, dataToSend)
return this.$refs.formFinalExam
.call(ApiStvAbschlusspruefung.updateAbschlusspruefung(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('finalexamModal');
@@ -347,7 +349,8 @@ export default {
});
},
deleteAbschlusspruefung(abschlusspruefung_id) {
return this.$fhcApi.factory.stv.abschlusspruefung.deleteAbschlusspruefung(abschlusspruefung_id)
return this.$api
.call(ApiStvAbschlusspruefung.deleteAbschlusspruefung(abschlusspruefung_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
@@ -381,7 +384,8 @@ export default {
}
this.abortController.mitarbeiter = new AbortController();
return this.$fhcApi.factory.stv.abschlusspruefung.getMitarbeiter(event.query)
return this.$api
.call(ApiStvAbschlusspruefung.getMitarbeiter(event.query))
.then(result => {
this.filteredMitarbeiter = result.data.retval;
});
@@ -392,7 +396,8 @@ export default {
}
this.abortController.pruefer = new AbortController();
return this.$fhcApi.factory.stv.abschlusspruefung.getPruefer(event.query)
return this.$api
.call(ApiStvAbschlusspruefung.getPruefer(event.query))
.then(result => {
this.filteredPruefer = result.data.retval;
});
@@ -422,33 +427,43 @@ export default {
},
},
created() {
this.$fhcApi.factory.stv.abschlusspruefung.getTypenAbschlusspruefung()
this.$api
.call(ApiStvAbschlusspruefung.getTypenAbschlusspruefung())
.then(result => {
this.arrTypen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.abschlusspruefung.getTypenAntritte()
this.$api
.call(ApiStvAbschlusspruefung.getTypenAntritte())
.then(result => {
this.arrAntritte = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.abschlusspruefung.getBeurteilungen()
this.$api
.call(ApiStvAbschlusspruefung.getBeurteilungen())
.then(result => {
this.arrBeurteilungen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.abschlusspruefung.getNoten()
this.$api
.call(ApiStvAbschlusspruefung.getNoten())
.then(result => {
this.arrNoten = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.abschlusspruefung.getAkadGrade(this.student.studiengang_kz)
this.$api
.call(ApiStvAbschlusspruefung.getAkadGrade(this.student.studiengang_kz))
.then(result => {
this.arrAkadGrad = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
if (!this.student.length) {
this.$fhcApi.factory.studiengang.getStudiengangByKz(this.student.studiengang_kz)
this.$api
.call(ApiStudiengang.getStudiengangByKz(this.student.studiengang_kz))
.then(result => {
this.stgInfo = result.data;
this.setDefaultFormData();
@@ -1,3 +1,5 @@
import ApiStvAbschlusspruefung from '../../../../../api/factory/stv/abschlusspruefung.js';
export default {
inject: {
$reloadList: {
@@ -76,7 +78,8 @@ export default {
return labels[documentKey] || documentKey;
},
checkUidsIfExistingFinalExams(uids) {
return this.$fhcApi.factory.stv.abschlusspruefung.checkForExistingExams(uids)
return this.$api
.call(ApiStvAbschlusspruefung.checkForExistingExams(uids))
.catch(this.$fhcAlert.handleSystemError);
},
printDocument(document, lang, format) {
@@ -1,5 +1,7 @@
import CoreBetriebsmittel from "../../../Betriebsmittel/Betriebsmittel.js";
import ApiBetriebsmittelPerson from '../../../../api/factory/betriebsmittel/person.js';
export default {
components: {
CoreBetriebsmittel
@@ -7,10 +9,15 @@ export default {
props: {
modelValue: Object
},
data() {
return {
endpoint: ApiBetriebsmittelPerson
};
},
template: `
<div class="stv-details-betriebsmittel h-100 pb-3">
<core-betriebsmittel
:endpoint="$fhcApi.factory.betriebsmittel.person"
:endpoint="endpoint"
ref="formc"
type-id="person_id"
:id="modelValue.person_id"
@@ -4,6 +4,8 @@ import FormUploadImage from '../../../Form/Upload/Image.js';
import CoreUdf from '../../../Udf/Udf.js';
import ApiStvDetails from '../../../../api/factory/stv/details.js';
export default {
components: {
@@ -93,7 +95,8 @@ export default {
},
methods: {
updateStudent(n) {
return this.$fhcApi.factory.stv.details.get(n.prestudent_id)
return this.$api
.call(ApiStvDetails.get(n.prestudent_id))
.then(result => {
this.data = result.data;
if (!this.data.familienstand)
@@ -107,7 +110,8 @@ export default {
return;
this.$refs.form.clearValidation();
return this.$fhcApi.factory.stv.details.save(this.$refs.form, this.modelValue.prestudent_id, this.changed)
return this.$refs.form
.call(ApiStvDetails.save(this.modelValue.prestudent_id, this.changed))
.then(result => {
this.original = {...this.data};
this.changed = {};
@@ -5,6 +5,9 @@ import BsModal from "../../../../Bootstrap/Modal.js";
import FormForm from '../../../../Form/Form.js';
import FormInput from '../../../../Form/Input.js';
import ApiStvAddress from '../../../../../api/factory/stv/kontakt/address.js';
import ApiStvCompany from '../../../../../api/factory/stv/kontakt/company.js';
export default{
components: {
CoreFilterCmpt,
@@ -21,12 +24,7 @@ export default{
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.kontakt.getAdressen,
ajaxParams: () => {
return {
id: this.uid
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvAddress.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
//autoColumns: true,
columns:[
@@ -230,7 +228,7 @@ export default{
},
watch: {
uid() {
this.$refs.table.tabulator.setData('api/frontend/v1/stv/Kontakt/getAdressen/' + this.uid);
this.reload();
},
},
methods:{
@@ -262,22 +260,23 @@ export default{
},
addNewAddress(addressData) {
this.addressData.plz = this.addressData.address.plz;
return this.$fhcApi.factory.stv.kontakt.addNewAddress(this.$refs.addressData, this.uid, this.addressData)
return this.$refs.addressData
.call(ApiStvAddress.add(this.uid, this.addressData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('adressModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
this.reload();
});
})
.catch(this.$fhcAlert.handleSystemError)
.finally(this.reload);
},
reload() {
this.$refs.table.reloadTable();
},
loadAdress(adresse_id) {
this.statusNew = false;
return this.$fhcApi.factory.stv.kontakt.loadAddress(adresse_id)
return this.$api
.call(ApiStvAddress.load(adresse_id))
.then(result => {
this.addressData = result.data;
this.addressData.address = {};
@@ -288,23 +287,24 @@ export default{
},
updateAddress(adresse_id) {
this.addressData.plz = this.addressData.address.plz;
return this.$fhcApi.factory.stv.kontakt.updateAddress(this.$refs.addressData, adresse_id,
this.addressData
).then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
return this.$refs.addressData
.call(ApiStvAddress.update(adresse_id, this.addressData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('adressModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
this.reload();
});
})
.catch(this.$fhcAlert.handleSystemError)
.finally(this.reload);
},
deleteAddress(adresse_id) {
return this.$fhcApi.factory.stv.kontakt.deleteAddress(adresse_id)
return this.$api
.call(ApiStvAddress.delete(adresse_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
});
@@ -317,7 +317,8 @@ export default{
this.abortController.places = new AbortController();
return this.$fhcApi.factory.stv.kontakt.getPlaces(this.addressData.address.plz)
return this.$api
.call(ApiStvAddress.getPlaces(this.addressData.address.plz))
.then(result => {
this.places = result.data;
});
@@ -329,7 +330,8 @@ export default{
this.abortController.firmen = new AbortController();
return this.$fhcApi.factory.stv.kontakt.getFirmen(event.query)
return this.$api
.call(ApiStvCompany.get(event.query))
.then(result => {
this.filteredFirmen = result.data.retval;
});
@@ -356,13 +358,15 @@ export default{
},
},
created() {
this.$fhcApi.factory.stv.kontakt.getNations()
this.$api
.call(ApiStvAddress.getNations())
.then(result => {
this.nations = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.kontakt.getAdressentypen()
this.$api
.call(ApiStvAddress.getTypes())
.then(result => {
this.adressentypen = result.data;
})
@@ -3,6 +3,8 @@ import BsModal from "../../../../Bootstrap/Modal.js";
import FormForm from '../../../../Form/Form.js';
import FormInput from '../../../../Form/Input.js';
import ApiStvBankaccount from '../../../../../api/factory/stv/kontakt/bankaccount.js';
export default{
components: {
CoreFilterCmpt,
@@ -17,12 +19,7 @@ export default{
return{
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.kontakt.getBankverbindung,
ajaxParams: () => {
return {
id: this.uid
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvBankaccount.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
columns:[
{title:"Name", field:"name"},
@@ -143,8 +140,8 @@ export default{
}
},
watch: {
uid(){
this.$refs.table.tabulator.setData('api/frontend/v1/stv/Kontakt/getBankverbindung/' + this.uid);
uid() {
this.reload();
}
},
methods:{
@@ -169,50 +166,58 @@ export default{
.catch(this.$fhcAlert.handleSystemError);
},
addNewBankverbindung(bankverbindungData) {
return this.$fhcApi.factory.stv.kontakt.addNewBankverbindung(this.$refs.bankverbindungData, this.uid, this.bankverbindungData)
.then(response => {
return this.$refs.bankverbindungData
.call(ApiStvBankaccount.add(this.uid, this.bankverbindungData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('bankverbindungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
});
window.scrollTo(0, 0);
this.reload();
});
},
loadBankverbindung(bankverbindung_id){
this.statusNew = false;
return this.$fhcApi.factory.stv.kontakt.loadBankverbindung(bankverbindung_id)
.then(
result => {
this.$api
.call(ApiStvBankaccount.load(bankverbindung_id))
.then(result => {
this.bankverbindungData = result.data;
return result;
})
.catch(this.$fhcAlert.handleSystemError);
},
updateBankverbindung(bankverbindung_id){
return this.$fhcApi.factory.stv.kontakt.updateBankverbindung(this.$refs.bankverbindungData, bankverbindung_id,
this.bankverbindungData)
updateBankverbindung(bankverbindung_id) {
return this.$refs.bankverbindungData
.call(ApiStvBankaccount.update(
bankverbindung_id,
this.bankverbindungData
))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('bankverbindungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
});
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
});
},
deleteBankverbindung(bankverbindung_id){
return this.$fhcApi.factory.stv.kontakt.deleteBankverbindung(bankverbindung_id)
deleteBankverbindung(bankverbindung_id) {
return this.$api
.call(ApiStvBankaccount.delete(bankverbindung_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.resetModal();
this.reload();
});
})
.catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.resetModal();
this.reload();
});
},
hideModal(modalRef){
this.$refs[modalRef].hide();
@@ -4,6 +4,9 @@ import PvAutoComplete from "../../../../../../../index.ci.php/public/js/componen
import FormForm from '../../../../Form/Form.js';
import FormInput from '../../../../Form/Input.js';
import ApiStvContact from '../../../../../api/factory/stv/kontakt/contact.js';
import ApiStvCompany from '../../../../../api/factory/stv/kontakt/company.js';
export default{
components: {
CoreFilterCmpt,
@@ -19,12 +22,7 @@ export default{
return{
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.kontakt.getKontakte,
ajaxParams: () => {
return {
id: this.uid
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvContact.get(this.uid)),
ajaxResponse: (url, params, response) => response.data,
columns:[
{title:"Typ", field:"kontakttyp"},
@@ -167,7 +165,7 @@ export default{
},
watch: {
uid() {
this.$refs.table.tabulator.setData('api/frontend/v1/stv/Kontakt/getKontakte/' + this.uid);
this.reload();
},
contactData: {
handler(newVal) {
@@ -200,31 +198,34 @@ export default{
.catch(this.$fhcAlert.handleSystemError);
},
addNewContact(formData) {
return this.$fhcApi.factory.stv.kontakt.addNewContact(this.$refs.contactData, this.uid, this.contactData)
return this.$refs.contactData
.call(ApiStvContact.add(this.uid, this.contactData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("contactModal");
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("contactModal");
this.resetModal();
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
});
window.scrollTo(0, 0);
this.reload();
});
},
loadContact(kontakt_id){
loadContact(kontakt_id) {
this.statusNew = false;
if(this.contactData.firma_id)
this.loadStandorte(this.contactData.firma_id);
return this.$fhcApi.factory.stv.kontakt.loadContact(kontakt_id)
.then(
result => {
this.contactData = result.data;
return result;
})
return this.$api
.call(ApiStvContact.load(kontakt_id))
.then(result => {
this.contactData = result.data;
return result;
})
.catch(this.$fhcAlert.handleSystemError);
},
deleteContact(kontakt_id){
return this.$fhcApi.factory.stv.kontakt.deleteContact(kontakt_id)
deleteContact(kontakt_id) {
return this.$api
.call(ApiStvContact.delete(kontakt_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
@@ -233,27 +234,28 @@ export default{
window.scrollTo(0, 0);
this.resetModal();
this.reload();
});
});
},
updateContact(kontakt_id){
return this.$fhcApi.factory.stv.kontakt.updateContact(this.$refs.contactData, kontakt_id,
this.contactData)
updateContact(kontakt_id) {
return this.$refs.contactData
.call(ApiStvContact.update(kontakt_id, this.contactData))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('contactModal');
this.resetModal();
this.reload();
}).catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.reload();
});
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('contactModal');
this.resetModal();
this.reload();
})
.catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.reload();
});
},
hideModal(modalRef){
hideModal(modalRef) {
this.$refs[modalRef].hide();
},
reload(){
reload() {
this.$refs.table.reloadTable();
},
searchFirma(event) {
@@ -263,7 +265,8 @@ export default{
this.abortController.firmen = new AbortController();
return this.$fhcApi.factory.stv.kontakt.getFirmen(event.query)
return this.$api
.call(ApiStvCompany.get(event.query))
.then(result => {
this.filteredFirmen = result.data.retval;
});
@@ -275,12 +278,13 @@ export default{
this.abortController.standorte = new AbortController();
return this.$fhcApi.factory.stv.kontakt.getStandorteByFirma(firmen_id)
return this.$api
.call(ApiStvContact.getStandorteByFirma(firmen_id))
.then(result => {
this.filteredOrte = result.data;
});
},
resetModal(){
resetModal() {
this.contactData = {};
this.contactData.zustellung = true;
this.contactData.kontakttyp = 'email';
@@ -294,8 +298,9 @@ export default{
this.statusNew = true;
},
},
created(){
this.$fhcApi.factory.stv.kontakt.getKontakttypen()
created() {
this.$api
.call(ApiStvContact.getTypes())
.then(result => {
this.kontakttypen = result.data;
})
@@ -3,6 +3,9 @@ import FormInput from "../../../Form/Input.js";
import KontoNew from "./Konto/New.js";
import KontoEdit from "./Konto/Edit.js";
import ApiStvFilter from '../../../../api/factory/stv/filter.js';
import ApiStvKonto from '../../../../api/factory/stv/konto.js';
const LOCAL_STORAGE_ID_FILTER = 'stv_details_konto_2024-01-11_filter';
export default {
@@ -78,7 +81,7 @@ export default {
this.$fhcAlert
.confirmDelete()
.then(result => result ? cell.getData().buchungsnr : Promise.reject({handled:true}))
.then(this.$fhcApi.factory.stv.konto.delete)
.then(buchungsnr => this.$api.call(ApiStvKonto.delete(buchungsnr)))
.then(() => {
// TODO(chris): deleting a child also removes the siblings!
//cell.getRow().delete();
@@ -94,14 +97,21 @@ export default {
return Object.values(columns);
},
tabulatorOptions() {
return this.$fhcApi.factory.stv.konto.tabulatorConfig({
return {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(ApiStvKonto.get(
this.modelValue.person_id || this.modelValue.map(e => e.person_id),
this.filter,
this.studiengang_kz_intern ? this.stg_kz : ''
)),
ajaxResponse: (url, params, response) => response.data,
dataTree: true,
columns: this.tabulatorColumns,
selectable: true,
selectableRangeMode: 'click',
index: 'buchungsnr',
persistenceID: 'stv-details-konto'
}, this);
};
}
},
watch: {
@@ -124,11 +134,11 @@ export default {
this.$refs.new.open();
},
actionCounter(selected) {
this.$fhcApi
.factory.stv.konto.counter({
this.$api
.call(ApiStvKonto.counter({
buchungsnr: selected.map(e => e.buchungsnr),
buchungsdatum: this.counterdate
})
}))
.then(result => result.data)
.then(this.updateData)
.then(() => this.$p.t('ui/gespeichert'))
@@ -172,8 +182,8 @@ export default {
if (type == 'open')
window.localStorage.setItem(LOCAL_STORAGE_ID_FILTER, this.filter ? 1 : 0);
else if (type == 'current_stg')
this.$fhcApi.factory
.stv.filter.setStg(this.studiengang_kz)
this.$api
.call(ApiStvFilter.setStg(this.studiengang_kz))
.catch(this.$fhcAlert.handleSystemError);
this.$nextTick(this.$refs.table.reloadTable);
@@ -181,8 +191,8 @@ export default {
},
created() {
this.filter = window.localStorage.getItem(LOCAL_STORAGE_ID_FILTER) == 1;
this.$fhcApi.factory
.stv.filter.getStg()
this.$api
.call(ApiStvFilter.getStg())
.then(result => this.studiengang_kz = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
@@ -3,6 +3,7 @@ import CoreForm from "../../../../Form/Form.js";
import FormValidation from "../../../../Form/Validation.js";
import FormInput from "../../../../Form/Input.js";
import ApiKonto from '../../../../../api/factory/stv/konto.js';
export default {
components: {
@@ -33,8 +34,8 @@ export default {
this.$refs.form.clearValidation();
this.loading = true;
this.$fhcApi
.factory.stv.konto.edit(this.$refs.form, this.data)
this.$refs.form
.call(ApiKonto.edit(this.data))
.then(result => {
this.$emit('saved', result.data);
this.loading = false;
@@ -4,6 +4,7 @@ import CoreForm from "../../../../Form/Form.js";
import FormValidation from "../../../../Form/Validation.js";
import FormInput from "../../../../Form/Input.js";
import ApiKonto from '../../../../../api/factory/stv/konto.js';
export default {
components: {
@@ -58,8 +59,8 @@ export default {
studiengang_kz: this.stgKz
}, ...this.data};
this.$fhcApi
.factory.stv.konto.checkDoubles(this.$refs.form, data)
this.$refs.form
.call(ApiKonto.checkDoubles(data))
.then(result => result.data
? Promise.all(
result.errors
@@ -68,7 +69,7 @@ export default {
)
: Promise.resolve())
.then(() => data)
.then((data) => this.$fhcApi.factory.stv.konto.insert(this.$refs.form, data))
.then(data => this.$refs.form.call(ApiKonto.insert(data)))
.then(result => {
this.$emit('saved', result.data);
this.loading = false;
@@ -4,6 +4,8 @@ import BsModal from "../../../../../Bootstrap/Modal.js";
import CoreForm from '../../../../../Form/Form.js';
import FormInput from '../../../../../Form/Input.js';
import ApiStvMobility from '../../../../../../api/factory/stv/mobility.js';
export default {
components: {
CoreFilterCmpt,
@@ -27,17 +29,8 @@ export default {
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
if (this.bisio_id) {
//fake params for getting api call with tabulator to run
const config = {
method: "get",
};
const params = {
id: this.bisio_id,
};
return this.$fhcApi.factory.stv.mobility.getPurposes('dummy', config, params)
}
else
{
return this.$api.call(ApiStvMobility.getPurposes(this.bisio_id));
} else {
// use local data
return new Promise((resolve) => {
const localData = this.localData;
@@ -45,11 +38,6 @@ export default {
});
}
},
ajaxParams: () => {
return {
id: this.bisio_id || "local"
};
},
ajaxResponse: (url, params, response) => response.data || this.localData,
@@ -4,6 +4,8 @@ import BsModal from "../../../../../Bootstrap/Modal.js";
import CoreForm from '../../../../../Form/Form.js';
import FormInput from '../../../../../Form/Input.js';
import ApiStvMobility from '../../../../../../api/factory/stv/mobility.js';
export default {
components: {
CoreFilterCmpt,
@@ -27,17 +29,8 @@ export default {
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
if (this.bisio_id) {
//fake params for getting api call with tabulator to run
const config = {
method: "get",
};
const params = {
id: this.bisio_id,
};
return this.$fhcApi.factory.stv.mobility.getSupports('dummy', config, params)
}
else
{
return this.$api.call(ApiStvMobility.getSupports(this.bisio_id));
} else {
// use local data
return new Promise((resolve) => {
const localData = this.localData;
@@ -45,11 +38,6 @@ export default {
});
}
},
ajaxParams: () => {
return {
id: this.bisio_id || "local"
};
},
ajaxResponse: (url, params, response) => response.data || this.localData,
columns: [
@@ -5,6 +5,7 @@ import FormInput from '../../../../Form/Input.js';
import MobilityPurpose from './List/Purpose.js';
import MobilitySupport from './List/Support.js';
import ApiStvMobility from '../../../../../api/factory/stv/mobility.js';
export default {
components: {
@@ -34,12 +35,9 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.mobility.getMobilitaeten,
ajaxParams: () => {
return {
id: this.student.uid
};
},
ajaxRequestFunc: () => this.$api.call(
ApiStvMobility.getMobilitaeten(this.student.uid)
),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Kurzbz", field: "kurzbz"},
@@ -213,7 +211,8 @@ export default {
uid: this.student.uid,
formData: this.formData
};
return this.$fhcApi.factory.stv.mobility.addNewMobility(this.$refs.formMobility, dataToSend)
return this.$refs.formMobility
.call(ApiStvMobility.addNewMobility(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("mobilityModal");
@@ -247,7 +246,8 @@ export default {
lv_id: lv_id,
studiensemester_kurzbz: studiensemester_kurzbz
};
return this.$fhcApi.factory.stv.mobility.getAllLehreinheiten(data)
return this.$api
.call(ApiStvMobility.getAllLehreinheiten(data))
.then(response => {
this.listLes = response.data;
})
@@ -260,7 +260,8 @@ export default {
this.$refs.table.reloadTable();
},
loadMobility(bisio_id) {
return this.$fhcApi.factory.stv.mobility.loadMobility(bisio_id)
return this.$api
.call(ApiStvMobility.loadMobility(bisio_id))
.then(result => {
this.formData = result.data;
if(this.formData.lehrveranstaltung_id === null) {
@@ -280,7 +281,8 @@ export default {
formData: this.formData,
uid: this.student.uid,
};
this.$fhcApi.factory.stv.mobility.updateMobility(this.$refs.formMobility, dataToSend)
this.$refs.formMobility
.call(ApiStvMobility.updateMobility(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("mobilityModal");
@@ -292,7 +294,8 @@ export default {
});
},
deleteMobility(bisio_id) {
return this.$fhcApi.factory.stv.mobility.deleteMobility(bisio_id)
return this.api
.call(ApiStvMobility.deleteMobility(bisio_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
@@ -322,7 +325,8 @@ export default {
bisio_id : bisio_id,
zweck_code: zweck_code
};
return this.$fhcApi.factory.stv.mobility.addMobilityPurpose(params)
return this.$api
.call(ApiStvMobility.addMobilityPurpose(params))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
@@ -335,7 +339,8 @@ export default {
bisio_id : bisio_id,
zweck_code: zweck_code
};
return this.$fhcApi.factory.stv.mobility.deleteMobilityPurpose(params)
return this.$api
.call(ApiStvMobility.deleteMobilityPurpose(params))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
@@ -352,7 +357,8 @@ export default {
bisio_id : bisio_id,
aufenthaltfoerderung_code: aufenthaltfoerderung_code
};
return this.$fhcApi.factory.stv.mobility.addMobilitySupport(params)
return this.$api
.call(ApiStvMobility.addMobilitySupport(params))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
@@ -365,7 +371,8 @@ export default {
bisio_id : bisio_id,
aufenthaltfoerderung_code: aufenthaltfoerderung_code
};
return this.$fhcApi.factory.stv.mobility.deleteMobilitySupport(params)
return this.$api
.call(ApiStvMobility.deleteMobilitySupport(params))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
@@ -378,27 +385,36 @@ export default {
},
},
created() {
this.$fhcApi.factory.stv.mobility.getProgramsMobility()
this.$api
.call(ApiStvMobility.getProgramsMobility())
.then(result => {
this.programsMobility = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.mobility.getLVList(this.student.studiengang_kz)
this.$api
.call(ApiStvMobility.getLVList(this.student.studiengang_kz))
.then(result => {
this.listLvs = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.mobility.getListPurposes()
this.$api
.call(ApiStvMobility.getListPurposes())
.then(result => {
this.listPurposes = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.mobility.getListSupports()
this.$api
.call(ApiStvMobility.getListSupports())
.then(result => {
this.listSupports = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.mobility.getLvsandLesByStudent(this.student.uid)
this.$api
.call(ApiStvMobility.getLvsandLesByStudent(this.student.uid))
.then(result => {
this.listLvsAndLes = result.data;
})
@@ -1,5 +1,7 @@
import {CoreFilterCmpt} from "../../../../filter/Filter.js";
import ApiStvGrades from '../../../../../api/factory/stv/grades.js';
export default {
components: {
CoreFilterCmpt
@@ -20,15 +22,10 @@ export default {
tabulatorOptions() {
return {
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
return this.$fhcApi.factory.stv.grades.getRepeaterGrades(params.prestudent_id, params.stdsem);
},
ajaxParams: () => {
return {
prestudent_id: this.student.prestudent_id,
stdsem: this.allSemester
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvGrades.getRepeaterGrades(
this.student.prestudent_id,
this.allSemester
)),
ajaxResponse: (url, params, response) => {
return response.data || [];
},
@@ -63,8 +60,11 @@ export default {
methods: {
copyGrades(selected) {
const promises = selected.map(
grade => this.$fhcApi.factory
.stv.grades.copyRepeaterGradeToCertificate(grade)
grade => this.$api
.call(
ApiStvGrades.copyRepeaterGradeToCertificate(grade),
{ errorHeader: grade.lv_bezeichnung }
)
.then(() => {
this.$refs.table.tabulator.deselectRow(this.$refs.table.tabulator.getRows().find(el => el.getData() == grade).getElement());
})
@@ -1,5 +1,7 @@
import {CoreFilterCmpt} from "../../../../filter/Filter.js";
import ApiStvGrades from '../../../../../api/factory/stv/grades.js';
export default {
components: {
CoreFilterCmpt
@@ -20,15 +22,10 @@ export default {
tabulatorOptions() {
return {
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
return this.$fhcApi.factory.stv.grades.getTeacherProposal(params.prestudent_id, params.stdsem);
},
ajaxParams: () => {
return {
prestudent_id: this.student.prestudent_id,
stdsem: this.allSemester
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvGrades.getTeacherProposal(
this.student.prestudent_id,
this.allSemester
)),
ajaxResponse: (url, params, response) => {
return response.data || [];
},
@@ -63,8 +60,10 @@ export default {
methods: {
copyGrades(selected) {
const promises = selected.map(
grade => this.$fhcApi.factory
.stv.grades.copyTeacherProposalToCertificate(grade)
grade => this.$api
.call(ApiStvGrades.copyTeacherProposalToCertificate(grade), {
errorHeader: grade.lehrveranstaltung_bezeichnung
})
.then(() => {
this.$refs.table.tabulator.deselectRow(this.$refs.table.tabulator.getRows().find(el => el.getData() == grade).getElement());
})
@@ -2,6 +2,8 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js";
import ZeugnisActions from './Zeugnis/Actions.js';
import ZeugnisDocuments from './Zeugnis/Documents.js';
import ApiStvGrades from '../../../../../api/factory/stv/grades.js';
export default {
components: {
CoreFilterCmpt,
@@ -42,8 +44,8 @@ export default {
},
computed: {
tabulatorOptions() {
const listPromise = this.$fhcApi.factory
.stv.grades.list()
const listPromise = this.$api
.call(ApiStvGrades.list())
.then(res => res.data.map(({bezeichnung: label, note: value}) => ({label, value})));
let gradeField = {
@@ -76,7 +78,7 @@ export default {
note_bezeichnung
}))
// send to backend
.then(this.$fhcApi.factory.stv.grades.updateCertificate)
.then(data => this.$api.call(ApiStvGrades.updateCertificate(data)))
// get bezeichnung again
.then(() => listPromise)
.then(list => list.find(el => el.value == note))
@@ -97,8 +99,14 @@ export default {
gradeField.editorParams = {
valuesLookup: (cell, filterTerm) => {
if (filterTerm) {
return this.$fhcApi.factory
.stv.grades.getGradeFromPoints(filterTerm, cell.getData().lehrveranstaltung_id, true)
return this.$api
.call(
ApiStvGrades.getGradeFromPoints(
filterTerm,
cell.getData().lehrveranstaltung_id
),
{ errorHandling: false }
)
.then(result =>
result.data === null
? []
@@ -191,15 +199,10 @@ export default {
return {
ajaxURL: 'dummy',
ajaxRequestFunc: (url, config, params) => {
return this.$fhcApi.factory.stv.grades.getCertificate(params.prestudent_id, params.stdsem);
},
ajaxParams: () => {
return {
prestudent_id: this.student.prestudent_id,
stdsem: this.allSemester
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvGrades.getCertificate(
this.student.prestudent_id,
this.allSemester
)),
ajaxResponse: (url, params, response) => {
return response.data || [];
},
@@ -221,8 +224,11 @@ export default {
},
methods: {
setGrade(data) {
this.$fhcApi.factory
.stv.grades.updateCertificate(data)
this.$api
.call(
ApiStvGrades.updateCertificate(data),
{ errorHeader: data.lehrveranstaltung_bezeichnung }
)
.then(this.$refs.table.reloadTable)
.then(() => this.$fhcAlert.alertSuccess(this.$p.t('stv/grades_updated')))
.catch(this.$fhcAlert.handleFormValidation);
@@ -232,7 +238,10 @@ export default {
return this.$fhcAlert
.confirmDelete()
.then(result => result ? data : Promise.reject({handled:true}))
.then(this.$fhcApi.factory.stv.grades.deleteCertificate)
.then(data => this.$api.call(
ApiStvGrades.deleteCertificate(data),
{ errorHeader: data.lehrveranstaltung_bezeichnung }
))
.then(this.$refs.table.reloadTable)
.then(() => this.$fhcAlert.alertSuccess(this.$p.t('ui/successDelete')))
.catch(this.$fhcAlert.handleSystemError);
@@ -2,6 +2,7 @@ import CoreForm from '../../../../../Form/Form.js';
import FormInput from '../../../../../Form/Input.js';
import ZeugnisDocuments from './Documents.js';
import ApiStvGrades from '../../../../../../api/factory/stv/grades.js';
export default {
components: {
@@ -62,8 +63,11 @@ export default {
if (!query) {
return this.suggestions = this.grades;
}
this.$refs.points.factory
.stv.grades.getGradeFromPoints(query, this.selected.find(Boolean)?.lehrveranstaltung_id)
this.$refs.points
.call(ApiStvGrades.getGradeFromPoints(
query,
this.selected.find(Boolean)?.lehrveranstaltung_id
))
.then(result => {
if (result.data === null) {
this.suggestions = [];
@@ -84,8 +88,8 @@ export default {
}
},
created() {
this.$fhcApi.factory
.stv.grades.list()
this.$api
.call(ApiStvGrades.list())
.then(result => {
this.grades = result.data;
})
@@ -1,8 +1,8 @@
// NOTE(chris): cache calls globally to prevent multiple calls on the same source
const calledPermissionUrls = {};
async function callPermissionUrl($fhcApi, url) {
async function callPermissionUrl($api, url) {
if (!calledPermissionUrls[url]) {
calledPermissionUrls[url] = $fhcApi.get(url);
calledPermissionUrls[url] = $api.get(url);
}
return (await calledPermissionUrls[url]).data;
}
@@ -42,7 +42,7 @@ export default {
for (const k in this.data) {
permissioncheckUrl = permissioncheckUrl.replace("{" + k + "}", this.data[k]);
}
if (!await callPermissionUrl(this.$fhcApi, permissioncheckUrl))
if (!await callPermissionUrl(this.$api, permissioncheckUrl))
continue;
}
const item = {label: part.title};
@@ -60,7 +60,7 @@ export default {
? this.data[value.slice(1,-1)]
: value
);
this.$fhcApi
this.$api
.post(this.addParamsToString(part.action.url), post)
.then(() => part.action.response || this.$p.t('ui/successSave'))
.then(this.$fhcAlert.alertSuccess)
@@ -1,5 +1,7 @@
import CoreNotiz from "../../../Notiz/Notiz.js";
import ApiNotizPerson from '../../../../api/factory/notiz/person.js';
export default {
components: {
CoreNotiz
@@ -7,12 +9,17 @@ export default {
props: {
modelValue: Object
},
data() {
return {
endpoint: ApiNotizPerson
};
},
template: `
<div class="stv-details-notizen h-100 pb-3">
<!-- mit factory als endpoint -->
<core-notiz
class="overflow-hidden"
:endpoint="$fhcApi.factory.notiz.person"
:endpoint="endpoint"
ref="formc"
notiz-layout="twoColumnsFormLeft"
type-id="person_id"
@@ -4,6 +4,8 @@ import TblHistory from "./Prestudent/History.js";
import CoreUdf from '../../../Udf/Udf.js';
import ApiStvPrestudent from '../../../../api/factory/stv/prestudent.js';
export default {
components: {
FormForm,
@@ -88,7 +90,8 @@ export default {
methods: {
loadPrestudent() {
return this.$fhcApi.factory.stv.prestudent.get(this.modelValue.prestudent_id)
return this.$api
.call(ApiStvPrestudent.get(this.modelValue.prestudent_id))
.then(result => result.data)
.then(result => {
this.data = result;
@@ -100,8 +103,9 @@ export default {
udfsLoaded(udfs) {
this.initialFormData = {...(this.initialFormData || {}), ...udfs};
},
updatePrestudent(){
return this.$fhcApi.factory.stv.prestudent.updatePrestudent(this.$refs.form, this.modelValue.prestudent_id, this.deltaArray)
updatePrestudent() {
return this.$refs.form
.call(ApiStvPrestudent.updatePrestudent(this.modelValue.prestudent_id, this.deltaArray))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.initialFormData = {...this.data};
@@ -116,55 +120,64 @@ export default {
},
created() {
this.loadPrestudent();
this.$fhcApi.factory.stv.prestudent.getBezeichnungZGV()
this.$api
.call(ApiStvPrestudent.getBezeichnungZGV())
.then(result => result.data)
.then(result => {
this.listZgvs = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getBezeichnungMZgv()
this.$api
.call(ApiStvPrestudent.getBezeichnungMZgv())
.then(result => result.data)
.then(result => {
this.listZgvsmaster = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getBezeichnungDZgv()
this.$api
.call(ApiStvPrestudent.getBezeichnungDZgv())
.then(result => result.data)
.then(result => {
this.listZgvsdoktor = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getStgs()
this.$api
.call(ApiStvPrestudent.getStgs())
.then(result => result.data)
.then(result => {
this.listStgs = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getAusbildung()
this.$api
.call(ApiStvPrestudent.getAusbildung())
.then(result => result.data)
.then(result => {
this.listAusbildung = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getAufmerksamdurch()
this.$api
.call(ApiStvPrestudent.getAufmerksamdurch())
.then(result => result.data)
.then(result => {
this.listAufmerksamdurch = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getBerufstaetigkeit()
this.$api
.call(ApiStvPrestudent.getBerufstaetigkeit())
.then(result => result.data)
.then(result => {
this.listBerufe = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getTypenStg()
this.$api
.call(ApiStvPrestudent.getTypenStg())
.then(result => result.data)
.then(result => {
this.listStgTyp = result;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.prestudent.getBisstandort()
this.$api
.call(ApiStvPrestudent.getBisstandort())
.then(result => result.data)
.then(result => {
this.listBisStandort = result;
@@ -1,5 +1,7 @@
import {CoreFilterCmpt} from "../../../../filter/Filter.js";
import ApiStvPrestudent from '../../../../../api/factory/stv/prestudent.js';
export default{
components: {
CoreFilterCmpt
@@ -12,12 +14,7 @@ export default{
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.prestudent.getHistoryPrestudents,
ajaxParams: () => {
return {
id: this.personId
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudents(this.personId)),
ajaxResponse: (url, params, response) => response.data,
//autoColumns: true,
columns:[
@@ -68,11 +65,7 @@ export default{
},
watch: {
personId() {
this.$fhcApi.factory.stv.prestudent.getHistoryPrestudents(this.personId)
.then(result => {
this.$refs.table.tabulator.setData(result.data);
})
.catch(this.$fhcAlert.handleSystemError); // Handle any errors
this.$refs.table.reloadTable();
},
},
template: `
@@ -5,6 +5,8 @@ import FormInput from '../../../../Form/Input.js';
import StatusModal from '../Status/Modal.js';
import StatusDropdown from '../Status/Dropdown.js';
import ApiStvPrestudent from '../../../../../api/factory/stv/prestudent.js';
export default{
components: {
CoreFilterCmpt,
@@ -58,12 +60,7 @@ export default{
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.prestudent.getHistoryPrestudent,
ajaxParams: () => {
return {
id: this.modelValue.prestudent_id
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudent(this.modelValue.prestudent_id)),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Kurzbz", field: "status_kurzbz", tooltip: true},
@@ -322,7 +319,8 @@ export default{
? [this.modelValue.studiengang_kz]
: this.modelValue.map(prestudent => prestudent.studiengang_kz);
this.maxSem = 0;
this.$fhcApi.factory.stv.prestudent.getMaxSem(studiengang_kzs)
this.$api
.call(ApiStvPrestudent.getMaxSem(studiengang_kzs))
.then(result => this.maxSem = result.data)
.catch(this.$fhcAlert.handleSystemError);
},
@@ -345,7 +343,7 @@ export default{
.then(result => {
// If confirmed, check if this is the last status
return result
? this.$fhcApi.factory.stv.prestudent.isLastStatus(statusId.prestudent_id)
? this.$api.call(ApiStvPrestudent.isLastStatus(statusId.prestudent_id))
: Promise.reject({handled: true});
})
.then(result => {
@@ -359,7 +357,7 @@ export default{
})
.then(result => {
return result
? this.$fhcApi.factory.stv.prestudent.deleteStatus(statusId)
? this.$api.call(ApiStvPrestudent.deleteStatus(statusId))
: Promise.reject({handled: true});
})
.then(() => {
@@ -376,7 +374,8 @@ export default{
studiensemester_kurzbz: stdsem,
ausbildungssemester: ausbildungssemester
};
return this.$fhcApi.factory.stv.prestudent.advanceStatus(statusId)
return this.$api
.call(ApiStvPrestudent.advanceStatus(statusId))
.then(() => this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successAdvance')))
.then(this.reload)
.catch(this.$fhcAlert.handleSystemError);
@@ -390,7 +389,7 @@ export default{
};
BsConfirm
.popup(this.$p.t('stv', 'status_confirm_popup'))
.then(() => this.$fhcApi.factory.stv.prestudent.confirmStatus(statusId))
.then(() => this.$api.call(ApiStvPrestudent.confirmStatus(statusId)))
.then(() => this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successConfirm')))
.then(this.reload)
.catch(this.$fhcAlert.handleSystemError);
@@ -402,7 +401,8 @@ export default{
},
created() {
this.getMaxSem();
this.$fhcApi.factory.stv.prestudent.getLastBismeldestichtag()
this.$api
.call(ApiStvPrestudent.getLastBismeldestichtag())
.then(result => {
this.dataMeldestichtag = result.data[0].meldestichtag;
if (this.$refs.table && this.$refs.table.tableBuilt)
@@ -3,6 +3,8 @@ import FormInput from "../../../../Form/Input.js";
import FormForm from '../../../../Form/Form.js';
import BsModal from "../../../../Bootstrap/Modal.js";
import ApiStvExam from '../../../../../api/factory/stv/exam.js';
export default{
components: {
CoreFilterCmpt,
@@ -29,12 +31,7 @@ export default{
return {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: this.$fhcApi.factory.stv.exam.getPruefungen,
ajaxParams: () => {
return {
id: this.uid
};
},
ajaxRequestFunc: () => this.$api.call(ApiStvExam.getPruefungen(this.uid)),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Datum", field: "format_datum"},
@@ -168,7 +165,8 @@ export default{
},
methods:{
loadPruefung(pruefung_id) {
return this.$fhcApi.factory.stv.exam.loadPruefung(pruefung_id)
return this.$api
.call(ApiStvExam.loadPruefung(pruefung_id))
.then(result => {
this.pruefungData = result.data;
return result;
@@ -226,8 +224,9 @@ export default{
});
},
addPruefung(){
return this.$fhcApi.factory.stv.exam.addPruefung(this.$refs.examData, this.pruefungData)
addPruefung() {
return this.$refs.examData
.call(ApiStvExam.addPruefung(this.pruefungData))
.then(response => {
this.checkData = response.data;
if (this.checkData === 2 || this.checkData === 5)
@@ -244,13 +243,14 @@ export default{
},
updatePruefung(pruefung_id){
this.checkChangeAfterExamDate();
return this.$fhcApi.factory.stv.exam.updatePruefung(this.$refs.examData, pruefung_id, this.pruefungData)
.then(response => {
this.checkData = response.data;
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
return this.$refs.examData
.call(ApiStvExam.updatePruefung(pruefung_id, this.pruefungData))
.then(response => {
this.checkData = response.data;
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal('pruefungModal');
this.resetModal();
}).catch(this.$fhcAlert.handleSystemError)
.finally(() => {
window.scrollTo(0, 0);
this.reload();
@@ -265,13 +265,14 @@ export default{
else
this.showHint = false;
},
checkChangeAfterExamDate(){
checkChangeAfterExamDate() {
const data = {
student_uid: this.pruefungData.student_uid,
studiensemester_kurzbz: this.pruefungData.studiensemester_kurzbz,
lehrveranstaltung_id: this.pruefungData.lehrveranstaltung_id
};
return this.$fhcApi.factory.stv.exam.checkZeugnisnoteLv(data)
return this.$api
.call(ApiStvExam.checkZeugnisnoteLv(data))
.then(result => {
this.zeugnisData = result.data;
let checkDate = this.zeugnisData[0].uebernahmedatum === '' ||
@@ -282,13 +283,16 @@ export default{
&& this.pruefungData.note !== this.zeugnisData[0].note) {
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
}
}).catch(this.$fhcAlert.handleSystemError);
})
.catch(this.$fhcAlert.handleSystemError);
},
deletePruefung(pruefung_id) {
return this.$fhcApi.factory.stv.exam.deletePruefung(pruefung_id)
return this.$api
.call(ApiStvExam.deletePruefung(pruefung_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
}).catch(this.$fhcAlert.handleSystemError)
})
.catch(this.$fhcAlert.handleSystemError)
.finally(()=> {
window.scrollTo(0, 0);
this.reload();
@@ -304,8 +308,9 @@ export default{
reload() {
this.$refs.table.reloadTable();
},
getMaFromLv(lv_id){
return this.$fhcApi.factory.stv.exam.getMitarbeiterLv(lv_id)
getMaFromLv(lv_id) {
return this.$api
.call(ApiStvExam.getMitarbeiterLv(lv_id))
.then(result => {
this.listMas = result.data;
})
@@ -316,7 +321,8 @@ export default{
lv_id: lv_id,
studiensemester_kurzbz: studiensemester_kurzbz
};
return this.$fhcApi.factory.stv.exam.getAllLehreinheiten(data)
return this.$api
.call(ApiStvExam.getAllLehreinheiten(data))
.then(response => {
this.listLes = response.data;
})
@@ -355,31 +361,37 @@ export default{
}
},
},
created(){
this.$fhcApi.factory.stv.exam.getLvsByStudent(this.uid)
created() {
this.$api
.call(ApiStvExam.getLvsByStudent(this.uid))
.then(result => {
this.listLvs = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.exam.getLvsandLesByStudent(this.uid, this.currentSemester)
this.$api
.call(ApiStvExam.getLvsandLesByStudent(this.uid, this.currentSemester))
.then(result => {
this.listLvsAndLes = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.exam.getLvsAndMas(this.uid)
this.$api
.call(ApiStvExam.getLvsAndMas(this.uid))
.then(result => {
this.listLvsAndMas = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.exam.getTypenPruefungen()
this.$api
.call(ApiStvExam.getTypenPruefungen())
.then(result => {
this.listTypesExam = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi.factory.stv.exam.getNoten()
this.$api
.call(ApiStvExam.getNoten())
.then(result => {
this.listMarks = result.data;
})
@@ -3,6 +3,8 @@ import BsConfirm from "../../../../Bootstrap/Confirm.js";
import BsPrompt from "../../../../Bootstrap/Prompt.js";
import FormInput from '../../../../Form/Input.js';
import ApiStvStatus from '../../../../../api/factory/stv/status.js';
export default {
components: {
BsModal,
@@ -142,7 +144,11 @@ export default {
addStudent(data) {
Promise
.allSettled(
this.prestudentIds.map(prestudent_id => this.$fhcApi.factory.stv.status.addStudent(prestudent_id, data)))
this.prestudentIds.map(prestudent_id => this.$api.call(
ApiStvStatus.addStudent(prestudent_id, data),
{ errorHeader: prestudent_id }
))
)
.then(res => this.showFeedback(res, data.status_kurzbz));
},
changeStatusToAbbrecher(statusgrund_id) {
@@ -238,7 +244,11 @@ export default {
changeStatus(data) {
Promise
.allSettled(
this.prestudentIds.map(prestudent_id => this.$fhcApi.factory.stv.status.changeStatus(prestudent_id, data)))
this.prestudentIds.map(prestudent_id => this.$api.call(
ApiStvStatus.changeStatus(prestudent_id, data),
{ errorHeader: prestudent_id }
))
)
.then(res => this.showFeedback(res, data.status_kurzbz));
},
showFeedback(results, status_kurzbz) {
@@ -259,7 +269,8 @@ export default {
}
},
created() {
this.$fhcApi.factory.stv.status.getStatusarray()
this.$api
.call(ApiStvStatus.getStatusarray())
.then(result => result.data)
.then(result => {
this.listDataToolbar = result;
@@ -3,6 +3,8 @@ import CoreForm from '../../../../Form/Form.js';
import FormValidation from '../../../../Form/Validation.js';
import FormInput from '../../../../Form/Input.js';
import ApiStvStatus from '../../../../../api/factory/stv/status.js';
export default{
components: {
BsModal,
@@ -128,7 +130,8 @@ export default{
ausbildungssemester
};
this.$fhcApi.factory.stv.status.loadStatus(this.statusId)
this.$api
.call(ApiStvStatus.loadStatus(this.statusId))
.then(result => {
this.statusNew = false;
this.formData = result.data;
@@ -142,7 +145,8 @@ export default{
}
},
insertStatus() {
this.$fhcApi.factory.stv.status.insertStatus(this.$refs.form, this.statusId, this.formData)
this.$refs.form
.call(ApiStvStatus.insertStatus(this.statusId, this.formData))
.then(result => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$reloadList();
@@ -152,7 +156,8 @@ export default{
.catch(this.$fhcAlert.handleSystemError);
},
editStatus() {
this.$fhcApi.factory.stv.status.updateStatus(this.$refs.form, this.statusId, this.formData)
this.$refs.form
.call(ApiStvStatus.updateStatus(this.statusId, this.formData))
.then(result => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.$reloadList();
@@ -167,19 +172,22 @@ export default{
if (old_id == prestudent.prestudent_id)
return Promise.resolve();
return this.$fhcApi.factory.stv.status.getStudienplaene(prestudent.prestudent_id)
return thid.$api
.call(ApiStvStatus.getStudienplaene(prestudent.prestudent_id))
.then(result => this.studienplaene = result.data)
.then(() => this.$fhcApi.factory.stv.status.getStudiengang(prestudent.prestudent_id))
.then(() => this.$api.call(ApiStvStatus.getStudiengang(prestudent.prestudent_id)))
.then(result => this.mischform = result.data.mischform);
}
},
created() {
this.$fhcApi.factory.stv.status.getStatusgruende()
this.$api
.call(ApiStvStatus.getStatusgruende())
.then(result => this.statusgruende = result.data)
.catch(this.$fhcAlert.handleSystemError);
//TODO(Manu) check why it is/was hard coded
this.$fhcApi.factory.stv.status.getStati()
this.$api
.call(ApiStvStatus.getStati())
.then(result => this.stati = result.data)
.catch(this.$fhcAlert.handleSystemError);
/* this.stati = [
@@ -107,6 +107,7 @@ export default {
}
},
ajaxRequestFunc: (url, params) => this.$api.call({url, params}),
ajaxResponse: (url, params, response) => response.data,
layout: 'fitDataStretch',
@@ -175,7 +176,7 @@ export default {
}
}
},
updateUrl(url, first) {
updateUrl(endpoint, first) {
this.lastSelected = first ? undefined : this.selected;
const params = {}, filter = {};
@@ -189,14 +190,14 @@ export default {
if (!this.$refs.table.tableBuilt) {
if (!this.$refs.table.tabulator) {
this.tabulatorOptions.ajaxURL = url;
this.tabulatorOptions.ajaxURL = endpoint.url;
this.tabulatorOptions.ajaxParams = params;
} else
this.$refs.table.tabulator.on("tableBuilt", () => {
this.$refs.table.tabulator.setData(url, params);
this.$refs.table.tabulator.setData(endpoint.url, params);
});
} else
this.$refs.table.tabulator.setData(url, params);
this.$refs.table.tabulator.setData(endpoint.url, params);
},
onKeydown(e) { // TODO(chris): this should be in the filter component
if (!this.focusObj)
@@ -5,6 +5,8 @@ import FormValidation from '../../../Form/Validation.js';
import FormInput from '../../../Form/Input.js';
import accessibility from '../../../../directives/accessibility.js';
import ApiStvStudents from '../../../../api/factory/stv/students.js';
var _uuid = 0;
const FORMDATA_DEFAULT = {
address: {
@@ -106,13 +108,13 @@ export default {
return;
this.abortController.suggestions = new AbortController();
// TODO(chris): move to fhcapi.factory
this.$fhcApi
.post('api/frontend/v1/stv/student/check', {
this.$api
.call(ApiStvStudents.check({
vorname: this.formData.vorname,
nachname: this.formData.nachname,
gebdatum: this.formData.gebdatum
}, {
}), {
signal: this.abortController.suggestions.signal
})
.then(result => this.suggestions = result.data)
@@ -5,6 +5,7 @@ import PvTree from "../../../../../index.ci.php/public/js/components/primevue/tr
import PvTreetable from "../../../../../index.ci.php/public/js/components/primevue/treetable/treetable.esm.min.js";
import PvColumn from "../../../../../index.ci.php/public/js/components/primevue/column/column.esm.min.js";
import ApiStvVerband from '../../../api/factory/stv/verband.js';
export default {
components: {
@@ -54,8 +55,8 @@ export default {
});
this.loading = true;
this.$fhcApi
.get('api/frontend/v1/stv/verband/' + node.data.link)
this.$api
.call(ApiStvVerband.get(node.data.link))
.then(result => result.data)
.then(result => {
const subNodes = result.map(this.mapResultToTreeData);
@@ -106,8 +107,10 @@ export default {
this.favnodes = await this.loadNodes(this.favorites.list);
}
this.favorites.on = !this.favorites.on;
this.$fhcApi
.factory.stv.verband.favorites.set(JSON.stringify(this.favorites));
this.$api
.call(ApiStvVerband.favorites.set(
JSON.stringify(this.favorites)
));
this.loading = false;
},
async loadNodes(links) {
@@ -131,8 +134,8 @@ export default {
let promises = [];
for (let parent in sortedInParents)
promises.push(
this.$fhcApi
.get('api/frontend/v1/stv/verband/' + (parent == '_' ? '' : parent))
this.$api
.call(ApiStvVerband.get(parent == '_' ? '' : parent))
.then(res => res.data)
.then(res => res.filter(node => sortedInParents[parent].includes(node.link + '')))
);
@@ -158,8 +161,10 @@ export default {
this.favorites.list.push(key.data.link + '');
}
this.$fhcApi
.factory.stv.verband.favorites.set(JSON.stringify(this.favorites));
this.$api
.call(ApiStvVerband.favorites.set(
JSON.stringify(this.favorites)
));
},
unsetFavFocus(e) {
if (e.target.dataset?.linkFavAdd !== undefined) {
@@ -179,16 +184,16 @@ export default {
}
},
mounted() {
this.$fhcApi
.factory.stv.verband.get()
this.$api
.call(ApiStvVerband.get())
.then(result => {
this.nodes = result.data.map(this.mapResultToTreeData);
this.loading = false;
})
.catch(this.$fhcAlert.handleSystemError);
this.$fhcApi
.factory.stv.verband.favorites.get()
this.$api
.call(ApiStvVerband.favorites.get())
.then(result => {
if (result.data) {
let f = JSON.parse(result.data);
+1 -1
View File
@@ -61,7 +61,7 @@ export default {
.then(this.initConfig)
.catch(this.$fhcAlert.handleSystemError);
if (typeof config === 'string' || config instanceof String)
return this.$fhcApi
return this.$api
.get(config)
.then(result => result.data)
.then(this.initConfig)
+2 -3
View File
@@ -1,6 +1,7 @@
import { CoreFetchCmpt } from '../Fetch.js';
import FormInput from '../Form/Input.js';
import ApiUdf from '../../api/udf.js';
export default {
components: {
@@ -72,9 +73,7 @@ export default {
},
methods: {
loadF(params) {
// TODO(chris): move to fhcapi.factory
return this.$fhcApi
.post('/api/frontend/v1/udf/load/' + params.ciModel, params.pk);
return this.$api.call(ApiUdf.load(params));
},
init(result) {
const fields = result.map(el => {
+11 -5
View File
@@ -23,6 +23,8 @@ import collapseAutoClose from '../../directives/collapseAutoClose.js';
import moduleLayoutFitDataStretchFrozen from '../../tabulator/layouts/fitDataStretchFrozen.js';
import ApiFilter from '../../api/factory/filter.js';
//
const FILTER_COMPONENT_NEW_FILTER = 'Filter Component New Filter';
const FILTER_COMPONENT_NEW_FILTER_TYPE = 'Filter Component New Filter Type';
@@ -333,10 +335,14 @@ export const CoreFilterCmpt = {
*/
getFilter() {
if (this.selectedFilter === null)
this.startFetchCmpt(this.$fhcApi.factory.filter.getFilter, null, this.render);
this.startFetchCmpt(
wsParams => this.$api.call(ApiFilter.getFilter(wsParams)),
null,
this.render
);
else
this.startFetchCmpt(
this.$fhcApi.factory.filter.getFilterById,
wsParams => this.$api.call(ApiFilter.getFilterById(wsParams)),
{
filterId: this.selectedFilter
},
@@ -509,7 +515,7 @@ export const CoreFilterCmpt = {
this.selectedFilter = null;
//
this.startFetchCmpt(
this.$fhcApi.factory.filter.saveCustomFilter,
wsParams => this.$api.call(ApiFilter.saveCustomFilter(wsParams)),
{
customFilterName
},
@@ -525,7 +531,7 @@ export const CoreFilterCmpt = {
this.selectedFilter = null;
//
this.startFetchCmpt(
this.$fhcApi.factory.filter.removeCustomFilter,
wsParams => this.$api.call(ApiFilter.removeCustomFilter(wsParams)),
{
filterId: filterId
},
@@ -562,7 +568,7 @@ export const CoreFilterCmpt = {
applyFilterConfig(filterFields) {
this.selectedFilter = null;
this.startFetchCmpt(
this.$fhcApi.factory.filter.applyFilterFields,
wsParams => this.$api.call(ApiFilter.applyFilterFields(wsParams)),
{
filterFields
},
@@ -16,6 +16,7 @@
*/
import {CoreFetchCmpt} from '../../components/Fetch.js';
import ApiNavigation from '../../api/factory/navigation.js';
/**
*
@@ -76,13 +77,13 @@ export const CoreNavigationCmpt = {
*
*/
fetchCmptApiFunctionHeader() {
return this.$fhcApi.factory.navigation.getHeader(this.getNavigationPage());
return this.$api.call(ApiNavigation.getHeader(this.getNavigationPage()))
},
/**
*
*/
fetchCmptApiFunctionSideMenu() {
return this.$fhcApi.factory.navigation.getMenu(this.getNavigationPage());
return this.$api.call(ApiNavigation.getMenu(this.getNavigationPage()))
},
/**
*