mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
adds LvMenu to the CalendarModel WIP
This commit is contained in:
@@ -32,6 +32,7 @@ class Stundenplan extends FHCAPI_Controller
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'Reservierungen' => self::PERM_LOGGED,
|
||||
'getStundenplan' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
@@ -154,6 +155,14 @@ class Stundenplan extends FHCAPI_Controller
|
||||
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
$result = current($this->getDataOrTerminateWithError($result))->studiensemester_kurzbz;
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
private function expand_object_information($data){
|
||||
foreach ($data as $item) {
|
||||
|
||||
|
||||
@@ -149,8 +149,9 @@ class Stundenplan_model extends DB_Model
|
||||
array_agg(DISTINCT lektor) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
string_agg(DISTINCT ort_kurzbz, '/') as ort_kurzbz,
|
||||
array_agg(DISTINCT lehreinheit_id) as lehreinheit_id,
|
||||
|
||||
titel, lehrfach, lehrform, lehrfach_bez, organisationseinheit, farbe
|
||||
titel, lehrfach, lehrform, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
FROM
|
||||
(
|
||||
@@ -177,7 +178,7 @@ class Stundenplan_model extends DB_Model
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
ORDER BY datum, beginn
|
||||
");
|
||||
|
||||
@@ -30,4 +30,10 @@ export default {
|
||||
{ start_date, end_date }
|
||||
);
|
||||
},
|
||||
getLehreinheitStudiensemester(lehreinheit_id) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Stundenplan/getLehreinheitStudiensemester/${lehreinheit_id}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -29,13 +29,11 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
data:this.event,
|
||||
|
||||
menu: [],
|
||||
result: false,
|
||||
info: null,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
computed: {
|
||||
start_time: function(){
|
||||
if(!this.data.start) return 'N/A';
|
||||
@@ -46,6 +44,27 @@ export default {
|
||||
return this.data.end.getHours() + ":" + this.data.end.getMinutes();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onModalShow: function(){
|
||||
console.log(this.event)
|
||||
if (this.event.type == 'lehreinheit') {
|
||||
this.$fhcApi.factory.stundenplan.getLehreinheitStudiensemester(this.event.lehreinheit_id[0]).then(
|
||||
res=>res.data
|
||||
).then(
|
||||
studiensemester_kurzbz =>{
|
||||
this.$fhcApi.factory.addons.getLvMenu(this.data.lehrveranstaltung_id, studiensemester_kurzbz).then(res => {
|
||||
//this.$fhcApi.factory.addons.getLvMenu(750, "WS2005").then(res =>{
|
||||
if (res.data) {
|
||||
this.menu = res.data;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.modal = this.$refs.modalContainer.modal;
|
||||
},
|
||||
@@ -53,31 +72,39 @@ export default {
|
||||
return BsModal.popup.bind(this)(null, options);
|
||||
},
|
||||
template: /*html*/ `
|
||||
<bs-modal ref="modalContainer" v-bind="$props" body-class="" dialog-class="modal-lg" class="bootstrap-alert" backdrop="false" >
|
||||
<bs-modal ref="modalContainer" @showBsModal="onModalShow" v-bind="$props" body-class="" dialog-class="modal-lg" class="bootstrap-alert" backdrop="false" >
|
||||
<template v-slot:title>
|
||||
<template v-if="data.titel">{{ data.titel + ' - ' + data.lehrfach_bez + ' [' + data.ort_kurzbz+']'}}</template>
|
||||
<template v-if="data.titel">{{ data.titel + ' - ' + data.lehrfach_bez + ' [' + data.ort_kurzbz+']'}}</template>
|
||||
<template v-else>{{ data.lehrfach_bez + ' [' + data.ort_kurzbz+']'}}</template>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="row">
|
||||
<div class="offset-3 col-4"><span>Datum:</span></div>
|
||||
<div class=" col"><span>{{data.datum}}</span></div>
|
||||
<div class="offset-3 col-4"><span>Datum:</span></div>
|
||||
<div class=" col"><span>{{data.datum}}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="offset-3 col-4"><span>Raum:</span></div>
|
||||
<div class=" col"><span>{{data.ort_kurzbz}}</span></div>
|
||||
<div class="offset-3 col-4"><span>Raum:</span></div>
|
||||
<div class=" col"><span>{{data.ort_kurzbz}}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="offset-3 col-4"><span>LV:</span></div>
|
||||
<div class=" col"><span>{{'('+data.lehrform+') ' + data.lehrfach_bez}}</span></div>
|
||||
<div class="offset-3 col-4"><span>LV:</span></div>
|
||||
<div class=" col"><span>{{'('+data.lehrform+') ' + data.lehrfach_bez}}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="offset-3 col-4"><span>Lektor:</span></div>
|
||||
<div class=" col"><span>{{data.lektor.map(lektor=>lektor.kurzbz).join("/")}}</span></div>
|
||||
<div class="offset-3 col-4"><span>Lektor:</span></div>
|
||||
<div class=" col"><span>{{data.lektor.map(lektor=>lektor.kurzbz).join("/")}}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="offset-3 col-4"><span>Zeitraum:</span></div>
|
||||
<div class=" col"><span>{{start_time + ' - ' + end_time}}</span></div>
|
||||
<div class="offset-3 col-4"><span>Zeitraum:</span></div>
|
||||
<div class=" col"><span>{{start_time + ' - ' + end_time}}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class=" col"><h2>LvMenu:</h2></div>
|
||||
</div>
|
||||
<div v-for="menuPunkt in menu" class="row">
|
||||
<div class="col">
|
||||
<a target="_blank" :href="menuPunkt.c4_link">{{menuPunkt.name}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user