mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
bugfixes changeStatus, generateMatrikelnummer, updateLists, validations
This commit is contained in:
@@ -12,6 +12,7 @@ class Prestudentstatus_model extends DB_Model
|
||||
const STATUS_AUFGENOMMENER = 'Aufgenommener';
|
||||
const STATUS_WARTENDER = 'Wartender';
|
||||
const STATUS_ABGEWIESENER = 'Abgewiesener';
|
||||
const STATUS_INTERESSENT = 'Interessent';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -438,6 +439,48 @@ class Prestudentstatus_model extends DB_Model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Rolle there is an existing Aufgenommenerstatus
|
||||
* @param integer $prestudent_id
|
||||
* @return error if no status Aufgenommener, success if existing
|
||||
*/
|
||||
public function checkIfExistingAufgenommenerstatus($prestudent_id)
|
||||
{
|
||||
$studentName = '';
|
||||
|
||||
$nameRes = $this->PersonModel->loadPrestudent($prestudent_id);
|
||||
|
||||
if (hasData($nameRes))
|
||||
{
|
||||
$nameData = getData($nameRes)[0];
|
||||
$studentName = $nameData->vorname.' '.$nameData->nachname;
|
||||
}
|
||||
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
public.tbl_prestudentstatus
|
||||
WHERE
|
||||
prestudent_id = ?
|
||||
AND
|
||||
status_kurzbz = 'Aufgenommener'";
|
||||
|
||||
$result = $this->execQuery($qry, array($prestudent_id));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error($result);
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
return success("0", $this->p->t('lehre','error_keinAufgenommener', ['name' => $studentName]));
|
||||
}
|
||||
else
|
||||
{
|
||||
return success($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is only one prestudentstatus left
|
||||
* @param integer $prestudent_id
|
||||
|
||||
@@ -108,9 +108,9 @@ class Student_model extends DB_Model
|
||||
$max = 0;
|
||||
if ($matrikelnrres && hasData($matrikelnrres)) {
|
||||
$max = mb_substr($matrikelnrres->retval[0]->matrikelnr, 7);
|
||||
/* if (!is_numeric($max)) {
|
||||
$max = 0;
|
||||
}*/
|
||||
if (!is_numeric($max)) {
|
||||
$max = (int) $max;
|
||||
}
|
||||
}
|
||||
|
||||
$max += 1;
|
||||
|
||||
Reference in New Issue
Block a user