diff --git a/application/controllers/api/frontend/v1/Cms.php b/application/controllers/api/frontend/v1/Cms.php index e41196f45..f0d009534 100644 --- a/application/controllers/api/frontend/v1/Cms.php +++ b/application/controllers/api/frontend/v1/Cms.php @@ -181,7 +181,6 @@ class Cms extends FHCAPI_Controller $page_size = $page_size ?? 10; $news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size); - $news = $this->getDataOrTerminateWithError($news); $this->addMeta('test', $this->p->t('global', 'studiengangsleitung')); diff --git a/application/libraries/CmsLib.php b/application/libraries/CmsLib.php index b65e2a71c..e7f2c2de2 100644 --- a/application/libraries/CmsLib.php +++ b/application/libraries/CmsLib.php @@ -236,7 +236,7 @@ class CmsLib return $news; $news = getData($news); - //var_dump($news->maxPageCount); + foreach ($news as $newsobj) { if ($studiengang_kz && $edit && !$newsobj->studiengang_kz) continue; @@ -247,7 +247,7 @@ class CmsLib $xml .= "" . $newsobj->content . $datum . $id . ""; } - if ($studiengang_kz != 0) { + /* if ($studiengang_kz != 0) { $stg_obj = $this->ci->StudiengangModel->load($studiengang_kz); if (isError($stg_obj)) return $stg_obj; @@ -262,7 +262,7 @@ class CmsLib } $xml .= 'bezeichnung . ']]>'; } - } + } */ if ($titel != '') { $xml .= '' . $titel . ''; diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index a69175cd8..5021becce 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -687,11 +687,15 @@ class Studiengang_model extends DB_Model $this->load->model('crm/Student_model', 'StudentModel'); - //TODO: this does not work for Mitarbeiter $student = $this->StudentModel->loadWhere(['student_uid' => getAuthUID()]); if (isError($student)) return error($student); if (getData($student)) { + //TODO: if a mitarbeiter requests this site, empty data should be returned + if(count($student) == 0) + { + return new stdClass(); + } $student = current(getData($student)); $studiengang_kz = $student->studiengang_kz; $semester = $student->semester; diff --git a/public/js/components/Cis/Cms/News.js b/public/js/components/Cis/Cms/News.js index 8e8c080f7..fc8df69b1 100644 --- a/public/js/components/Cis/Cms/News.js +++ b/public/js/components/Cis/Cms/News.js @@ -1,8 +1,10 @@ import Pagination from "../../Pagination/Pagination.js"; +import StudiengangInformation from "./StudiengangInformation/StudiengangInformation.js"; export default { components: { Pagination, + StudiengangInformation, }, data() { return { @@ -39,6 +41,14 @@ export default {
-
+
+
+
+
+
+ +
+
+
`, }; diff --git a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js index 6fae52f1d..ddc8cab93 100644 --- a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js +++ b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js @@ -18,14 +18,32 @@ components:{ StudiengangPerson }, template:/*html*/` + +
+ + + + `, computed:{ collection_array: function(){ @@ -48,6 +66,10 @@ computed:{ }, }, methods:{ + vertretungFormatedName: function(vertretung,bezeichnung=true){ + if(!vertretung) return null; + return `${vertretung.vorname ?? ''} ${vertretung.nachname ?? ''} ${vertretung.bezeichnung && bezeichnung ? '('.concat(vertretung.bezeichnung.replace("(","").replace(")","")).concat(")") : ''}` + }, studiengangs_person_data: function (collection) { // early return if the reactive data is not yet loaded or not present if (!collection || !Array.isArray(collection) || collection.length === 0) @@ -110,6 +132,7 @@ mounted(){ .then(res => res.data) .then(studiengangInformationen => { Object.assign(this, studiengangInformationen); + console.log(studiengangInformationen,"das sind die Informationen") }); }, diff --git a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js index 848b31256..294f41cdf 100644 --- a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js +++ b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js @@ -25,7 +25,7 @@ export default { person_dataFoto
-
{{person_data.fullname}}
+
{{person_data.fullname}}