mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
Validation during delete for extension mobility, add field lehreinheit to dropdown and backend
This commit is contained in:
@@ -44,4 +44,27 @@ class Bisio_model extends DB_Model
|
||||
else
|
||||
return success("Bisio not found");
|
||||
}
|
||||
|
||||
/**
|
||||
* checks, if an (extension) table exists to avoid later errors
|
||||
* @param String $schema like 'extension'
|
||||
* @param String $table like 'tbl_mo_bisiozuordnung'
|
||||
* @return boolean
|
||||
*/
|
||||
public function tableExists($schema, $table)
|
||||
{
|
||||
$params = array($schema, $table);
|
||||
|
||||
$qry = "SELECT
|
||||
1
|
||||
FROM
|
||||
information_schema.role_table_grants
|
||||
WHERE
|
||||
table_schema = ?
|
||||
AND table_name = ?";
|
||||
|
||||
$result = $this->execQuery($qry, $params);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,4 +244,57 @@ EOSQL;
|
||||
$res = $this->execReadOnlyQuery($query);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Lehreinheiten for Lehrveranstaltungen in a Studiensemester.
|
||||
* Without using tbl_lehrfach: bezeichnung and kurzbz ALWAYS from lehrveranstaltung
|
||||
* @param $lehrveranstaltung_id
|
||||
* @param $studiensemester
|
||||
* @return array with Lehreinheiten and their Lehreinheitgruppen
|
||||
*/
|
||||
public function getLesFromLvIds($lehrveranstaltung_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$params = array($lehrveranstaltung_id);
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
lv.lehrveranstaltung_id,
|
||||
le.lehreinheit_id,
|
||||
le.lehrform_kurzbz,
|
||||
lv.kurzbz,
|
||||
lv.bezeichnung,
|
||||
lv.semester,
|
||||
ma.mitarbeiter_uid,
|
||||
(
|
||||
SELECT
|
||||
STRING_AGG(CONCAT(leg.semester, leg.verband, leg.gruppe), ' ')
|
||||
FROM lehre.tbl_lehreinheitgruppe leg
|
||||
WHERE leg.lehreinheit_id = le.lehreinheit_id
|
||||
) AS gruppe,
|
||||
tma.kurzbz as kuerzel
|
||||
FROM
|
||||
lehre.tbl_lehreinheit le
|
||||
JOIN
|
||||
lehre.tbl_lehrveranstaltung lv ON lv.lehrveranstaltung_id = le.lehrveranstaltung_id
|
||||
JOIN
|
||||
lehre.tbl_lehreinheitmitarbeiter ma USING (lehreinheit_id)
|
||||
JOIN
|
||||
public.tbl_mitarbeiter tma USING (mitarbeiter_uid)
|
||||
WHERE
|
||||
lv.lehrveranstaltung_id = ?
|
||||
";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$query .= " AND le.studiensemester_kurzbz = ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
$query .="
|
||||
ORDER BY
|
||||
le.lehreinheit_id;
|
||||
";
|
||||
|
||||
return $this->execQuery($query, $params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user