From 8983af4aef7a4ed115b84741445b924c0be00ab8 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 25 Nov 2024 19:59:39 +0100 Subject: [PATCH 1/7] refactor(Stundenplan_model/getStundenplanQuery):removes wrong comments --- application/models/ressource/Stundenplan_model.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/application/models/ressource/Stundenplan_model.php b/application/models/ressource/Stundenplan_model.php index 896187ace..8cb07a3bb 100644 --- a/application/models/ressource/Stundenplan_model.php +++ b/application/models/ressource/Stundenplan_model.php @@ -135,7 +135,7 @@ class Stundenplan_model extends DB_Model /** - * function that takes a query that fetches lehre.vw_stundenplan rows and groups them so that they can be displayed in a calendar + * groups rows of a subquery that fetches data from the lehre.vw_stundenplan table * @param string $stundenplanViewQuery the subquery used to group the result * * @return stdClass @@ -190,7 +190,7 @@ class Stundenplan_model extends DB_Model * NO STANDALONE FUNCTION - Generates a SQL query string to fetch 'stundenplan' events for a specific student within the current semester. * @param string $uid the user id that is used to fetch the stundenplan rows from the lehre.vw_stundenplan table * - * @return string + * @return mixed */ public function getStundenplanQuery($start_date, $end_date,$semester,$gruppen,$studentlehrverbaende){ @@ -207,10 +207,10 @@ class Stundenplan_model extends DB_Model return $result; }; - // if both the gruppen and the studentlehrverbaende are empty we return nothing + // if both the gruppen and the studentlehrverbaende are empty we early return if($emptyCheck($gruppen) && $emptyCheck($studentlehrverbaende)) { - return ""; + return false; } $query = @@ -239,13 +239,11 @@ class Stundenplan_model extends DB_Model // converts the array of gruppen strings into a sql IN (_,_,_) chain $query .="(sp.gruppe_kurzbz IN (" .implode(',',$gruppen[$sem_date]).") AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende)." )"; - // adds the OR sql chain only if the $studentlehrverbaende array is not empty - // or its not the last semester to add the groups from $query .="OR"; } } - // if there are no studentlehrverbaende, we can remove the last OR added after the groups + // if there are no studentlehrverbaende and the gruppen are not empty, we can remove the last OR added after the groups if($emptyCheck($studentlehrverbaende) && !$emptyCheck($gruppen)) { $query = substr($query, 0, -2); @@ -267,7 +265,7 @@ class Stundenplan_model extends DB_Model // Eintraege fuer das ganze Semester $query .= "OR (sp.studiengang_kz = ".$this->escape($lehrverband->studiengang_kz)." AND sp.semester = ".$this->escape($lehrverband->semester)." AND (sp.verband is null OR sp.verband='') AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende).") AND gruppe_kurzbz is null)"; - $query .="OR"; + $query .="OR"; } } From 82f1a70de50adbd6af6cf820ba36c4e9772e3e95 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 26 Nov 2024 09:25:24 +0100 Subject: [PATCH 2/7] fix(Calender/Day/Page.js): ausgewaehlte Event wird resetet wenn man den darauffolgenden oder vorherigen Tag auswaehlt --- public/js/components/Calendar/Day/Page.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index de5ab2b5a..52b1c9bfb 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -75,6 +75,14 @@ export default { this.fetchLvMenu(event); }, immediate:true, + }, + isSliding:{ + handler(value){ + if(value) + { + this.setSelectedEvent(null); + } + } } }, computed: { From 24740d055e5c00398d499295d88a14aeadad7dd6 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 26 Nov 2024 16:26:29 +0100 Subject: [PATCH 3/7] feature(Sprache/Phrasen aendern): creates a Cis Sprachen component that lists all available Sprachen from the database and lets the user change the currently active language and persist it in the database --- .../controllers/api/frontend/v1/Phrasen.php | 23 +++++++- public/css/Cis4/Cis.css | 7 ++- public/js/api/phrasen.js | 6 +++ public/js/components/Cis/Menu.js | 5 +- public/js/components/Cis/Sprachen.js | 53 +++++++++++++++++++ 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 public/js/components/Cis/Sprachen.js diff --git a/application/controllers/api/frontend/v1/Phrasen.php b/application/controllers/api/frontend/v1/Phrasen.php index 317f515e0..3509e6630 100644 --- a/application/controllers/api/frontend/v1/Phrasen.php +++ b/application/controllers/api/frontend/v1/Phrasen.php @@ -29,7 +29,9 @@ class Phrasen extends FHCAPI_Controller { parent::__construct([ 'loadModule' => self::PERM_ANONYMOUS, - 'setLanguage' => self::PERM_ANONYMOUS + 'setLanguage' => self::PERM_ANONYMOUS, + 'getLanguage' => self::PERM_ANONYMOUS, + 'getAllLanguages' => self::PERM_ANONYMOUS, ]); $this->load->helper('hlp_language'); @@ -60,4 +62,23 @@ class Phrasen extends FHCAPI_Controller $phrases = $this->p->setPhrases($categories, $language); $this->terminateWithSuccess($phrases); } + + // gets the langauge of the currently logged in user session and otherwhise the system language + public function getLanguage() + { + $lang = getUserLanguage(); + $this->terminateWithSuccess($lang); + } + + // gets all languages that are set as active in the database + public function getAllLanguages() + { + $langs = getDBActiveLanguages(); + $langs = $this->getDataOrTerminateWithError($langs); + $langs = array_map(function($lang){ + return $lang->sprache; + }, $langs); + $this->terminateWithSuccess($langs); + } + } \ No newline at end of file diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 2762e2235..82575b3a5 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -478,7 +478,7 @@ html { } .fhc-entry:hover{ - background-color:#0088d6 !important; + background-color:#00649C !important; color:white !important; } @@ -487,6 +487,11 @@ html { transition-duration: 0.3s,0.2s; transition-timing-function: ease-out,ease-out; } + +[selected].fhc-entry { + background-color: #005585 !important; +} + @media screen and ( max-width: 767px ) { #nav-search { position: static; diff --git a/public/js/api/phrasen.js b/public/js/api/phrasen.js index c5994ea9b..769686447 100644 --- a/public/js/api/phrasen.js +++ b/public/js/api/phrasen.js @@ -22,5 +22,11 @@ export default { setLanguage(categories,language) { const payload = {categories, language} return this.$fhcApi.post('/api/frontend/v1/phrasen/setLanguage', payload); + }, + getLanguage() { + return this.$fhcApi.get('/api/frontend/v1/phrasen/getLanguage', {}); + }, + getActiveDbLanguages() { + return this.$fhcApi.get('/api/frontend/v1/phrasen/getAllLanguages', {}); } }; \ No newline at end of file diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index 632967085..8d5189c7f 100644 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -1,10 +1,12 @@ import CisMenuEntry from "./Menu/Entry.js"; import FhcSearchbar from "../searchbar/searchbar.js"; +import CisSprachen from "./Sprachen.js" export default { components: { CisMenuEntry, - FhcSearchbar + FhcSearchbar, + CisSprachen, }, props: { menu: Array, @@ -151,6 +153,7 @@ export default {
+