mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'master' into feature-61232/Studierendenverwaltung_Karteireiter_Projektarbeit_portieren
This commit is contained in:
@@ -33,6 +33,11 @@ class Lehreinheit_model extends DB_Model
|
||||
{
|
||||
$lehreinheiten = array();
|
||||
|
||||
$this->addSelect(
|
||||
'lehreinheit_id, lehrveranstaltung_id, studiensemester_kurzbz, lehrform_kurzbz,
|
||||
stundenblockung, wochenrythmus, start_kw, raumtyp, raumtypalternativ,
|
||||
sprache, lehre, unr, lvnr, lehrfach_id, gewicht'
|
||||
);
|
||||
$this->addOrder('lehreinheit_id');
|
||||
$les = $this->loadWhere(
|
||||
array('lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
@@ -689,10 +694,26 @@ EOSQL;
|
||||
|
||||
private function _getTagsCTE()
|
||||
{
|
||||
$this->load->config('lvverwaltung');
|
||||
$tags = $this->config->item('tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags))
|
||||
{
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag)
|
||||
{
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
}
|
||||
|
||||
$whereTags = " AND tbl_notiz_typ.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
|
||||
return "tag_data_agg AS (
|
||||
SELECT
|
||||
lehreinheit_id,
|
||||
COALESCE(json_agg(tag ORDER BY id), '[]'::json) AS tags
|
||||
COALESCE(json_agg(tag ORDER BY done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (public.tbl_notiz.notiz_id)
|
||||
tbl_notiz.notiz_id AS id,
|
||||
@@ -705,8 +726,9 @@ EOSQL;
|
||||
FROM public.tbl_notizzuordnung
|
||||
JOIN public.tbl_notiz ON tbl_notizzuordnung.notiz_id = tbl_notiz.notiz_id
|
||||
JOIN public.tbl_notiz_typ ON tbl_notiz.typ = tbl_notiz_typ.typ_kurzbz
|
||||
WHERE lehreinheit_id IN (SELECT lehreinheit_id FROM lehreinheiten)
|
||||
) AS tag
|
||||
WHERE lehreinheit_id IN (SELECT lehreinheit_id FROM lehreinheiten)"
|
||||
. $whereTags.
|
||||
") AS tag
|
||||
GROUP BY lehreinheit_id
|
||||
)";
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
public function getBetriebsmittelData($id, $type_id)
|
||||
public function getBetriebsmittelData($id, $type_id, $betriesmitteltypes = null)
|
||||
{
|
||||
switch ($type_id) {
|
||||
case 'person_id':
|
||||
@@ -113,6 +113,15 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
return error("ID nicht gültig");
|
||||
}
|
||||
|
||||
$cond .= " = ? ";
|
||||
$params[] = $id;
|
||||
|
||||
if ($betriesmitteltypes && !isEmptyArray($betriesmitteltypes))
|
||||
{
|
||||
$cond .= " AND bm.betriebsmitteltyp IN ?";
|
||||
$params[] = $betriesmitteltypes;
|
||||
}
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
bm.nummer, bmp.person_id, bm.betriebsmitteltyp, bmp.anmerkung as anmerkung,
|
||||
@@ -126,9 +135,9 @@ class Betriebsmittelperson_model extends DB_Model
|
||||
JOIN
|
||||
wawi.tbl_betriebsmittel bm ON (bmp.betriebsmittel_id = bm.betriebsmittel_id)
|
||||
WHERE
|
||||
" . $cond . " = ? ";
|
||||
" . $cond;
|
||||
|
||||
return $this->execQuery($query, array($id));
|
||||
return $this->execQuery($query, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user