mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-23 04:09:36 +00:00
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:
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__). '/basis_db.class.php');
|
||||
require_once(dirname(__FILE__). '/sprache.class.php');
|
||||
|
||||
/**
|
||||
* Karrierepfad: marketing specialisation of a Studiengang, linked to Studienpläne.
|
||||
* Not official: no printing it on a Zeugnis or report to BIS.
|
||||
*/
|
||||
class karrierepfad extends basis_db
|
||||
{
|
||||
public $result = array();
|
||||
|
||||
//Tabellenspalten
|
||||
public $karrierepfad_id;
|
||||
public $karrierepfad_kurzbz;
|
||||
public $karrierepfad_typ_kurzbz;
|
||||
public $studiengang_kz;
|
||||
public $bezeichnung_mehrsprachig; // array, key = sprache
|
||||
public $sort;
|
||||
public $aktiv;
|
||||
public $insertamum;
|
||||
public $insertvon;
|
||||
public $updateamum;
|
||||
public $updatevon;
|
||||
|
||||
/**
|
||||
* @param integer $karrierepfad_id Karrierepfad to load (optional)
|
||||
*/
|
||||
public function __construct($karrierepfad_id = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if ($karrierepfad_id != null)
|
||||
$this->load($karrierepfad_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a Karrierepfad
|
||||
* @param integer $karrierepfad_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function load($karrierepfad_id)
|
||||
{
|
||||
if (!is_numeric($karrierepfad_id))
|
||||
{
|
||||
$this->errormsg = 'Karrierepfad ID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$sprache = new sprache();
|
||||
$qry = "SELECT *, ".$sprache->getSprachQuery('bezeichnung_mehrsprachig')."
|
||||
FROM public.tbl_karrierepfad
|
||||
WHERE karrierepfad_id=".$this->db_add_param($karrierepfad_id, FHC_INTEGER);
|
||||
|
||||
if (!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden des Karrierepfads';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$row = $this->db_fetch_object())
|
||||
{
|
||||
$this->errormsg = 'Karrierepfad wurde nicht gefunden';
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->setFromRow($this, $row, $sprache);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the Karrierepfade linked to a Studienplan into $this->result.
|
||||
* 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 boolean
|
||||
*/
|
||||
public function getByStudienplan($studienplan_id, $aktiv = true)
|
||||
{
|
||||
if (!is_numeric($studienplan_id))
|
||||
{
|
||||
$this->errormsg = 'Studienplan ID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$sprache = new sprache();
|
||||
$qry = "SELECT kp.*, ".$sprache->getSprachQuery('bezeichnung_mehrsprachig')."
|
||||
FROM public.tbl_karrierepfad kp
|
||||
JOIN public.tbl_karrierepfad_studienplan USING(karrierepfad_id)
|
||||
WHERE studienplan_id=".$this->db_add_param($studienplan_id, FHC_INTEGER);
|
||||
if ($aktiv)
|
||||
$qry .= " AND kp.aktiv";
|
||||
$qry .= " ORDER BY kp.sort NULLS LAST, kp.karrierepfad_kurzbz";
|
||||
|
||||
if (!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Karrierepfade';
|
||||
return false;
|
||||
}
|
||||
|
||||
while ($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new karrierepfad();
|
||||
$this->setFromRow($obj, $row, $sprache);
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private function setFromRow($obj, $row, $sprache)
|
||||
{
|
||||
$obj->karrierepfad_id = $row->karrierepfad_id;
|
||||
$obj->karrierepfad_kurzbz = $row->karrierepfad_kurzbz;
|
||||
$obj->karrierepfad_typ_kurzbz = $row->karrierepfad_typ_kurzbz;
|
||||
$obj->studiengang_kz = $row->studiengang_kz;
|
||||
$obj->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig', $row);
|
||||
$obj->sort = $row->sort;
|
||||
$obj->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->updateamum = $row->updateamum;
|
||||
$obj->updatevon = $row->updatevon;
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,7 @@ class prestudent extends person
|
||||
public $priorisierung = null;
|
||||
public $foerderrelevant = null;
|
||||
public $standort_code = null;
|
||||
public $karrierepfad_id = null;
|
||||
public $udf_values = null;
|
||||
|
||||
public $status_kurzbz;
|
||||
@@ -176,6 +177,7 @@ class prestudent extends person
|
||||
$this->priorisierung = $row->priorisierung;
|
||||
$this->foerderrelevant = $this->db_parse_bool($row->foerderrelevant);
|
||||
$this->standort_code = $row->standort_code;
|
||||
$this->karrierepfad_id = $row->karrierepfad_id;
|
||||
|
||||
if(!person::load($row->person_id))
|
||||
return false;
|
||||
@@ -268,7 +270,7 @@ class prestudent extends person
|
||||
reihungstest_id, anmeldungreihungstest, reihungstestangetreten, rt_gesamtpunkte,
|
||||
rt_punkte1, rt_punkte2, rt_punkte3, bismelden, insertamum, insertvon,
|
||||
updateamum, updatevon, anmerkung, dual, ausstellungsstaat, mentor,
|
||||
gsstudientyp_kurzbz, aufnahmegruppe_kurzbz, priorisierung, zgvdoktor_erfuellt, foerderrelevant, standort_code) VALUES('.
|
||||
gsstudientyp_kurzbz, aufnahmegruppe_kurzbz, priorisierung, zgvdoktor_erfuellt, foerderrelevant, standort_code, karrierepfad_id) VALUES('.
|
||||
|
||||
$this->db_add_param($this->aufmerksamdurch_kurzbz).",".
|
||||
$this->db_add_param($this->person_id).",".
|
||||
@@ -312,7 +314,8 @@ class prestudent extends person
|
||||
$this->db_add_param($this->priorisierung).",".
|
||||
$this->db_add_param($this->zgvdoktor_erfuellt).",".
|
||||
$this->db_add_param($this->foerderrelevant, FHC_BOOLEAN).",".
|
||||
$this->db_add_param($this->standort_code).");";
|
||||
$this->db_add_param($this->standort_code).",".
|
||||
$this->db_add_param($this->karrierepfad_id, FHC_INTEGER).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,7 +360,8 @@ class prestudent extends person
|
||||
' priorisierung='.$this->db_add_param($this->priorisierung).",".
|
||||
' zgvdoktor_erfuellt='.$this->db_add_param($this->zgvdoktor_erfuellt).', '.
|
||||
' foerderrelevant='.$this->db_add_param($this->foerderrelevant, FHC_BOOLEAN).",".
|
||||
' standort_code='.$this->db_add_param($this->standort_code)." ".
|
||||
' standort_code='.$this->db_add_param($this->standort_code).",".
|
||||
' karrierepfad_id='.$this->db_add_param($this->karrierepfad_id, FHC_INTEGER)." ".
|
||||
" WHERE prestudent_id=".$this->db_add_param($this->prestudent_id).";";
|
||||
}
|
||||
|
||||
@@ -1097,6 +1101,7 @@ class prestudent extends person
|
||||
$ps->priorisierung = $row->priorisierung;
|
||||
$ps->foerderrelevant = $row->foerderrelevant;
|
||||
$ps->standort_code = $row->standort_code;
|
||||
$ps->karrierepfad_id = $row->karrierepfad_id;
|
||||
|
||||
$ps->status_kurzbz = $row->status_kurzbz;
|
||||
$ps->studiensemester_kurzbz = $row->studiensemester_kurzbz;
|
||||
@@ -1632,6 +1637,7 @@ class prestudent extends person
|
||||
$obj->aufnahmegruppe_kurzbz = $row->aufnahmegruppe_kurzbz;
|
||||
$obj->priorisierung = $row->priorisierung;
|
||||
$obj->zgvdoktor_erfuellt = $row->zgvdoktor_erfuellt;
|
||||
$obj->karrierepfad_id = $row->karrierepfad_id;
|
||||
|
||||
if ($hasUDF)
|
||||
{
|
||||
@@ -2262,7 +2268,7 @@ class prestudent extends person
|
||||
aufnahmeschluessel, facheinschlberuf, anmeldungreihungstest, reihungstestangetreten, reihungstest_id,
|
||||
punkte, rt_punkte1, rt_punkte2, rt_punkte3, bismelden, person_id, anmerkung, mentor, ext_id_prestudent,
|
||||
dual, ausstellungsstaat, zgvdoktor_code, zgvdoktorort, zgvdoktordatum, zgvdoktornation,
|
||||
gsstudientyp_kurzbz, aufnahmegruppe_kurzbz, priorisierung,zgvdoktor_erfuellt) VALUES('.
|
||||
gsstudientyp_kurzbz, aufnahmegruppe_kurzbz, priorisierung,zgvdoktor_erfuellt, karrierepfad_id) VALUES('.
|
||||
$this->db_add_param($this->prestudent_id).','.
|
||||
$this->db_add_param($this->aufmerksamdurch_kurzbz).','.
|
||||
$this->db_add_param($this->studiengang_kz).','.
|
||||
@@ -2301,7 +2307,8 @@ class prestudent extends person
|
||||
$this->db_add_param($this->gsstudientyp_kurzbz).','.
|
||||
$this->db_add_param($this->aufnahmegruppe_kurzbz).','.
|
||||
$this->db_add_param($this->priorisierung).','.
|
||||
$this->db_add_param($this->zgvdoktor_erfuellt).');';
|
||||
$this->db_add_param($this->zgvdoktor_erfuellt).','.
|
||||
$this->db_add_param($this->karrierepfad_id, FHC_INTEGER).');';
|
||||
|
||||
if($log->save(true))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user