diff --git a/application/config/cis.php b/application/config/cis.php index 028e9899a..b7330ef29 100644 --- a/application/config/cis.php +++ b/application/config/cis.php @@ -5,3 +5,5 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); // CMS Content Id for CIS4 Menu Root $config['cis_menu_root_content_id'] = 11066; +// send Mails for ProfilUpdate +$config['cis_send_profil_update_mails'] = true; diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php index 423b0c9c3..c47b7540b 100644 --- a/application/controllers/Cis/ProfilUpdate.php +++ b/application/controllers/Cis/ProfilUpdate.php @@ -36,6 +36,7 @@ class ProfilUpdate extends Auth_Controller 'getTopic' => ['basis/cis:r'], ]); + $this->load->config('cis'); $this->load->model('person/Profil_update_model', 'ProfilUpdateModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); @@ -111,6 +112,10 @@ class ProfilUpdate extends Auth_Controller private function sendEmail_onProfilUpdate_response($uid, $topic, $status) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $email = $uid . "@" . DOMAIN; @@ -138,6 +143,10 @@ class ProfilUpdate extends Auth_Controller private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $emails = []; diff --git a/application/controllers/Cis4.php b/application/controllers/Cis4.php index 84aedc5f2..9197fd388 100644 --- a/application/controllers/Cis4.php +++ b/application/controllers/Cis4.php @@ -28,14 +28,12 @@ class Cis4 extends Auth_Controller public function index() { $this->load->model('person/Person_model','PersonModel'); - $begruesung = $this->PersonModel->getFirstName(getAuthUID()); - if(isError($begruesung)) - { - show_error("name couldn't be loaded for username ".getAuthUID()); - } - $begruesung = getData($begruesung); + $personData = getData($this->PersonModel->getByUid(getAuthUID()))[0]; + $viewData = array( - 'name' => $begruesung + 'uid' => getAuthUID(), + 'name' => $personData->vorname, + 'person_id' => $personData->person_id ); $this->load->view('CisVue/Dashboard.php',['viewData' => $viewData]); diff --git a/application/controllers/api/frontend/v1/Cms.php b/application/controllers/api/frontend/v1/Cms.php index 16142532b..e41196f45 100644 --- a/application/controllers/api/frontend/v1/Cms.php +++ b/application/controllers/api/frontend/v1/Cms.php @@ -125,7 +125,7 @@ class Cms extends FHCAPI_Controller //get the data or terminate with error $news = $this->getDataOrTerminateWithError($news); - + // collect the content of the news foreach($news as $news_element){ $this->addMeta("content_id",$news_element->content_id); @@ -134,12 +134,17 @@ class Cms extends FHCAPI_Controller $this->NewsModel->resetQuery(); $content = $this->cmslib->getContent($news_element->content_id); - $content = $this->getDataOrTerminateWithError($content); + $content = getData($content); $news_element->content_obj = $content; } + $withContent = function($news) { + return $news->content_obj != null; + }; + + $newsWithContent = array_filter($news, $withContent); - $this->terminateWithSuccess($news); + $this->terminateWithSuccess($newsWithContent); } 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/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index 35b7e4e64..827654d21 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -47,6 +47,8 @@ class ProfilUpdate extends FHCAPI_Controller 'show' => self::PERM_LOGGED, ]); + $this->load->config('cis'); + // Load language phrases $this->loadPhrases( array( @@ -504,6 +506,10 @@ class ProfilUpdate extends FHCAPI_Controller private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } $this->load->helper('hlp_sancho_helper'); $emails = []; @@ -573,6 +579,11 @@ class ProfilUpdate extends FHCAPI_Controller private function sendEmail_onProfilUpdate_response($uid, $topic, $status) { + if($this->config->item('cis_send_profil_update_mails') === false) + { + return; + } + $this->load->helper('hlp_sancho_helper'); $email = $uid . "@" . DOMAIN; diff --git a/application/controllers/api/frontend/v1/Stundenplan.php b/application/controllers/api/frontend/v1/Stundenplan.php index 116854930..c14ea4315 100644 --- a/application/controllers/api/frontend/v1/Stundenplan.php +++ b/application/controllers/api/frontend/v1/Stundenplan.php @@ -151,7 +151,12 @@ class Stundenplan extends FHCAPI_Controller // getting the student_lehrverbaende of the student in the different studiensemester $student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($semester_range); - $stundenplan_data = $this->StundenplanModel->stundenplanGruppierung($this->StundenplanModel->getStundenplanQuery($start_date, $end_date, $semester_range, $benutzer_gruppen, $student_lehrverband)); + $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); diff --git a/application/models/ressource/Stundenplan_model.php b/application/models/ressource/Stundenplan_model.php index 01d8dd792..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){ @@ -206,7 +206,13 @@ class Stundenplan_model extends DB_Model } return $result; }; - + + // if both the gruppen and the studentlehrverbaende are empty we early return + if($emptyCheck($gruppen) && $emptyCheck($studentlehrverbaende)) + { + return false; + } + $query = "select sp.* from lehre.vw_stundenplan sp @@ -233,15 +239,15 @@ 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 - // DOES not include the sql OR if the $studentlehrverbaende are empty and it is the last gruppen element in the iteration - if(key($semester) != $sem || !$emptyCheck($studentlehrverbaende)) - { - $query .="OR"; - } - + $query .="OR"; } } + + // 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); + } foreach($semester as $sem=>$semester_date_range) { @@ -253,20 +259,24 @@ class Stundenplan_model extends DB_Model } foreach($studentlehrverbaende[$sem_date] as $key=>$lehrverband) { - // adds the OR sql chain only if its not the first element in the first semester of the $studentlehrverbaende array - if($sem != array_keys($semester)[0] || $key != array_keys($semester)[0]) - { - $query .="OR"; - } $query .= "((sp.studiengang_kz = ".$this->escape($lehrverband->studiengang_kz)." AND sp.semester = ".$this->escape($lehrverband->semester)." AND sp.verband = ".$this->escape($lehrverband->verband)." AND sp.gruppe = ".$this->escape($lehrverband->gruppe)." AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende).")"; // Eintraege fuer den ganzen Verband $query .= "OR (sp.studiengang_kz = ".$this->escape($lehrverband->studiengang_kz)." AND sp.semester = ".$this->escape($lehrverband->semester)." AND sp.verband = ".$this->escape($lehrverband->verband)." AND (sp.gruppe is null OR sp.gruppe='') AND sp.datum BETWEEN ".$this->escape($sem_date_range->start)." AND ".$this->escape($sem_date_range->ende).")"; // 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"; + } } } + // if the studentlehrverbaende is not empty we can remove the last OR that was added to the query + if(!$emptyCheck($studentlehrverbaende)) + { + $query = substr($query, 0, -2); + } + // closes the AND sql chain only if it was opened previously if(!$emptyCheck($gruppen) || !$emptyCheck($studentlehrverbaende)) { diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 2762e2235..78d9215f1 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -182,6 +182,10 @@ html { transform: rotate(-90deg); } +#nav-sprachen{ + transition: none; +} + /* searchbar */ #nav-search { z-index: 1; @@ -478,15 +482,28 @@ html { } .fhc-entry:hover{ - background-color:#0088d6 !important; + background-color:#005585 !important; color:white !important; } +.fhc-entry.btn:focus { + box-shadow: none !important; +} + +.fhc-entry.btn { + border-radius: 0 !important; +} + .fhc-entry { transition-property: background,color; transition-duration: 0.3s,0.2s; transition-timing-function: ease-out,ease-out; } + +[selected].fhc-entry { + background-color: #00649C !important; +} + @media screen and ( max-width: 767px ) { #nav-search { position: static; @@ -527,4 +544,25 @@ html { padding-left: 2.5rem; overflow-wrap: anywhere; } +} + +/* classes used for the Vue component*/ +.v-enter-active, +.v-leave-active { + transition: opacity 0.2s ease-out; +} + +.v-enter-from, +.v-leave-to { + opacity: 0; +} + +.height-enter-active, +.height-leave-active { + transition: height 0.3s ease-out; +} + +.height-enter-from, +.height-leave-to { + height: 0px; } \ No newline at end of file diff --git a/public/css/components/dashboard/news.css b/public/css/components/dashboard/news.css index 366542969..742884371 100644 --- a/public/css/components/dashboard/news.css +++ b/public/css/components/dashboard/news.css @@ -1,27 +1,72 @@ -.widgets-news .card-header { - flex-direction: column; - align-items: flex-start !important; - -} - :root{ --news-widget-height: 1; } -.widgets-news .news-content > div, -.widgets-news .news-content .row:nth-child(1), -.widgets-news .news-content .news-list, -.widgets-news .news-content .news-list-item, -.widgets-news .news-content .card-body -{ - height: 100%; -} - .widgets-news img { max-width: 100%; } -.widgets-news .card-body{ - overflow: hidden; -} \ No newline at end of file +.fhc-news-menu-item { + padding: 0.375rem; + color: var(--fhc-cis-menu-lvl-1-color); + min-height: 5%; + max-height: 30%; + width: 100%; + justify-content: space-between; + align-items: center; + background-color: #00649c; + border: 1px solid #f1f1f1; + font-size: 16px; + cursor: pointer; + transition: background-color 0.2s ease, border-color 0.2s ease; /* Smooth transition */ +} + +.fhc-news-menu-item:hover { + background-color: var(--fhc-cis-menu-lvl-1-bg-hover); + border-color: #f1f1f1; +} + +.fhc-news-menu-item:active { + background-color: var(--fhc-cis-menu-lvl-1-color-hover); + border-color: #f1f1f1; +} + +.fhc-news-menu-item.selected { + background-color: var(--fhc-cis-menu-lvl-1-bg-hover); + border-right: 2px solid #fff; + +} + +.fhc-news-menu-item:focus { + outline: none; +} + +.fhc-news-menu-item-betreff +{ + width: 100%; + text-align: center; + max-height: 100%; + height: 100%; +} + +.fhc-news-menu-item-date { + text-align: end; + width: 100%; + max-height: 100%; + height: 100%; +} + +.fhc-carousel .carousel-item { + transition: transform 0.375s ease-in-out, opacity 0.75s ease-in-out; +} + +.fhc-carousel .carousel-item-next, +.fhc-carousel .carousel-item-prev { + transition: transform 0.44s ease-in-out, opacity 0.8s ease-in-out; +} + +.fhc-carousel .carousel-item-start, +.fhc-carousel .carousel-item-end { + transition: transform 0.44s ease-in-out, opacity 0.8s ease-in-out; +} 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/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 441d83f35..afe400c82 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -2,6 +2,8 @@ import FhcCalendar from "../../components/Calendar/Calendar.js"; import Phrasen from "../../plugin/Phrasen.js"; import CalendarDate from "../../composables/CalendarDate.js"; import LvModal from "../../components/Cis/Mylv/LvModal.js"; +import LvInfo from "../../components/Cis/Mylv/LvInfo.js" +import LvMenu from "../../components/Cis/Mylv/LvMenu.js" const app = Vue.createApp({ @@ -17,7 +19,7 @@ const app = Vue.createApp({ } }, components: { - FhcCalendar, LvModal + FhcCalendar, LvModal, LvMenu, LvInfo }, computed:{ weekFirstDay: function () { @@ -35,6 +37,9 @@ const app = Vue.createApp({ }, methods:{ + setSelectedEvent: function (event) { + this.currentlySelectedEvent = event; + }, getLvID: function () { this.lv_id = window.location.pathname }, @@ -111,7 +116,7 @@ const app = Vue.createApp({

{{$p.t('lehre/stundenplan')}}


- + -