addgroup/addperson immer anzeigen

gruppen sortierung angepasst
fehlende les anzeigen
This commit is contained in:
ma0048
2025-11-14 08:07:39 +01:00
parent 4407310f40
commit 63eda8b934
8 changed files with 73 additions and 28 deletions
@@ -119,7 +119,19 @@ class Lehrveranstaltung extends FHCAPI_Controller
if (hasData($lehreinheiten_data))
{
$lehreinheiten = getData($lehreinheiten_data);
$rowData->_children = $lehreinheiten;
if (!isset($row->_children))
{
$row->_children = $lehreinheiten;
}
else
{
if (!is_array($row->_children))
{
$row->_children = [$row->_children];
}
$row->_children = array_merge($row->_children, $lehreinheiten);
}
}
if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
@@ -169,6 +169,10 @@ class Lehreinheit extends FHCAPI_Controller
{
$value = $this->input->post($field);
if ($field === 'lehre')
{
$value = (bool)$value;
}
if ($value !== null)
{
$updateData[$field] = $value;
@@ -281,15 +285,43 @@ class Lehreinheit extends FHCAPI_Controller
public function delete()
{
$lehreinheit_id = $this->input->post('lehreinheit_id');
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
$errors = array();
if (is_array($lehreinheit_id))
{
foreach ($lehreinheit_id as $le_id)
{
$lehreinheit = $this->checkLehreinheit($le_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
if (isError($result))
$this->terminateWithValidationErrors(getError($result));
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
$this->terminateWithSuccess('Erfolgreich geloescht');
if (isError($result))
{
$errors[] = getError($result);
}
}
}
else
{
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
if (isError($result))
$this->terminateWithError(getError($result));
}
if (!isEmptyArray($errors))
{
if (count($errors) !== count($lehreinheit_id))
$this->terminateWithSuccess(array('errors' => $errors));
else
$this->terminateWithError($errors);
}
else
$this->terminateWithSuccess('Erfolgreich geloescht');
}
public function update()