mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 07:52:16 +00:00
Merge branch 'feature-25999/C4_cleanup' into feature-25999/C4_CMS_content_router
# Conflicts: # public/js/components/Cis/Cms/News.js
This commit is contained in:
@@ -30,6 +30,7 @@ class Lehre extends FHCAPI_Controller
|
||||
parent::__construct([
|
||||
'lvStudentenMail' => self::PERM_LOGGED,
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
@@ -76,6 +77,23 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all Pruefungen of a student for a specific lehrveranstaltung
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* @param mixed $lehrveranstaltung_id
|
||||
* @return void
|
||||
*/
|
||||
public function Pruefungen($lehrveranstaltung_id)
|
||||
{
|
||||
$this->load->model('education/Pruefung_model', 'PruefungModel');
|
||||
|
||||
$result = $this->PruefungModel->getByStudentAndLv(getAuthUID(), $lehrveranstaltung_id, getUserLanguage());
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,11 +73,22 @@ class Phrasen extends FHCAPI_Controller
|
||||
// gets all languages that are set as active in the database
|
||||
public function getAllLanguages()
|
||||
{
|
||||
$langs = getDBActiveLanguages();
|
||||
$this->load->model('system/Sprache_model', 'SprachenModel');
|
||||
|
||||
// Add order clause by index and select the sprache,bezeichnung and index column
|
||||
$this->SprachenModel->addOrder('index');
|
||||
$this->SprachenModel->addSelect('sprache, bezeichnung, index');
|
||||
|
||||
// Retrieves from public.tbl_sprache
|
||||
$langs = $this->SprachenModel->loadWhere(array('content' => true));
|
||||
$langs = $this->getDataOrTerminateWithError($langs);
|
||||
$langs = array_map(function($lang){
|
||||
return $lang->sprache;
|
||||
$data = new stdClass();
|
||||
$data->sprache = $lang->sprache;
|
||||
$data->bezeichnung = $lang->bezeichnung[($lang->index-1)];
|
||||
return $data;
|
||||
}, $langs);
|
||||
|
||||
$this->terminateWithSuccess($langs);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,4 +13,10 @@ export default {
|
||||
, {}
|
||||
);
|
||||
},
|
||||
getStudentPruefungen(lehrveranstaltung_id){
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Lehre/Pruefungen/${lehrveranstaltung_id}`
|
||||
, {}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,43 +3,44 @@ import StudiengangInformation from "./StudiengangInformation/StudiengangInformat
|
||||
|
||||
export default {
|
||||
name: "NewsComponent",
|
||||
components: {
|
||||
Pagination,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: null,
|
||||
maxPageCount: 0,
|
||||
page_size: 10,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
loadNewPageContent: function (data) {
|
||||
this.$fhcApi.factory.cms.getNews(data.page, data.rows)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
components: {
|
||||
Pagination,
|
||||
StudiengangInformation,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: null,
|
||||
maxPageCount: 0,
|
||||
page_size: 10,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
loadNewPageContent: function (data) {
|
||||
this.$fhcApi.factory.cms.getNews(data.page, data.rows)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms.getNews(1, this.page_size)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms.getNews(1, this.page_size)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
|
||||
this.$fhcApi.factory.cms.getNewsRowCount()
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.maxPageCount = result;
|
||||
});
|
||||
},
|
||||
template: /*html*/ `
|
||||
this.$fhcApi.factory.cms.getNewsRowCount()
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.maxPageCount = result;
|
||||
});
|
||||
},
|
||||
template: /*html*/ `
|
||||
<h2 >News</h2>
|
||||
<hr/>
|
||||
<pagination :page_size="page_size" @page="loadNewPageContent" :maxPageCount="maxPageCount">
|
||||
<pagination v-show="content?true:false" :page_size="page_size" @page="loadNewPageContent" :maxPageCount="maxPageCount">
|
||||
</pagination>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@@ -52,5 +53,7 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<pagination v-show="content?true:false" :page_size="page_size" @page="loadNewPageContent" :maxPageCount="maxPageCount">
|
||||
</pagination>
|
||||
`,
|
||||
};
|
||||
|
||||
@@ -26,15 +26,20 @@ components:{
|
||||
StudiengangVertretung,
|
||||
},
|
||||
template:/*html*/`
|
||||
|
||||
<template v-if="studiengang?.bezeichnung && semester">
|
||||
<div class="card card-body mb-3">
|
||||
<div class="mb-3">
|
||||
<h2 >Studiengang:</h2>
|
||||
{{studiengang.bezeichnung}}
|
||||
<div class="mb-1">
|
||||
<h2 class="mb-1 pb-0">Studiengang:</h2>
|
||||
<span class="mb-1">{{studiengang.bezeichnung}}</span>
|
||||
</div>
|
||||
<div :class="{'mb-3':studiengang?.zusatzinfo_html}">
|
||||
<h2 >Semester: </h2>
|
||||
{{semester}}
|
||||
<div class="mb-1">
|
||||
<h2 class="mb-1 pb-0">Moodle:</h2>
|
||||
<a class="mb-1" target="_blank" :href="moodleLink">{{studiengang.kurzbzlang}}</a>
|
||||
</div>
|
||||
<div :class="{'mb-1':studiengang?.zusatzinfo_html}">
|
||||
<h2 class="mb-1 pb-0">Semester: </h2>
|
||||
<span class="mb-1">{{semester}}</span>
|
||||
</div>
|
||||
<div v-if="studiengang?.zusatzinfo_html" v-html="studiengang?.zusatzinfo_html"></div>
|
||||
</div>
|
||||
@@ -96,6 +101,12 @@ computed:{
|
||||
|
||||
return returnData;
|
||||
},
|
||||
moodleLink: function(){
|
||||
// early return if the studiengang information is not available
|
||||
if(!this.studiengang || !this.studiengang.studiengang_kz) return;
|
||||
|
||||
return `https://moodle.technikum-wien.at/course/view.php?idnumber=dl` + this.studiengang.studiengang_kz;
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
this.$fhcApi.factory.studiengang.studiengangInformation()
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
pruefungen: null,
|
||||
pruefungenData: null,
|
||||
info: null,
|
||||
menu: null,
|
||||
preselectedMenuItem: null,
|
||||
@@ -47,7 +47,10 @@ export default {
|
||||
},
|
||||
grade() {
|
||||
return this.benotung ? this.znote || this.lvnote || null : null;
|
||||
}
|
||||
},
|
||||
LvHasPruefungenInformation(){
|
||||
return this.pruefungenData && this.pruefungenData.length > 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
c4_link(menuItem) {
|
||||
@@ -72,13 +75,13 @@ export default {
|
||||
}
|
||||
},
|
||||
openPruefungen() {
|
||||
if (!this.pruefungen) {
|
||||
this.pruefungen = true;
|
||||
LvPruefungen.popup({
|
||||
lehrveranstaltung_id: this.lehrveranstaltung_id,
|
||||
bezeichnung: this.bezeichnung
|
||||
}).then(() => this.pruefungen = false).catch(() => this.pruefungen = false);
|
||||
}
|
||||
// early return if the pruefungenData is empty or not set
|
||||
if (!this.LvHasPruefungenInformation) return;
|
||||
|
||||
LvPruefungen.popup({
|
||||
pruefungenData: this.pruefungenData,
|
||||
bezeichnung: this.bezeichnung
|
||||
});
|
||||
},
|
||||
openInfos() {
|
||||
if (!this.info) {
|
||||
@@ -107,6 +110,14 @@ export default {
|
||||
.catch((error) => this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$fhcApi.factory.lehre.getStudentPruefungen(this.lehrveranstaltung_id)
|
||||
.then(res => res.data)
|
||||
.then(pruefungen =>{
|
||||
this.pruefungenData = pruefungen;
|
||||
});
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$fhcApi.factory.addons.getLvMenu(this.lehrveranstaltung_id, this.studien_semester)
|
||||
.then(res => {
|
||||
@@ -130,8 +141,8 @@ export default {
|
||||
<h6 class="card-title">{{bezeichnung}}</h6>
|
||||
</div>
|
||||
<div class="card-body " :style="bodyStyle">
|
||||
<ul class="list-group border-top-0 border-bottom-0 rounded-0">
|
||||
<template v-if="menu">
|
||||
<template v-if="menu">
|
||||
<ul class="list-group border-top-0 border-bottom-0 rounded-0">
|
||||
<li :type="menuItem.c4_link ? 'button' : null" v-for="menuItem in menu" class="list-group-item border-0 " >
|
||||
<div class="d-flex flex-row" :data-bs-toggle="menuItem.c4_moodle_links?.length ? 'dropdown' : null">
|
||||
<div class="mx-4">
|
||||
@@ -145,25 +156,28 @@ export default {
|
||||
<li v-for="item in menuItem.c4_moodle_links"><a class="dropdown-item border-bottom" :href="item.url">{{item.lehrform}}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li class="text-center"><i class="fa-solid fa-spinner fa-pulse fa-3x"></i></li>
|
||||
</template>
|
||||
</ul>
|
||||
</ul>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="text-center d-flex justify-content-center align-items-center h-100" >
|
||||
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<a href="#" class="col-auto text-start text-decoration-none" @click.prevent="openPruefungen">
|
||||
<i class="fa fa-check text-success" v-if="positiv"></i>
|
||||
{{ grade || p.t('lehre/noGrades') }}
|
||||
</a>
|
||||
<!--
|
||||
Not used anymore because the lehrveranstaltungs informationen is available as a menu point in the lehrveranstaltungs optionen
|
||||
<div v-if="lvinfo" class="col text-end">
|
||||
<a class="card-link" href="#" @click.prevent="openInfos">
|
||||
<i class="fa fa-info-circle" aria-hidden="true"></i>
|
||||
<template v-if="LvHasPruefungenInformation">
|
||||
<a href="#" class="col-auto text-start text-decoration-none" @click.prevent="openPruefungen">
|
||||
<i class="fa fa-check text-success" v-if="positiv"></i>
|
||||
{{ grade || p.t('lehre/noGrades') }}
|
||||
</a>
|
||||
</div>-->
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="col-auto text-start text-decoration-none" >
|
||||
<i class="fa fa-check text-success" v-if="positiv"></i>
|
||||
{{ grade || p.t('lehre/noGrades') }}
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
@@ -10,7 +10,7 @@ export default {
|
||||
BsModal
|
||||
],
|
||||
props: {
|
||||
lehrveranstaltung_id: Number,
|
||||
pruefungenData: Array|null,
|
||||
bezeichnung: String,
|
||||
/*
|
||||
* NOTE(chris):
|
||||
@@ -26,16 +26,7 @@ export default {
|
||||
},
|
||||
data: () => ({
|
||||
result: true,
|
||||
pruefungen: null
|
||||
}),
|
||||
created() {
|
||||
if (pruefungen[this.lehrveranstaltung_id])
|
||||
this.pruefungen = pruefungen[this.lehrveranstaltung_id];
|
||||
else
|
||||
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Cis/Mylv/Pruefungen/' + this.lehrveranstaltung_id).then(res => {
|
||||
this.pruefungen = pruefungen[this.lehrveranstaltung_id] = res.data.retval || [];
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.modal = this.$refs.modalContainer.modal;
|
||||
},
|
||||
@@ -47,10 +38,10 @@ export default {
|
||||
Prüfungen: {{bezeichnung}}
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div v-if="!pruefungen" class="text-center">
|
||||
<div v-if="!pruefungenData" class="text-center">
|
||||
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
|
||||
</div>
|
||||
<p v-else-if="!pruefungen.length" class="alert alert-info mb-0">
|
||||
<p v-else-if="!pruefungenData.length" class="alert alert-info mb-0">
|
||||
Keine Prüfungen vorhanden!
|
||||
</p>
|
||||
<table v-else class="table table-hover">
|
||||
@@ -60,7 +51,7 @@ export default {
|
||||
<td class="text-end">Note</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="pruefung in pruefungen" :key="pruefung.pruefung_id">
|
||||
<tr v-for="pruefung in pruefungenData" :key="pruefung.pruefung_id">
|
||||
<th>{{pruefung.pruefungstyp_kurzbz}}</th>
|
||||
<td>{{pruefung.datum}}</td>
|
||||
<td class="text-end">{{pruefung.note}}</td>
|
||||
|
||||
@@ -2,6 +2,7 @@ export default {
|
||||
data(){
|
||||
return {
|
||||
allActiveLanguages: null,
|
||||
sprachenTranslation:null,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
@@ -11,20 +12,25 @@ export default {
|
||||
this.$p.setLanguage(lang, this.$fhcApi);
|
||||
}
|
||||
},
|
||||
getSprachenBezeichnung: function(lang){
|
||||
if (!Array.isArray(this.sprachenTranslation) || this.sprachenTranslation.length == 0) return;
|
||||
return this.sprachenTranslation.find(s=>s.sprache == lang)?.bezeichnung;
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
this.$fhcApi.factory.phrasen.getActiveDbLanguages()
|
||||
.then(res => res.data)
|
||||
.then(
|
||||
(langs) => {
|
||||
this.allActiveLanguages = langs;
|
||||
this.allActiveLanguages = langs.map(l=>l.sprache);
|
||||
this.sprachenTranslation = langs;
|
||||
}
|
||||
);
|
||||
},
|
||||
template:/*html*/`
|
||||
<div class="container">
|
||||
<div class="row justify-content-center align-items-center flex-nowrap overflow-hidden">
|
||||
<button v-for="lang in allActiveLanguages" @click.prevent="changeLanguage(lang)" class="col text-white fhc-entry btn text-center w-100" :selected="$p.user_language.value==lang?'':null">{{lang}}</button>
|
||||
<button v-for="lang in allActiveLanguages" @click.prevent="changeLanguage(lang)" class="col text-white fhc-entry btn text-center w-100" :selected="$p.user_language.value==lang?'':null">{{getSprachenBezeichnung(lang)}}</button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
|
||||
Reference in New Issue
Block a user