diff --git a/application/controllers/Cis/Compat.php b/application/controllers/Cis/Compat.php new file mode 100644 index 000000000..5c99d8bfc --- /dev/null +++ b/application/controllers/Cis/Compat.php @@ -0,0 +1,44 @@ + ['basis/cis:r'], + 'legacy' => ['basis/cis:r'], + + ]); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + + /** + * @access public + * @return void + */ + public function ci() + { + $this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']); + } + + /** + * @access public + * @return void + */ + public function legacy() + { + $this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']); + } + +} diff --git a/application/controllers/api/frontend/v1/CisMenu.php b/application/controllers/api/frontend/v1/CisMenu.php index 439f52df6..debab48a4 100644 --- a/application/controllers/api/frontend/v1/CisMenu.php +++ b/application/controllers/api/frontend/v1/CisMenu.php @@ -67,8 +67,11 @@ class CisMenu extends FHCAPI_Controller private function generateUrlForMenuItem($menuItem) { - $menuItem->url = $this->menuItemUrlHelper($menuItem); - unset($menuItem->content); + if(!isset($menuItem->url)) + { + $menuItem->url = $this->menuItemUrlHelper($menuItem); + unset($menuItem->content); + } if ($menuItem->childs && count($menuItem->childs)) { $menuItem->childs = $this->generateUrlsForMenuItems($menuItem->childs); @@ -83,7 +86,7 @@ class CisMenu extends FHCAPI_Controller return site_url("/CisVue/Cms/content/" . $menuItem->content_id); } - if (!$menuItem->content || !mb_strlen($menuItem->content)) { + if (!isset($menuItem->content) || !$menuItem->content || !mb_strlen($menuItem->content)) { return ''; } diff --git a/cis/testtool/login.php b/cis/testtool/login.php index 60447ee52..4b8acb228 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -632,6 +632,7 @@ elseif (isset($prestudent_id)) $ps_obj->lastStatus = $ps_tmp->status_kurzbz; // letzten Status dem result array hinzufügen $ps_obj->status_mehrsprachig = $ps_tmp->status_mehrsprachig; + $ps_obj->ausbildungssemester = $ps_tmp->ausbildungssemester; } // Falls Status 'Abgewiesene' vorhanden, nach hinten reihen diff --git a/cis/testtool/menu.php b/cis/testtool/menu.php index fb28825de..ca85daf45 100644 --- a/cis/testtool/menu.php +++ b/cis/testtool/menu.php @@ -29,6 +29,7 @@ require_once('../../include/sprache.class.php'); require_once '../../include/phrasen.class.php'; require_once '../../include/studiengang.class.php'; require_once('../../include/gebiet.class.php'); +require_once('../../include/gebiet_pruefling.class.php'); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); @@ -198,8 +199,8 @@ else if (isset($_SESSION['pruefling_id'])) ) - SELECT DISTINCT ON - (gebiet_id, semester, reihung) + SELECT * FROM (SELECT DISTINCT ON + (gebiet_id) semester, gebiet_id, STRING_AGG(studiengang_kz::TEXT, ', ' ORDER BY studiengang_kz) AS studiengang_kz_list, @@ -226,13 +227,7 @@ else if (isset($_SESSION['pruefling_id'])) JOIN testtool.tbl_gebiet USING (gebiet_id) WHERE - ( - (prestudent_data.semester= 1 AND tbl_ablauf.semester = 1) - OR - (prestudent_data.semester= 2 AND tbl_ablauf.semester = 2) - OR - (prestudent_data.semester= 3 AND tbl_ablauf.semester IN (1,3)) - ) + tbl_ablauf.semester <= prestudent_data.semester AND ( prestudent_data.studienplan_id = tbl_ablauf.studienplan_id OR @@ -259,9 +254,7 @@ else if (isset($_SESSION['pruefling_id'])) JOIN testtool.tbl_gebiet USING (gebiet_id) WHERE - (prestudent_data.semester= 1 AND tbl_ablauf.semester = 1) - OR - (prestudent_data.semester= 3 AND tbl_ablauf.semester IN (1,3)) + tbl_ablauf.semester <= prestudent_data.semester ) ) temp ) temp2 @@ -270,7 +263,7 @@ else if (isset($_SESSION['pruefling_id'])) semester, gebiet_id, bezeichnung, - ". $bezeichnung_mehrsprachig_sel ." + ". $bezeichnung_mehrsprachig_sel ." ) temp3 ORDER BY semester, @@ -283,6 +276,8 @@ else if (isset($_SESSION['pruefling_id'])) $lastsemester = ''; $quereinsteiger_stg = ''; $_SESSION['alleGebiete']= []; + $gebiet_pruefling = new gebiet_pruefling(); + $quereinsteiger_menu = false; while($row = $db->db_fetch_object($result)) { //Jedes Semester in einer eigenen Tabelle anzeigen @@ -294,8 +289,25 @@ else if (isset($_SESSION['pruefling_id'])) } $lastsemester = $row->semester; - echo ''; - echo ''; + if ($row->semester == '1') + { + // Basisgebiete anzeigen + echo '
'. ($row->semester == '1' ? $p->t('testtool/basisgebiete') : $p->t('testtool/quereinstiegsgebiete')).'
'; + echo ''; + } + else + { + if (!$quereinsteiger_menu) + { + echo '
' . $p->t('testtool/basisgebiete') . '
'; + echo ''; + $quereinsteiger_menu = true; + } + else + { + echo '
' . $p->t('testtool/quereinstiegsgebiete') . '
'; + } + } } // Bei Quereinstiegsgebieten nach STG clustern und die STG anzeigen @@ -394,6 +406,12 @@ else if (isset($_SESSION['pruefling_id'])) '; + if (!$gebiet_pruefling->checkIfExists($_SESSION['pruefling_id'], $row->gebiet_id)) + { + $gebiet_pruefling->pruefling_id = $_SESSION['pruefling_id']; + $gebiet_pruefling->gebiet_id = $row->gebiet_id; + $gebiet_pruefling->saveGebietForPruefling(); + } $_SESSION['alleGebiete'][] = $row->gebiet_id; } else diff --git a/include/gebiet_pruefling.class.php b/include/gebiet_pruefling.class.php new file mode 100644 index 000000000..9578bb546 --- /dev/null +++ b/include/gebiet_pruefling.class.php @@ -0,0 +1,97 @@ +db_add_param($pruefling_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->prueflinggebiet_id = $row->prueflinggebiet_id; + $this->pruefling_id = $row->pruefling_id; + $this->gebiet_id = $row->gebiet_id; + return true; + } + else + { + $this->errormsg = "Pruefling nicht gefunden"; + return false; + } + } + else + { + $this->errormsg = "Fehler beim Laden der Gebiete für den Pruefling"; + return false; + } + } + + public function checkIfExists($pruefling_id, $gebiet_id) + { + $qry = "SELECT 1 + FROM testtool.tbl_pruefling_gebiet + WHERE pruefling_id =".$this->db_add_param($pruefling_id, FHC_INTEGER) ." AND gebiet_id =".$this->db_add_param($gebiet_id, FHC_INTEGER); + + if ($result = $this->db_query($qry)) + { + if ($this->db_num_rows($result) > 0) + return true; + else + return false; + } + } + + public function saveGebietForPruefling() + { + $qry = "INSERT INTO testtool.tbl_pruefling_gebiet + (pruefling_id, gebiet_id) + VALUES(". + $this->db_add_param($this->pruefling_id, FHC_INTEGER).','. + $this->db_add_param($this->gebiet_id, FHC_INTEGER).');'; + + if ($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return true; + } + } + +} +?> diff --git a/public/js/apps/Cis/Cis.js b/public/js/apps/Cis/Cis.js index d4f846f25..2ce04b9e9 100644 --- a/public/js/apps/Cis/Cis.js +++ b/public/js/apps/Cis/Cis.js @@ -19,6 +19,7 @@ import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.j import Studium from "../../components/Cis/Studium/Studium.js"; import StgOrgLvPlan from "../../components/Cis/LvPlan/StgOrg.js"; import OtherLvPlan from "../../components/Cis/LvPlan/OtherLvPlan.js"; +import Compat from "../../components/Cis/Compat.js"; import ApiRouteInfo from '../../api/factory/routeinfo.js'; import {capitalize} from "../../helpers/StringHelpers.js"; @@ -29,6 +30,18 @@ const isMobile = window.matchMedia("(max-width: 767px)").matches; const router = VueRouter.createRouter({ history: VueRouter.createWebHistory(`/${ciPath}`), routes: [ + { + path: `/Cis/Compat/:mode(ci|legacy)/:path(.*)`, + name: 'Compat', + component: Compat, + props: (route) => { + return { + mode: route.params.mode, + path: route.params.path, + query_string: VueRouter.stringifyQuery(route.query) + }; + } + }, { path: `/Cis/Studium`, name: 'Studium', @@ -277,7 +290,7 @@ const app = Vue.createApp({ if (target && this.isInternalRoute(target.href)) { const url = new URL(target.href) - const path = url.pathname + const path = url.pathname + url.search; const base = this.$router.options.history.base const route = path.replace(base, '') || '/' diff --git a/public/js/components/Cis/Compat.js b/public/js/components/Cis/Compat.js new file mode 100644 index 000000000..e6fb653f7 --- /dev/null +++ b/public/js/components/Cis/Compat.js @@ -0,0 +1,93 @@ +export default { + name: "Compat", + props: { + mode: { type: String, required: true }, + path: { type: String, required: true }, + query_string: { type: String, required: true, default: ''} + }, + data: function() { + return { + lastLoadediFrameURL: '', + srcUrl: '' + }; + }, + computed: { + propsWatchHelper: function() { + return this.mode + '#' + this.path + '#' + this.query_string; + } + }, + mounted: function() { + this.srcUrl = this.buildSrcUrl(); + }, + watch: { + propsWatchHelper: function() { + if(this.lastLoadediFrameURL === '') { + return; + } + + let currentiFrameURL = this.$refs.compatiframe ? this.$refs.compatiframe.src : ''; + + let url = this.buildSrcUrl(); + if(this.lastLoadediFrameURL !== url) { + this.srcUrl = url; + if(this.srcUrl === url) { + this.$refs.compatiframe.contentWindow.location.href = url; + } + } + } + }, + methods: { + buildSrcUrl: function() { + let url = false; + switch(this.mode) { + case 'ci': + url = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/' + this.path; + break; + case 'legacy': + url = FHC_JS_DATA_STORAGE_OBJECT.app_root + this.path; + break; + default: + url = false; + } + if(this.query_string !== '' && url) { + url += '?' + this.query_string; + } + + return url; + }, + loadHandler: function() { + let iframe_href = this.$refs.compatiframe.contentWindow.location.href; + let ci_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/'; + let legacy_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root; + let routerpath = null; + + this.lastLoadediFrameURL = iframe_href; + + if(iframe_href.startsWith(ci_urlstart)) { + routerpath = iframe_href.replace( + ci_urlstart, '/Cis/Compat/ci/'); + } else if(iframe_href.startsWith(legacy_urlstart)) { + routerpath = iframe_href.replace( + legacy_urlstart, '/Cis/Compat/legacy/'); + } else { + return; + } + + if(this.$route.fullPath !== routerpath) { + this.$router.push(routerpath); + } + } + }, + template: ` +
+ +
Keine URL gefunden.
+
+ ` +}; diff --git a/public/js/components/DetailHeader/DetailHeader.js b/public/js/components/DetailHeader/DetailHeader.js index f57b679db..e1810fc78 100644 --- a/public/js/components/DetailHeader/DetailHeader.js +++ b/public/js/components/DetailHeader/DetailHeader.js @@ -542,10 +542,10 @@ export default {