Merge branch 'merge_FHC4_55354_55991_55992_60874_60876_60875_61229_61230_61231' into feature-63192/FHC4-Studierendenverwaltung_Semsterauswahl_fuer_mehrere_Tabs_anpassen

This commit is contained in:
Harald Bamberger
2025-07-31 17:03:31 +02:00
30 changed files with 139 additions and 26 deletions
@@ -31,6 +31,11 @@ class Address extends FHCAPI_Controller
'getNations' => self::PERM_LOGGED,
'getPlaces' => self::PERM_LOGGED
]);
// Load language phrases
$this->loadPhrases([
'ui'
]);
}
public function getNations()
@@ -53,7 +58,11 @@ class Address extends FHCAPI_Controller
$this->form_validation->set_data(['address.plz' => $plz]);
$this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]');
$this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']),
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ']),
'less_than' => $this->p->t('ui', 'error_fieldLessThan10000', ['field' => 'PLZ'])
]);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
@@ -136,14 +136,19 @@ class Prestudent extends FHCAPI_Controller
$update_prestudent = array();
foreach ($array_allowed_props_prestudent as $prop)
{
$val = $this->input->post($prop);
if ($val !== null || $prop == 'foerderrelevant') {
$val = $this->input->post($prop, true);
if ($val !== null || $prop === 'foerderrelevant') {
$update_prestudent[$prop] = $val;
}
if (($prop == 'zgvdatum' && $val == '')
|| ($prop == 'zgvmadatum' && $val == '')
|| ($prop == 'zgvdoktordatum' && $val == '')
) {
// allowed to be null, but has to be in postparameter
if (
in_array($prop, ['zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
&& !isset($update_prestudent[$prop])
&& array_key_exists($prop, $_POST)
)
{
$update_prestudent[$prop] = null;
}
}
@@ -97,6 +97,15 @@ class Student extends FHCAPI_Controller
$this->PrestudentModel->addSelect('v.verband');
$this->PrestudentModel->addSelect('v.gruppe');
$this->PrestudentModel->addSelect('b.alias');
$this->PrestudentModel->addSelect('p.geburtsnation');
$this->PrestudentModel->addSelect('p.sprache');
$this->PrestudentModel->addSelect('p.gebort');
$this->PrestudentModel->addSelect('p.homepage');
$this->PrestudentModel->addSelect('p.anmerkung');
$this->PrestudentModel->addSelect('p.familienstand');
$this->PrestudentModel->addSelect('p.staatsbuergerschaft');
$this->PrestudentModel->addSelect('p.matr_nr');
$this->PrestudentModel->addSelect('p.anrede');
if (defined('ACTIVE_ADDONS') && strpos(ACTIVE_ADDONS, 'bewerbung') !== false) {
$this->PrestudentModel->addSelect(
@@ -172,6 +181,7 @@ class Student extends FHCAPI_Controller
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->load->library('form_validation');
@@ -186,7 +196,15 @@ class Student extends FHCAPI_Controller
$this->form_validation->set_rules('gebdatum', 'Geburtsdatum', 'is_valid_date');
$this->form_validation->set_rules('semester', 'Semester', 'integer');
$this->form_validation->set_rules('semester', 'Semester', 'integer', [
'integer' => $this->p->t('ui', 'error_fieldNotInteger')
]
);
$this->form_validation->set_rules('alias', 'Alias', 'regex_match[/^[-a-z0-9\_\.]*[a-z0-9]{1,}\.[-a-z0-9\_]{1,}$/]',
[
'regex_match' => $this->p->t('ui', 'error_fieldInvalidAlias')
]);
$this->load->library('UDFLib');
@@ -298,11 +316,37 @@ class Student extends FHCAPI_Controller
// Do Updates
if (count($update_lehrverband)) {
$curstudlvb = $this->StudentlehrverbandModel->load([
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'student_uid' => $uid
]);
$data = $this->getDataOrTerminateWithError($curstudlvb);
$data = current($data);
$verbandCurrent = $data->verband;
$studiengang_kz = $data->studiengang_kz;
$semesterCurrent = $data->semester;
$gruppeCurrent = $data->gruppe;
$verband = isset($update_lehrverband['verband']) ? $update_lehrverband['verband'] : $verbandCurrent;
$gruppe = isset($update_lehrverband['gruppe']) ? $update_lehrverband['gruppe'] : $gruppeCurrent;
$semester = isset($update_lehrverband['semester']) ? $update_lehrverband['semester'] : $semesterCurrent;
//check if existing Lehrverband of new data to avoid Error
$result = $this->LehrverbandModel->loadWhere([
'verband' => $verband,
'gruppe' => $gruppe,
'semester' => $semester,
'studiengang_kz' => $studiengang_kz,
]);
if(!hasData($result))
{
$this->terminateWithError($this->p->t('lehre', 'error_noLehrverband'), self::ERROR_TYPE_GENERAL);
}
if(hasData($curstudlvb) && count(getData($curstudlvb)) > 0 )
{
$update_lehrverband['updatevon'] = $authuid;