diff --git a/application/controllers/api/frontend/v1/vertraege/Config.php b/application/controllers/api/frontend/v1/vertraege/Config.php
index 8ff241914..72d38e93e 100644
--- a/application/controllers/api/frontend/v1/vertraege/Config.php
+++ b/application/controllers/api/frontend/v1/vertraege/Config.php
@@ -47,6 +47,7 @@ class Config extends FHCAPI_Controller
$params
);
+ //TODO(Manu) check warning
$this->terminateWithSuccess($menu[0]);
}
}
diff --git a/application/controllers/api/frontend/v1/vertraege/Vertraege.php b/application/controllers/api/frontend/v1/vertraege/Vertraege.php
index d1376c484..579883c8d 100644
--- a/application/controllers/api/frontend/v1/vertraege/Vertraege.php
+++ b/application/controllers/api/frontend/v1/vertraege/Vertraege.php
@@ -467,7 +467,7 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($result)));
}
- public function insertContractStatus($vertrag_id)
+ public function insertContractStatus()
{
$this->load->library('form_validation');
@@ -486,7 +486,7 @@ class Vertraege extends FHCAPI_Controller
$result = $this->VertragvertragsstatusModel->loadWhere(
array(
- 'vertrag_id' => $vertrag_id,
+ 'vertrag_id' => $this->input->post('vertrag_id'),
'vertragsstatus_kurzbz' => $this->input->post('vertragsstatus_kurzbz')
)
);
@@ -497,7 +497,7 @@ class Vertraege extends FHCAPI_Controller
}
$status_result = $this->VertragvertragsstatusModel->insert([
- 'vertrag_id' => $vertrag_id,
+ 'vertrag_id' => $this->input->post('vertrag_id'),
'uid' => getAuthUID(),
'vertragsstatus_kurzbz' => $this->input->post('vertragsstatus_kurzbz'),
'insertamum' => date('c'),
@@ -512,9 +512,10 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($status_result)));
}
- public function deleteContractStatus($vertrag_id)
+ public function deleteContractStatus()
{
$status = $this->input->post('vertragsstatus_kurzbz');
+ $vertrag_id = $this->input->post('vertrag_id');
$result = $this->VertragvertragsstatusModel->delete(
array(
@@ -534,9 +535,10 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($result)));
}
- public function loadContractStatus($vertrag_id)
+ public function loadContractStatus()
{
- $status = $this->input->post('vertragsstatus_kurzbz');
+ $status = $this->input->get('vertragsstatus_kurzbz');
+ $vertrag_id = $this->input->get('vertrag_id');
$result = $this->VertragvertragsstatusModel->loadWhere(
array(
@@ -550,7 +552,7 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($result)));
}
- public function updateContractStatus($vertrag_id)
+ public function updateContractStatus()
{
$this->load->library('form_validation');
@@ -569,7 +571,7 @@ class Vertraege extends FHCAPI_Controller
$status_result = $this->VertragvertragsstatusModel->update(
[
- 'vertrag_id' => $vertrag_id,
+ 'vertrag_id' => $this->input->post('vertrag_id'),
'vertragsstatus_kurzbz' => $this->input->post('vertragsstatus_kurzbz')],
[
'uid' => getAuthUID(),
@@ -586,10 +588,11 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($status_result)));
}
- public function deleteLehrauftrag($vertrag_id)
+ public function deleteLehrauftrag()
{
$lehreinheit_id = $this->input->post('lehreinheit_id');
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+ $vertrag_id = $this->input->post('vertrag_id ');
$this->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
@@ -616,11 +619,12 @@ class Vertraege extends FHCAPI_Controller
return $this->terminateWithSuccess(current(getData($result)));
}
- public function deleteBetreuung($vertrag_id)
+ public function deleteBetreuung()
{
$person_id= $this->input->post('person_id');
$projektarbeit_id = $this->input->post('projektarbeit_id');
$betreuerart_kurzbz = $this->input->post('betreuerart_kurzbz');
+ $vertrag_id = $this->input->post('vertrag_id ');
$this->load->model('education/Projektbetreuer_model', 'Projektbetreuermodel');
diff --git a/public/js/api/factory/vertraege/vertraege.js b/public/js/api/factory/vertraege/vertraege.js
new file mode 100644
index 000000000..8d39a24c9
--- /dev/null
+++ b/public/js/api/factory/vertraege/vertraege.js
@@ -0,0 +1,158 @@
+/**
+ * Copyright (C) 2025 fhcomplete.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+export default {
+ getAllVertraege(person_id) {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getAllVertraege/' + person_id
+ };
+ },
+/* getAllContractsNotAssigned2(person_id) {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getAllContractsNotAssigned/' + person_id
+ };
+ },*/
+ getAllContractsNotAssigned(person_id) {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getAllContractsNotAssigned/' + person_id
+ };
+ },
+ getAllContractsAssigned(person_id, vertrag_id) {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getAllContractsAssigned/' + person_id + '/' + vertrag_id + ''
+ };
+ },
+ getAllContractTypes() {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getAllContractTypes/'
+ };
+ },
+ getStatiOfContract(vertrag_id){
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Vertraege/getStatiOfContract/' + vertrag_id
+ };
+ },
+ configPrintDocument() {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/Config/printDocument/'
+ };
+ },
+ getAllContractStati() {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/vertraege/getAllContractStati/'
+ };
+ },
+ deleteContract(vertrag_id) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/deleteContract/' + vertrag_id
+ };
+ },
+ addNewContract(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/addNewContract/',
+ params
+ };
+ },
+ loadContract(vertrag_id){
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/vertraege/loadContract/' + vertrag_id
+ };
+ },
+ updateContract(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/updateContract/',
+ params
+ };
+ },
+ loadContractStatus(params){
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/vertraege/loadContractStatus/',
+ params
+ };
+ },
+ insertContractStatus(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/insertContractStatus/',
+ params
+ };
+ },
+ updateContractStatus(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/updateContractStatus/',
+ params
+ };
+ },
+ deleteContractStatus(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/deleteContractStatus/',
+ params
+ };
+ },
+ deleteLehrauftrag(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/deleteLehrauftrag/',
+ params
+ };
+ },
+ deleteBetreuung(params) {
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/deleteBetreuung/',
+ params
+ };
+ },
+ getMitarbeiter(){
+ return {
+ method: 'post',
+ url: 'api/frontend/v1/vertraege/vertraege/getMitarbeiter/',
+ };
+ //return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/getMitarbeiter/');
+ },
+ getHeader(person_id){
+ return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/getHeader/' + person_id);
+ },
+ getPersonAbteilung(person_id){
+ return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/getPersonAbteilung/' + person_id);
+ },
+ getLeitungOrg(oekurzbz){
+ return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/getLeitungOrg/' + oekurzbz);
+ },
+ getMitarbeiterUid(person_id){
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/vertraege/vertraege/getMitarbeiterUid/' + person_id
+ };
+ // return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getMitarbeiterUid/' + person_id);
+ },
+};
\ No newline at end of file
diff --git a/public/js/components/Vertraege/List/Details.js b/public/js/components/Vertraege/List/Details.js
index 60ec5110e..47eb629a3 100644
--- a/public/js/components/Vertraege/List/Details.js
+++ b/public/js/components/Vertraege/List/Details.js
@@ -26,19 +26,19 @@ export default {
type: [Number],
required: true
},
+ endpoint: {
+ type: Object,
+ required: true
+ },
},
data() {
return {
//tableData: [],
tabulatorOptions: {
ajaxURL: 'dummy',
- ajaxRequestFunc: this.$fhcApi.factory.vertraege.person.getAllContractsAssigned,
- ajaxParams: () => {
- return {
- person_id: this.person_id,
- vertrag_id: this.vertrag_id
- };
- },
+ ajaxRequestFunc: () => this.$api.call(
+ this.endpoint.getAllContractsAssigned(this.person_id, this.vertrag_id)
+ ),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Typ", field: "type"},
diff --git a/public/js/components/Vertraege/List/Status.js b/public/js/components/Vertraege/List/Status.js
index 60475d3e2..11410bfff 100644
--- a/public/js/components/Vertraege/List/Status.js
+++ b/public/js/components/Vertraege/List/Status.js
@@ -29,18 +29,19 @@ export default {
formDataParent: {
type: Object,
required: true
- }
+ },
+ endpoint: {
+ type: Object,
+ required: true
+ },
},
data() {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
- ajaxRequestFunc: this.$fhcApi.factory.vertraege.person.getStatiOfContract,
- ajaxParams: () => {
- return {
- vertrag_id: this.vertrag_id
- };
- },
+ ajaxRequestFunc: () => this.$api.call(
+ this.endpoint.getStatiOfContract(this.vertrag_id)
+ ),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Status", field: "bezeichnung"},
diff --git a/public/js/components/Vertraege/List/Unassigned.js b/public/js/components/Vertraege/List/Unassigned.js
index 9ffb1c3c8..4b0d20bb8 100644
--- a/public/js/components/Vertraege/List/Unassigned.js
+++ b/public/js/components/Vertraege/List/Unassigned.js
@@ -25,12 +25,9 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
- ajaxRequestFunc: this.$fhcApi.factory.vertraege.person.getAllContractsNotAssigned,
- ajaxParams: () => {
- return {
- person_id: this.person_id
- };
- },
+ ajaxRequestFunc: () => this.$api.call(
+ this.endpoint.getAllContractsNotAssigned(this.person_id)
+ ),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "Typ", field: "type", width: 100},
diff --git a/public/js/components/Vertraege/MitarbeiterHeader.js b/public/js/components/Vertraege/MitarbeiterHeader.js
index ff361eaea..175c61006 100644
--- a/public/js/components/Vertraege/MitarbeiterHeader.js
+++ b/public/js/components/Vertraege/MitarbeiterHeader.js
@@ -6,15 +6,19 @@ export default {
CoreFilterCmpt,
FormInput
},
- inject: {
+/* inject: {
cisRoot: {
from: 'cisRoot'
},
- },
+ },*/
emits: [
"selectedPerson"
],
props: {
+ endpoint: {
+ type: Object,
+ required: true
+ },
// maybe later nur fixe oder alle Mitarbeiter: gleich funktionsaufruf
//oder Mitarbeiter mit Verträgen
/* filterMa: {
@@ -41,12 +45,9 @@ export default {
return {
tabulatorOptions: {
ajaxURL: 'dummy',
- ajaxRequestFunc: this.$fhcApi.factory.vertraege.person.getMitarbeiter,
- ajaxParams: () => {
- return {
- fix: this.filterMa
- };
- },
+ ajaxRequestFunc: () => this.$api.call(
+ this.endpoint.getMitarbeiter()
+ ),
ajaxResponse: (url, params, response) => response.data,
columns: [
{title: "UID", field: "uid", headerFilter:"input"},
@@ -148,6 +149,7 @@ export default {