mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'feature-25999/C4_cleanup' into merge_FHC4_C4
This commit is contained in:
@@ -83,13 +83,13 @@ class Cms extends Auth_Controller
|
||||
*/
|
||||
public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true)
|
||||
{
|
||||
// TODO: what are those parameters and what are they used for?
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'News']);
|
||||
// $this->load->view('CisVue/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]);
|
||||
}
|
||||
|
||||
|
||||
public function getRoomInformation($ort_kurzbz){
|
||||
$this->load->view('CisVue/Cms/RoomInformation',['ort_kurzbz'=>$ort_kurzbz]);
|
||||
$viewData = array(
|
||||
'ort_kurzbz' => $ort_kurzbz
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'CmsRoom']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class Stundenplan extends FHCAPI_Controller
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
//TODO: getStundenplan fuer Mitarbeiter anpassen
|
||||
|
||||
public function getStundenplan(){
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model','MitarbeiterModel');
|
||||
@@ -160,27 +160,34 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$is_mitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter($student_uid));
|
||||
if($is_mitarbeiter)
|
||||
{
|
||||
$this->terminateWithError("Not possible to look at the Student Calendar as a Mitarbeiter");
|
||||
|
||||
$stundenplan_data = $this->StundenplanModel->getStundenplanMitarbeiter($start_date, $end_date, $student_uid);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
} else {
|
||||
// getting the gruppen_kurzbz of the student in the different studiensemester
|
||||
$benutzer_gruppen = $this->fetchBenutzerGruppenFromStudiensemester($semester_range);
|
||||
|
||||
// getting the student_lehrverbaende of the student in the different studiensemester
|
||||
$student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($semester_range);
|
||||
|
||||
$stundenplan_query = $this->StundenplanModel->getStundenplanQuery($start_date, $end_date, $semester_range, $benutzer_gruppen, $student_lehrverband);
|
||||
if(!$stundenplan_query)
|
||||
{
|
||||
$this->terminateWithSuccess([]);
|
||||
}
|
||||
$stundenplan_data = $this->StundenplanModel->stundenplanGruppierung($stundenplan_query);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
|
||||
$this->returnObj['$stundenplan_query'] = $stundenplan_query;
|
||||
$this->returnObj['$student_lehrverband'] = $student_lehrverband;
|
||||
$this->returnObj['$benutzer_gruppen'] = $benutzer_gruppen;
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
|
||||
// getting the gruppen_kurzbz of the student in the different studiensemester
|
||||
$benutzer_gruppen = $this->fetchBenutzerGruppenFromStudiensemester($semester_range);
|
||||
|
||||
// getting the student_lehrverbaende of the student in the different studiensemester
|
||||
$student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($semester_range);
|
||||
|
||||
$stundenplan_query = $this->StundenplanModel->getStundenplanQuery($start_date, $end_date, $semester_range, $benutzer_gruppen, $student_lehrverband);
|
||||
if(!$stundenplan_query)
|
||||
{
|
||||
$this->terminateWithSuccess([]);
|
||||
}
|
||||
$stundenplan_data = $this->StundenplanModel->stundenplanGruppierung($stundenplan_query);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
// gets the reservierungen of a room if the ort_kurzbz parameter is supplied otherwise gets the reservierungen of the stundenplan of a student
|
||||
@@ -193,19 +200,25 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$this->load->model('ressource/Mitarbeiter_model','MitarbeiterModel');
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
$reservierungen = $this->getDataOrTerminateWithError($reservierungen) ?? [];
|
||||
|
||||
$is_mitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
if($is_mitarbeiter)
|
||||
{
|
||||
$reservierungen = $this->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
|
||||
} else {
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
}
|
||||
|
||||
$reservierungen = $this->getDataOrTerminateWithError($reservierungen) ?? [];
|
||||
$this->expand_object_information($reservierungen);
|
||||
|
||||
$this->terminateWithSuccess($reservierungen);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
|
||||
@@ -71,6 +71,51 @@ class Reservierung_model extends DB_Model
|
||||
return $query_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $uid
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz = null)
|
||||
{
|
||||
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
CASE
|
||||
WHEN res.gruppe_kurzbz IS NOT NULL THEN res.gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(res.semester AS varchar),'/'),COALESCE(CAST(res.verband AS varchar),'/'))
|
||||
END as gruppen_kuerzel
|
||||
FROM campus.vw_reservierung res
|
||||
JOIN public.tbl_studiengang studg ON studg.studiengang_kz=res.studiengang_kz
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
|
||||
WHERE res.uid = ? AND datum >= ? AND datum <= ?";
|
||||
|
||||
// $subquery = is_null($ort_kurzbz)? $stundenplan_reservierungen_query:$raum_reservierungen_query;
|
||||
$subquery = $raum_reservierungen_query;
|
||||
|
||||
|
||||
$query_result= $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
'reservierung' as type, beginn, ende, datum,
|
||||
COALESCE(titel, beschreibung) as topic,
|
||||
array_agg(DISTINCT mitarbeiter_kurzbz) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
|
||||
ort_kurzbz, 'FFFFFF' as farbe
|
||||
|
||||
FROM
|
||||
(
|
||||
". $subquery ."
|
||||
) AS subquery
|
||||
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", [getAuthUID(), $start_date, $end_date]);
|
||||
|
||||
|
||||
return $query_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $uid
|
||||
*
|
||||
|
||||
@@ -232,7 +232,7 @@ class Stundenplan_model extends DB_Model
|
||||
AND sp.datum <= ? AND sp.lehrveranstaltung_id = ?
|
||||
) sp
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = sp.stunde
|
||||
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
@@ -240,6 +240,62 @@ class Stundenplan_model extends DB_Model
|
||||
ORDER BY datum, beginn
|
||||
", [$start_date, $end_date, $lv_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* queries Stundenplan and filters by assigned ma_kurzbz, very similar to get by LVA
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getStundenplanMitarbeiter($start_date, $end_date, $ma_uid) {
|
||||
return $this->execReadOnlyQuery("
|
||||
|
||||
SELECT
|
||||
'lehreinheit' as type, beginn, ende, datum,
|
||||
CONCAT(lehrfach,'-',lehrform) as topic,
|
||||
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, lehrveranstaltung_id
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT unr,datum,beginn, ende,
|
||||
CASE
|
||||
WHEN sp.mitarbeiter_kurzbz IS NOT NULL THEN sp.mitarbeiter_kurzbz
|
||||
ELSE sp.lektor
|
||||
END as lektor,
|
||||
CASE
|
||||
WHEN gruppe_kurzbz IS NOT NULL THEN gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/'))
|
||||
END as gruppen_kuerzel,
|
||||
(SELECT bezeichnung
|
||||
FROM public.tbl_organisationseinheit
|
||||
WHERE oe_kurzbz IN(
|
||||
SELECT oe_kurzbz
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
WHERE lehrveranstaltung_id = sp.lehrveranstaltung_id
|
||||
)) as organisationseinheit,
|
||||
sp.ort_kurzbz, sp.studiengang_kz, sp.titel,sp.lehreinheit_id,sp.lehrfach_id,sp.anmerkung,fix,lehrveranstaltung_id,stg_kurzbzlang,stg_bezeichnung,stg_typ,fachbereich_kurzbz,lehrfach,lehrfach_bez,farbe,lehrform,anmerkung_lehreinheit,gruppe, verband, semester,stg_kurzbz
|
||||
|
||||
FROM (
|
||||
SELECT sp.*
|
||||
FROM lehre.vw_stundenplan sp
|
||||
WHERE
|
||||
sp.datum >= ?
|
||||
AND sp.datum <= ?
|
||||
) sp
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = sp.stunde
|
||||
JOIN public.tbl_mitarbeiter ON public.tbl_mitarbeiter.kurzbz = sp.mitarbeiter_kurzbz
|
||||
WHERE mitarbeiter_uid = ?
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
ORDER BY datum, beginn", [$start_date, $end_date, $ma_uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* NO STANDALONE FUNCTION - Generates a SQL query string to fetch 'stundenplan' events for a specific student within the current semester.
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'customJSModules' => ['public/js/apps/Cis/Cms.js'],
|
||||
'primevue3'=>true,
|
||||
'customCSSs' => [
|
||||
'public/css/Cis4/Cms.css',
|
||||
#'skin/style.css.php'
|
||||
]
|
||||
);
|
||||
|
||||
// adds the tabulator5 dependency for all templates to replace the tablesorter
|
||||
$includesArray['tabulator5'] = true;
|
||||
|
||||
if(defined('CIS4')){
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
}else{
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
}
|
||||
?>
|
||||
|
||||
<div ref="cmsContainer" id="cms">
|
||||
<?php echo (isset($content_id) ? '<router-view ref="cms" :content_id="'.$content_id.'" :version="'.$version.'" :sprache="'.$sprache.'" :sichtbar="'.$sichtbar.'" />' : '<router-view ref="cms" />'); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (defined('CIS4')) {
|
||||
$this->load->view('templates/CISVUE-Footer', $includesArray);
|
||||
} else {
|
||||
$this->load->view('templates/FHC-Footer', $includesArray);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'RoomInformation',
|
||||
'customJSModules' => ['public/js/apps/Cis/RoomInformation.js'],
|
||||
'customCSSs' => ['public/css/components/calendar.css']
|
||||
);
|
||||
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div >
|
||||
<h2>Room Information: <?php echo $ort_kurzbz ?></h2>
|
||||
<hr>
|
||||
<div id="content">
|
||||
<room-information ort_kurzbz="<?php echo $ort_kurzbz ?>"></room-information>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/CISVUE-Footer', $includesArray); ?>
|
||||
@@ -34,4 +34,4 @@ $this->load->view('templates/FHC-Header', $includesArray);
|
||||
></cis-menu>
|
||||
</header>
|
||||
|
||||
<main id="cis-main" class="flex-grow-1 p-4">
|
||||
<main id="cis-main" class="flex-grow-1 p-4 pt-2">
|
||||
@@ -1,5 +1,6 @@
|
||||
:root{
|
||||
--fhc-calendar-pane-height: calc(100vh - 220px);
|
||||
--fhc-calendar-past: #F5E9D7
|
||||
}
|
||||
|
||||
.fhc-calendar-week-page-header {
|
||||
@@ -188,7 +189,7 @@
|
||||
|
||||
|
||||
.fhc-calendar-past {
|
||||
background-color:#F5E9D7;
|
||||
background-color: var(--fhc-calendar-past);
|
||||
border-color: #E8E8E8;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
//api function used for the news View that renders the html
|
||||
getNews(page = 1, page_size = 10, sprache) {
|
||||
return this.$fhcApi.get(
|
||||
@@ -22,7 +21,6 @@ export default {
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
//api function used for the widget component
|
||||
news(limit) {
|
||||
return this.$fhcApi.get(
|
||||
@@ -32,19 +30,16 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getNewsRowCount: function () {
|
||||
return this.$fhcApi.get(
|
||||
"/api/frontend/v1/Cms/getNewsRowCount",
|
||||
{}
|
||||
);
|
||||
},
|
||||
|
||||
getNewsExtra: function(){
|
||||
return this.$fhcApi.get(
|
||||
"/api/frontend/v1/Cms/getStudiengangInfoForNews",
|
||||
{}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import Phrasen from "../../plugin/Phrasen.js";
|
||||
import RoomInformation from "../../components/Cis/Mylv/RoomInformation.js";
|
||||
import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers";
|
||||
|
||||
const app = Vue.createApp({
|
||||
name: 'RoomInformationApp',
|
||||
components: {
|
||||
RoomInformation
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setScrollbarWidth();
|
||||
|
||||
app.use(Phrasen);
|
||||
app.mount('#content');
|
||||
@@ -9,6 +9,7 @@ import Profil from "../../components/Cis/Profil/Profil";
|
||||
import CmsNews from "../../components/Cis/Cms/News";
|
||||
import CmsContent from "../../components/Cis/Cms/Content";
|
||||
import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info";
|
||||
import RoomInformation from "../../components/Cis/Mylv/RoomInformation";
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
@@ -27,7 +28,12 @@ const router = VueRouter.createRouter({
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
|
||||
{
|
||||
path: `/CisVue/Cms/getRoomInformation/:ort_kurzbz`,
|
||||
name: 'RoomInformation',
|
||||
component: RoomInformation,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/CisVue/Cms/Content/:content_id`,
|
||||
name: 'Content',
|
||||
|
||||
@@ -8,7 +8,6 @@ import CalendarMinimized from './Minimized.js';
|
||||
import CalendarDate from '../../composables/CalendarDate.js';
|
||||
import CalendarDates from '../../composables/CalendarDates.js';
|
||||
|
||||
|
||||
const todayDate = new Date(new Date().setHours(0, 0, 0, 0));
|
||||
const today = todayDate.getTime()
|
||||
|
||||
@@ -29,8 +28,8 @@ export default {
|
||||
date: this.date,
|
||||
focusDate: this.focusDate,
|
||||
size: Vue.computed({ get: () => this.size }),
|
||||
calendarHeight: Vue.computed({ get: () => this.calendarHeight }),
|
||||
calendarWidth: Vue.computed({ get: () => this.calendarWidth }),
|
||||
containerHeight: Vue.computed({ get: () => this.containerHeight }),
|
||||
containerWidth: Vue.computed({ get: () => this.containerWidth }),
|
||||
|
||||
events: Vue.computed(() => this.eventsPerDay),
|
||||
filteredEvents: Vue.computed(() => this.filteredEvents),
|
||||
|
||||
@@ -93,6 +93,17 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
overlayStyle() {
|
||||
return {
|
||||
'background-color': '#F5E9D7',
|
||||
'position': 'absolute',
|
||||
'pointer-events': 'none',
|
||||
'z-index': 2,
|
||||
height: this.getDayTimePercent + '%',
|
||||
opacity: 0.5,
|
||||
overflow: 'hidden'
|
||||
}
|
||||
},
|
||||
pageHeaderStyle() {
|
||||
return {
|
||||
'z-index': 4,
|
||||
@@ -149,7 +160,7 @@ export default {
|
||||
}
|
||||
},
|
||||
noEventsCondition() {
|
||||
return !this.isSliding && this.filteredEvents?.length === 0;
|
||||
return !this.isSliding && (this.filteredEvents?.length === 0 || !this.filteredEvents);
|
||||
},
|
||||
hours() {
|
||||
// returns an array with elements starting at 7 and ending at 24
|
||||
@@ -307,7 +318,6 @@ export default {
|
||||
// calculate the minutes percentage of the total minutes
|
||||
timePercentage = ((currentMinutes - (this.hours[0] * 60)) / (this.hours.length * 60)) * 100;
|
||||
// calculate the relative position of the time percentage
|
||||
console.log('height: ', height)
|
||||
position = height * (timePercentage / 100);
|
||||
this.hourPosition = position;
|
||||
|
||||
@@ -365,6 +375,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="dayGridStyle(day)">
|
||||
<div v-if="lookingAtToday && !noEventsCondition" :style="overlayStyle"></div>
|
||||
<div v-for="event in day.events" :key="event" :style="eventGridStyle(day,event)" v-contrast :selected="event.orig == selectedEvent" class="fhc-entry mx-2 small rounded overflow-hidden " >
|
||||
<!-- desktop version of the page template, parent receives slotProp mobile = false -->
|
||||
<div class="d-none d-xl-block h-100 " @click.prevent="eventClick(event)">
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
'mode',
|
||||
'noWeekView',
|
||||
'noMonthView',
|
||||
'containerWidth'
|
||||
],
|
||||
props: {
|
||||
title: String
|
||||
@@ -26,15 +27,23 @@ export default {
|
||||
'next',
|
||||
'click'
|
||||
],
|
||||
computed: {
|
||||
getHeaderClassSide() {
|
||||
return this.containerWidth > 780 ? 'col-3' : 'col-12'
|
||||
},
|
||||
getHeaderClassMiddle() {
|
||||
return this.containerWidth > 780 ? 'col-6' : 'col-12'
|
||||
}
|
||||
},
|
||||
template: /*html*/`
|
||||
<div class="calendar-header card-header w-100">
|
||||
<div class="row align-items-center ">
|
||||
<div class=" col-12 col-md-3 d-flex justify-content-center justify-content-md-start align-items-center">
|
||||
<div :class="getHeaderClassSide" class="d-flex justify-content-center justify-content-md-start align-items-center">
|
||||
<slot name="calendarDownloads"></slot>
|
||||
</div>
|
||||
<div class="col-12 col-md-6" :style="{'padding-left':headerPadding}">
|
||||
<div :class="getHeaderClassMiddle" :style="{'padding-left':headerPadding}">
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col-auto ">
|
||||
<div class="col-auto p-2">
|
||||
<button class="btn btn-outline-secondary border-0" :class="{'btn-sm':!this.size}" @click="$emit('prev')"><i class="fa fa-chevron-left"></i></button>
|
||||
</div>
|
||||
<div class="justify-content-center text-center col-auto">
|
||||
@@ -45,12 +54,12 @@ export default {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto ">
|
||||
<div class="col-auto p-2">
|
||||
<button class="btn btn-outline-secondary border-0" :class="{'btn-sm': !this.size}" @click="$emit('next')"><i class="fa fa-chevron-right"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="viewButtons" v-if="!noWeekView && !noMonthView" class=" col-12 col-md-3 d-flex justify-content-center justify-content-md-end align-items-center" style="pointer-events: none;">
|
||||
<div ref="viewButtons" v-if="!noWeekView && !noMonthView" :class="getHeaderClassSide" class="d-flex justify-content-center justify-content-md-end align-items-center" style="pointer-events: none;">
|
||||
<div style="pointer-events: all;">
|
||||
<div role="group" aria-label="Kalender Modus">
|
||||
<button type="button" :class="{'active':mode_kurzbz === mode}" style="margin-right: 4px;" @click.prevent="$emit('updateMode',mode_kurzbz)" class="btn btn-outline-secondary" v-for="({mode_bezeichnung,icon,condition},mode_kurzbz) in modes">
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
this.syncOnNextChange = false;
|
||||
this.focusDate.set(this.date);
|
||||
} else {
|
||||
this.focusDate.m += dir;
|
||||
this.focusDate.moveMonthInDirection(dir)
|
||||
}
|
||||
this.$emit('change:range', {
|
||||
start: new Date(this.focusDate.y, this.focusDate.m, 1),
|
||||
|
||||
@@ -36,8 +36,16 @@ export default {
|
||||
'input',
|
||||
],
|
||||
computed: {
|
||||
getGridStyle() {
|
||||
return {
|
||||
'min-height': '100px',
|
||||
// this.size is the magic number anyway which directs font-size,
|
||||
// which in turn influences a lot of layout
|
||||
width: '42px'
|
||||
}
|
||||
},
|
||||
laneWidth() {
|
||||
return this.width / this.days.length
|
||||
return (this.width - 42) / this.days.length
|
||||
},
|
||||
curTime() {
|
||||
const now = new Date();
|
||||
@@ -52,6 +60,17 @@ export default {
|
||||
top: 0,
|
||||
}
|
||||
},
|
||||
overlayStyle() {
|
||||
return {
|
||||
'background-color': '#F5E9D7',
|
||||
'position': 'absolute',
|
||||
'pointer-events': 'none',
|
||||
'z-index': 2,
|
||||
height: this.getDayTimePercent + '%',
|
||||
width: this.laneWidth + 'px',
|
||||
opacity: 0.5
|
||||
}
|
||||
},
|
||||
indicatorStyle() {
|
||||
return {
|
||||
'pointer-events': 'none',
|
||||
@@ -148,7 +167,7 @@ export default {
|
||||
'z-index': 2,
|
||||
'border-color': '#00649C!important',
|
||||
top: this.getDayTimePercent + '%',
|
||||
width: this.laneWidth + 'px' // todo: manage the real value of 1fr somehow
|
||||
width: this.laneWidth + 'px'
|
||||
}
|
||||
},
|
||||
getDayTimePercent() {
|
||||
@@ -170,7 +189,7 @@ export default {
|
||||
top: this.getAbsolutePositionForHour(hour),
|
||||
left: 0,
|
||||
right: 0,
|
||||
'z-index': 0,
|
||||
'z-index': 0
|
||||
}
|
||||
},
|
||||
dayGridStyle(day) {
|
||||
@@ -185,9 +204,9 @@ export default {
|
||||
styleObj.opacity = 0.5;
|
||||
} else if (day.isToday) {
|
||||
|
||||
styleObj['backgroundImage'] = 'linear-gradient(to bottom, #F5E9D7 '+this.getDayTimePercent+'%, #FFFFFF '+this.getDayTimePercent+'%)'
|
||||
styleObj['border-color'] = '#E8E8E8';
|
||||
styleObj.opacity = 0.5;
|
||||
// styleObj['backgroundImage'] = 'linear-gradient(to bottom, #F5E9D7 '+this.getDayTimePercent+'%, #FFFFFF '+this.getDayTimePercent+'%)'
|
||||
// styleObj['border-color'] = '#E8E8E8';
|
||||
// styleObj.opacity = 0.5;
|
||||
}
|
||||
|
||||
return styleObj
|
||||
@@ -315,7 +334,7 @@ export default {
|
||||
|
||||
<div class="events" :ref="'eventsRef'+week">
|
||||
<div class="hours">
|
||||
<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 v-for="hour in hours" :style="getGridStyle" :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="dayGridStyle(day)">
|
||||
<Transition>
|
||||
@@ -323,6 +342,7 @@ export default {
|
||||
<span class="border border-top-0 px-2 bg-white">{{curTime}}</span>
|
||||
</div>
|
||||
</Transition>
|
||||
<div v-if="day.isToday" :style="overlayStyle"></div>
|
||||
<div v-for="event in day.events" :key="event" @click.prevent="weekPageClick(event.orig, day)"
|
||||
:selected="event.orig == selectedEvent"
|
||||
:style="eventGridStyle(day,event)"
|
||||
|
||||
@@ -20,6 +20,13 @@ export default {
|
||||
})
|
||||
return lektorenLinks;
|
||||
},
|
||||
getOrtContentLink: function()
|
||||
{
|
||||
if (!this.event || !this.event.ort_content_id) return "a";
|
||||
|
||||
// TODO: define/build link with content_id and/or roomname
|
||||
// return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + `/CisVue/cms/content/${this.event.ort_content_id}`
|
||||
},
|
||||
start_time: function () {
|
||||
if (!this.event.start) return 'N/A';
|
||||
if (!this.event.start instanceof Date) {
|
||||
@@ -60,7 +67,10 @@ export default {
|
||||
$p.t('global','raum')+':'
|
||||
:''
|
||||
}}</th>
|
||||
<td>{{event.ort_kurzbz}}</td>
|
||||
<td>
|
||||
<a v-if="event.ort_content_id" :href="getOrtContentLink"><i class="fa fa-arrow-up-right-from-square me-1" style="color:#00649C"></i></a>
|
||||
{{event.ort_kurzbz}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{
|
||||
|
||||
@@ -4,6 +4,7 @@ import LvModal from "../../../components/Cis/Mylv/LvModal.js";
|
||||
import LvInfo from "../../../components/Cis/Mylv/LvInfo.js"
|
||||
|
||||
export default{
|
||||
name: "RoomInformation",
|
||||
props:{
|
||||
ort_kurzbz: {
|
||||
type: String,
|
||||
@@ -119,6 +120,8 @@ export default{
|
||||
this.loadEvents();
|
||||
},
|
||||
template: /*html*/`
|
||||
<h2>Room Information {{ ort_kurzbz }}</h2>
|
||||
<hr>
|
||||
<lv-modal v-if="currentlySelectedEvent" :showMenu="false" :event="currentlySelectedEvent" ref="lvmodal" />
|
||||
<fhc-calendar @selectedEvent="setSelectedEvent" :initial-date="currentDay" @change:range="updateRange" :events="events" initial-mode="week" show-weeks @select:day="selectDay" v-model:minimized="minimized">
|
||||
<template #monthPage="{event,day}">
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import {user_locale} from "../plugin/Phrasen.js";
|
||||
import CalendarDates from "./CalendarDates.js";
|
||||
|
||||
const monthDayRanges = []
|
||||
for(let i = 1; i < 13; i++) {
|
||||
monthDayRanges.push(new Date(1995, i, 0).getDate())
|
||||
}
|
||||
|
||||
class CalendarDate {
|
||||
constructor(y, m, d) {
|
||||
this.weekStart = CalendarDate.getWeekStart();
|
||||
@@ -210,6 +215,15 @@ class CalendarDate {
|
||||
cleanup(){
|
||||
if(this.watchLocale && this.watchLocale.stop) this.watchLocale.stop(); // TODO: ?
|
||||
}
|
||||
moveMonthInDirection (dir) {
|
||||
// avoid setting date in wrong month if we try to create a date which does not exist like 30th of february
|
||||
const newM = this.m + dir
|
||||
const maxDaysTarget = monthDayRanges[newM]
|
||||
|
||||
if (this.d > maxDaysTarget) this.d = maxDaysTarget
|
||||
|
||||
this.m = newM // calls _clean which sets a new Date
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the weekday number (Date.getDay()) on which the week starts depending on the locale.
|
||||
|
||||
Reference in New Issue
Block a user