mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
raum query
This commit is contained in:
@@ -390,6 +390,80 @@ EOSC;
|
||||
*/
|
||||
private function _raum($searchstr, $type)
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
// select - ARRAY_AGG(ort_reihungstest_studiengang.test) as reihungstest_studiengang
|
||||
/* LEFT JOIN (
|
||||
Select reihungstest_id, bezeichnung as reihungstest_studiengang_bezeichnung, CONCAT(reihungstest_id,\' - \',bezeichnung) as test, public.tbl_rt_ort.ort_kurzbz
|
||||
FROM public.tbl_reihungstest
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN public.tbl_rt_ort ON reihungstest_id = rt_id
|
||||
|
||||
) ort_reihungstest_studiengang ON ort_reihungstest_studiengang.ort_kurzbz = ort.ort_kurzbz
|
||||
*/
|
||||
$rooms = $dbModel->execReadOnlyQuery('
|
||||
SELECT
|
||||
\''.$type.'\' AS type,
|
||||
ort.ort_kurzbz as ort_kurzbz,
|
||||
ort.gebteil as building,
|
||||
ort.stockwerk as floor,
|
||||
ort.dislozierung as room_number
|
||||
|
||||
FROM public.tbl_ort as ort
|
||||
|
||||
WHERE ort.ort_kurzbz like \'%'. $searchstr . '%\' GROUP BY ort.ort_kurzbz'
|
||||
/*
|
||||
|
||||
org joins:
|
||||
|
||||
JOIN public.tbl_organisationseinheittyp ot USING(organisationseinheittyp_kurzbz)
|
||||
LEFT JOIN public.tbl_organisationseinheit oParent ON(oParent.oe_kurzbz = o.oe_parent_kurzbz)
|
||||
LEFT JOIN public.tbl_organisationseinheittyp otParent ON(oParent.organisationseinheittyp_kurzbz = otParent.organisationseinheittyp_kurzbz)
|
||||
LEFT JOIN (
|
||||
SELECT benutzerfunktion_id, oe_kurzbz
|
||||
FROM public.tbl_benutzerfunktion
|
||||
WHERE funktion_kurzbz = \'oezuordnung\'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
) bfCount ON(bfCount.oe_kurzbz = o.oe_kurzbz)
|
||||
LEFT JOIN (
|
||||
SELECT bf.oe_kurzbz, bf.uid, p.vorname, p.nachname
|
||||
FROM public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_benutzer b USING(uid)
|
||||
JOIN public.tbl_person p USING(person_id)
|
||||
WHERE funktion_kurzbz = \'Leitung\'
|
||||
AND (datum_von IS NULL OR datum_von <= NOW())
|
||||
AND (datum_bis IS NULL OR datum_bis >= NOW())
|
||||
AND b.aktiv = TRUE
|
||||
) bfLeader ON(bfLeader.oe_kurzbz = o.oe_kurzbz)
|
||||
|
||||
|
||||
|
||||
$this->buildSearchClause(
|
||||
$dbModel,
|
||||
array('o.oe_kurzbz', 'o.bezeichnung', 'ot.bezeichnung'),
|
||||
$searchstr
|
||||
) .
|
||||
'GROUP BY type, o.oe_kurzbz, o.bezeichnung, ot.bezeichnung, oParent.oe_kurzbz, oParent.bezeichnung, otParent.bezeichnung'
|
||||
*/
|
||||
);
|
||||
|
||||
// If something has been found
|
||||
if (hasData($rooms))
|
||||
{
|
||||
// Loop through the returned dataset
|
||||
foreach (getData($rooms) as $room)
|
||||
{
|
||||
if($room->building == null){
|
||||
$room->test = "test";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the dataset
|
||||
return getData($rooms);
|
||||
}
|
||||
|
||||
// Otherwise return an empty array
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import CisMenuEntry from "./Menu/Entry.js";
|
||||
import FhcSearchbar from "../searchbar/searchbar.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CisMenuEntry,
|
||||
FhcSearchbar
|
||||
},
|
||||
props: {
|
||||
rootUrl: String,
|
||||
logoUrl: String,
|
||||
avatarUrl: String,
|
||||
logoutUrl: String,
|
||||
searchbaroptions: Object,
|
||||
searchfunction: Function
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
entries: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/CisVue/Menu').then(res => {
|
||||
this.entries = res.data.retval.childs;
|
||||
});
|
||||
},
|
||||
template: /*html*/`
|
||||
<button id="nav-main-btn" class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#nav-main" aria-controls="nav-main" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a id="nav-logo" :href="rootUrl">
|
||||
<img :src="logoUrl" alt="Logo">
|
||||
</a>
|
||||
<nav id="nav-main" class="offcanvas offcanvas-start bg-dark" tabindex="-1" aria-labelledby="nav-main-btn" data-bs-backdrop="false">
|
||||
<div id="nav-main-toggle" class="position-static d-none d-lg-block bg-dark">
|
||||
<button type="button" class="btn bg-dark text-light rounded-0 p-1 d-flex align-items-center" data-bs-toggle="collapse" data-bs-target="#nav-main-menu" aria-expanded="true" aria-controls="nav-main-menu">
|
||||
<i class="fa fa-arrow-circle-left"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="offcanvas-body p-0">
|
||||
<fhc-searchbar id="nav-search" class="fhc-searchbar w-100" :searchoptions="searchbaroptions" :searchfunction="searchfunction"></fhc-searchbar>
|
||||
<button id="nav-user-btn" class="btn btn-link rounded-0" type="button" data-bs-toggle="collapse" data-bs-target="#nav-user-menu" aria-expanded="false" aria-controls="nav-user-menu">
|
||||
<img :src="avatarUrl" class="avatar rounded-circle"/>
|
||||
</button>
|
||||
<ul id="nav-user-menu" class="collapse list-unstyled" aria-labelledby="nav-user-btn">
|
||||
<li><a class="btn btn-level-2 rounded-0 d-block" href="#" id="menu-profil">Profil</a></li>
|
||||
<li><a class="btn btn-level-2 rounded-0 d-block" href="#">Ampeln</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="btn btn-level-2 rounded-0 d-block" :href="logoutUrl">Logout</a></li>
|
||||
</ul>
|
||||
<div id="nav-main-menu" class="collapse collapse-horizontal show">
|
||||
<div>
|
||||
<cis-menu-entry v-for="entry in entries" :key="entry.content_id" :entry="entry" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>`
|
||||
};
|
||||
@@ -10,7 +10,8 @@ export default {
|
||||
emits: [ 'actionexecuted' ],
|
||||
template: `
|
||||
<div class="searchbar_result searchbar_raum">
|
||||
|
||||
<pre>{{JSON.stringify(actions,null,2)}}</pre>
|
||||
<pre>{{JSON.stringify(res,null,2)}}</pre>
|
||||
<div class="searchbar_grid">
|
||||
<div class="searchbar_icon">
|
||||
<action :res="this.res" :action="this.actions.defaultaction" @actionexecuted="$emit('actionexecuted')">
|
||||
@@ -19,7 +20,7 @@ export default {
|
||||
</div>
|
||||
<div class="searchbar_data">
|
||||
<action :res="this.res" :action="this.actions.defaultaction" @actionexecuted="$emit('actionexecuted')">
|
||||
<span class="fw-bold">{{ res.r }}</span>
|
||||
<span class="fw-bold">{{ res.ort_kurzbz }}</span>
|
||||
</action>
|
||||
|
||||
<div class="mb-3"></div>
|
||||
@@ -27,15 +28,15 @@ export default {
|
||||
<div class="searchbar_table">
|
||||
<div class="searchbar_tablerow">
|
||||
<div class="searchbar_tablecell">Gebäude</div>
|
||||
<div class="searchbar_tablecell">{{ res.g }}</div>
|
||||
<div class="searchbar_tablecell">{{ res.building }}</div>
|
||||
</div>
|
||||
<div class="searchbar_tablerow">
|
||||
<div class="searchbar_tablecell">Stockwerk</div>
|
||||
<div class="searchbar_tablecell">{{ res.s }}</div>
|
||||
<div class="searchbar_tablecell">{{ res.floor }}</div>
|
||||
</div>
|
||||
<div class="searchbar_tablerow">
|
||||
<div class="searchbar_tablecell">Raumnummer</div>
|
||||
<div class="searchbar_tablecell">{{ res.rn }}</div>
|
||||
<div class="searchbar_tablecell">{{ res.room_number }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,8 +26,13 @@ export default {
|
||||
employee: employee,
|
||||
organisationunit: organisationunit
|
||||
},
|
||||
<<<<<<< Updated upstream
|
||||
template: `
|
||||
<form ref="searchform" class="d-flex me-3 position-relative" action="javascript:void(0);"
|
||||
=======
|
||||
template: /*html*/`
|
||||
<form ref="searchform" class="d-flex me-3" action="javascript:void(0);"
|
||||
>>>>>>> Stashed changes
|
||||
@focusin="this.searchfocusin" @focusout="this.searchfocusout">
|
||||
<div class="input-group me-2 bg-white">
|
||||
<input ref="searchbox" @keyup="this.search" @focus="this.showsearchresult"
|
||||
|
||||
Reference in New Issue
Block a user