added dbupdate script for creating tbl_karrierepfad_typ, tbl_karrierepfad and tbl_karrierepfad_studienplan; added it to prestudent.class.php; added legacy class, ci3 model for karrierepfad; also some seeders for cy-db;

This commit is contained in:
Johann Hoffmann
2026-10-22 14:26:30 +02:00
parent e68634cf6f
commit 1678c6ba76
7 changed files with 357 additions and 6 deletions
@@ -0,0 +1,15 @@
<?php
class KarrierepfadStudienplan_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_karrierepfad_studienplan';
$this->pk = array('karrierepfad_id', 'studienplan_id');
$this->hasSequence = false;
}
}
@@ -0,0 +1,44 @@
<?php
/**
* Karrierepfad: marketing specialisation of a Studiengang, linked to Studienpläne.
* Not official: never print it on a Zeugnis or report it to BIS.
*/
class Karrierepfad_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_karrierepfad';
$this->pk = 'karrierepfad_id';
}
/**
* Gets the Karrierepfade linked to a Studienplan, with the Bezeichnung in the user language.
* A Karrierepfad is selectable for a prestudent if it is aktiv and linked to the
* Studienplan of the last status. A value stored earlier stays valid without this check.
*
* @param integer $studienplan_id
* @param boolean $aktiv true: only active Karrierepfade
*
* @return stdClass
*/
public function getByStudienplan($studienplan_id, $aktiv = true)
{
$query = "
SELECT
kp.*,
kp.bezeichnung_mehrsprachig[(SELECT index FROM public.tbl_sprache WHERE sprache = ? LIMIT 1)] AS bezeichnung
FROM public.tbl_karrierepfad kp
JOIN public.tbl_karrierepfad_studienplan USING (karrierepfad_id)
WHERE studienplan_id = ?";
if ($aktiv)
$query .= " AND kp.aktiv";
$query .= " ORDER BY kp.sort NULLS LAST, kp.karrierepfad_kurzbz";
return $this->execQuery($query, array(getUserLanguage(), $studienplan_id));
}
}