diff --git a/application/libraries/SearchBarLib.php b/application/libraries/SearchBarLib.php index b725f6e90..60f22f51a 100755 --- a/application/libraries/SearchBarLib.php +++ b/application/libraries/SearchBarLib.php @@ -454,6 +454,71 @@ EOSC; */ private function _raum($searchstr, $type) { + $dbModel = new DB_Model(); + + $rooms = $dbModel->execReadOnlyQuery(' + SELECT + \''.$type.'\' AS type, + COALESCE(ort.ort_kurzbz, \'N/A\') as ort_kurzbz, + COALESCE(ort.gebteil, \'N/A\') as building, + COALESCE(ort.ausstattung, \'N/A\') as austattung, + COALESCE(CAST(ort.stockwerk AS VARCHAR), \'N/A\') as floor, + COALESCE(CAST(ort.dislozierung AS VARCHAR), \'N/A\') as room_number, + COALESCE(CAST(ort.content_id AS VARCHAR), \'N/A\') as content_id, + + CASE + WHEN standort.plz IS NULL OR standort.ort IS NULL THEN + CASE + WHEN standort.strasse IS NULL THEN + CASE + WHEN ort.stockwerk IS NULL THEN \'N/A\' + ELSE CONCAT(ort.stockwerk,\' Stockwerk\') + END + ELSE + CASE + WHEN ort.stockwerk IS NULL THEN standort.strasse + ELSE CONCAT(standort.strasse,\' / \',ort.stockwerk,\' Stockwerk\') + END + END + ELSE + CASE + WHEN standort.strasse IS NULL THEN + CASE + WHEN ort.stockwerk IS NULL THEN CONCAT(standort.plz,\' \',standort.ort) + ELSE CONCAT(standort.plz,\' \',standort.ort,\' / \',ort.stockwerk,\' Stockwerk\') + END + ELSE + CASE + WHEN ort.stockwerk IS NULL THEN CONCAT(standort.plz,\' \',standort.ort,\' / \',standort.strasse) + ELSE CONCAT(standort.plz,\' \',standort.ort,\', \',standort.strasse,\' / \',ort.stockwerk,\' Stockwerk\') + END + END + END as standort, + + + CASE + WHEN ort.max_person IS NULL OR ort.arbeitsplaetze IS NULL THEN \'N/A\' + ELSE CONCAT(ort.max_person,\', davon \',ort.arbeitsplaetze,\' PC-Plätze\') + END as sitzplaetze + + FROM public.tbl_ort as ort + LEFT JOIN ( + select ort,standort_id,strasse, plz + FROM public.tbl_standort + LEFT JOIN public.tbl_adresse USING(adresse_id) + ) standort USING(standort_id) + WHERE LOWER(ort.ort_kurzbz) like LOWER(\'%'. $searchstr . '%\') ' + + ); + + // If something has been found + if (hasData($rooms)) + { + // Returns the dataset + return getData($rooms); + } + + // Otherwise return an empty array return array(); } } diff --git a/public/js/components/Cis/Menu.js b/public/js/components/Cis/Menu.js index 99023032d..a183509d7 100755 --- a/public/js/components/Cis/Menu.js +++ b/public/js/components/Cis/Menu.js @@ -55,4 +55,4 @@ export default { ` -}; \ No newline at end of file +}; diff --git a/public/js/components/searchbar/raum.js b/public/js/components/searchbar/raum.js index 887820d6c..69e303ed4 100755 --- a/public/js/components/searchbar/raum.js +++ b/public/js/components/searchbar/raum.js @@ -7,10 +7,18 @@ export default { action: action, actions: actions }, + created(){ + //! this should be the default action for a raum + /*this.actions.defaultaction = { + type: "link", + action: function(data) { + return FHC_JS_DATA_STORAGE_OBJECT.app_root+'cms/content.php?content_id='+data.content_id; + } + }; */ + }, emits: [ 'actionexecuted' ], - template: ` + template: /*html*/`
-
@@ -19,23 +27,27 @@ export default {
- {{ res.r }} + {{ res.ort_kurzbz }}
+
+
Standort
+
{{ res.standort }}
+
+
+
Sitzplätze
+
{{ res.sitzplaetze }}
+
Gebäude
-
{{ res.g }}
+
{{ res.building }}
-
Stockwerk
-
{{ res.s }}
-
-
-
Raumnummer
-
{{ res.rn }}
+
Zusatz Informationen
+
diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 94aa2d822..621463672 100755 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -63,6 +63,7 @@ require_once('dbupdate_3.4/41134_bookmark_dashboardWidget.php'); require_once('dbupdate_3.4/28575_softwarebereitstellung.php'); require_once('dbupdate_3.4/41150_oe-pfad_db_view.php'); require_once('dbupdate_3.4/44031_stv_favorites.php'); +require_once('dbupdate_3.4/39911_tabulator_in_contentmittitel.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/39911_tabulator_in_contentmittitel.php b/system/dbupdate_3.4/39911_tabulator_in_contentmittitel.php new file mode 100644 index 000000000..b743648ed --- /dev/null +++ b/system/dbupdate_3.4/39911_tabulator_in_contentmittitel.php @@ -0,0 +1,106 @@ + + + + + <xsl:value-of select="titel" /> + + + + + + +

+ + + +
+ +EOD; + +$raum_contentmittitel_xsd=<< + + + + + +EOD; + +$raum_contentmittitel_xslt_xhtml_c4= << + +

+ +

+ +
+ +EOD; + +$raum_contentmittitel_insert_query= <<db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='raum_contentmittitel'")) { + + // only inserting the new template if it doesn't exist already + if ($db->db_num_rows($result) == 0) { + + // executing the insert statement for the new template + if (!$db->db_query($raum_contentmittitel_insert_query)){ + echo 'FAILED INSERTING NEW TEMPLATE RAUM_CONTENTMITTITEL : ' . $db->db_last_error() . '
'; + + } + else { + echo '
SUCCESSFULLY INSERTING NEW TEMPLATE RAUM_CONTENTMITTITEL '; + + // only update the rooms template if the insert of the room_contentmittitel template was successful + // executing the update statement to update the template for all room content + if (!$db->db_query($raum_content_update_query)){ + echo 'FAILED TO UPDATE ROOMS WITH NEW TEMPLATE raum_contentmittitel : ' . $db->db_last_error() . '
'; + } + else{ + echo '
SUCCESSFULLY UPDATED ROOMS WITH NEW TEMPLATE raum_contentmittitel'; + } + + } + + } +} \ No newline at end of file