mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-26 00:19:28 +00:00
router click intercepter does not resolve internally when only matched route was the Fallback matchAll route; cleanup routes.php & Stundenplan controller from viewData and verbose reroutes; overflow setting on years page;
This commit is contained in:
@@ -61,17 +61,7 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
$route['Cis/Stundenplan'] = 'Cis/Stundenplan/index/null/null/null';
|
||||
$route['Cis/Stundenplan/(:num)'] = 'Cis/Stundenplan/index/null/null/$1';
|
||||
$route['Cis/Stundenplan/(:num)/(:any)'] = 'Cis/Stundenplan/index/null/$2/$1';
|
||||
|
||||
// Specific route (for mode: month|week|day, focusdate, lv_id optional)
|
||||
$route['Cis/Stundenplan/([M|m]onth|[W|w]eek|[D|d]ay)'] = 'Cis/Stundenplan/index/$1';
|
||||
$route['Cis/Stundenplan/([M|m]onth|[W|w]eek|[D|d]ay)(/(:any))?'] = 'Cis/Stundenplan/index/$1/$3';
|
||||
$route['Cis/Stundenplan/([M|m]onth|[W|w]eek|[D|d]ay)(/(:any))?(/(:num))?'] = 'Cis/Stundenplan/index/$1/$3/$5';
|
||||
|
||||
|
||||
|
||||
$route['Cis/Stundenplan/.*'] = 'Cis/Stundenplan/index/$1';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
|
||||
@@ -23,19 +23,10 @@ class Stundenplan extends Auth_Controller
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index($mode = 'Week', $focus_date = null, $lv_id = null)
|
||||
public function index()
|
||||
{
|
||||
// convert string "null" to actual null values -> ci3 reroute fix
|
||||
$mode = ($mode === 'null') ? 'Week' : ucfirst(strtolower($mode));
|
||||
$focus_date = ($focus_date === 'null') ? date('Y-m-d') : $focus_date;
|
||||
$lv_id = ($lv_id === 'null') ? null : $lv_id;
|
||||
|
||||
if($mode) $mode = ucfirst(strtolower($mode));
|
||||
|
||||
$viewData = array(
|
||||
'mode' => $mode,
|
||||
'focus_date' => $focus_date,
|
||||
'lv_id' => $lv_id,
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
|
||||
@@ -37,8 +37,10 @@ const router = VueRouter.createRouter({
|
||||
redirect: (to) => {
|
||||
return { // redirect to longer Rauminfo url and map params
|
||||
name: "RoomInformation",
|
||||
params: {
|
||||
ort_kurzbz: to.params.ort_kurzbz
|
||||
params: { // in this case always populate other params since they are not optional
|
||||
ort_kurzbz: to.params.ort_kurzbz,
|
||||
mode: DEFAULT_MODE_RAUMINFO,
|
||||
focus_date: new Date().toISOString().split("T")[0]
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -57,7 +59,8 @@ const router = VueRouter.createRouter({
|
||||
: DEFAULT_MODE_RAUMINFO;
|
||||
|
||||
// default to today date if not provided
|
||||
const focus_date = route.params.focus_date || new Date().toISOString().split("T")[0];
|
||||
const d = new Date(route.params.focus_date)
|
||||
const focus_date = !isNaN(d) ? route.params.focus_date : new Date().toISOString().split("T")[0];
|
||||
|
||||
// for consistency reasons format the props into one object but actually use a new name to we dont collide with
|
||||
// existing viewData declaration written from codeigniter 3 into routerview tag
|
||||
@@ -137,8 +140,9 @@ const router = VueRouter.createRouter({
|
||||
? route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase()
|
||||
: DEFAULT_MODE_STUNDENPLAN;
|
||||
|
||||
// default to today date if not provided
|
||||
const focus_date = route.params.focus_date || new Date().toISOString().split("T")[0];
|
||||
// default to today date if not provided or string forms invalid date
|
||||
const d = new Date(route.params.focus_date)
|
||||
const focus_date = !isNaN(d) ? route.params.focus_date : new Date().toISOString().split("T")[0];
|
||||
// for consistency reasons format the props into one object but actually use a new name to we dont collide with
|
||||
// existing viewData declaration written from codeigniter 3 into routerview tag
|
||||
return {
|
||||
@@ -227,7 +231,7 @@ const app = Vue.createApp({
|
||||
|
||||
// let click event propagate normally if we dont route internally
|
||||
const res = this.$router.resolve(route)
|
||||
if(!res?.matched?.length) return
|
||||
if(!res?.matched?.length || res.name === 'Fallback') return
|
||||
|
||||
event.preventDefault(); // Prevent browser navigation
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@ export default {
|
||||
return [...Array(this.end - this.start).keys()].map(i => i + this.start);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const container = document.getElementById("calendarContainer")
|
||||
if(container) {
|
||||
container.style['overflow-y'] = 'scroll'
|
||||
container.style['overflow-x'] = 'auto'
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="fhc-calendar-years-page d-flex flex-wrap">
|
||||
<div v-for="year in years" :key="year" class="d-grid col-4">
|
||||
|
||||
Reference in New Issue
Block a user