mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
only adds the Events file from addons which are actually active and refactors the Lv Information into its own component
This commit is contained in:
@@ -13,7 +13,8 @@ class MyLv extends Auth_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['student/anrechnung_beantragen:r','user:r'] // TODO(chris): permissions?
|
||||
'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Info' => ['student/anrechnung_beantragen:r','user:r'] // TODO(chris): permissions?
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -27,4 +28,9 @@ class MyLv extends Auth_Controller
|
||||
{
|
||||
$this->load->view('Cis/MyLv');
|
||||
}
|
||||
|
||||
public function Info($studien_semester,$lvid)
|
||||
{
|
||||
$this->load->view('Cis/LvInfo',['lvid'=> $lvid, 'studien_semester' => $studien_semester]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +47,19 @@ class CI3_Events
|
||||
*/
|
||||
require_once(APPPATH.'config/Events.php');
|
||||
|
||||
$active_addons_array = explode(";", ACTIVE_ADDONS);
|
||||
|
||||
foreach (scandir(APPPATH.'config/extensions') as $dir)
|
||||
if ($dir[0] != '.' && file_exists(APPPATH.'config/extensions/'.$dir.'/Events.php'))
|
||||
require_once APPPATH.'config/extensions/'.$dir.'/Events.php';
|
||||
|
||||
foreach (scandir(FHCPATH.'addons') as $dir)
|
||||
if ($dir[0] != '.' && file_exists(FHCPATH.'addons/'.$dir.'/Events.php'))
|
||||
require_once FHCPATH.'addons/'.$dir.'/Events.php';
|
||||
{
|
||||
// only includes the Events of the addon if the addon is one of the active addons in the cis config
|
||||
if(in_array($dir,$active_addons_array))
|
||||
{
|
||||
require_once FHCPATH . 'addons/' . $dir . '/Events.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'LvInfo',
|
||||
'customJSModules' => ['public/js/apps/Cis/LvInfo.js']
|
||||
);
|
||||
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<Info studien_semester="<?= $studien_semester ?>" lehrveranstaltung_id="<?= $lvid ?>"></Info>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/CISVUE-Footer', $includesArray); ?>
|
||||
@@ -0,0 +1,8 @@
|
||||
import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js";
|
||||
import Phrasen from "../../plugin/Phrasen.js";
|
||||
|
||||
Vue.createApp({
|
||||
components: {
|
||||
Info
|
||||
}
|
||||
}).use(Phrasen, { reload: true }).mount('#content');
|
||||
@@ -1,19 +1,10 @@
|
||||
import BsModal from '../../../../../Bootstrap/Modal.js';
|
||||
import Phrasen from '../../../../../../mixins/Phrasen.js';
|
||||
import LvMenu from '../../../LvMenu.js';
|
||||
|
||||
|
||||
const infos = {};
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BsModal,
|
||||
LvMenu
|
||||
},
|
||||
mixins: [
|
||||
BsModal,
|
||||
Phrasen
|
||||
],
|
||||
props: {
|
||||
|
||||
lehrveranstaltung_id: Number,
|
||||
bezeichnung: String,
|
||||
studiengang_kuerzel: String,
|
||||
@@ -38,8 +29,6 @@ export default {
|
||||
data: () => ({
|
||||
result: true,
|
||||
info: null,
|
||||
isMenuSelected: false,
|
||||
menu: [],
|
||||
}),
|
||||
computed: {
|
||||
lektorNames() {
|
||||
@@ -80,58 +69,40 @@ export default {
|
||||
}).catch(() => this.info = {});
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onModelHide() {
|
||||
this.isMenuSelected = false;
|
||||
},
|
||||
onModalShow() {
|
||||
this.$fhcApi.factory.addons.getLvMenu(this.lehrveranstaltung_id, this.studien_semester)
|
||||
.then(res => {
|
||||
this.menu = res.data;
|
||||
})
|
||||
.catch((error) => this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.modal = this.$refs.modalContainer.modal;
|
||||
},
|
||||
popup(options) {
|
||||
return BsModal.popup.bind(this)(null, options);
|
||||
},
|
||||
template: /*html*/`
|
||||
<bs-modal ref="modalContainer" @hideBsModal="onModelHide" @showBsModal="onModalShow" class="bootstrap-alert" v-bind="$props" body-class="" :dialogClass="{'modal-lg': !isMenuSelected, 'modal-fullscreen':isMenuSelected}">
|
||||
<template v-slot:title>
|
||||
{{p.t('lvinfo/lehrveranstaltungsinformationen')}}
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<template v-if="!isMenuSelected">
|
||||
|
||||
<!-- debugging print
|
||||
<p>{{JSON.stringify(info,null,2)}}</p>
|
||||
-->
|
||||
<h1>{{$p.t('lvinfo/lehrveranstaltungsinformationen')}}</h1>
|
||||
<hr>
|
||||
<div v-if="!info" class="text-center">
|
||||
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
|
||||
</div>
|
||||
<table v-else class="table table-hover mb-4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/lehrveranstaltung')}}</th>
|
||||
<th>{{$p.t('lehre/lehrveranstaltung')}}</th>
|
||||
<td>{{bezeichnung}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/studiengang')}}</th>
|
||||
<th>{{$p.t('lehre/studiengang')}}</th>
|
||||
<td>{{studiengang_kuerzel}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/semester')}}</th>
|
||||
<th>{{$p.t('lehre/semester')}}</th>
|
||||
<td>{{semester}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/studiensemester')}}</th>
|
||||
<th>{{$p.t('lehre/studiensemester')}}</th>
|
||||
<td>{{studien_semester}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/organisationsform')}}</th>
|
||||
<th>{{$p.t('lehre/organisationsform')}}</th>
|
||||
<td>{{orgform_kurzbz}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/lehrbeauftragter')}}</th>
|
||||
<th>{{$p.t('lehre/lehrbeauftragter')}}</th>
|
||||
<td>
|
||||
<ul v-if="lektorNames.length" class="list-unstyled mb-0">
|
||||
<li v-for="name in lektorNames" :key="name">
|
||||
@@ -140,12 +111,12 @@ export default {
|
||||
</li>
|
||||
</ul>
|
||||
<template v-else>
|
||||
{{p.t('lehre/keinLektorZugeordnet')}}
|
||||
{{$p.t('lehre/keinLektorZugeordnet')}}
|
||||
</template>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="lvLeitung">
|
||||
<th>{{p.t('lehre/lvleitung')}}</th>
|
||||
<th>{{$p.t('lehre/lvleitung')}}</th>
|
||||
<td>
|
||||
<ul class="list-unstyled mb-0">
|
||||
<li v-for="name in lvLeitung" :key="name">
|
||||
@@ -156,37 +127,36 @@ export default {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('global/sprache')}}</th>
|
||||
<th>{{$p.t('global/sprache')}}</th>
|
||||
<td>{{sprache}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/ects')}}</th>
|
||||
<th>{{$p.t('lehre/ects')}}</th>
|
||||
<td>{{ects}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/incomingplaetze')}}</th>
|
||||
<th>{{$p.t('lehre/incomingplaetze')}}</th>
|
||||
<td>{{incoming}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{p.t('lehre/organisationseinheit')}}</th>
|
||||
<th>{{$p.t('lehre/organisationseinheit')}}</th>
|
||||
<td>
|
||||
{{oe}} <br>
|
||||
(
|
||||
<i>{{p.t('global/leitung')}}: </i>{{oeLeitung.join(', ')}}
|
||||
<i>{{$p.t('global/leitung')}}: </i>{{oeLeitung.join(', ')}}
|
||||
<template v-if="koordinator">
|
||||
<i>{{p.t('global/koordination')}}: </i>{{koordinator.join(', ')}}
|
||||
<i>{{$p.t('global/koordination')}}: </i>{{koordinator.join(', ')}}
|
||||
</template>
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
<lv-menu v-model:isMenuSelected="isMenuSelected" :menu="menu"></lv-menu>
|
||||
<template v-if="!isMenuSelected">
|
||||
|
||||
|
||||
<div v-if="info && info.lvinfo">
|
||||
<div v-if="Object.keys(info.lvinfo).length > 1" class="text-end">
|
||||
<div class="btn-group" role="group" :title="p.t('global/verfuegbareSprachen')" :aria-label="p.t('global/verfuegbareSprachen')">
|
||||
<div class="btn-group" role="group" :title="$p.t('global/verfuegbareSprachen')" :aria-label="$p.t('global/verfuegbareSprachen')">
|
||||
<template v-for="lang in info.sprachen" :key="lang.index">
|
||||
<button v-if="info.lvinfo[lang.sprache]" type="button" class="btn btn-outline-primary" :class="lang.sprache == currentLang ? 'active' : ''" @click.prevent="info.lastLang = lang.sprache">{{lang.bezeichnung[lang.index-1]}}</button>
|
||||
</template>
|
||||
@@ -202,8 +172,5 @@ export default {
|
||||
{{i.body}}
|
||||
</p>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</bs-modal>`
|
||||
</div>`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user