diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php
index 9b713b5f9..3a8268775 100644
--- a/application/controllers/api/frontend/v1/stv/Kontakt.php
+++ b/application/controllers/api/frontend/v1/stv/Kontakt.php
@@ -434,7 +434,10 @@ class Kontakt extends FHCAPI_Controller
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
$this->KontakttypModel->addJoin('public.tbl_kontakttyp kt', 'ON (public.tbl_kontakt.kontakttyp = kt.kontakttyp)');
$result = $this->KontaktModel->loadWhere(
- array('person_id' => $person_id)
+ array(
+ 'person_id' => $person_id,
+ 'public.tbl_kontakt.kontakttyp !=' => 'hidden'
+ )
);
if (isError($result))
@@ -442,20 +445,18 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
+
}
public function getKontakttypen()
{
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
+ $this->KontakttypModel->addOrder('beschreibung', 'ASC');
+ $result = $this->KontakttypModel->loadWhere(array('kontakttyp !=' => 'hidden'));
- $result = $this->KontakttypModel->load();
- if (isError($result)) {
- $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
- }
- else
- {
- $this->terminateWithSuccess(getData($result) ?: []);
- }
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
}
public function loadContact()
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js
index e429e5933..1ff34dc79 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js
@@ -300,8 +300,7 @@ export default{
this.$api
.call(ApiStvContact.getTypes())
.then(result => {
- //this.kontakttypen = result.data;
- this.kontakttypen = result.data.filter(item => item.kontakttyp !== 'hidden');
+ this.kontakttypen = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
@@ -326,7 +325,7 @@ export default{
v-model="contactData.kontakttyp">
>
-
+
@@ -455,4 +454,4 @@ export default{
>
`
-};
\ No newline at end of file
+};