adds the roomInformation Calendar to the menu and uses different template for the calendar page slot

This commit is contained in:
SimonGschnell
2024-05-31 12:28:06 +02:00
parent b9bd8e1d4d
commit 39321dcde3
5 changed files with 23 additions and 7 deletions
@@ -74,6 +74,7 @@ class Stundenplan extends Auth_Controller
$result = $this->StundenplanModel->getRoomDataOnDay('EDV_A2.06','2024-05-21');
$result = hasData($result) ? getData($result) : [];
//echo($this->db->last_query());
echo json_encode($result);
@@ -165,6 +165,15 @@ class Content_model extends DB_Model
"menu_open": false,
"aktiv": true,
"childs": []
},
{
"content_id": 1000008,
"template_kurzbz": "redirect",
"titel": "room information (to delete)",
"content": "<content><url><![CDATA[' . site_url('/CisVue/Cms/getRoomInformation') . ']]></url><target><![CDATA[]]></target></content>",
"menu_open": false,
"aktiv": true,
"childs": []
}
]
@@ -21,7 +21,7 @@ class Stundenplan_model extends DB_Model
public function getRoomDataOnDay($ort_kurzbz,$date){
$this->addSelect(['*',"CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/')) as eintrag","lektor","CONCAT(lehrfach,'-',lehrform)"]);
$this->addSelect(['*',"CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/')) as stg","lektor","CONCAT(lehrfach,'-',lehrform) as lv_info" ]);
/* $this->addSelect(["lehre.tbl_stundenplan.*","CONCAT(UPPER(sg.typ),UPPER(sg.kurzbz),'-',lehre.tbl_stundenplan.semester,lehre.tbl_stundenplan.verband) as simml"]);
$this->addJoin("public.tbl_lehrverband as lv","lv.studiengang_kz=lehre.tbl_stundenplan.studiengang_kz AND lv.gruppe=lehre.tbl_stundenplan.gruppe AND lv.verband=lehre.tbl_stundenplan.verband AND lv.semester=lehre.tbl_stundenplan.semester","LEFT");
$this->addJoin("public.tbl_studiengang as sg","sg.studiengang_kz=lehre.tbl_stundenplan.studiengang_kz","LEFT");
@@ -29,7 +29,7 @@ class Stundenplan_model extends DB_Model
$res = hasData($res) ? getData($res): null;
return $res; */
$this->db->where('ort_kurzbz','EDV_A2.06',true);
$this->db->where('datum','2024-05-21',true);
$this->db->where('datum >=','2024-05-21',true);
$query = $this->db->get_compiled_select('lehre.vw_stundenplan sp');
+10 -4
View File
@@ -37,12 +37,12 @@ const app = Vue.createApp({
});
events = res.data;
//console.log("this are the room events",events)
//this.events = events;
this.events = events;
}
}).catch((e)=>{console.log(e,"this is the exception")})
});
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Cis/Stundenplan').then(res => {
/* axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Cis/Stundenplan').then(res => {
let events;
console.log(" this is the res of the api call stundenplan",res);
@@ -65,7 +65,7 @@ const app = Vue.createApp({
}).catch((e)=>{console.log(e,"this is the exception")})
*/
@@ -73,7 +73,13 @@ const app = Vue.createApp({
template: /*html*/`
<div>
<!--initialDate="2023-5-12"-->
<fhc-calendar :initialDate="testDate" :events="events" initial-mode="week" show-weeks></fhc-calendar>
<fhc-calendar v-slot="{event}" :initialDate="testDate" :events="events" initial-mode="week" show-weeks>
<div class="d-flex flex-column align-items-center justify-content-evenly h-100">
<span>{{event.orig.lv_info}}</span>
<span>{{event.orig.stg}}</span>
<span>{{event.orig.lektor}}</span>
</div>
</fhc-calendar>
</div>
`,
});
+1 -1
View File
@@ -112,7 +112,7 @@ export default {
<div v-for="hour in hours" style="min-height:100px" :key="hour" class="text-muted text-end small" :ref="'hour' + hour">{{hour}}:00</div>
</div>
<div v-for="day in eventsPerDayAndHour" :key="day" class="day border-start" :style="{'grid-template-columns': 'repeat(' + day.lanes + ', 1fr)', 'grid-template-rows': 'repeat(' + (1440 / smallestTimeFrame) + ', 1fr)'}">
<a href="#" :title="event.orig.title + ' - ' + event.orig.lehrfach_bez + ' [' + event.orig.ort_kurzbz+']'" v-for="event in day.events" :key="event" class="mx-2 border border-dark border-2 small rounded overflow-hidden text-decoration-none text-dark" :style="{'grid-column-start': 1+(event.lane-1)*day.lanes/event.maxLane, 'grid-column-end': 1+event.lane*day.lanes/event.maxLane, 'grid-row-start': dateToMinutesOfDay(event.start), 'grid-row-end': dateToMinutesOfDay(event.end), 'background': event.orig.farbe?event.orig.farbe:'white' ,'--test': dateToMinutesOfDay(event.end)}" @click.prevent="$emit('input', event.orig)">
<a href="#" :title="event.orig.title + ' - ' + event.orig.lehrfach_bez + ' [' + event.orig.ort_kurzbz+']'" v-for="event in day.events" :key="event" class="mx-2 border border-dark border-2 small rounded overflow-hidden text-decoration-none text-dark" :style="{'background-color': event.orig.farbe?'#'.concat(event.orig.farbe):'white','grid-column-start': 1+(event.lane-1)*day.lanes/event.maxLane, 'grid-column-end': 1+event.lane*day.lanes/event.maxLane, 'grid-row-start': dateToMinutesOfDay(event.start), 'grid-row-end': dateToMinutesOfDay(event.end) ,'--test': dateToMinutesOfDay(event.end)}" @click.prevent="$emit('input', event.orig)">
<slot :event="event" />
</a>
</div>